/* ============================================================
   NextCounsel Issue Tracker — modern theme
   ============================================================ */

:root {
  /* Brand */
  --brand-navy:      #0F2A5E;
  --brand-navy-900:  #0A1F47;
  --brand-cyan:      #2EC8E6;
  --brand-cyan-600:  #1FA9C4;
  --brand-indigo:    #3B5BDB;
  --brand-violet:    #6D4AFF;

  --brand-gradient-soft: linear-gradient(135deg, rgba(59,91,219,0.08) 0%, rgba(46,200,230,0.10) 100%);

  /* Solid CTA color (replaces gradient on buttons / active states) */
  --brand-solid:        hsl(194, 100%, 48%);
  --brand-solid-hover:  hsl(194, 100%, 42%);
  --brand-solid-shadow: hsla(194, 100%, 48%, 0.40);

  /* Neutrals — slate scale */
  --slate-50:  #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* Semantic */
  --success:   #10B981;
  --success-bg:#D1FAE5;
  --warning:   #F59E0B;
  --warning-bg:#FEF3C7;
  --danger:    #E11D48;
  --danger-bg: #FFE4E6;
  --info:      #3B82F6;
  --info-bg:   #DBEAFE;

  /* Surfaces */
  --bg-page:   #F6F8FB;
  --bg-card:   #FFFFFF;
  --bg-subtle: #F1F5F9;
  --border:    rgba(15,23,42,0.08);
  --border-strong: rgba(15,23,42,0.14);

  /* Text */
  --text:      var(--slate-900);
  --text-muted:var(--slate-500);
  --text-soft: var(--slate-600);

  /* Shadow + radius */
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.06), 0 2px 4px -2px rgba(15,23,42,0.06);
  --shadow-lg: 0 10px 30px -10px rgba(15,23,42,0.15), 0 4px 12px rgba(15,23,42,0.04);
  --shadow-xl: 0 25px 50px -12px rgba(15,23,42,0.18);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(ellipse 1200px 600px at 0% 0%, rgba(59,91,219,0.05), transparent 55%),
    radial-gradient(ellipse 800px 400px at 100% 0%, rgba(46,200,230,0.05), transparent 55%),
    var(--bg-page);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

h1,h2,h3,h4,h5,h6 {
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
h1,.h1 { font-weight: 700; }

a { color: var(--brand-indigo); text-decoration: none; }
a:hover { color: var(--brand-navy); }

::selection { background: rgba(46,200,230,0.3); }

/* ============================================================
   Navbar — glass top bar
   ============================================================ */
.nc-navbar {
  background: rgba(255,255,255,0.75);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15,23,42,0.03);
  padding: 0.5rem 0;
}
.nc-navbar .navbar-brand {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.nc-navbar .navbar-brand:hover { background: var(--slate-100); }
.nc-navbar .navbar-brand img { height: 26px; }
.nc-navbar .brand-divider {
  width: 1px; height: 20px; background: var(--border-strong); margin: 0 0.25rem;
}
.nc-navbar .brand-tag {
  color: var(--slate-700);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}
.nc-navbar .btn-light-outline {
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--border-strong);
  color: var(--slate-700);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  transition: all 0.15s ease;
}
.nc-navbar .btn-light-outline:hover {
  background: #fff;
  border-color: var(--slate-400);
  color: var(--slate-900);
}
.nc-navbar .user-chip {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--border-strong);
  color: var(--slate-800);
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.nc-navbar .user-chip:hover {
  background: #fff; border-color: var(--slate-400);
}

/* ============================================================
   Sidebar
   ============================================================ */
