/* ================================================================
   VTicketDesk - Premium Dark Theme CSS
   ================================================================ */

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

/* ================================================================
   CSS CUSTOM PROPERTIES
   ================================================================ */
:root {
  /* Core Colors */
  --bg-primary:    #0a0c14;
  --bg-secondary:  #0f1117;
  --bg-tertiary:   #141722;
  --bg-card:       #181b28;
  --bg-card-hover: #1e2233;
  --bg-input:      #1a1d2e;
  --bg-modal:      #13162100;

  /* Borders */
  --border-primary:   #1e2235;
  --border-secondary: #252840;
  --border-focus:     #6366f1;

  /* Brand Colors */
  --brand-primary:  #6366f1;
  --brand-secondary:#8b5cf6;
  --brand-accent:   #a78bfa;
  --brand-glow:     rgba(99, 102, 241, 0.15);

  /* Text */
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-inverse:   #0a0c14;

  /* Status Colors */
  --status-open:       #6366f1;
  --status-progress:   #f59e0b;
  --status-hold:       #64748b;
  --status-resolved:   #10b981;
  --status-closed:     #374151;

  /* Priority Colors */
  --priority-low:      #10b981;
  --priority-medium:   #f59e0b;
  --priority-high:     #ef4444;
  --priority-critical: #dc2626;

  /* Functional */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

  /* UI Dimensions */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --border-radius: 10px;
  --border-radius-lg: 14px;
  --border-radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-brand: 0 4px 20px rgba(99,102,241,0.25);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { height: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary); }

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

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: orbFloat 8s ease-in-out infinite;
}
.login-bg-orb.orb-1 {
  width: 400px; height: 400px;
  background: rgba(99,102,241,0.12);
  top: -100px; left: -100px;
}
.login-bg-orb.orb-2 {
  width: 300px; height: 300px;
  background: rgba(139,92,246,0.1);
  bottom: -80px; right: -80px;
  animation-delay: -3s;
}
.login-bg-orb.orb-3 {
  width: 200px; height: 200px;
  background: rgba(16,185,129,0.08);
  top: 50%; left: 50%;
  animation-delay: -5s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(20px, -15px) scale(1.05); }
  66%       { transform: translate(-10px, 10px) scale(0.95); }
}

.login-card {
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(99,102,241,0.08);
  animation: loginFadeIn 0.5s ease;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-brand);
}
.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-control, .form-select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  transition: var(--transition);
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { opacity: 0.5; cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 100px; }

.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .form-control { padding-left: 40px; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  outline: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
}
.btn:hover::after { background: rgba(255,255,255,0.04); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.4); }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border-primary);
}
.btn-secondary:hover { border-color: var(--brand-primary); }

.btn-success {
  background: rgba(16,185,129,0.15);
  color: var(--success);
  border-color: rgba(16,185,129,0.3);
}
.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-warning {
  background: rgba(245,158,11,0.12);
  color: var(--warning);
  border-color: rgba(245,158,11,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn-icon.btn-sm { width: 28px; height: 28px; padding: 4px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ================================================================
   SPINNER / LOADING
   ================================================================ */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   BADGES & STATUS
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-status-open     { background: rgba(99,102,241,0.15); color: var(--status-open); }
.badge-status-progress { background: rgba(245,158,11,0.15); color: var(--status-progress); }
.badge-status-hold     { background: rgba(100,116,139,0.15); color: var(--status-hold); }
.badge-status-resolved { background: rgba(16,185,129,0.15); color: var(--status-resolved); }
.badge-status-closed   { background: rgba(55,65,81,0.4);    color: #9ca3af; }

.badge-priority-low      { background: rgba(16,185,129,0.12);  color: var(--priority-low);      border: 1px solid rgba(16,185,129,0.25); }
.badge-priority-medium   { background: rgba(245,158,11,0.12);  color: var(--priority-medium);   border: 1px solid rgba(245,158,11,0.25); }
.badge-priority-high     { background: rgba(239,68,68,0.12);   color: var(--priority-high);     border: 1px solid rgba(239,68,68,0.25); }
.badge-priority-critical { background: rgba(220,38,38,0.2);    color: var(--priority-critical); border: 1px solid rgba(220,38,38,0.4); animation: critPulse 1.5s ease-in-out infinite; }

@keyframes critPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.3); }
  50%       { box-shadow: 0 0 0 4px rgba(220,38,38,0); }
}

/* ================================================================
   DASHBOARD LAYOUT
   ================================================================ */
.app-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s ease, min-width 0.25s ease;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-brand);
}
.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.brand-ver {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-section {
  padding: 16px 12px 8px;
}
.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--brand-glow);
  color: var(--brand-primary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--brand-primary);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.nav-badge {
  margin-left: auto;
  background: var(--brand-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-user {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border-primary);
}
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
}
.sidebar-user-card:hover { background: var(--bg-card); }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.user-avatar.lg { width: 44px; height: 44px; font-size: 17px; }
.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

