/* ================================================================
   NeuroTicket Design System — v3
   Glassmorphism dark navy · Sora + Manrope · Slate & Steel palette
   ================================================================ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --bg:      #f1f5f9;
  --bg2:     #f8fafc;
  --panel:   rgba(255,255,255,.97);
  --card:    #ffffff;
  --card2:   #f8fafc;
  --line:    rgba(148,163,184,.28);
  --line2:   rgba(148,163,184,.16);
  --text:    #0f172a;
  --muted:   #475569;
  --soft:    #94a3b8;
  --primary: #2a628f;
  --pri2:    #1d4e6e;
  --success: #16a34a;
  --warning: #d97706;
  --danger:  #dc2626;
  --shadow:  0 1px 8px rgba(15,23,42,.08), 0 0 0 1px rgba(148,163,184,.14);
  --radius:  12px;
}

/* ── Reset / Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: transparent; }
img { display: block; max-width: 100%; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 272px;
  padding: 24px 14px 20px;
  border-right: 1px solid rgba(148,163,184,.12);
  background: linear-gradient(180deg, #0d1829 0%, #081222 100%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 40;
  overflow-y: auto;
  /* Sidebar always dark — override light tokens locally */
  --text:  #f8fafc;
  --muted: #94a3b8;
  --soft:  #64748b;
  --line:  rgba(148,163,184,.14);
}

/* Brand */
.nt-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  flex-shrink: 0;
}
.nt-brand-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--pri2));
  display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(42,98,143,.40);
  flex-shrink: 0;
}
.nt-brand-icon svg { width: 20px; height: 20px; color: #fff; }
.nt-brand strong { display: block; font-size: 16px; font-weight: 700; color: var(--text); }
.nt-brand span   { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

/* Menu */
.nt-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nt-section {
  margin: 16px 8px 6px;
  color: var(--soft);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .08em;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: background .14s, color .14s;
  position: relative;
}
.menu-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.menu-item:hover {
  background: linear-gradient(90deg, rgba(42,98,143,.20), rgba(42,98,143,.06));
  color: var(--text);
}
.menu-item.active {
  background: linear-gradient(90deg, rgba(42,98,143,.25), rgba(42,98,143,.08));
  color: #8fc2dc;
  box-shadow: inset 0 0 0 1px rgba(58,125,170,.25);
}
.menu-item.active svg { color: #5a9ec4; }

/* Badge de contagem no menu */
.menu-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}
.menu-badge-yellow { background: #f59e0b; color: #1c1400; }
.menu-badge-red    { background: #ef4444; color: #fff; animation: pulse 2s infinite; }
.menu-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; }
.menu-dot-green { background: var(--success); box-shadow: 0 0 8px var(--success); }
.menu-dot-red   { background: var(--danger); }

/* Profile card na base da sidebar */
.nt-profile {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nt-profile-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background .14s;
}
.nt-profile-link:hover { background: rgba(42,98,143,.12); }
.nt-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pri2), var(--primary));
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.nt-avatar-online { position: relative; }
.nt-avatar-online::after {
  content: '';
  position: absolute;
  width: 9px; height: 9px;
  background: var(--success);
  border-radius: 50%;
  right: 0; bottom: 1px;
  border: 2px solid #08101f;
}
.nt-profile-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.nt-profile-role  { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.nt-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--soft);
  transition: color .14s, background .14s;
}
.nt-logout:hover { color: #f87171; background: rgba(239,68,68,.08); }
.nt-logout svg { width: 15px; height: 15px; }

/* ── App shell ───────────────────────────────────────────────── */
.app {
  margin-left: 272px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 440px) auto;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  height: 58px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-title { font-size: 14px; font-weight: 600; color: var(--text); }

.topbar-search {
  position: relative;
}
.topbar-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--soft);
  pointer-events: none;
}
.topbar-search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search input::placeholder { color: var(--soft); }
.topbar-search input:focus {
  border-color: rgba(42,98,143,.50);
  box-shadow: 0 0 0 3px rgba(42,98,143,.10);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Notification button */
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: background .14s, color .14s;
}
.notif-btn:hover { background: rgba(15,23,42,.06); color: var(--text); }
.notif-btn svg { width: 18px; height: 18px; }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  display: grid; place-items: center;
  padding: 0 3px;
  border: 2px solid #070f1d;
}

