/* =====================================================================
   Tech Novelty Support - modern design layer
   Loaded AFTER style.css / ticket-view.css. Design only: no markup or
   behaviour is changed. Every brand colour comes from the --tn-blue-* tokens
   (Settings > Branding), so a re-branded portal re-themes automatically.
   Language: Inter, slate neutrals, soft layered shadows, 12-16px radii,
   tinted surfaces, 150ms motion, visible focus rings.
   ===================================================================== */

:root{
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* neutrals (slate) */
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --line: #E6EAF0;
  --line-strong: #D5DBE4;
  --surface: #FFFFFF;
  --canvas: #F5F7FB;
  --canvas-2: #EEF2F7;

  /* re-point the old tokens so every existing rule inherits the new look */
  --tn-border: var(--line);
  --tn-grey-light: var(--canvas);
  --tn-grey-dark: var(--ink-2);
  --tn-black: var(--ink);
  --tn-radius: 14px;
  --tn-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);

  --tn-success: #1E8E4E;  --tn-success-bg: #E6F6EC;
  --tn-warning: #B26A00;  --tn-warning-bg: #FFF4DB;
  --tn-danger:  #D0342C;  --tn-danger-bg:  #FDECEA;

  /* brand tints derived from the configurable brand colours */
  --brand: var(--tn-blue-1);
  --brand-deep: var(--tn-blue-dot);
  --brand-soft: #E6F4F8;
  --brand-ring: rgba(0,139,169,.22);
  --brand-grad: linear-gradient(135deg, var(--tn-blue-1) 0%, var(--tn-blue-dot) 100%);

  --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 2px 8px rgba(15,23,42,.05);
  --shadow-md: 0 2px 4px rgba(15,23,42,.04), 0 12px 28px rgba(15,23,42,.08);
  --shadow-lg: 0 8px 16px rgba(15,23,42,.06), 0 28px 60px rgba(15,23,42,.16);
  --ease: cubic-bezier(.2,.7,.2,1);
}
@supports (color: color-mix(in srgb, red, blue)){
  :root{
    --brand-soft: color-mix(in srgb, var(--tn-blue-1) 10%, white);
    --brand-ring: color-mix(in srgb, var(--tn-blue-1) 24%, transparent);
  }
}