/* Main content area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.search-bar {
  position: relative;
  flex: 1;
  max-width: 420px;
}
.search-bar input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}
.search-bar input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-glow); }
.search-bar .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Page content */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-secondary); }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border-primary); }

/* ================================================================
   STAT WIDGETS
   ================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--brand-primary));
  border-radius: 3px 3px 0 0;
}
.stat-card:hover {
  border-color: var(--card-accent, var(--brand-primary));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(99,102,241,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}
.stat-card .stat-change {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ================================================================
   TABLES
   ================================================================ */
.table-wrap { overflow-x: auto; }

.vtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.vtable th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  white-space: nowrap;
}
.vtable td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
  vertical-align: middle;
}
.vtable tbody tr {
  transition: var(--transition);
  cursor: pointer;
}
.vtable tbody tr:hover { background: var(--bg-card-hover); }
.vtable tbody tr:last-child td { border-bottom: none; }

.ticket-subject { font-weight: 600; color: var(--text-primary); }
.ticket-code   { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--brand-primary); font-weight: 600; }
.ticket-meta   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* SLA breach row */
.vtable tbody tr.sla-breach td:first-child {
  border-left: 3px solid var(--danger);
}

/* ================================================================
   TICKET DETAIL VIEW
   ================================================================ */
.ticket-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  height: calc(100vh - var(--topbar-height) - 48px);
}

.ticket-conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-bubble {
  display: flex;
  gap: 10px;
  animation: msgFadeIn 0.3s ease;
}
@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message-bubble.is-agent { flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.msg-avatar.customer { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.msg-avatar.agent    { background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); }
.msg-avatar.admin    { background: linear-gradient(135deg, #ef4444, #dc2626); }

.msg-content { max-width: 75%; }
.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.msg-meta.right { flex-direction: row-reverse; }
.msg-sender { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.msg-time   { font-size: 11px; color: var(--text-muted); }

.msg-body {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-wrap;
}
.message-bubble.is-agent .msg-body {
  background: var(--brand-glow);
  border-color: rgba(99,102,241,0.3);
}
.msg-body.is-internal {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.2);
  border-style: dashed;
}

.msg-attachments { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.attach-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

/* Reply box */
.reply-box {
  border-top: 1px solid var(--border-primary);
  padding: 16px;
  background: var(--bg-secondary);
}
.reply-box textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  resize: none;
  padding: 10px 14px;
  outline: none;
  transition: var(--transition);
  min-height: 80px;
}
.reply-box textarea:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-glow); }

.reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.reply-tools { display: flex; gap: 6px; align-items: center; }

/* Ticket sidebar info */
.ticket-info-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}

.info-section { }
.info-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.info-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-primary);
  gap: 12px;
}
.info-field:last-child { border-bottom: none; }
.info-field .label { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.info-field .value { font-size: 13px; font-weight: 500; color: var(--text-primary); text-align: right; }

.time-tracker {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  padding: 14px;
  text-align: center;
}
.time-tracker .hours-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand-primary);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -1px;
}
.time-tracker .hours-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.time-tracker.sla-ok   { border-color: rgba(16,185,129,0.3); }
.time-tracker.sla-warn { border-color: rgba(245,158,11,0.3); }
.time-tracker.sla-breach { border-color: rgba(239,68,68,0.4); animation: critPulse 2s infinite; }

