/* ==========================================================================
   Employee Ticket Management System - theme
   Palette: slate console sidebar + teal signal accent + amber priority cues
   Type: Inter (UI) / JetBrains Mono (ticket codes, data)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --teal-600:  #0d9488;
  --teal-500:  #14b8a6;
  --teal-50:   #ecfdf5;
  --amber-500: #f59e0b;
  --red-500:   #ef4444;
  --ink:       #111827;
  --muted:     #64748b;
  --radius:    10px;
  --shadow:    0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--slate-50);
  color: var(--ink);
  margin: 0;
}

code, .mono, .ticket-code { font-family: 'JetBrains Mono', monospace; }

a { text-decoration: none; }

/* ---------- App shell ---------- */
.app-wrapper { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--slate-900);
  color: var(--slate-200);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 24px; font-size: 18px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand i { color: var(--teal-500); font-size: 22px; }
.sidebar-nav { display: flex; flex-direction: column; padding: 16px 12px; gap: 2px; }
.sidebar-nav a {
  color: var(--slate-200); padding: 10px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px;
  transition: background .15s, color .15s;
}
.sidebar-nav a i { width: 18px; text-align: center; opacity: .8; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--teal-600); color: #fff; }

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--slate-200);
  position: sticky; top: 0; z-index: 10;
}
.page-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--ink); }
.navbar-right { display: flex; align-items: center; gap: 14px; }
.role-badge {
  font-size: 12px; font-weight: 600; background: var(--teal-50); color: var(--teal-600);
  padding: 5px 12px; border-radius: 999px; letter-spacing: .02em;
}
.user-menu-btn { border: 1px solid var(--slate-200); background: #fff; font-size: 14px; font-weight: 500; }
.sidebar-toggle { border: none; background: none; font-size: 22px; color: var(--ink); }

.app-content { padding: 28px; flex: 1; }

/* ---------- Welcome banner ---------- */
.welcome-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #0f172a 0%, #134e4a 100%);
  border-radius: 16px; padding: 28px 32px; color: #fff; margin-bottom: 24px;
}
.welcome-banner::before {
  content: ''; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(20, 184, 166, 0.18);
}
.welcome-banner::after {
  content: ''; position: absolute; right: 80px; bottom: -70px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(20, 184, 166, 0.12);
}
.welcome-banner .wb-eyebrow { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--teal-500); font-weight: 700; position: relative; }
.welcome-banner h2 { font-size: 24px; font-weight: 700; margin: 6px 0 4px; position: relative; }
.welcome-banner p { color: #cbd5e1; font-size: 14px; margin: 0; position: relative; max-width: 560px; }
.welcome-banner .wb-meta { position: relative; display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.welcome-banner .wb-meta div { font-size: 13px; color: #cbd5e1; }
.welcome-banner .wb-meta strong { display: block; font-size: 20px; color: #fff; font-family: 'JetBrains Mono', monospace; font-weight: 600; }

/* ---------- Cards / stats ---------- */
.stat-card {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  padding: 20px; border: 1px solid var(--slate-200); height: 100%;
  position: relative; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,0.10); }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 30px; font-weight: 700; margin-top: 6px; font-family: 'JetBrains Mono', monospace; }
.stat-card .stat-icon {
  width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--teal-50); color: var(--teal-600); font-size: 18px; margin-bottom: 10px;
}
.stat-card .stat-icon.ic-blue { background: #e6f1fb; color: #185fa5; }
.stat-card .stat-icon.ic-amber { background: #faeeda; color: #854f0b; }
.stat-card .stat-icon.ic-red { background: #fcebeb; color: #a32d2d; }
.stat-card .stat-icon.ic-green { background: #eaf3de; color: #3b6d11; }
.stat-card .stat-icon.ic-purple { background: #eeedfe; color: #534ab7; }
.stat-card .stat-foot { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-card .stat-accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat-card .stat-top-row { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-delta {
  font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; display: inline-flex;
  align-items: center; gap: 3px;
}
.stat-delta.up { background: #eaf3de; color: #3b6d11; }
.stat-delta.down { background: #fcebeb; color: #a32d2d; }
.stat-delta.flat { background: var(--slate-100); color: var(--muted); }
.sparkline { display: block; margin-top: 10px; }

/* ---------- Avatars ---------- */
.avatar-circle {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; flex-shrink: 0; color: #fff;
}
.avatar-circle.sz-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-circle.av-1 { background: #0d9488; }
.avatar-circle.av-2 { background: #185fa5; }
.avatar-circle.av-3 { background: #854f0b; }
.avatar-circle.av-4 { background: #7f77dd; }
.avatar-circle.av-5 { background: #a32d2d; }
.avatar-circle.av-6 { background: #3b6d11; }

/* ---------- Section labels ---------- */
.section-eyebrow {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--teal-600); margin-bottom: 4px; display: block;
}
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-heading h6 { margin: 0; font-size: 15px; font-weight: 700; }

/* ---------- Custom chart legend ---------- */
.chart-legend { display: flex; flex-direction: column; gap: 9px; }
.chart-legend .cl-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.chart-legend .cl-label { display: flex; align-items: center; gap: 8px; color: var(--slate-700); }
.chart-legend .cl-count { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--ink); }

/* ---------- Workload / progress rows ---------- */
.workload-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--slate-100); }
.workload-item:last-child { border-bottom: none; }
.workload-info { flex: 1; min-width: 0; }
.workload-name { font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; }
.workload-bar-track { height: 6px; border-radius: 999px; background: var(--slate-100); margin-top: 6px; overflow: hidden; }
.workload-bar-fill { height: 100%; border-radius: 999px; background: var(--teal-500); }
.workload-count { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ---------- Page header (used on every non-dashboard page) ---------- */
.page-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page-header .ph-left { display: flex; align-items: center; gap: 14px; }
.page-header .ph-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--slate-900); color: var(--teal-500);
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
}
.page-header .ph-eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-600); }
.page-header h4 { margin: 2px 0 0; font-size: 19px; font-weight: 700; color: var(--ink); }
.page-header .ph-sub { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.page-header .ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 46px 20px; }
.empty-state .es-icon {
  width: 56px; height: 56px; border-radius: 14px; background: var(--slate-100); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 14px;
}
.empty-state .es-title { font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.empty-state .es-sub { font-size: 13px; color: var(--muted); max-width: 320px; margin: 0 auto; }

/* ---------- Table cells with person identity ---------- */
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell .pc-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.person-cell .pc-sub { font-size: 11.5px; color: var(--muted); }

/* ---------- Filter bar card ---------- */
.filter-bar { background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.filter-bar .form-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }

/* ---------- Result count strip ---------- */
.result-strip { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid var(--slate-200); font-size: 12.5px; color: var(--muted); }
.result-strip strong { color: var(--ink); font-family: 'JetBrains Mono', monospace; }

/* ---------- Detail page hero ---------- */
.ticket-hero {
  background: #fff; border: 1px solid var(--slate-200); border-radius: 14px; padding: 20px 24px; margin-bottom: 18px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.ticket-hero .th-code { font-size: 12px; color: var(--muted); }
.ticket-hero h4 { margin: 4px 0 0; font-size: 20px; font-weight: 700; }
.ticket-hero .th-badges { display: flex; gap: 8px; }

/* ---------- Form section card ---------- */
.form-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--slate-100); }

/* ---------- Chart cards ---------- */
.chart-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--slate-200); height: 100%; }
.chart-card .chart-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--slate-200);
}
.chart-card .chart-card-header h6 { margin: 0; font-size: 14px; font-weight: 700; }
.chart-card .chart-card-header .chart-sub { font-size: 12px; color: var(--muted); }
.chart-card .chart-card-body { padding: 18px 20px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* ---------- Activity feed ---------- */
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--slate-100); }
.feed-item:last-child { border-bottom: none; }
.feed-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 15px; background: var(--slate-100); color: var(--slate-700);
}
.feed-icon.fi-new { background: #e6f1fb; color: #185fa5; }
.feed-icon.fi-progress { background: #faeeda; color: #854f0b; }
.feed-icon.fi-resolved { background: #eaf3de; color: #3b6d11; }
.feed-icon.fi-closed { background: var(--slate-800); color: #fff; }
.feed-icon.fi-rejected { background: #fcebeb; color: #a32d2d; }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.feed-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Quick action tiles ---------- */
.quick-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--slate-200); background: #fff; transition: border-color .15s, background .15s;
  color: var(--ink);
}
.quick-tile:hover { border-color: var(--teal-500); background: var(--teal-50); color: var(--ink); }
.quick-tile .qt-icon {
  width: 38px; height: 38px; border-radius: 10px; background: var(--slate-900); color: var(--teal-500);
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.quick-tile .qt-label { font-size: 13.5px; font-weight: 600; }
.quick-tile .qt-sub { font-size: 11.5px; color: var(--muted); }

.card { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--slate-200); }
.card-header { background: #fff; border-bottom: 1px solid var(--slate-200); font-weight: 600; padding: 14px 20px; }
.card-body { padding: 20px; }

/* ---------- Tables ---------- */
.table thead th {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  border-bottom: 2px solid var(--slate-200); font-weight: 700;
}
.table td { vertical-align: middle; font-size: 14px; }
.table-hover tbody tr:hover { background: var(--slate-50); }

/* ---------- Badges ---------- */
.badge { font-weight: 600; font-size: 11.5px; padding: 5px 10px; letter-spacing: .01em; }

/* ---------- Buttons ---------- */
.btn-primary { background: var(--teal-600); border-color: var(--teal-600); }
.btn-primary:hover { background: var(--teal-500); border-color: var(--teal-500); }
.btn-outline-primary { color: var(--teal-600); border-color: var(--teal-600); }
.btn-outline-primary:hover { background: var(--teal-600); border-color: var(--teal-600); }

/* ---------- Login ---------- */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, #1e293b 0%, #0f172a 60%);
  padding: 20px;
}
.auth-card {
  background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-brand i { color: var(--teal-600); font-size: 26px; }
.auth-brand span { font-size: 20px; font-weight: 700; }
.auth-card .form-label { font-weight: 600; font-size: 13.5px; }

/* ---------- Timeline (status history) ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--slate-200); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
  content: ''; position: absolute; left: -28px; top: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--teal-500); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--teal-500);
}
.timeline-item .ts { font-size: 12px; color: var(--muted); }

/* ---------- Comments ---------- */
.comment-item { border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.comment-item .comment-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Priority left-border accents on ticket rows ---------- */
.priority-strip-Low { border-left: 4px solid #22c55e; }
.priority-strip-Medium { border-left: 4px solid #0ea5e9; }
.priority-strip-High { border-left: 4px solid var(--amber-500); }
.priority-strip-Critical { border-left: 4px solid var(--red-500); }

/* ---------- Loading spinner overlay ---------- */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.7); display: none;
  align-items: center; justify-content: center; z-index: 2000;
}
.loading-overlay.active { display: flex; }

@media (max-width: 991px) {
  .app-sidebar { position: fixed; left: -240px; z-index: 1050; transition: left .2s ease; }
  .app-sidebar.show { left: 0; }
}
