/* -----------------------------------------------------------------------
   KGSZ ER – Global styles
   ----------------------------------------------------------------------- */

:root {
  --er-blue:      #2563a8;
  --er-blue-dark: #1a4278;
  --er-teal:      #1a7f6e;
  --er-sidebar:   #1e2d40;
  --er-sidebar2:  #162233;
  --er-text:      #212529;
  --er-muted:     #6c757d;
}

body {
  font-size: 0.875rem;
  color: var(--er-text);
  background: #f4f6f9;
}

/* -----------------------------------------------------------------------
   Navbar
   ----------------------------------------------------------------------- */
.session-timer {
  color: rgba(255,255,255,0.5);
  font-variant-numeric: tabular-nums;
  transition: color .3s;
}
.session-timer.timer-warn     { color: #ffc107 !important; }
.session-timer.timer-critical { color: #f87171 !important; animation: blink 1s step-end infinite; }

@keyframes blink {
  50% { opacity: 0.3; }
}

.kgsz-navbar {
  background: var(--er-sidebar);
  border-bottom: 3px solid var(--er-teal);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* -----------------------------------------------------------------------
   Login page – split layout (sidebar + form)
   ----------------------------------------------------------------------- */
.login-page {
  display: flex;
  min-height: 100vh;
  margin: 0;
}

.login-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f9;
  padding: 2rem;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 420px;
}

.login-logo-img {
  width: 200px;
  max-width: 100%;
}

.register-link {
  color: var(--er-blue);
  font-size: 0.85rem;
  text-decoration: none;
}

.register-link:hover {
  text-decoration: underline;
}

.login-portal-label {
  color: var(--er-muted);
  font-size: 0.8rem;
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--er-blue-dark);
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.8rem;
  color: var(--er-muted);
  margin-bottom: 1.5rem;
}

.btn-login {
  background: var(--er-blue);
  border-color: var(--er-blue);
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.55rem;
}

.btn-login:hover {
  background: var(--er-blue-dark);
  border-color: var(--er-blue-dark);
}

.captcha-input {
  max-width: 120px;
}

@media (max-width: 640px) {
  .login-sidebar { display: none; }
}

/* -----------------------------------------------------------------------
   Filter bar
   ----------------------------------------------------------------------- */
.filter-bar {
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

/* -----------------------------------------------------------------------
   Ticket table / treegrid
   ----------------------------------------------------------------------- */
.kgsz-table {
  font-size: 0.82rem;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.kgsz-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-group-header {
  background: #eef2f7 !important;
  cursor: pointer;
  user-select: none;
}

.status-group-header:hover {
  background: #e2e8f0 !important;
}

.status-group-header td {
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  border-top: 2px solid #d1dbe8;
}

.toggle-icon {
  display: inline-block;
  width: 1.2rem;
  color: var(--er-muted);
  transition: transform .2s;
}

.toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
}

.badge-open   { background: #dbeafe; color: #1e40af; }
.badge-closed { background: #f1f5f9; color: #64748b; }

.ticket-row td {
  vertical-align: middle;
}

.ticket-row:hover td {
  background: #f8fafc;
}

.ticket-row.priority-critical td {
  background: #fde8e8;
  color: #b42318;
}

.ticket-row.priority-critical:hover td {
  background: #fbd5d5;
}

.ticket-row.priority-critical .ticket-link,
.ticket-row.priority-critical .text-muted {
  color: #b42318 !important;
}

.ticket-link {
  color: var(--er-blue);
  text-decoration: none;
  font-weight: 500;
}

.ticket-link:hover {
  text-decoration: underline;
}

/* -----------------------------------------------------------------------
   Ticket detail
   ----------------------------------------------------------------------- */
.detail-meta .meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--er-muted);
  margin-bottom: 0.15rem;
}

.issue-description {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1rem;
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.6;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.comment-author {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--er-blue-dark);
}

.comment-body {
  padding: 0.75rem 0.85rem;
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.6;
}
