@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --bg:         #06090f;
  --bg2:        #0c1120;
  --bg3:        #111827;
  --surface:    #1a2332;
  --surface2:   #1e293b;
  --surface3:   #253349;
  --border:     #1e3a5f;
  --border2:    #2d4a6f;
  --accent:     #3b82f6;
  --accent2:    #60a5fa;
  --accent-glow: rgba(59,130,246,0.2);
  --green:      #10b981;
  --green-glow: rgba(16,185,129,0.15);
  --yellow:     #f59e0b;
  --yellow-glow:rgba(245,158,11,0.15);
  --red:        #ef4444;
  --red-glow:   rgba(239,68,68,0.15);
  --purple:     #8b5cf6;
  --purple-glow:rgba(139,92,246,0.15);
  --cyan:       #06b6d4;
  --cyan-glow:  rgba(6,182,212,0.15);
  --text:       #f1f5f9;
  --text2:      #94a3b8;
  --text3:      #64748b;
  --text4:      #475569;
  --font:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:       'JetBrains Mono', 'Fira Code', monospace;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-xs:  6px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.6);
  --shadow-glow:0 0 30px rgba(59,130,246,0.15);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w:  260px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.login-bg { position: fixed; inset: 0; z-index: 0; }

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: orbFloat 20s ease-in-out infinite;
}
.login-orb-1 { width: 400px; height: 400px; background: var(--accent); top: -10%; left: -5%; animation-delay: 0s; }
.login-orb-2 { width: 300px; height: 300px; background: var(--purple); bottom: -10%; right: -5%; animation-delay: -7s; }
.login-orb-3 { width: 250px; height: 250px; background: var(--cyan); top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: -14s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.1); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(40px, 20px) scale(1.05); }
}

.login-container { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }

.login-card {
  background: rgba(12, 17, 32, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(59, 130, 246, 0.08);
  animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header { text-align: center; margin-bottom: 32px; }

.login-logo { display: flex; justify-content: center; margin-bottom: 16px; }

.login-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 30px var(--accent-glow);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 60px rgba(59,130,246,0.1); }
}

.login-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; background: linear-gradient(135deg, var(--text), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-subtitle { font-size: 13px; color: var(--text3); font-family: var(--mono); letter-spacing: 0.08em; margin-top: 4px; }

.login-alerts { margin-bottom: 20px; }

.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  z-index: 1;
}

.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder { color: var(--text4); }

.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.toggle-password:hover { opacity: 1; }

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 30px var(--accent-glow); }
.login-btn:active { transform: translateY(0); }

.login-btn-icon { font-size: 18px; transition: transform 0.3s; }
.login-btn:hover .login-btn-icon { transform: translateX(4px); }