.nc-sidebar {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 60px);
  padding: 1.5rem 0.9rem;
}
.nc-sidebar h6 {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--slate-400);
  margin: 1.25rem 0.75rem 0.4rem;
}
.nc-sidebar h6:first-child { margin-top: 0; }
.nc-sidebar .nav-link {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--slate-700);
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}
.nc-sidebar .nav-link:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}
.nc-sidebar .nav-link i {
  font-size: 1.05rem;
  color: var(--slate-500);
  width: 20px; text-align: center;
}
.nc-sidebar .nav-link.active {
  background: var(--brand-solid);
  color: #fff;
  box-shadow: 0 6px 18px -6px var(--brand-solid-shadow);
}
.nc-sidebar .nav-link.active i { color: #fff; }

/* New-ticket CTA */
.sidebar-cta {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--brand-solid);
  color: #fff !important;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  box-shadow: 0 8px 20px -8px var(--brand-solid-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.sidebar-cta:hover {
  background: var(--brand-solid-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px var(--brand-solid-shadow);
  color: #fff !important;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn { font-weight: 500; border-radius: 10px; transition: all 0.15s ease; }
.btn-sm { border-radius: 8px; }
.btn-lg { border-radius: 12px; }

.btn-nc-primary {
  background: var(--brand-solid);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px -4px var(--brand-solid-shadow);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-nc-primary:hover {
  background: var(--brand-solid-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px var(--brand-solid-shadow);
}
.btn-nc-primary:active { transform: translateY(0); }

.btn-nc-accent {
  background: var(--brand-solid);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px -4px var(--brand-solid-shadow);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-nc-accent:hover {
  background: var(--brand-solid-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px var(--brand-solid-shadow);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--slate-700);
}
.btn-ghost:hover {
  background: var(--slate-100);
  border-color: var(--slate-400);
  color: var(--slate-900);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 1rem 1.25rem;
  color: var(--slate-800);
}
.card-header i { color: var(--slate-500); margin-right: 0.35rem; }
.card-body { padding: 1.25rem; }
.card-hover { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   Stat tiles (dashboard)
   ============================================================ */
.stat-tile {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-tile .icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
  background: var(--brand-gradient-soft);
  color: var(--brand-indigo);
}
.stat-tile .label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stat-tile .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-top: 0.15rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-tile .delta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.stat-tile .bg-art {
  position: absolute;
  right: -30px; bottom: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  opacity: 0.08;
  background: var(--brand-solid);
  pointer-events: none;
}

.stat-tile.accent .icon {
  background: linear-gradient(135deg, rgba(46,200,230,0.15), rgba(46,200,230,0.05));
  color: var(--brand-cyan-600);
}
.stat-tile.warning .icon {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05));
  color: var(--warning);
}
.stat-tile.warning .value { color: var(--warning); }
.stat-tile.danger .icon {
  background: linear-gradient(135deg, rgba(225,29,72,0.15), rgba(225,29,72,0.05));
  color: var(--danger);
}
.stat-tile.danger .value { color: var(--danger); }
.stat-tile.success .icon {
  background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05));
  color: var(--success);
}
.stat-tile.success .value { color: var(--success); }

/* ============================================================
   Pills (status, priority, type) — soft colored
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1;
}
.pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.pill-no-dot::before { display: none; }

/* Status */
.pill-status-new          { background: rgba(59,130,246,0.10); color: #1D4ED8; }
.pill-status-acknowledged { background: rgba(14,165,233,0.10); color: #0369A1; }
.pill-status-in-progress  { background: rgba(245,158,11,0.12); color: #B45309; }
.pill-status-on-hold      { background: rgba(100,116,139,0.12); color: #334155; }
.pill-status-resolved     { background: rgba(16,185,129,0.12); color: #047857; }
.pill-status-closed       { background: rgba(71,85,105,0.14); color: #1E293B; }

/* Priority */
.pill-priority-low        { background: rgba(100,116,139,0.10); color: #475569; }
.pill-priority-medium     { background: rgba(59,130,246,0.10); color: #1D4ED8; }
.pill-priority-high       { background: rgba(245,158,11,0.12); color: #B45309; }
.pill-priority-critical   { background: rgba(225,29,72,0.12); color: #BE123C; }

/* Neutral type chip */
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--border);
}

/* ============================================================
   Tables
   ============================================================ */
.table {
  margin-bottom: 0;
  color: var(--text);
  --bs-table-hover-bg: var(--slate-50);
}
.table > thead {
  background: var(--slate-50);
}
.table > thead th {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-500);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
}
.table > tbody > tr > td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.table > tbody > tr:last-child > td { border-bottom: none; }
.table-hover > tbody > tr { transition: background 0.1s ease; }

.ticket-row { cursor: pointer; }
.ticket-row:hover { background: var(--slate-50); }

.ticket-ref {
  font-family: 'JetBrains Mono','SF Mono', Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-indigo);
  letter-spacing: -0.02em;
}

/* Tenant color bar */
.tenant-bar {
  display: inline-block;
  width: 4px; height: 22px; border-radius: 4px;
  margin-right: 10px;
  vertical-align: middle;
}

/* ============================================================
   Avatars
   ============================================================ */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  background: var(--brand-solid);
  box-shadow: 0 2px 6px rgba(15,23,42,0.08);
}
.avatar-sm { width: 26px; height: 26px; font-size: 0.72rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 1.05rem; }

/* ============================================================
   Login page — split-screen hero
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-page);
}
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none !important; }
}

.auth-hero {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 3rem 3.5rem;
  background: var(--brand-solid);
  color: #fff;
  overflow: hidden;
}
.auth-hero::before, .auth-hero::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.auth-hero::before { width: 500px; height: 500px; top: -160px; right: -180px; }
.auth-hero::after  { width: 360px; height: 360px; bottom: -120px; left: -100px; background: rgba(46,200,230,0.15); }

.auth-hero .hero-logo {
  background: #fff;
  display: inline-flex;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.auth-hero .hero-logo img { height: 28px; }

.auth-hero h1 {
  position: relative; z-index: 1;
  font-size: 2.4rem;
  line-height: 1.15;
  color: #fff;
  margin: 2rem 0 1rem;
  letter-spacing: -0.03em;
}
.auth-hero p {
  position: relative; z-index: 1;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  max-width: 440px;
  line-height: 1.55;
}
.auth-hero .features {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 0.9rem;
  margin-top: 2.5rem;
}
.auth-hero .feat {
  display: flex; align-items: flex-start; gap: 0.85rem;
  color: rgba(255,255,255,0.92);
}
.auth-hero .feat .dot {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-hero .feat strong { display: block; color: #fff; margin-bottom: 0.1rem; }
.auth-hero .feat span  { font-size: 0.9rem; color: rgba(255,255,255,0.75); }

.auth-hero .foot {
  position: relative; z-index: 1;
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
}

.auth-form-col {
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.auth-card {
  width: 100%; max-width: 420px;
  padding: 1rem;
}
.auth-card h2 {
  font-size: 1.75rem;
  margin-bottom: 0.3rem;
  letter-spacing: -0.03em;
}
.auth-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.auth-card .form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
.auth-card .form-control {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 0.95rem;
  transition: all 0.15s ease;
}
.auth-card .form-control:focus {
  border-color: var(--brand-indigo);
  box-shadow: 0 0 0 4px rgba(59,91,219,0.12);
}

.btn-microsoft {
  display: flex; align-items: center; justify-content: center; gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  color: var(--slate-800);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.btn-microsoft:hover {
  border-color: var(--slate-400);
  box-shadow: var(--shadow-md);
  color: var(--slate-900);
  transform: translateY(-1px);
}
.ms-logo {
  width: 18px; height: 18px; display: inline-block;
  background:
    linear-gradient(to right, #F25022 0 50%, #7FBA00 50% 100%) top / 100% 50% no-repeat,
    linear-gradient(to right, #00A4EF 0 50%, #FFB900 50% 100%) bottom / 100% 50% no-repeat;
}

.or-divider {
  display: flex; align-items: center; gap: 0.9rem;
  margin: 1.3rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Mock login picker (microsoft mock) */
.ms-picker .item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  background: #fff;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s ease;
}
.ms-picker .item:hover {
  border-color: var(--brand-indigo);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.ms-picker .item .meta { flex: 1; min-width: 0; }
.ms-picker .item .meta strong { display: block; color: var(--text); }
.ms-picker .item .meta span { color: var(--text-muted); font-size: 0.85rem; }

/* ============================================================
   Timeline (ticket activity)
   ============================================================ */
.timeline {
  border-left: 2px solid var(--border);
  padding-left: 1.1rem;
  margin-left: 0.9rem;
  position: relative;
}
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.6rem; top: 0.35rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(46,200,230,0.18);
}
.timeline-item.internal::before {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.22);
}

.comment-body {
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  color: var(--text);
  margin-top: 0.35rem;
  line-height: 1.55;
}
.comment-body.internal {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border-color: rgba(245,158,11,0.25);
}

/* ============================================================
   Alerts (toasts)
   ============================================================ */
.alert {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0.85rem 1.05rem;
  font-size: 0.9rem;
}
.alert-success {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.2);
  color: #065F46;
}
.alert-danger {
  background: rgba(225,29,72,0.08);
  border-color: rgba(225,29,72,0.2);
  color: #9F1239;
}
.alert-info {
  background: rgba(59,130,246,0.06);
  border-color: rgba(59,130,246,0.18);
  color: #1E40AF;
}
.alert-warning {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.22);
  color: #92400E;
}

/* ============================================================
   Forms
   ============================================================ */
.form-control, .form-select {
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: all 0.15s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-indigo);
  box-shadow: 0 0 0 4px rgba(59,91,219,0.1);
}
.form-label {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--slate-700);
}

/* ============================================================
   Utility
   ============================================================ */
.text-muted-sm { color: var(--text-muted); font-size: 0.85rem; }
.dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
}
.divider {
  height: 1px; background: var(--border); margin: 1rem 0;
}
.tenant-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  margin-right: 8px; vertical-align: middle;
}