/* Notification dropdown */
.notif-panel {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  width: 320px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 50;
}
.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}
.notif-panel-head button {
  font-size: 12px;
  color: #5a9ec4;
  padding: 0;
}
.notif-panel-head button:hover { color: #8fc2dc; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line2);
  cursor: pointer;
  transition: background .12s;
}
.notif-item:hover { background: rgba(42,98,143,.06); }
.notif-item p:first-child { font-size: 13px; font-weight: 500; margin: 0 0 3px; }
.notif-item p:last-child  { font-size: 11px; color: var(--muted); margin: 0; }

/* Search results dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
  z-index: 50;
}
.search-group-head {
  padding: 8px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--bg);
  border-bottom: 1px solid var(--line2);
}
.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  transition: background .12s;
}
.search-result-item:hover { background: rgba(42,98,143,.10); }

/* ── Flash message ───────────────────────────────────────────── */
.flash {
  margin: 16px 28px 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}
.flash-success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.28);  color: #86efac; }
.flash-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.28);  color: #fca5a5; }
.flash-info    { background: rgba(42,98,143,.12);  border: 1px solid rgba(42,98,143,.28);  color: #8fc2dc; }

/* ── Page content ────────────────────────────────────────────── */
.page-content { padding: 24px 28px 40px; flex: 1; }

/* ── Panel (equivale ao .card do Tailwind) ───────────────────── */
.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 6px rgba(15,23,42,.06);
}
.card-flush { padding: 0; overflow: hidden; }