.login-footer { text-align: center; margin-top: 28px; color: var(--text4); font-size: 11px; }
.login-footer-sub { margin-top: 4px; font-size: 10px; color: var(--text4); opacity: 0.6; }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.brand-logo { display: flex; align-items: center; gap: 12px; max-width: 100%; }

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px var(--accent-glow);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.brand-image-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-image {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.brand-logo.has-custom-logo {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.brand-logo.has-custom-logo .brand-name {
  font-size: 16px;
}

.brand-logo.has-custom-logo .brand-sub {
  font-size: 10px;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.brand-sub { font-size: 10px; color: var(--text3); font-family: var(--mono); letter-spacing: 0.08em; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section { margin-bottom: 24px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 10px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active {
  background: var(--accent-glow);
  color: var(--accent2);
  border: 1px solid rgba(59,130,246,0.2);
  font-weight: 600;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-external { margin-left: auto; font-size: 11px; color: var(--text4); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: white;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text3); font-family: var(--mono); }

.logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--red-glow);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}
.logout-btn:hover { background: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.4); }

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 44px;
}

/* TOPBAR */
.topbar {
  background: rgba(12, 17, 32, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-title { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.page-subtitle { font-size: 12px; color: var(--text3); font-family: var(--mono); }

.topbar-center {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--yellow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.topbar-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text3);
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

/* ALERTS */
.alerts-container { padding: 16px 28px 0; }

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
  animation: slideDown 0.3s ease;
  position: relative;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: var(--green-glow); border: 1px solid rgba(16,185,129,0.25); color: var(--green); }
.alert-error   { background: var(--red-glow); border: 1px solid rgba(239,68,68,0.25); color: var(--red); }
.alert-warning { background: var(--yellow-glow); border: 1px solid rgba(245,158,11,0.25); color: var(--yellow); }
.alert-info    { background: var(--accent-glow); border: 1px solid rgba(59,130,246,0.25); color: var(--accent2); }

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.alert-close:hover { opacity: 1; }

/* PAGE CONTENT */
.page-content { padding: 24px 28px; flex: 1; }

.panel-footer {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 10px 28px 12px;
  border-top: 1px solid var(--border);
  background: rgba(12, 17, 32, 0.95);
  backdrop-filter: blur(8px);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--yellow);
  font-family: var(--mono);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: white;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-secondary:hover { color: var(--text); border-color: var(--border2); }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-outline:hover { background: var(--surface); color: var(--text); border-color: var(--accent); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
}
.btn-danger:hover { background: #dc2626; }

/* ═══════════════════════════════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent);
}

.stat-card.stat-blue   { --card-accent: var(--accent); }
.stat-card.stat-green  { --card-accent: var(--green); }
.stat-card.stat-amber  { --card-accent: var(--yellow); }
.stat-card.stat-purple { --card-accent: var(--purple); }
.stat-card.stat-red    { --card-accent: var(--red); }
.stat-card.stat-cyan   { --card-accent: var(--cyan); }

.stat-card-inner { display: flex; justify-content: space-between; align-items: flex-start; }

.stat-info { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 28px; font-weight: 900; color: var(--text); font-family: var(--mono); line-height: 1; letter-spacing: -0.02em; }
.stat-icon-wrap { font-size: 24px; opacity: 0.3; }

.stat-bar { margin-top: 12px; background: var(--bg2); border-radius: 3px; height: 4px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 3px; background: var(--card-accent); transition: width 1s ease; }

.stat-footer { margin-top: 10px; }
.stat-trend { font-size: 11px; font-weight: 600; font-family: var(--mono); }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }

/* HIGHLIGHTS */
.highlight-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.highlight-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.highlight-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }

.highlight-icon { font-size: 28px; }
.highlight-info { display: flex; flex-direction: column; }
.highlight-value { font-size: 22px; font-weight: 800; font-family: var(--mono); color: var(--text); }
.highlight-label { font-size: 11px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.5);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-badge {
  background: var(--accent-glow);
  color: var(--accent2);
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  font-family: var(--mono);
  font-weight: 600;
}

.card-action {
  font-size: 12px;
  color: var(--accent2);
  font-weight: 600;
  transition: var(--transition);
}
.card-action:hover { color: var(--accent); }

.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* GRID LAYOUTS */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.grid-2 > .card { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   DATA TABLE
   ═══════════════════════════════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table thead th {
  background: var(--bg2);
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(30,58,95,0.4);
  transition: background 0.15s;
}
.data-table tbody tr:hover { background: rgba(59,130,246,0.04); }

.data-table tbody td {
  padding: 10px 14px;
  color: var(--text2);
  vertical-align: middle;
}

.col-sn { font-family: var(--mono); color: var(--text3) !important; font-size: 11px; }
.col-name { color: var(--text) !important; font-weight: 600; }
.col-id { font-family: var(--mono); font-size: 11px; color: var(--accent2) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   TAGS & BADGES
   ═══════════════════════════════════════════════════════════════════════════ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.tag-issue { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.tag-branch { background: var(--cyan-glow); color: var(--cyan); border: 1px solid rgba(6,182,212,0.2); }
.tag-admin { background: var(--red-glow); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.tag-staff { background: var(--accent-glow); color: var(--accent2); border: 1px solid rgba(59,130,246,0.2); }
.tag-user { background: var(--surface2); color: var(--text3); border: 1px solid var(--border); }

/* STATUS PILLS */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  white-space: nowrap;
  transition: var(--transition);
}

.status-solved, .status-pill.status-solved { background: var(--green-glow); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.status-pending, .status-pill.status-pending { background: var(--yellow-glow); color: var(--yellow); border: 1px solid rgba(245,158,11,0.3); }
.status-time-taken, .status-pill.status-time-taken { background: var(--purple-glow); color: var(--purple); border: 1px solid rgba(139,92,246,0.3); }
.status-no-response, .status-pill.status-no-response { background: var(--red-glow); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

/* STATUS DROPDOWN */
.status-dropdown { position: relative; display: inline-block; }

.status-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 150px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  display: none;
  overflow: hidden;
}
.status-menu.show { display: block; animation: menuAppear 0.15s ease; }

@keyframes menuAppear {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.status-opt {
  padding: 9px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex; align-items: center; gap: 8px;
}
.status-opt:hover { background: var(--surface3); }

/* ═══════════════════════════════════════════════════════════════════════════
   ACTION BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.action-btns { display: flex; gap: 5px; }

.act-btn {
  padding: 5px 9px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.act-view { background: var(--purple-glow); color: var(--purple); border: 1px solid rgba(139,92,246,0.2); }
.act-view:hover { background: rgba(139,92,246,0.3); }
.act-edit { background: var(--accent-glow); color: var(--accent2); border: 1px solid rgba(59,130,246,0.2); }
.act-edit:hover { background: rgba(59,130,246,0.3); }
.act-delete { background: var(--red-glow); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.act-delete:hover { background: rgba(239,68,68,0.3); }

/* ═══════════════════════════════════════════════════════════════════════════
   FILTERS
   ═══════════════════════════════════════════════════════════════════════════ */
.filters-bar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg2);
  align-items: center;
}

.filter-input, .filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
  min-width: 0;
}
.filter-input:focus, .filter-select:focus { border-color: var(--accent); }
.filter-input::placeholder { color: var(--text4); }
.filter-input { min-width: 160px; flex: 1; }
.filter-date { min-width: 130px !important; flex: 0 !important; }
.filter-select { min-width: 120px; }
.filter-select option { background: var(--surface); color: var(--text); }

.btn-filter {
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--accent2);
  padding: 7px 16px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
}
.btn-filter:hover { background: rgba(59,130,246,0.3); }

.btn-clear {
  background: none;
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red);
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-clear:hover { background: var(--red-glow); }

/* ═══════════════════════════════════════════════════════════════════════════
   CHARTS (CSS-only)
   ═══════════════════════════════════════════════════════════════════════════ */
.chart-area {
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding-top: 20px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.chart-bar-v {
  width: 100%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  min-height: 4px;
}
.chart-bar-v:hover { filter: brightness(1.2); }

.chart-bar-v .chart-tooltip {
  position: absolute;
  top: -28px; left: 50%; transform: translateX(-50%);
  background: var(--bg2);
  color: var(--text);
  font-size: 11px;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.chart-bar-v:hover .chart-tooltip { opacity: 1; }

.chart-label {
  font-size: 9px;
  color: var(--text4);
  font-family: var(--mono);
  text-align: center;
  writing-mode: vertical-rl;
  height: 50px;
  overflow: hidden;
}

/* HORIZONTAL BAR CHART */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }

.hbar-item { display: flex; flex-direction: column; gap: 4px; }
.hbar-head { display: flex; justify-content: space-between; align-items: center; }
.hbar-name { font-size: 12px; color: var(--text2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.hbar-count { font-size: 11px; color: var(--accent2); font-family: var(--mono); font-weight: 600; }
.hbar-track { background: var(--bg2); border-radius: 4px; height: 6px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); }

/* DONUT CHART */
.donut-chart-container { display: flex; align-items: center; gap: 24px; }

.donut-chart {
  position: relative;
  width: 140px; height: 140px;
  flex-shrink: 0;
}

.donut-svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-value { font-size: 22px; font-weight: 800; font-family: var(--mono); color: var(--text); }
.donut-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; }

.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-text { font-size: 12px; color: var(--text2); }
.legend-val { margin-left: auto; font-size: 12px; font-family: var(--mono); font-weight: 600; color: var(--text); }

/* MINI TABLE (recent tickets) */
.mini-table { display: flex; flex-direction: column; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid rgba(30,58,95,0.3);
  transition: background 0.15s;
  text-decoration: none;
}
.mini-row:last-child { border-bottom: none; }
.mini-row:hover { background: rgba(59,130,246,0.04); }

.mini-sn { font-family: var(--mono); font-size: 11px; color: var(--text3); min-width: 40px; }
.mini-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-issue { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-status { font-size: 14px; }
.empty-mini { padding: 32px; text-align: center; color: var(--text3); font-size: 13px; }

/* MINI PROGRESS (Reports) */
.mini-progress { background: var(--bg2); border-radius: 3px; height: 5px; overflow: hidden; width: 60px; display: inline-block; vertical-align: middle; }
.mini-progress-fill { height: 100%; border-radius: 3px; background: var(--green); }
.mini-pct { font-size: 11px; font-family: var(--mono); color: var(--text3); margin-left: 6px; }

/* REPORT FILTER */
.report-filter { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.report-filter-group { display: flex; flex-direction: column; gap: 4px; }

/* AI report block */
.ai-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.ai-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin-bottom: 8px;
}

.ai-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-list li {
  font-size: 13px;
  color: var(--text2);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
}

.ai-health-good {
  background: var(--green-glow);
  color: var(--green);
}

.ai-health-warning {
  background: var(--yellow-glow);
  color: var(--yellow);
}

.ai-health-critical {
  background: var(--red-glow);
  color: var(--red);
}

.ai-health-neutral {
  background: var(--accent-glow);
  color: var(--accent2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group.full { grid-column: 1 / -1; }

.form-control, .form-select {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  padding: 9px 14px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13px !important;
  font-family: var(--font) !important;
  outline: none !important;
  transition: var(--transition) !important;
  width: 100%;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}
.form-control::placeholder { color: var(--text4) !important; }
.form-select option { background: var(--surface); color: var(--text); }
textarea.form-control { resize: vertical; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  padding: 8px 0;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(6px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 680px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal.modal-sm { width: 420px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }

.modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--red); color: white; border-color: var(--red); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-del-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-del-msg { color: var(--text2); font-size: 13px; margin-bottom: 24px; }
.modal-del-actions { display: flex; gap: 10px; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   DETAILS
   ═══════════════════════════════════════════════════════════════════════════ */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-label { font-size: 10px; color: var(--text4); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.detail-value { font-size: 14px; color: var(--text); font-weight: 500; }
.detail-value.mono { font-family: var(--mono); }
.detail-value.accent { color: var(--accent2); }
.detail-value.subtle { font-size: 12px; color: var(--text3); }
.remarks-box { background: var(--surface); padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings-grid > .card { margin-bottom: 0; }
.settings-grid > .full-span { grid-column: 1 / -1; }

.settings-form { display: flex; flex-direction: column; gap: 16px; }

.config-grid { display: flex; flex-direction: column; gap: 24px; }
.config-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* USER CELL */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: white;
  flex-shrink: 0;
}

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text3); }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .main-content { margin-left: 0; padding-bottom: 42px; }
  .grid-2 { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .highlight-row { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px 14px 60px; }
  .topbar-center { display: none; }
  .page-content { padding: 16px; }
  .panel-footer { left: 0; padding: 10px 16px 12px; }
}

@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .donut-chart-container { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   REMARKS TIMELINE
   ═══════════════════════════════════════════════════════════════════════════ */
.remarks-timeline {
  position: relative;
  padding: 4px 0;
}

.remark-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 20px;
}

.remark-item:last-child { padding-bottom: 0; }

/* Vertical connecting line */
.remark-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.remark-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--border);
}

.status-dot-solved          { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.status-dot-pending         { background: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }
.status-dot-time-taken      { background: var(--purple); box-shadow: 0 0 0 2px var(--purple); }
.status-dot-no-response     { background: var(--red); box-shadow: 0 0 0 2px var(--red); }

.remark-content {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: var(--transition);
}

.remark-content:hover {
  border-color: var(--border2);
  background: var(--surface2);
}

.remark-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.remark-meta {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
}

.remark-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}