/* Page header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
}
.page-header p { color: var(--text-muted); margin: 0; font-size: 0.9rem; }

/* ============================================================
   Error pages
   ============================================================ */
.error-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.error-card {
  text-align: center;
  max-width: 440px;
  padding: 3rem 2rem;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.error-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--brand-solid);
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
}

/* Dropdown */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
}
.dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--slate-700);
}
.dropdown-item:hover { background: var(--slate-100); color: var(--slate-900); }
.dropdown-header { color: var(--text-muted); font-size: 0.75rem; }

/* ============================================================
   SLA pills + progress + stacked bar
   ============================================================ */
.sla-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem 0.2rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1;
}
.sla-pill i { font-size: 0.85rem; }
.sla-pill.sla-met       { background: rgba(16,185,129,0.12); color: #047857; }
.sla-pill.sla-pending   { background: rgba(59,130,246,0.10); color: #1D4ED8; }
.sla-pill.sla-at_risk   { background: rgba(245,158,11,0.14); color: #B45309; }
.sla-pill.sla-breached  { background: rgba(225,29,72,0.14); color: #BE123C; }
.sla-pill.sla-paused    { background: rgba(100,116,139,0.14); color: #334155; }

/* Progress bar */
.progress-shell {
  position: relative;
  width: 100%;
  height: 22px;
  background: var(--slate-100);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.progress-label {
  position: absolute;
  top: 50%; right: 0.7rem;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--slate-700);
  font-variant-numeric: tabular-nums;
}
.progress-empty {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

/* Stacked horizontal bar (status / priority breakdown) */
.stacked-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: var(--slate-100);
  overflow: hidden;
}
.stacked-bar .seg { display: block; height: 100%; }
.stacked-bar .seg:first-child { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.stacked-bar .seg:last-child  { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }

.legend-list {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1.25rem;
  margin-top: 0.85rem;
}
.legend-item {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--slate-700);
}
.legend-item .swatch {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block;
}
.legend-item strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-left: 0.15rem;
}

/* SLA detail panel rows */
.sla-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.sla-row:last-child { border-bottom: none; }
.sla-row .sla-row-label { color: var(--slate-600); font-size: 0.85rem; font-weight: 500; }
.sla-row .sla-row-meta  { color: var(--slate-500); font-size: 0.78rem; }
.sla-row .sla-row-value { display: flex; align-items: center; gap: 0.5rem; }

/* Tenant header on admin tenant page */
.tenant-hero {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.tenant-hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 6px;
  background: var(--accent, var(--brand-solid));
}
.tenant-hero .tenant-mark {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; color: #fff;
  background: var(--accent, var(--brand-solid));
  flex-shrink: 0;
}
.tenant-hero h1 { font-size: 1.5rem; margin: 0; }
.tenant-hero .meta { color: var(--text-muted); font-size: 0.9rem; }
.tenant-hero .meta span + span::before {
  content: '·'; margin: 0 0.5rem; color: var(--slate-300);
}

/* ============================================================
   New components: filter chips, mentions, attachments, dropzone,
   bulk bar, day toggle, log block, KB suggestions
   ============================================================ */

/* Quick-filter chips (above ticket list) */
.filter-chips {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.chip-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--slate-700);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.chip-link:hover { border-color: var(--brand-solid); color: var(--brand-solid); }
.chip-link.active {
  background: var(--brand-solid);
  border-color: var(--brand-solid);
  color: #fff;
}
.chip-link i { font-size: 0.95rem; }

/* @mention highlight in comments */
.mention-link {
  background: rgba(0,188,245,0.10);
  color: #0369A1;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.92em;
}

/* Attachments grid on ticket detail */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}
.attachment-card {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s ease;
}
.attachment-card:hover { border-color: var(--brand-solid); transform: translateY(-1px); }
.attachment-card img {
  width: 44px; height: 44px; object-fit: cover; border-radius: 8px;
}
.attachment-icon {
  width: 44px; height: 44px;
  background: var(--slate-100);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--slate-500);
  font-size: 1.4rem;
}
.attachment-meta { min-width: 0; flex: 1; }
.attachment-name {
  font-size: 0.85rem; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attachment-size { color: var(--text-muted); font-size: 0.75rem; }

/* Drop zone for new attachments */
.dropzone {
  position: relative;
  text-align: center;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--slate-50);
  cursor: pointer;
  transition: all 0.15s ease;
}
.dropzone:hover,
.dropzone.dropzone-over {
  border-color: var(--brand-solid);
  background: rgba(0,188,245,0.08);
}
.dropzone-input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

/* Bulk action bar above the table */
.bulk-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  border-bottom: none;
  margin-bottom: -1px;
}

/* Working-day toggles in tenant settings */
.day-toggle {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 50px;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--slate-700);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.day-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.day-toggle.active {
  background: var(--brand-solid);
  border-color: var(--brand-solid);
  color: #fff;
}

/* Notification log raw block */
.log-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  white-space: pre;
  overflow: auto;
  color: var(--slate-700);
}