/* SLA progress bar */
.sla-bar-wrap { margin-top: 8px; }
.sla-bar {
  height: 4px;
  background: var(--border-primary);
  border-radius: 2px;
  overflow: hidden;
}
.sla-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.sla-bar-fill.ok     { background: var(--success); }
.sla-bar-fill.warn   { background: var(--warning); }
.sla-bar-fill.breach { background: var(--danger); }

/* ================================================================
   AUDIT TRAIL
   ================================================================ */
.audit-trail { }
.audit-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 12px;
}
.audit-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-secondary);
  flex-shrink: 0;
  margin-top: 3px;
}
.audit-text { color: var(--text-secondary); line-height: 1.4; }
.audit-time { color: var(--text-muted); font-size: 11px; }

/* ================================================================
   MODALS
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayFadeIn 0.2s ease;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.25s ease;
}
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); flex: 1; }
.modal-body  { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-primary); display: flex; justify-content: flex-end; gap: 8px; }

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  font-size: 13px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--brand-primary); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { color: var(--text-primary); line-height: 1.4; }
.toast-exit { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 16px;
}
.page-btn {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-primary);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover, .page-btn.active {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-glow);
}

/* ================================================================
   REPORTS
   ================================================================ */
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.report-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  padding: 16px;
  text-align: center;
}
.report-stat .num {
  font-size: 30px;
  font-weight: 800;
  color: var(--brand-primary);
  letter-spacing: -1px;
}
.report-stat .lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Chart placeholder */
.chart-container { position: relative; height: 220px; }

/* ================================================================
   FILE UPLOAD AREA
   ================================================================ */
.upload-area {
  border: 2px dashed var(--border-secondary);
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--brand-primary);
  background: var(--brand-glow);
}
.upload-area input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-area .upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-area .upload-text { font-size: 13px; color: var(--text-secondary); }
.upload-area .upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.file-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}
.file-chip .remove-file {
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  width: 16px; height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.file-chip .remove-file:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ================================================================
   SESSION TIMEOUT WARNING
   ================================================================ */
.session-warning-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  background: linear-gradient(90deg, rgba(245,158,11,0.9), rgba(239,68,68,0.9));
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9998;
  animation: slideDown 0.3s ease;
  display: none;
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

/* ================================================================
   SEARCH RESULTS DROPDOWN
   ================================================================ */
.search-results {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  margin-top: 4px;
  overflow: hidden;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-primary);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card-hover); }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; }

/* ================================================================
   DROPDOWN MENUS
   ================================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  min-width: 180px;
  padding: 4px;
  margin-top: 4px;
  animation: dropIn 0.15s ease;
}
.dropdown-menu.left { right: auto; left: 0; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}
.dropdown-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.1); color: var(--danger); }
.dropdown-divider { border-bottom: 1px solid var(--border-primary); margin: 4px 0; }

/* ================================================================
   TABS
   ================================================================ */
.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border-primary);
  gap: 2px;
  padding: 0 16px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }

.tab-panel { display: none; padding: 20px; }
.tab-panel.active { display: block; }

/* ================================================================
   NOTIFICATIONS BELL
   ================================================================ */
.notif-bell-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
  color: var(--text-secondary);
}
.notif-bell-btn:hover { border-color: var(--brand-primary); color: var(--text-primary); }
.notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px; height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
  display: none;
}

.notif-panel {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  width: 340px;
  margin-top: 8px;
  animation: dropIn 0.15s ease;
  display: none;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-primary);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { background: rgba(99,102,241,0.04); }

/* ================================================================
   MOBILE SIDEBAR TOGGLE
   ================================================================ */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .ticket-detail-grid { grid-template-columns: 1fr; }
  .ticket-info-panel { display: none; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 200;
    transition: left 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 14px; }
  .topbar { padding: 0 14px; }
  .session-warning-bar { left: 0; }
  .modal { max-width: calc(100vw - 32px); }
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.d-flex { display: flex; }
.d-none { display: none !important; }
.d-block { display: block; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted) !important; }
.text-primary-color { color: var(--brand-primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.p-0 { padding: 0 !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full { width: 100%; }
.rounded { border-radius: var(--border-radius); }
.hidden { display: none; }

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.4s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