/* ---------- Base ---------- */
html{ scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body{
  font-family: var(--font);
  font-size: 14.5px; line-height: 1.6; color: var(--ink);
  background: var(--canvas);
  font-feature-settings: "cv11","ss01","tnum" 0;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,.brand-word{ font-family: var(--font); color: var(--ink); letter-spacing:-.022em; }
h1{ font-size:30px; font-weight:700; line-height:1.15; }
h2{ font-size:21px; font-weight:700; line-height:1.25; }
h3{ font-size:16.5px; font-weight:650; line-height:1.3; }
p{ color: var(--ink-2); }
a{ color: var(--brand); transition: color .15s var(--ease); }
a:hover{ color: var(--brand-deep); text-decoration: none; }
small, .text-muted{ color: var(--muted); }
::selection{ background: var(--brand-ring); color: var(--ink); }
:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; border-radius:6px; }
hr{ border:0; border-top:1px solid var(--line); }
.mono, code{ font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
table, .kpi-value, .pill, .new-badge{ font-variant-numeric: tabular-nums; }

/* scrollbars */
*{ scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-thumb{ background:#CBD5E1; border-radius:10px; border:3px solid transparent; background-clip:padding-box; }
::-webkit-scrollbar-thumb:hover{ background:#94A3B8; background-clip:padding-box; border:3px solid transparent; }

/* ---------- Motion ---------- */
@keyframes rise{ from{ opacity:0; transform: translateY(6px); } to{ opacity:1; transform:none; } }
@keyframes pop{ from{ opacity:0; transform: translateY(8px) scale(.98); } to{ opacity:1; transform:none; } }
.card, .alert, .kpi-card, .ticket-banner, .auth-card{ animation: rise .35s var(--ease) both; }
.reveal-panel.open{ animation: rise .25s var(--ease) both; }
@media (prefers-reduced-motion: reduce){ *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; } }

/* ---------- Buttons ---------- */
.btn{
  font-family: var(--font); font-weight:600; font-size:14px; letter-spacing:-.005em;
  padding:10px 18px; border-radius:10px; line-height:1.2;
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease), color .15s var(--ease);
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: var(--brand-grad); color:#fff; border-color: transparent;
  box-shadow: 0 1px 2px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover{ color:#fff; filter: brightness(1.07); box-shadow: 0 6px 16px -4px var(--brand-ring), 0 1px 2px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.2); transform: translateY(-1px); }
.btn-primary:active{ transform: translateY(0); filter: brightness(.98); }
.btn-secondary{
  background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-xs);
}
.btn-secondary:hover{ background:#F8FAFC; border-color:#B8C2D0; color: var(--ink); }
.btn-danger{ background: var(--surface); color: var(--tn-danger); border-color: color-mix(in srgb, var(--tn-danger) 45%, white); box-shadow: var(--shadow-xs); }
.btn-danger:hover{ background: var(--tn-danger-bg); border-color: var(--tn-danger); color: var(--tn-danger); }
.btn-danger-solid{ background: linear-gradient(180deg,#E0463D,#C4302A); color:#fff; border-color:transparent; box-shadow: 0 1px 2px rgba(15,23,42,.2), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-danger-solid:hover{ filter:brightness(1.06); color:#fff; background: linear-gradient(180deg,#E0463D,#C4302A); }
.btn-sm{ padding:6px 12px; font-size:12.5px; border-radius:8px; }
.btn[disabled], .btn:disabled{ opacity:.5; cursor:not-allowed; box-shadow:none; transform:none; filter:none; }
.btn:focus-visible{ outline:none; box-shadow: 0 0 0 3px var(--brand-ring); }
.btn-uniform{ border-radius:8px; }
.btn.active-toggle{ background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); }
.btn-primary.active-toggle{ background: var(--brand-grad); color:#fff; }

/* ---------- Surfaces ---------- */
.card{
  background: var(--surface); border:1px solid var(--line); border-radius: var(--tn-radius);
  box-shadow: var(--shadow-sm); padding:24px;
}
.card h3{ margin-bottom:14px; }
.card-flush{ border-radius: var(--tn-radius); }
.page-actions{ margin-bottom:18px; }
.page-actions .page-actions-text{ color: var(--muted); font-size:14px; max-width:760px; }
.meta-row{ border-bottom:1px solid #EEF1F6; }
.empty-state{ color: var(--muted); padding:56px 20px; font-size:14px; }

/* ---------- Forms ---------- */
label{ font-size:13px; font-weight:600; color: var(--ink); margin-bottom:7px; letter-spacing:-.003em; }
.field{ margin-bottom:20px; }
.field-hint{ color: var(--muted); font-size:12.5px; margin-top:6px; line-height:1.5; }
.req{ color: var(--tn-danger); }
.opt{ color: #94A3B8; }
.field-callout, .ticket-banner-situation{ background: var(--brand-soft); border-left:3px solid var(--brand); border-radius:10px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=number], input[type=tel], input[type=datetime-local], input[type=url], input[type=date],
select, textarea{
  font-family: var(--font); font-size:14px; color: var(--ink);
  padding:10px 13px; min-height:42px; background: var(--surface);
  border:1px solid var(--line-strong); border-radius:10px; box-shadow: var(--shadow-xs);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
input::placeholder, textarea::placeholder{ color:#94A3B8; }
input:hover, select:hover, textarea:hover{ border-color:#B8C2D0; }
input:focus, select:focus, textarea:focus{
  border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); background:#fff;
}
textarea{ line-height:1.55; }
select{
  appearance:none; -webkit-appearance:none; padding-right:38px; cursor:pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position: right 12px center; background-size:16px;
}
input[type=checkbox], input[type=radio]{ accent-color: var(--brand); }
input[disabled], select[disabled], textarea[disabled]{ background: var(--canvas); color:#94A3B8; cursor:not-allowed; }
input[type=file]{ font-family: var(--font); font-size:13px; padding:8px; border:1px dashed var(--line-strong); border-radius:10px; background: #FAFBFD; width:100%; }
input[type=file]::file-selector-button{ font-family:var(--font); font-weight:600; font-size:12.5px; margin-right:12px; padding:6px 12px; border:1px solid var(--line-strong); border-radius:8px; background:#fff; cursor:pointer; }
input[type=file]::file-selector-button:hover{ background:#F8FAFC; }
input.domain-locked{ background: var(--tn-success-bg); border-color: var(--tn-success); }

.type-option{ border:1.5px solid var(--line); border-radius:12px; padding:16px; box-shadow: var(--shadow-xs); transition: all .18s var(--ease); }
.type-option:hover{ border-color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.type-option:has(input:checked), .type-option.selected{ border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 4px var(--brand-ring); }
.type-option-title{ color: var(--ink); }

.rr-box, .rule-block{ border:1px solid var(--line); border-radius:14px; background:#FBFCFE; }
.rule-badge{ letter-spacing:.06em; }
.rule-badge.when{ background: var(--brand-soft); color: var(--brand-deep); }

/* ---------- Pills / badges ---------- */
.pill{ font-size:11.5px; font-weight:600; padding:3px 10px; border-radius:999px; letter-spacing:.01em; line-height:1.5; border:1px solid transparent; }
.sla-ok{ background: var(--tn-success-bg); color: var(--tn-success); border-color: color-mix(in srgb, var(--tn-success) 18%, transparent); }
.sla-warning{ background: var(--tn-warning-bg); color: var(--tn-warning); border-color: color-mix(in srgb, var(--tn-warning) 20%, transparent); }
.sla-overdue{ background: var(--tn-danger-bg); color: var(--tn-danger); border-color: color-mix(in srgb, var(--tn-danger) 18%, transparent); }
.sla-neutral{ background:#F1F5F9; color:#475569; border-color:#E2E8F0; }
.type-incident, .type-request, .type-problem, .type-change{ background: var(--brand-soft); color: var(--brand-deep); border:1px solid color-mix(in srgb, var(--tn-blue-1) 20%, transparent); }
.chip{ background:#F1F5F9; border:1px solid #E2E8F0; border-radius:8px; padding:2px 9px; color: var(--ink-2); }
a.chip:hover{ background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); }
.new-badge{ background: var(--brand-grad); box-shadow: 0 2px 6px -2px var(--brand-ring); }
.unread-dot{ background: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

/* ---------- Alerts ---------- */
.alert{ border-radius:12px; padding:13px 16px 13px 18px; border:1px solid transparent; border-left-width:4px; font-size:13.5px; box-shadow: var(--shadow-xs); }
.alert-success{ background: var(--tn-success-bg); color:#14693A; border-color: color-mix(in srgb, var(--tn-success) 25%, transparent); border-left-color: var(--tn-success); }
.alert-error{ background: var(--tn-danger-bg); color:#A62620; border-color: color-mix(in srgb, var(--tn-danger) 25%, transparent); border-left-color: var(--tn-danger); }
.alert-info{ background: var(--brand-soft); color: var(--brand-deep); border-color: color-mix(in srgb, var(--tn-blue-1) 25%, transparent); border-left-color: var(--brand); }

/* ---------- Tables ---------- */
.card-flush{ box-shadow: var(--shadow-sm); }
table.tn-table{ font-size:13.5px; }
table.tn-table th{
  background:#F8FAFC; color: var(--muted); font-size:11.5px; font-weight:650; text-transform:uppercase; letter-spacing:.06em;
  padding:11px 14px; border-bottom:1px solid var(--line); white-space:nowrap;
}
table.tn-table td{ padding:13px 14px; border-bottom:1px solid #EEF1F6; color: var(--ink-2); }
table.tn-table tbody tr:last-child td{ border-bottom:0; }
table.tn-table tbody tr{ transition: background .12s var(--ease); }
table.tn-table tbody tr:hover td{ background:#F8FBFD; }
table.tn-table a.row-link{ color: var(--ink); font-weight:600; }
table.tn-table a.row-link:hover{ color: var(--brand); }
table.tn-compact th{ padding:10px 12px; }
table.tn-compact td{ padding:10px 12px; }
table.tn-compact .cell-sub{ color: var(--muted); }
tr.row-unread td{ background: color-mix(in srgb, var(--tn-blue-1) 5%, white); }
tr.row-unread td:first-child{ box-shadow: inset 3px 0 0 var(--brand); }
tr.rr-editing td{ background:#FFFAEB; }
table.tn-compact th.grp-sep, table.tn-compact td.grp-sep{ border-left:1px solid var(--line-strong); }
.filters-grid, .filters-bar{ background: var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow: var(--shadow-xs); }

/* ---------- Tabs ---------- */
.tab-bar{ gap:6px; border-bottom:1px solid var(--line); }
.tab-bar a{ font-size:13.5px; font-weight:600; color: var(--muted); padding:11px 14px; border-bottom:2px solid transparent; border-radius:8px 8px 0 0; transition: color .15s var(--ease), background .15s var(--ease); }
.tab-bar a:hover{ color: var(--ink); background:#F1F5F9; }
.tab-bar a.active{ color: var(--brand-deep); border-bottom-color: var(--brand); background: transparent; }

/* ---------- KPI cards ---------- */
.kpi-grid{ gap:16px; }
.kpi-card{
  position:relative; text-align:left; padding:18px 20px; border-radius:14px; border:1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm); overflow:hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.kpi-card::before{ content:""; position:absolute; left:0; top:0; right:0; height:3px; background: var(--brand-grad); opacity:.9; }
.kpi-card.kpi-clickable:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--tn-blue-1) 40%, var(--line)); }
.kpi-card.kpi-clickable.active{ background: var(--brand-soft); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.kpi-value{ font-size:30px; font-weight:700; letter-spacing:-.03em; line-height:1.1; }
.kpi-label{ font-size:12px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; color: var(--muted); margin-top:8px; }

/* ---------- Staff shell ---------- */
.staff-shell{ background: var(--canvas); }
.staff-sidebar{
  width:248px; padding:20px 14px; gap:3px;
  background:
    radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--tn-blue-1) 28%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--tn-blue-dot) 78%, #020A10) 0%, color-mix(in srgb, var(--tn-blue-dot) 55%, #020A10) 100%);
  border-right:1px solid rgba(255,255,255,.06);
  position:sticky; top:0; height:100vh; align-self:flex-start; overflow-y:auto;
}
.staff-sidebar .staff-logo{ margin:2px 0 20px; padding:6px 10px 16px; border-bottom:1px solid rgba(255,255,255,.1); }
.staff-sidebar a:not(.staff-logo){
  display:flex; align-items:center; gap:12px; position:relative;
  color: rgba(255,255,255,.72); padding:9px 12px; border-radius:10px; font-size:13.5px; font-weight:550; letter-spacing:-.005em;
  transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.staff-sidebar a:not(.staff-logo)::before{
  content:""; width:18px; height:18px; flex:none; opacity:.85;
  background: currentColor;
  -webkit-mask: var(--ic, none) center / contain no-repeat; mask: var(--ic, none) center / contain no-repeat;
}
.staff-sidebar a:not(.staff-logo):hover{ background: rgba(255,255,255,.08); color:#fff; }
.staff-sidebar a:not(.staff-logo):hover::before{ opacity:1; }
.staff-sidebar a.active:not(.staff-logo){
  background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.07)); color:#fff; font-weight:650;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 6px 14px -8px rgba(0,0,0,.5);
}
.staff-sidebar a.active:not(.staff-logo)::after{ content:""; position:absolute; left:-14px; top:9px; bottom:9px; width:3px; border-radius:0 3px 3px 0; background: var(--tn-blue-2); }
.staff-sidebar a.active:not(.staff-logo)::before{ opacity:1; }
.staff-sidebar a[href*="dashboard.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1.6'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.6'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.6'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1.6'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="/staff/tickets.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9a2 2 0 0 0 0 6v3a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-3a2 2 0 0 1 0-6V6a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1z'/%3E%3Cpath d='M14 5v2M14 11v2M14 17v2'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="new-ticket.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="canned-responses.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="reports.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="support-category-catalog.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 2 7l10 5 10-5-10-5z'/%3E%3Cpath d='m2 17 10 5 10-5M2 12l10 5 10-5'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="companies.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M9 7h2M13 7h2M9 11h2M13 11h2M9 15h2M13 15h2'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="routing-rules.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3v12'/%3E%3Ccircle cx='18' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M18 9a9 9 0 0 1-9 9'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="kb-manage.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h6a4 4 0 0 1 4 4v13a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 4h-6a4 4 0 0 0-4 4v13a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="staff-users.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="roles.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="sla-settings.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.staff-sidebar a[href*="settings.php"]:not(.staff-logo){ --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6'/%3E%3C/svg%3E"); }

.staff-topbar{
  position:sticky; top:0; z-index:40; padding:14px 32px;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom:1px solid var(--line);
}
.staff-topbar h2{ font-size:19px; font-weight:700; letter-spacing:-.025em; }
.staff-content{ padding:28px 32px 56px; max-width:1680px; }
.account-line{ font-size:13.5px; color: var(--ink); }
.account-role{ color: var(--muted); }
.account-links a{ color: var(--muted); font-weight:550; }
.account-links a:hover{ color: var(--brand-deep); }
.account-sep{ color:#CBD5E1; }

@media (max-width:820px){
  .staff-sidebar{ position:static; height:auto; width:100%; flex-direction:row; padding:10px; gap:4px; border-right:0; overflow-x:auto; }
  .staff-sidebar a:not(.staff-logo){ white-space:nowrap; padding:8px 12px; }
  .staff-sidebar a.active:not(.staff-logo)::after{ display:none; }
  .staff-topbar{ padding:12px 18px; position:static; }
  .staff-content{ padding:18px; }
}

/* list + detail layouts (roles, KB, categories) */
.role-list{ border-radius:14px; border:1px solid var(--line); box-shadow: var(--shadow-sm); }
.role-item{ padding:13px 16px; border-left:3px solid transparent; transition: background .15s var(--ease); }
.role-item:hover{ background:#F8FAFC; }
.role-item.active{ background: var(--brand-soft); border-left-color: var(--brand); }
.role-item strong{ color: var(--ink); font-weight:650; }
.role-group{ background:#F8FAFC; color: var(--muted); letter-spacing:.07em; }
.perm-row.on .perm-mark{ background: var(--tn-success-bg); color: var(--tn-success); }
.sub-edit-row{ border-bottom:1px solid #EEF1F6; }

/* ---------- Ticket view ---------- */
.ticket-banner{ border-radius:16px; border:1px solid var(--line); box-shadow: var(--shadow-md); position:relative; overflow:hidden; }
.ticket-banner::before{ content:""; position:absolute; inset:0 0 auto 0; height:3px; background: var(--brand-grad); }
.tb-label{ color: var(--muted); font-weight:650; letter-spacing:.07em; }
.tb-value{ color: var(--ink); font-weight:550; }
.thread{ gap:14px; }
.msg{ border-radius:16px; padding:15px 18px; box-shadow: var(--shadow-xs); }
.msg-client{ background: var(--surface); border:1px solid var(--line); border-top-left-radius:6px; }
.msg-staff{ background: var(--brand-grad); border-top-right-radius:6px; box-shadow: 0 8px 20px -10px var(--brand-ring); }
.msg-internal{ background:#FFFAEB; border:1px dashed #E3B341; border-radius:12px; }
.msg-meta{ font-weight:550; letter-spacing:.01em; }
.attachment-chip{ border-radius:8px; background: rgba(15,23,42,.06); }
.flow-dot{ background: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); width:10px; height:10px; }
.flow-item:not(:last-child)::before{ background: var(--line-strong); }
.flow-details{ background:#F8FAFC; border:1px solid #EEF1F6; border-radius:10px; }
.reopen-panel, .resolution-card{ border-radius:14px; }
.readonly-note{ background:#F8FAFC; border:1px dashed var(--line-strong); border-radius:12px; }
.rich-content blockquote, .rich-area blockquote{ border-left:3px solid var(--brand); color: var(--ink-2); background: var(--brand-soft); border-radius:0 8px 8px 0; padding:8px 12px; }

/* ---------- Editors, tag inputs, dropdowns ---------- */
.rich-toolbar, .ee-toolbar{ background:#F8FAFC; border:1px solid var(--line-strong); border-bottom:0; border-radius:12px 12px 0 0; padding:8px; gap:4px; }
.rich-toolbar button, .ee-toolbar button{ border:1px solid transparent; background:transparent; border-radius:8px; padding:5px 10px; font-family:var(--font); font-size:12.5px; font-weight:600; color: var(--ink-2); transition: all .12s var(--ease); }
.rich-toolbar button:hover, .ee-toolbar button:hover{ background:#fff; border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.rich-toolbar button.on, .ee-toolbar button.on{ background: var(--brand-grad); color:#fff; }
.rich-toolbar .sep, .ee-sep{ background: var(--line-strong); }
.rich-area, .ee-visual, .ee-source{ border:1px solid var(--line-strong); border-radius:0 0 12px 12px; background:#fff; font-family: var(--font); }
.rich-area:focus, .ee-visual:focus, .ee-source:focus{ outline:none; box-shadow: 0 0 0 4px var(--brand-ring); border-color: var(--brand); }
.ee-source{ font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; }
.ttags-box, .msel-btn, .multi-select{ border:1px solid var(--line-strong); border-radius:10px; background:#fff; box-shadow: var(--shadow-xs); min-height:42px; transition: all .15s var(--ease); }
.ttags-box:focus-within, .msel.open .msel-btn, .msel-btn:hover{ border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); outline:none; }
.ttag{ background: var(--brand-soft); color: var(--brand-deep); border:1px solid color-mix(in srgb, var(--tn-blue-1) 22%, transparent); }
.ttags-panel, .msel-panel, .mention-menu, .var-popup{ border:1px solid var(--line); border-radius:14px; box-shadow: var(--shadow-lg); animation: pop .16s var(--ease) both; }
.ttags-item.active, .ttags-item:hover, .msel-opt:hover, .mention-menu .item.active, .mention-menu .item:hover, .var-popup-item.active, .var-popup-item:hover{ background: var(--brand-soft); }
.var-chip{ border-radius:10px; }
.var-chip:hover{ border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Confirmation pop-up ---------- */
.tn-modal-backdrop{ background: rgba(15,23,42,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: rise .18s var(--ease) both; }
.tn-modal{ border-radius:18px; padding:26px 26px 22px; box-shadow: var(--shadow-lg); border:1px solid rgba(255,255,255,.6); animation: pop .22s var(--ease) both; max-width:440px; }
.tn-modal h3{ font-size:18px; margin-bottom:8px; }
.tn-modal p{ color: var(--muted); line-height:1.6; }

/* ---------- Client portal ---------- */
.tn-topbar{
  background:
    radial-gradient(90% 220% at 0% 0%, color-mix(in srgb, var(--tn-blue-1) 30%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--tn-blue-dot) 80%, #020A10), color-mix(in srgb, var(--tn-blue-dot) 62%, #020A10));
  padding:14px 0; border-bottom:1px solid rgba(255,255,255,.08);
}
.tn-session{ color: rgba(255,255,255,.78); font-size:13.5px; }
.tn-session a{ color:#fff; font-weight:600; }
.tn-nav{ background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:30; }
.tn-nav .wrap{ gap:6px; }
.tn-nav a{ padding:14px 14px; font-size:13.5px; font-weight:600; color: var(--muted); border-bottom:2px solid transparent; transition: color .15s var(--ease), background .15s var(--ease); }
.tn-nav a:hover{ color: var(--ink); background:#F1F5F9; }
.tn-nav a.active{ color: var(--brand-deep); border-bottom-color: var(--brand); }
.page-body{ padding:36px 0 64px; }
.wrap{ max-width:1200px; }
.kb-grid .card{ transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.kb-grid .card:hover{ transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--tn-blue-1) 35%, var(--line)); }

.tn-footer{
  background:
    radial-gradient(80% 140% at 100% 0%, color-mix(in srgb, var(--tn-blue-1) 18%, transparent) 0%, transparent 55%),
    color-mix(in srgb, var(--tn-blue-dot) 40%, #020A10);
  color: rgba(255,255,255,.75); margin-top:56px; border-top:1px solid rgba(255,255,255,.06);
}
.tn-footer-grid{ padding:44px 28px 30px; gap:40px; }
.tn-footer-grid p, .tn-footer-address{ color: rgba(255,255,255,.62); }
.tn-footer-address strong{ color: rgba(255,255,255,.9); }
.tn-footer-grid h4{ color:#fff; letter-spacing:.09em; font-size:11.5px; font-weight:700; }
.tn-footer-grid a{ color: rgba(255,255,255,.7); transition: color .15s var(--ease), transform .15s var(--ease); }
.tn-footer-grid a:hover{ color:#fff; text-decoration:none; transform: translateX(2px); }
.tn-footer-bottom{ border-top:1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.5); }

/* ---------- Auth pages ---------- */
.auth-body{
  background:
    radial-gradient(60% 50% at 12% 8%, color-mix(in srgb, var(--tn-blue-2) 55%, transparent) 0%, transparent 70%),
    radial-gradient(55% 45% at 92% 14%, color-mix(in srgb, var(--tn-blue-1) 70%, transparent) 0%, transparent 70%),
    radial-gradient(70% 60% at 50% 110%, color-mix(in srgb, var(--tn-blue-dot) 90%, black) 0%, transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--tn-blue-dot) 70%, #020A10), color-mix(in srgb, var(--tn-blue-1) 75%, #020A10));
  background-attachment: fixed;
}
.auth-shell{ max-width:460px; padding:56px 20px 40px; }
.auth-hero h1{ font-size:28px; font-weight:700; letter-spacing:-.03em; }
.auth-hero p{ color: rgba(255,255,255,.8); }
.auth-card{
  border-radius:22px; padding:32px 30px; border:1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.96); box-shadow: var(--shadow-lg);
}
.auth-card input, .auth-card select{ min-height:46px; }
.auth-card .btn{ min-height:46px; font-size:14.5px; }
.auth-links, .tn-auth-footer{ color: rgba(255,255,255,.78); }
.auth-links a, .tn-auth-footer a{ color:#fff; text-underline-offset:3px; }

/* ---------- Responsive polish ---------- */
@media (max-width:640px){
  h1{ font-size:25px; } .card{ padding:18px; border-radius:12px; }
  .kpi-value{ font-size:26px; }
}


/* ---------- Rich articles (Knowledge Base) ---------- */
.rich-content{ font-size:15px; line-height:1.7; color: var(--ink-2); }
.rich-content h2{ font-size:19px; margin:1.7em 0 .55em; padding-top:.2em; }
.rich-content h3{ font-size:16px; margin:1.4em 0 .45em; }
.rich-content h2:first-child, .rich-content h3:first-child{ margin-top:0; }
.rich-content ul, .rich-content ol{ margin:0 0 1em 1.4em; padding:0; }
.rich-content li{ margin:.3em 0; }
.rich-content table{ width:100%; border-collapse:separate; border-spacing:0; margin:1em 0 1.3em; font-size:13.5px; border:1px solid var(--line); border-radius:12px; overflow:hidden; box-shadow: var(--shadow-xs); }
.rich-content th, .rich-content td{ padding:10px 14px; text-align:left; vertical-align:top; border-bottom:1px solid #EEF1F6; }
.rich-content tr:last-child td{ border-bottom:0; }
.rich-content th{ background:#F8FAFC; color: var(--muted); font-size:11.5px; font-weight:650; text-transform:uppercase; letter-spacing:.06em; }
.rich-content td:first-child{ white-space:nowrap; }
.rich-content blockquote{ margin:1.2em 0; }
.rich-content strong{ color: var(--ink); }