/* ── Hero section ────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, rgba(42,98,143,.07), rgba(30,64,175,.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: 240px; height: 100%;
  background: linear-gradient(135deg, rgba(42,98,143,.06), rgba(37,99,235,.03));
  border-radius: inherit;
}
.page-hero h1 { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.page-hero p  { font-size: 14px; color: var(--muted); margin: 0; }

/* ── Botões ──────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3a7daa, #1d4e6e);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .14s, box-shadow .14s;
  box-shadow: 0 10px 28px rgba(42,98,143,.35);
  border: none;
}
.btn-primary:hover { opacity: .88; box-shadow: 0 14px 36px rgba(42,98,143,.48); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.btn-secondary:hover { background: var(--bg); border-color: rgba(148,163,184,.40); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.30);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s;
}
.btn-danger:hover { background: rgba(239,68,68,.22); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(42,98,143,.08);
  border: 1px solid rgba(42,98,143,.28);
  color: #8fc2dc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s;
}
.btn-ghost:hover { background: rgba(42,98,143,.16); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 7px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--soft); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(42,98,143,.50);
  box-shadow: 0 0 0 3px rgba(42,98,143,.10);
}
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 100px; }

/* ── Badges: Status ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* Priority badges */
.badge-low      { background: rgba(100,116,139,.20); color: #94a3b8; border: 1px solid rgba(100,116,139,.25); }
.badge-medium   { background: rgba(59,130,246,.15);  color: #93c5fd; border: 1px solid rgba(59,130,246,.25); }
.badge-high     { background: rgba(245,158,11,.15);  color: #fcd34d; border: 1px solid rgba(245,158,11,.25); }
.badge-critical { background: rgba(239,68,68,.18);   color: #fca5a5; border: 1px solid rgba(239,68,68,.30); animation: pulse 2s infinite; }

/* Status badges */
.status-open         { background: rgba(59,130,246,.15);   color: #93c5fd; border: 1px solid rgba(59,130,246,.25); }
.status-triage       { background: rgba(42,98,143,.18);   color: #8fc2dc; border: 1px solid rgba(42,98,143,.28); }
.status-waiting      { background: rgba(245,158,11,.15);   color: #fcd34d; border: 1px solid rgba(245,158,11,.25); }
.status-waiting_client { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.25); }
.status-progress     { background: rgba(42,98,143,.18);    color: #8fc2dc; border: 1px solid rgba(42,98,143,.28); }
.status-in_progress  { background: rgba(42,98,143,.18);    color: #8fc2dc; border: 1px solid rgba(42,98,143,.28); }
.status-review       { background: rgba(34,211,238,.15);   color: #67e8f9; border: 1px solid rgba(34,211,238,.25); }
.status-answered     { background: rgba(20,184,166,.15);   color: #5eead4; border: 1px solid rgba(20,184,166,.25); }
.status-waiting_acceptance { background: rgba(20,184,166,.15); color: #5eead4; border: 1px solid rgba(20,184,166,.25); }
.status-closed       { background: rgba(34,197,94,.15);    color: #86efac; border: 1px solid rgba(34,197,94,.25); }
.status-reopened     { background: rgba(249,115,22,.15);   color: #fdba74; border: 1px solid rgba(249,115,22,.25); }
.status-cancelled    { background: rgba(100,116,139,.15);  color: #94a3b8; border: 1px solid rgba(100,116,139,.20); }
.status-in_development { background: rgba(42,98,143,.18);  color: #8fc2dc; border: 1px solid rgba(42,98,143,.28); }
.status-internal_review { background: rgba(34,211,238,.15); color: #67e8f9; border: 1px solid rgba(34,211,238,.25); }
.status-waiting_approval { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.25); }

/* ── Tables ──────────────────────────────────────────────────── */
.nt-table { width: 100%; border-collapse: collapse; }
.nt-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--line);
}
.nt-table td {
  padding: 13px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--line2);
  vertical-align: middle;
}
.table-row { border-bottom: 1px solid var(--line2); transition: background .12s; }
.table-row:hover { background: rgba(42,98,143,.04); }
.nt-table .table-row:hover td { background: transparent; }

/* ── KPI / Stat cards ────────────────────────────────────────── */
.kpi-grid { display: grid; gap: 16px; }
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid-2 { grid-template-columns: repeat(2, 1fr); }

.kpi-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(15,23,42,.05);
}
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-sub   { font-size: 11px; color: var(--soft); margin-top: 4px; }

/* Color helpers */
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-muted   { color: var(--muted); }
.text-soft    { color: var(--soft); }

.bg-danger-subtle  { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.25); }
.bg-warning-subtle { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.25); }
.bg-success-subtle { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.25); }
.bg-primary-subtle { background: rgba(42,98,143,.12);  border: 1px solid rgba(42,98,143,.25); }

/* ── Auth layout ─────────────────────────────────────────────── */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #1d4e6e);
  box-shadow: 0 16px 40px rgba(42,98,143,.38);
  margin-bottom: 16px;
}
.auth-logo-icon svg { width: 30px; height: 30px; color: #fff; }
.auth-logo h1 { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.auth-logo p  { font-size: 13px; color: var(--muted); margin: 0; }

.auth-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.auth-box h2 { font-size: 18px; font-weight: 700; margin: 0 0 22px; }

/* ── Portal layout ───────────────────────────────────────────── */
.portal-header {
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.portal-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.portal-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.portal-brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand, var(--primary)); }
.portal-nav { display: flex; align-items: center; gap: 4px; }
.portal-nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  transition: background .13s, color .13s;
}
.portal-nav-link:hover { background: rgba(148,163,184,.08); color: var(--text); }
.portal-content { max-width: 960px; margin: 0 auto; padding: 32px 24px 48px; }

/* Portal brand button */
.btn-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  background-color: var(--brand, var(--primary));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .14s;
}
.btn-brand:hover { opacity: .85; }
.btn-brand-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }

/* ── Utilities ───────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.section-head { font-size: 11px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 12px; }

.empty-state { padding: 56px 20px; text-align: center; }
.empty-state-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(42,98,143,.12);
  border: 1px solid rgba(42,98,143,.25);
  display: grid; place-items: center;
  margin: 0 auto 20px;
}
.empty-state-icon svg { width: 28px; height: 28px; color: #5a9ec4; }
.empty-state h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.empty-state p  { font-size: 13px; color: var(--muted); margin: 0 0 20px; }

/* ── Tabs ────────────────────────────────────────────────────── */
.nt-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.nt-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .13s;
  background: transparent;
}
.nt-tab:hover { color: var(--muted); }
.nt-tab.active { color: #5a9ec4; border-bottom-color: #2a628f; }

/* ── Timeline (ticket view) ──────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.timeline-msg.own { flex-direction: row-reverse; }
.timeline-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--card);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: #8fc2dc;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.timeline-bubble {
  max-width: 70%;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.timeline-bubble.team { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-top-left-radius: 4px; }
.timeline-bubble.own  { background: linear-gradient(135deg, rgba(42,98,143,.12), rgba(29,78,110,.08)); border: 1px solid rgba(42,98,143,.22); color: var(--text); border-top-right-radius: 4px; }
.timeline-bubble.system { background: rgba(148,163,184,.08); border: 1px solid var(--line2); color: var(--muted); font-size: 12px; border-radius: 8px; text-align: center; }
.timeline-meta { font-size: 11px; color: var(--soft); margin-top: 5px; }
.timeline-separator { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: 11px; margin: 4px 0; }
.timeline-separator::before, .timeline-separator::after { content: ''; flex: 1; height: 1px; background: var(--line2); }

/* ── Sidebar toggle (hamburger) ──────────────────────────────── */
.sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: background .14s, color .14s;
  flex-shrink: 0;
  border: none;
  background: transparent;
}
.sidebar-toggle:hover { background: rgba(148,163,184,.10); color: var(--text); }
.sidebar-toggle svg { width: 22px; height: 22px; }

/* ── Sidebar overlay (mobile) ────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 39;
  animation: fadeIn .18s ease-out;
}
.sidebar-overlay.open { display: block; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  /* Sidebar */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    z-index: 40;
  }
  .sidebar.open { transform: translateX(0); }

  /* App shell */
  .app { margin-left: 0; }

  /* Topbar: flex ao invés de grid no mobile */
  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
  }
  .topbar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-search { display: none; }

  /* Hamburger visível */
  .sidebar-toggle { display: flex; }

  /* KPI grids */
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .kpi-grid-4, .kpi-grid-3, .kpi-grid-2 { grid-template-columns: 1fr; }
  .page-content { padding: 12px 14px 32px; }
  .topbar { padding: 0 12px; height: 52px; }
  .topbar-actions .btn-primary { display: none; } /* esconde "Novo chamado" no topo em telas muito pequenas */
  .card { padding: 14px; }
  .page-hero { padding: 20px; }
  .page-hero h1 { font-size: 20px; }
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeIn .18s ease-out; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.55); }

/* ── Light-mode text corrections ─────────────────────────────────── */
/* Tailwind dark-mode utilities used as text in views → readable on light bg */
/* Só sobrescreve text-white em elementos que NÃO têm bg-* próprio (ex: headings, não pills/botões) */
.page-content .text-white:not([class*="bg-"]) { color: var(--text); }
.page-content .text-slate-200,
.page-content .text-slate-300 { color: var(--muted); }
/* Dark inner backgrounds → light on white cards */
.page-content .bg-slate-800,
.page-content .bg-slate-900 { background-color: var(--bg) !important; }
.page-content .bg-slate-700 { background-color: var(--bg2) !important; border-color: var(--line) !important; }
.page-content .border-slate-700 { border-color: var(--line) !important; }
.page-content .border-slate-600 { border-color: var(--line2) !important; }

/* ── Chart.js override ───────────────────────────────────────── */
canvas { max-width: 100%; }