/* KB suggestions on the new-ticket form */
.kb-suggestions {
  margin-top: 0.5rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.kb-suggestions-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.kb-suggestion {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgba(0,188,245,0.06);
  border: 1px solid rgba(0,188,245,0.18);
  border-radius: 8px;
  color: var(--slate-700);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.15s ease;
}
.kb-suggestion:hover { background: rgba(0,188,245,0.12); color: var(--brand-solid); }

/* Field-change timeline item (smaller dot) */
.timeline-item.change::before {
  background: var(--slate-100);
  border-color: var(--slate-400);
  box-shadow: 0 0 0 2px var(--slate-100);
}

/* ============================================================
   Quill editor + KB article rendering
   ============================================================ */

/* Editor container — match our form-control look. Toolbar + container
   share one continuous border so they read as a single card. */
.ql-toolbar.ql-snow {
  border: 1px solid var(--border-strong) !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 10px 10px 0 0;
  background: var(--slate-50);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
/* High-specificity override so we beat Quill's own border */
.kb-editor.ql-container.ql-snow {
  border: 1px solid var(--border-strong) !important;
  border-top: none !important;
  border-radius: 0 0 10px 10px;
  background: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Subtle focus ring on the whole editor when the inner area is active */
.kb-editor.ql-container.ql-snow:focus-within {
  border-color: var(--brand-solid) !important;
  box-shadow: 0 0 0 4px rgba(0,188,245,0.10);
}
.ql-editor {
  min-height: 300px;
  padding: 1rem 1.25rem !important;
  color: var(--text);
}
.ql-editor.ql-blank::before {
  color: var(--text-muted) !important;
  font-style: normal !important;
  font-size: 0.95rem !important;
  left: 1.25rem !important;
}

/* Rendered article body */
.kb-article-body {
  color: var(--slate-700);
  line-height: 1.75;
  font-size: 1rem;
}
.kb-article-body h1,
.kb-article-body h2,
.kb-article-body h3,
.kb-article-body h4,
.kb-article-body h5,
.kb-article-body h6 {
  color: var(--text);
  margin: 1.6rem 0 0.6rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.kb-article-body h1 { font-size: 1.6rem; }
.kb-article-body h2 { font-size: 1.35rem; }
.kb-article-body h3 { font-size: 1.15rem; }
.kb-article-body p { margin: 0 0 1rem; }
.kb-article-body p:last-child { margin-bottom: 0; }
.kb-article-body ul,
.kb-article-body ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}
.kb-article-body li { margin-bottom: 0.35rem; }
.kb-article-body blockquote {
  margin: 1rem 0;
  padding: 0.65rem 1rem;
  border-left: 3px solid var(--brand-solid);
  background: rgba(0,188,245,0.06);
  border-radius: 0 8px 8px 0;
  color: var(--slate-700);
  font-style: italic;
}
.kb-article-body code {
  background: var(--slate-100);
  color: #BE123C;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 0.88em;
}
.kb-article-body pre {
  background: var(--slate-900);
  color: #E2E8F0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 1rem 0;
}
.kb-article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.kb-article-body a {
  color: var(--brand-solid);
  text-decoration: underline;
}
.kb-article-body a:hover { color: var(--brand-solid-hover); }
.kb-article-body strong { color: var(--text); font-weight: 600; }
.kb-article-body hr {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination-nav {
  padding: 0.85rem 1.05rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: -1px !important; /* pull up flush against the table card */
}
.pagination .page-link {
  border: 1px solid var(--border);
  color: var(--slate-700);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  min-width: 36px;
  text-align: center;
  background: #fff;
  margin: 0 2px;
  border-radius: 8px !important;
  transition: all 0.15s ease;
}
.pagination .page-link:hover {
  background: var(--slate-100);
  color: var(--slate-900);
  border-color: var(--slate-300);
}
.pagination .page-item.active .page-link {
  background: var(--brand-solid);
  border-color: var(--brand-solid);
  color: #fff;
}
.pagination .page-item.disabled .page-link {
  color: var(--slate-400);
  background: var(--slate-50);
  cursor: not-allowed;
}

/* Smooth scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--slate-200);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--slate-300); background-clip: content-box; }
