/* Support & Request Helpdesk — agent console + employee portal */
*, *::before, *::after { box-sizing: border-box; }

/*
 * Brand palette.
 *
 *   primary   #223E47  deep teal   — structure: sidebar, headings, primary buttons
 *   secondary #E03C4A  coral       — accent: the active marker and the main CTA
 *
 * The accent is used sparingly on purpose. It is the only warm colour in the
 * interface, so it reads as "look here" precisely because nothing else competes.
 *
 * Note on --danger: the brand accent is itself a red, five degrees of hue from
 * the old danger colour, which made a destructive button indistinguishable from
 * a highlighted one. Danger is therefore a deeper, darker crimson — far enough
 * in lightness that the two never read as the same thing.
 */
:root {
  --primary: #223E47;
  --primary-dark: #172a30;
  --primary-soft: #eff5f6;
  --primary-line: #cee1e7;

  --secondary: #E03C4A;
  --secondary-dark: #c9202e;
  --secondary-soft: #fbedee;

  /* Neutrals carry a trace of the primary's hue so nothing looks bolted on. */
  --bg: #f2f6f7;
  --surface: #ffffff;
  --border: #e3eaec;
  --text: #15242a;
  --muted: #64777e;

  /* Status colours, each with a soft background and a darker ink for text. */
  --ok: #0e7c5a;     --ok-soft: #e6f4ef;     --ok-ink: #0a5c43;
  --warn: #b26a00;   --warn-soft: #fdf4e6;   --warn-ink: #8a5200;
  --danger: #8c1d2a; --danger-soft: #f7e9eb; --danger-ink: #7a1824;
  --info: #2a6f8a;   --info-soft: #eaf3f7;   --info-ink: #1f5468;

  --radius: 12px;

  /* Two-layer elevation: a tight contact shadow plus a wide, soft ambient one. */
  --shadow: 0 1px 2px rgba(21,36,42,.05), 0 1px 3px rgba(21,36,42,.04);
  --shadow-md: 0 2px 4px rgba(21,36,42,.04), 0 8px 20px -8px rgba(21,36,42,.12);
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* ------------------------------------------------------------- layout --- */
/* Only the main column scrolls; the sidebar stays fixed in place. */
.shell { display: flex; height: 100vh; overflow: hidden; }

/*
 * The sidebar carries the primary colour as a solid field. It anchors the page,
 * keeps the brand present without decorating the working area, and lets the
 * content column stay plain white so the data is what stands out.
 */
.sidebar {
  width: 244px;
  flex: 0 0 244px;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid rgba(255,255,255,.10); }
.sidebar-toggle {
  margin-left: auto; width: 26px; height: 26px; border-radius: 7px; flex: none;
  border: 1px solid rgba(255,255,255,.20); background: transparent; color: rgba(255,255,255,.72);
  cursor: pointer; display: grid; place-items: center;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.10); color: #fff; }
.sidebar-toggle svg { width: 15px; height: 15px; transition: transform .15s; }

/* Collapsed rail: icons only. */
body.sidebar-collapsed .sidebar { width: 64px; flex-basis: 64px; }
body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .who-text,
body.sidebar-collapsed .foot-links,
body.sidebar-collapsed .pill-count { display: none; }
body.sidebar-collapsed .brand { justify-content: center; padding: 16px 8px; }
body.sidebar-collapsed .sidebar-toggle { position: absolute; top: 18px; right: -13px; z-index: 6; background: var(--primary); border-color: rgba(255,255,255,.24); box-shadow: var(--shadow-md); }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 8px; }
body.sidebar-collapsed .who { justify-content: center; }
body.sidebar-collapsed .sidebar { position: relative; }
/* The one place the accent appears at full strength on the dark field. */
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: #fff; font-weight: 700; font-size: 13px;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 2px 8px -2px rgba(224,60,74,.55);
}
.brand-name { font-weight: 600; font-size: 13px; line-height: 1.2; color: #fff; letter-spacing: .01em; }
.brand-logo { max-height: 32px; max-width: 150px; }

/* Feature-flag toggle rows + business-hours day picker */
.flag-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eef2f3; font-size: 13px; font-weight: 500; }
.flag-row:last-of-type { border-bottom: 0; }
.flag-row input { width: auto; }
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; }
.day-chip span { display: inline-grid; place-items: center; width: 42px; padding: 8px 0; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.day-chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

/* Admin hub cards */
.hub-card { display: block; padding: 20px; color: inherit; transition: border-color .12s; }
.hub-card:hover { text-decoration: none; border-color: var(--primary); }
.hub-ic { font-size: 26px; margin-bottom: 10px; }
.hub-card strong { display: block; font-size: 15px; margin-bottom: 4px; }
.hub-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* Google sign-in button + divider on the login page */
.login-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn { width: 100%; justify-content: center; gap: 9px; padding: 10px; font-size: 13.5px; }

/* ---------------------------------------------------------------- CSAT --- */
.csat-card { border-color: var(--primary-line); background: linear-gradient(180deg, var(--primary-soft), #fff); }
.csat-faces { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.csat-opt {
  flex: 1; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--muted);
}
.csat-opt span { font-size: 26px; }
.csat-opt:hover { border-color: var(--primary); }
.csat-opt.is-on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); box-shadow: 0 0 0 1px var(--primary); }
.csat-done { display: flex; align-items: center; gap: 12px; }
.csat-face { font-size: 30px; }
.csat-badge { display: inline-flex; align-items: center; gap: 4px; }

/* Friendly sign-in notice (e.g. Google email not registered) */
.login-notice { display: flex; gap: 12px; align-items: flex-start; border-radius: 10px; padding: 14px 16px; margin: 0 0 20px; }
.login-notice-info { background: var(--primary-soft); border: 1px solid var(--primary-line); }
.login-notice-danger { background: var(--danger-soft); border: 1px solid #eccdd1; }
.ln-ic { font-size: 22px; line-height: 1.2; flex: none; }
.login-notice strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 3px; }
.login-notice p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.ln-email { font-weight: 600; color: var(--text); }

.nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
.nav-group { margin: 14px 0 6px; }
.nav-label {
  display: block; padding: 4px 10px; font-size: 10.5px; font-weight: 700;
  /* .40 looked right but only reached 3.2:1 on the teal — under the 4.5:1 floor
     for text this size. .62 clears it while still reading as a quiet label. */
  letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.62);
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0; border-radius: 8px;
  color: rgba(255,255,255,.76); font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.nav-item.is-active { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }

/* A short accent bar is what marks the current page — the only warm mark in the rail. */
.nav-item.is-active::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--secondary);
}
body.sidebar-collapsed .nav-item.is-active::before { left: -4px; }

.nav-ic { width: 18px; height: 18px; flex: none; opacity: .7; }
.nav-item.is-active .nav-ic { opacity: 1; }
.pill-count {
  margin-left: auto; background: var(--secondary); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 9px;
}

.sidebar-foot { border-top: 1px solid rgba(255,255,255,.10); padding: 12px; }
.who { display: flex; align-items: center; gap: 9px; padding: 6px; margin: -6px -6px 4px; border-radius: 8px; color: inherit; }
.who:hover { background: rgba(255,255,255,.09); text-decoration: none; }
.who-text { min-width: 0; line-height: 1.3; }
.who-text strong { display: block; font-size: 13px; color: #fff; }
.who-text small { color: rgba(255,255,255,.66); font-size: 11px; }
.foot-links { display: flex; justify-content: space-between; font-size: 12px; padding: 0 6px; }
.foot-links a { color: rgba(255,255,255,.66); }
.foot-links a:hover { color: #fff; }
.signout { color: rgba(255,255,255,.66); }
.signout:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 16px; flex: none; }
.search { flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; background: #f9fafb;
}
.search input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); background: #fff; }

/* ------------------------------------------------------ notifications --- */
.notif { position: relative; flex: none; }
.notif-bell {
  position: relative; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: #4b5563;
  cursor: pointer; display: grid; place-items: center;
}
.notif-bell:hover { background: #f3f6fb; border-color: #c7d2e5; }
.notif-bell svg { width: 19px; height: 19px; }
.notif-count {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--surface);
}
.notif-panel {
  position: absolute; top: 46px; right: 0; width: 340px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(16,24,40,.14); overflow: hidden;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.notif-item {
  display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #f1f3f7; color: inherit;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: #f9fafb; text-decoration: none; }
.notif-item.is-unread { background: var(--primary-soft); }
.notif-item.is-unread:hover { background: #e4eefc; }
.notif-ic { font-size: 16px; line-height: 1.3; flex: none; }
.notif-body { min-width: 0; line-height: 1.4; }
.notif-msg { display: block; font-size: 12.5px; color: var(--text); }
.notif-time { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------ attachment preview --- */
.amodal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.amodal[hidden] { display: none; }
.amodal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.amodal-box {
  position: relative; width: min(1000px, 94vw); height: min(88vh, 900px);
  background: var(--surface); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
  display: flex; flex-direction: column; overflow: hidden;
}
.amodal-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.amodal-titles { flex: 1; min-width: 0; line-height: 1.3; }
.amodal-titles strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amodal-titles small { color: var(--muted); font-size: 12px; }
.amodal-x { border: 0; background: none; font-size: 16px; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.amodal-x:hover { background: #f3f6fb; color: var(--text); }
.amodal-body { flex: 1; background: #f1f3f7; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 16px; }
.amodal-img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.amodal-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.amodal-none { text-align: center; color: var(--muted); }
.amodal-none p { margin: 0 0 14px; }

/* Small centred dialog (edit user, reset password). */
.dialog { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.dialog[hidden] { display: none; }
.dialog-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.5); }
.dialog-box { position: relative; width: min(460px, 94vw); background: var(--surface); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 15px; }
.dialog-body { padding: 18px; }

/* Approver multi-select in the approval request modal. */
.approver-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 20px; }
.approver-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary-dark); border-radius: 20px; padding: 3px 6px 3px 11px; font-size: 12.5px; font-weight: 600; }
.approver-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 11px; padding: 0 2px; }
.approver-picker { border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; box-shadow: var(--shadow); background: var(--surface); }
.approver-search { border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 8px 8px 0 0 !important; }
.approver-list { max-height: 200px; overflow-y: auto; padding: 4px; }
.approver-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.approver-opt:hover { background: #f3f6fb; }
.approver-opt input { width: auto; }
.approver-opt small { color: var(--muted); }

/* Inline assignee select in the ticket list, and per-row action buttons. */
.inline-assign { margin: 0; }
.inline-assign select { width: auto; min-width: 130px; max-width: 170px; padding: 5px 8px; font-size: 12.5px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* --------------------------------------------------- header user menu --- */
.user-btn {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 4px 8px 4px 5px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); cursor: pointer; font-family: inherit;
}
.user-btn:hover { background: #f3f6fb; border-color: #c7d2e5; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-caret { width: 14px; height: 14px; color: var(--muted); }
.user-head { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); }
.user-link { display: block; padding: 10px 14px; font-size: 13px; color: var(--text); border-bottom: 1px solid #f1f3f7; }
.user-link:last-child { border-bottom: 0; }
.user-link:hover { background: #f9fafb; text-decoration: none; }

.content { padding: 20px; flex: 1; }

.flash { margin: 14px 20px -6px; padding: 10px 14px; border-radius: var(--radius); font-weight: 500; }
.flash-success { background: var(--ok-soft); color: #065f46; border: 1px solid #a7f3d0; }
.flash-danger  { background: var(--danger-soft); color: #991b1b; border: 1px solid #fecaca; }

/* -------------------------------------------------------------- cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-head h2, .card-head h3 { font-size: 13.5px; }
.card-body { padding: 16px; }

.grid { display: grid; gap: 14px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid-2 { grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; line-height: 1; }
.stat.is-danger { background: var(--danger-soft); border-color: #eccdd1; }
.stat.is-danger .stat-value { color: var(--danger-ink); }
.stat.is-warn { background: var(--warn-soft); border-color: #f0dcb4; }
.stat.is-warn .stat-value { color: var(--warn-ink); }
.stat a { color: inherit; }

/* ------------------------------------------------------------- badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-info    { background: var(--info-soft); color: var(--info-ink); }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge-ok      { background: var(--ok-soft); color: var(--ok-ink); }
.badge-warn    { background: var(--warn-soft); color: var(--warn-ink); }
.badge-danger  { background: var(--danger-soft); color: var(--danger-ink); }
.badge-muted   { background: #eef2f3; color: #566a71; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot-Low { background: #10b981; } .dot-Medium { background: #f59e0b; }
.dot-High { background: #f97316; } .dot-Urgent { background: #dc2626; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  color: #fff; font-size: 11px; font-weight: 600;
  display: inline-grid; place-items: center;
}
.avatar-sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }
img.avatar { display: inline-block; object-fit: cover; background: #eef2f7; }

/* -------------------------------------------------------------- table --- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 9px 14px; font-size: 11.5px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #f1f3f7; vertical-align: middle; }
.table tbody tr:hover { background: #fbfcfe; }
.table .subject { font-weight: 600; color: var(--text); }
.table .subject:hover { color: var(--primary); }
.ref { color: var(--muted); font-size: 12px; font-weight: 500; }
.cell-user { display: flex; align-items: center; gap: 8px; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; font-size: 15px; }

/* ------------------------------------------------------------ buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn:hover { background: #f9fafb; text-decoration: none; }
/*
 * Actions carry the accent; the primary teal carries the chrome. So the sidebar,
 * headings and links are teal, and anything the user is meant to press is coral.
 * A plain .btn stays white for the secondary choice beside it.
 */
.btn-primary {
  background: var(--secondary); border-color: var(--secondary); color: #fff;
  box-shadow: 0 1px 2px rgba(21,36,42,.06), 0 4px 12px -4px rgba(224,60,74,.42);
}
.btn-primary:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); }

/* Kept for the few places that ask for the structural colour on a button. */
.btn-deep { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-deep:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-link { border: 0; background: none; color: var(--primary); padding: 0; }

/* ------------------------------------------------------------- forms --- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=search], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13.5px; font-family: inherit; color: var(--text); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea { min-height: 110px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type=file] {
  width: 100%; padding: 8px 11px; font-size: 13px; font-family: inherit;
  border: 1px dashed #c7d2e5; border-radius: 7px; background: #f9fafb; cursor: pointer;
}
input[type=file]:hover { border-color: var(--primary); background: var(--primary-soft); }
input[type=file]::file-selector-button {
  padding: 5px 11px; margin-right: 10px; border-radius: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: #f3f6fb; }

/* --------------------------------------------------------- attachments --- */
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: #fbfcfe; color: var(--text); max-width: 260px;
}
.file:hover { text-decoration: none; border-color: var(--primary); background: var(--primary-soft); }
.file-icon { font-size: 16px; line-height: 1; flex: none; }
.file-text { min-width: 0; line-height: 1.3; }
.file-text strong {
  display: block; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-text small { color: var(--muted); font-size: 11px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; }
.check input { width: auto; }

/* ---------------------------------------------------- rich-text editor --- */
.rte { border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: #fff; }
.rte:focus-within { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.rte-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: #fafbfc; flex-wrap: wrap; }
.rte-toolbar button {
  min-width: 28px; height: 28px; padding: 0 7px; border: 0; background: none; cursor: pointer;
  border-radius: 5px; font-size: 13px; color: #4b5563; font-family: inherit;
}
.rte-toolbar button:hover { background: #eef2f7; color: var(--text); }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rte-area { min-height: 150px; padding: 11px 13px; font-size: 13.5px; line-height: 1.6; color: var(--text); outline: none; }
.rte-area:empty::before { content: attr(data-placeholder); color: #9aa4b2; }
.rte-area ul, .rte-area ol { margin: 6px 0 6px 22px; }
.rte-area a { color: var(--primary); }

/* Rendered rich description on the ticket. */
.rich { line-height: 1.65; color: #374151; }
.rich p { margin: 0 0 10px; }
.rich ul, .rich ol { margin: 6px 0 10px 22px; }
.rich a { color: var(--primary); }
.rich blockquote { border-left: 3px solid var(--border); margin: 8px 0; padding: 2px 0 2px 12px; color: var(--muted); }

/* ---------------------------------------------------- @-mention menu --- */
.mention-menu {
  position: absolute; z-index: 60; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,24,40,.16); overflow: hidden; max-height: 240px; overflow-y: auto;
}
.mention-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 8px 12px; font-family: inherit; font-size: 13px; color: var(--text);
}
.mention-opt:hover { background: var(--primary-soft); }
.mention-name { font-weight: 500; }
.mention-role { font-size: 11px; color: var(--muted); text-transform: capitalize; }

/* ------------------------------------------------------------ filters --- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters select { width: auto; min-width: 130px; padding: 6px 9px; font-size: 12.5px; }
.chip {
  padding: 5px 11px; border-radius: 20px; border: 1px solid var(--border);
  background: #fff; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.chip:hover { text-decoration: none; border-color: #c7d2e5; }
.chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* -------------------------------------------------------------- board --- */
.board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: #eef2f7; border-radius: var(--radius); padding: 10px; min-width: 210px; }
.board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; padding: 0 2px; }
.board-head span { font-size: 12.5px; font-weight: 700; }
.board-head b { background: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; color: var(--muted); }
.board-card {
  display: block; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); color: inherit;
}
.board-card:hover { text-decoration: none; border-color: #b9c7e0; }
.board-card .ref { font-size: 11px; }
.board-card .subject { font-size: 12.5px; font-weight: 600; margin: 5px 0 8px; line-height: 1.35; }
.board-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.board-empty { text-align: center; color: #9aa4b2; font-size: 12px; padding: 18px 0; }

/* ------------------------------------------------------- ticket detail --- */
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.crumb span { margin: 0 6px; color: #cbd5e1; }
.crumb strong { color: var(--text); }

.td-head {
  position: relative; overflow: hidden; display: flex; flex-wrap: wrap;
  gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px 16px 22px; margin-bottom: 16px;
}
.td-head::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }

/*
 * flex-basis matters here. With a bare `flex: 1` the basis is 0, so this block
 * would surrender all its width to the action row beside it and the subject
 * would wrap one word per line. The 320px basis keeps it readable and, together
 * with flex-wrap above, pushes the actions onto their own line instead once
 * there is no longer room for both.
 */
.td-head-main { display: flex; gap: 14px; flex: 1 1 320px; min-width: 0; }
.tk-typeicon { width: 40px; height: 40px; border-radius: 9px; background: var(--ok-soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.tk-badges { display: flex; gap: 7px; margin-bottom: 6px; align-items: center; }
.viewers { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.viewers svg { width: 15px; height: 15px; }
.viewers.is-active { color: var(--ok); }
.viewers-avatars { display: inline-flex; }
.viewers-avatars .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.viewers-avatars .avatar:first-child { margin-left: 0; }
.viewers-label { font-weight: 600; }
/* anywhere, not break-all: only splits a word that cannot fit on its own line. */
.tk-subject { font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.tk-reported { font-size: 12.5px; color: var(--muted); margin-top: 7px; }

/*
 * `flex: none` here refused to shrink, so the row held its full width, starved
 * the header beside it and was then clipped by the overflow:hidden above.
 * Allowing it to shrink lets it wrap onto its own line on a narrow screen.
 * margin-left:auto keeps it right-aligned while it still shares a line.
 */
.td-actions {
  display: flex; gap: 7px; flex: 0 1 auto; flex-wrap: wrap;
  justify-content: flex-end; margin-left: auto;
}

.tk-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .tk-grid { grid-template-columns: 1fr; } }
.tk-side { display: flex; flex-direction: column; gap: 16px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  border: 0; background: none; cursor: pointer; font-family: inherit;
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count { background: #eef2f7; color: var(--muted); border-radius: 9px; padding: 0 6px; font-size: 11px; }
.tab.is-active .tab-count { background: var(--primary-soft); color: var(--primary); }

.desc-card { margin-bottom: 16px; }
.desc-card .card-body { background: #f7faff; border-radius: 0 0 var(--radius) var(--radius); }

.status-card {
  position: relative; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 16px 12px;
}
.status-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.sc-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 10px; border-bottom: 1px solid #f1f3f7; }
.sc-group { font-size: 13px; font-weight: 600; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f3f7; font-size: 12.5px; color: var(--muted); }
.sc-row:last-child { border-bottom: 0; }
.sc-row strong { color: var(--text); font-weight: 600; }

.back-link { display: inline-block; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); font-weight: 500; }

.ticket-hero {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px 18px 24px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 20px;
}
.ticket-hero::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.hero-main { flex: 1; min-width: 0; }
.hero-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hero-title { font-size: 19px; line-height: 1.3; }
.hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 12.5px; color: var(--muted); }
.hero-meta .cell-user { gap: 6px; color: var(--text); }
.hero-meta strong { color: var(--text); font-weight: 600; }
.dot-sep { color: #cbd5e1; }
.hero-sla { flex: none; text-align: right; padding-left: 20px; border-left: 1px solid var(--border); }
.hero-sla-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
@media (max-width: 720px) { .ticket-hero { flex-direction: column; } .hero-sla { border-left: 0; padding-left: 0; text-align: left; } }

.notice { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 13px; line-height: 1.55; }
.notice strong { display: block; margin-bottom: 2px; }
.notice-warn { background: var(--warn-soft); border: 1px solid #fde68a; color: #92400e; }
.notice-danger { background: var(--danger-soft); border: 1px solid #fecaca; color: #991b1b; }

.panel { margin-bottom: 16px; }
.sect-ic { font-size: 13px; margin-right: 5px; opacity: .9; }
.card-head h3 { display: flex; align-items: center; }

.action-block { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid #f1f3f7; }
.action-block:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.block-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.block-hint { font-size: 11.5px; color: var(--muted); margin: 0 0 8px; line-height: 1.4; }
.action-approval { background: var(--warn-soft); border: 1px solid #fde68a; border-radius: 8px; padding: 12px; margin: -4px 0 14px; }
.action-approval .block-label { color: #92400e; }
/* Amber is the status colour for "waiting on someone", not an action colour —
   requesting approval is an action, so it uses .btn-primary like every other.
   Kept as a variant alongside btn-ok / btn-danger; nothing uses it right now. */
.btn-warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-warn:hover { background: var(--warn-dark, #a86a03); }

.ticket-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.ticket-head h2 { font-size: 17px; line-height: 1.35; }
.ticket-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 7px; }

.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 11px; }
.msg-body { flex: 1; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 12px 14px; }
.msg.is-private .msg-body { background: var(--warn-soft); border-color: #fde68a; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.msg-head strong { font-weight: 600; }
.msg-head time { color: var(--muted); margin-left: auto; font-size: 11.5px; }
.msg-text { white-space: pre-wrap; line-height: 1.6; color: #374151; }

.side-prop { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f3f7; font-size: 12.5px; }
.side-prop:last-child { border-bottom: 0; }
.side-prop span { color: var(--muted); }
.side-prop strong { font-weight: 600; text-align: right; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -5px; top: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: #c7d2e5;
}
.timeline b { font-weight: 600; font-size: 12.5px; }
.timeline p { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

.task-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f1f3f7; }
.task-row:last-child { border-bottom: 0; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { flex: 1; font-size: 13px; font-weight: 500; }

.bar { height: 7px; border-radius: 4px; background: #eef2f7; overflow: hidden; }
.bar > div { height: 100%; border-radius: 4px; }
.bar-row { margin-bottom: 11px; }
.bar-row .bar-label { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.bar-row .bar-label b { font-weight: 600; }

/* -------------------------------------------------------- leaderboard --- */
.rank {
  display: inline-grid; place-items: center; min-width: 30px; height: 26px;
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.rank-sm { min-width: 24px; height: 20px; font-size: 12.5px; }

tr.row-me { background: var(--primary-soft) !important; }
tr.row-me td { border-bottom-color: #d7e3fb; }
.side-prop.is-me { background: var(--primary-soft); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }

.podium {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  align-items: end; margin-bottom: 16px;
}
@media (max-width: 760px) { .podium { grid-template-columns: 1fr; } }
.podium-spot {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 14px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.podium-spot strong { font-size: 13.5px; }
.podium-spot small { color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.podium-spot.is-me { outline: 2px solid var(--primary); }
/* First place sits highest and carries the accent. */
.podium-1 { padding-top: 26px; padding-bottom: 26px; border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb, #fff); }
.podium-2 { border-color: #d8dee9; }
.podium-3 { border-color: #e7c9a9; }
.podium-medal { font-size: 24px; line-height: 1; }
.podium-1 .podium-medal { font-size: 30px; }
.podium-avatar { width: 42px; height: 42px; font-size: 15px; margin: 6px 0 4px; }
.podium-1 .podium-avatar { width: 52px; height: 52px; font-size: 18px; }
.podium-score { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.podium-1 .podium-score { font-size: 32px; color: #b45309; }
.podium-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 600; margin-bottom: 7px;
}

/* -------------------------------------------------------------- login --- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #f7f9fc; }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } .login-aside { display: none; } }

.login-aside {
  position: relative; overflow: hidden; color: #fff;
  padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  /* Mostly the brand teal, with the accent surfacing only in the far corner —
     enough warmth to stop a large dark field feeling cold, not enough to
     compete with the sign-in form beside it. The middle stops follow whatever
     primary the admin has set. */
  background: linear-gradient(150deg, #0a1418 0%, var(--primary-dark) 26%, var(--primary) 52%, #2f5b68 76%, var(--secondary-dark) 100%);
  background-size: 220% 220%;
  animation: auroraShift 20s ease-in-out infinite;
}
@keyframes auroraShift {
  0%   { background-position: 0% 30%; }
  50%  { background-position: 100% 70%; }
  100% { background-position: 0% 30%; }
}
/* Faint dot-grid texture overlaid on the gradient. */
.login-aside > .login-grid {
  content: ''; position: absolute; inset: 0; z-index: 0; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
}
/* Soft decorative glows that drift slowly. */
.login-aside::before, .login-aside::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(12px); opacity: .5; z-index: 0;
}
.login-aside::before {
  width: 360px; height: 360px; top: -100px; right: -90px;
  background: radial-gradient(circle, rgba(56,189,248,.6), transparent 70%);
  animation: floatA 16s ease-in-out infinite;
}
.login-aside::after  {
  width: 320px; height: 320px; bottom: -110px; left: -70px;
  background: radial-gradient(circle, rgba(129,140,248,.5), transparent 70%);
  animation: floatB 19s ease-in-out infinite;
}
@keyframes floatA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-26px,30px) scale(1.08); } }
@keyframes floatB { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-24px) scale(1.1); } }

.login-aside-inner { position: relative; z-index: 1; max-width: 460px; }
/* Staggered entrance for the panel contents. */
.login-aside-inner > * { animation: loginFadeUp .7s cubic-bezier(.2,.7,.2,1) both; }
.login-aside-inner > .login-brand { animation-delay: .05s; }
.login-aside-inner > h2         { animation-delay: .14s; }
.login-aside-inner > p          { animation-delay: .22s; }
.login-aside-inner > .login-visual { animation-delay: .30s; }
.login-aside-inner > .login-features { animation-delay: .38s; }
@keyframes loginFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Floating glass "app preview" card. */
.login-visual { position: relative; margin: 30px 0 4px; height: 150px; }
.login-visual .lv-card {
  position: absolute; border-radius: 14px; padding: 14px 16px; color: #e6eefc;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.55);
}
.login-visual .lv-main {
  left: 0; top: 8px; width: 260px; animation: cardFloat 7s ease-in-out infinite;
}
.login-visual .lv-badge {
  right: 6px; top: 0; width: 150px; padding: 11px 14px;
  animation: cardFloat 7s ease-in-out infinite; animation-delay: -3.5s;
}
@keyframes cardFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.lv-row { display: flex; align-items: center; gap: 8px; }
.lv-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.lv-title { font-size: 12.5px; font-weight: 700; }
.lv-sub { font-size: 10.5px; opacity: .7; margin-top: 2px; }
.lv-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,.16); margin-top: 10px; overflow: hidden; }
.lv-bar > i { display: block; height: 100%; width: 68%; border-radius: 4px; background: linear-gradient(90deg,#38bdf8,#818cf8); animation: barGrow 3.5s ease-in-out infinite alternate; }
@keyframes barGrow { from { width: 34%; } to { width: 82%; } }
.lv-num { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.lv-pill { display: inline-block; margin-top: 6px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(52,211,153,.22); color: #6ee7b7; }

.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 36px; }
.login-mark {
  width: 38px; height: 38px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-weight: 700; font-size: 15px; backdrop-filter: blur(4px);
}
.login-brand-name { font-size: 15px; font-weight: 600; }
.login-aside h2 { font-size: 30px; line-height: 1.25; margin-bottom: 16px; font-weight: 600; }
.login-aside p { opacity: .82; line-height: 1.7; font-size: 14.5px; }
.login-features { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 14px; }
.login-features li { display: flex; gap: 11px; align-items: center; font-size: 14px; opacity: .95; }
.lf-ic {
  width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: rgba(255,255,255,.12); font-size: 15px;
}
.login-aside-foot { position: relative; z-index: 1; font-size: 12.5px; opacity: .6; }

.login-main {
  display: grid; place-items: center; padding: 40px 24px; position: relative;
  background: radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #f4f7fc 55%, #eef2f9 100%);
}
.login-box { width: 100%; max-width: 380px; animation: loginFadeUp .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: .12s; }
.login-box-mark { display: none; margin-bottom: 20px; }
@media (max-width: 900px) {
  .login-box-mark { display: block; }
  .login-box-mark .login-mark { background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); border: 0; }
}
.login-box h1 { font-size: 26px; margin-bottom: 7px; letter-spacing: -.01em; }
.login-box > p { color: var(--muted); margin: 0 0 26px; font-size: 14px; }

.login-form .field label { font-size: 12.5px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon .ii-lead { position: absolute; left: 12px; font-size: 14px; opacity: .5; pointer-events: none; }
.input-icon input { padding: 11px 12px 11px 36px; font-size: 14px; }
.input-icon input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.ii-toggle {
  position: absolute; right: 8px; border: 0; background: none; cursor: pointer;
  color: var(--primary); font-size: 12px; font-weight: 600; font-family: inherit; padding: 4px 6px;
}
.login-submit {
  width: 100%; justify-content: center; padding: 12px; font-size: 14px; font-weight: 600;
  border-radius: 10px; box-shadow: 0 10px 24px -10px var(--primary);
  transition: transform .12s ease, box-shadow .2s ease, filter .15s ease;
}
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px var(--primary); filter: brightness(1.03); }
.login-submit:active { transform: translateY(0); }
.login-help { text-align: center; color: var(--muted); font-size: 12.5px; margin: 22px 0 0; }

/* Respect users who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
  .login-aside, .login-aside::before, .login-aside::after,
  .login-aside-inner > *, .login-box,
  .login-visual .lv-main, .login-visual .lv-badge,
  .lv-bar > i { animation: none !important; }
}

.error-page { text-align: center; padding: 80px 20px; }
.error-page h2 { font-size: 42px; color: var(--muted); }
.error-page p { color: var(--muted); margin: 8px 0 20px; }

/* -------------------------------------------------- pills, alerts, 2fa --- */
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: #eef1f6; color: var(--muted);
}
.pill-open { background: #e7f6ec; color: #15803d; }

.alert {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px;
  border: 1px solid #e5e9f0; background: #f8fafc;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; }

.backup-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-width: 420px;
}
.backup-grid code {
  padding: 8px 10px; background: #fff; border: 1px solid #d1fae5; border-radius: 7px;
  font-size: 13.5px; letter-spacing: 1px; text-align: center;
}
.totp-key {
  display: inline-block; padding: 10px 14px; background: var(--primary-soft, #eff5f6);
  border: 1px dashed var(--primary); border-radius: 9px; color: var(--primary-dark, #172a30);
  font: 600 17px/1.4 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 2px;
}

/* ---------------------------------------------------------- nav icons --- */

/* ------------------------------------------------------------- pager --- */

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.pager-count { color: var(--muted); font-size: 12.5px; }
.pager-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.pager-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--text);
  background: #fff; transition: background .12s, border-color .12s;
}
.pager-link:hover { background: var(--primary-soft); border-color: var(--primary); }

.pager-link.is-on {
  background: var(--primary); border-color: var(--primary);
  color: #fff; cursor: default;
}
.pager-link.is-on:hover { background: var(--primary); }

/* Previous/Next at the ends of the range — visible but plainly inert. */
.pager-link.is-off { color: var(--muted); opacity: .5; cursor: default; }
.pager-link.is-off:hover { background: #fff; border-color: var(--border); }

.pager-gap { color: var(--muted); padding: 0 2px; }

/* ------------------------------------------ ticket submission confirm --- */

.verify-card { max-width: 480px; margin: 6vh auto; }
.verify-card .card-body { padding: 32px 30px 26px; text-align: center; }

.verify-mark {
  width: 52px; height: 52px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--primary-soft);
  color: var(--primary); font-size: 24px;
}
.verify-title { font-size: 19px; margin: 0 0 6px; }
.verify-lead { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

/* A reminder of what is being confirmed — the ticket does not exist yet. */
.verify-draft {
  text-align: left; padding: 12px 14px; margin-bottom: 20px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.verify-draft-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 3px;
}
.verify-draft-subject { font-weight: 600; font-size: 14px; word-break: break-word; }
.verify-draft-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.verify-form { display: block; }
.verify-label {
  display: block; text-align: left; font-size: 12.5px;
  font-weight: 600; margin-bottom: 6px;
}
.verify-code {
  width: 100%; padding: 13px 12px;
  border: 1px solid var(--border); border-radius: 9px;
  font: 600 26px/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .38em; text-align: center; text-indent: .38em;
  color: var(--text); background: #fff;
}
.verify-code:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.verify-hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 16px; }
.verify-warn { color: var(--danger); font-weight: 600; }
.verify-submit { width: 100%; justify-content: center; }

.verify-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 16px;
}
.verify-sep { color: var(--border); }

.btn-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--primary);
}
.btn-link:hover { text-decoration: underline; }
.btn-link-danger { color: var(--muted); }
.btn-link-danger:hover { color: var(--danger); }

.verify-foot {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ---------------------------------------------- manager team dashboard --- */

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.page-title { font-size: 20px; margin: 0 0 2px; }
.page-sub { margin: 0; color: var(--muted); font-size: 13px; }
.period-switch select { min-width: 150px; }

/* The approvals a manager still has to act on — the reason they open this page. */
.approval-callout { border-color: #fde68a; }
.approval-callout .card-head { background: var(--warn-soft); border-bottom-color: #fde68a; }
.approval-list { display: flex; flex-direction: column; gap: 0; padding: 0; }

.approval-item {
  display: grid; gap: 12px 14px; align-items: center;
  grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) auto;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.approval-item:last-child { border-bottom: 0; }

.approval-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.approval-who strong { font-size: 13.5px; }
/* min-width:0 lets the subject ellipsis instead of forcing the grid wider. */
.approval-what { min-width: 0; }
.approval-what .subject { display: block; }

.approval-act { display: flex; align-items: center; gap: 6px; }
.approval-act input[type="text"] { width: 170px; padding: 7px 9px; font-size: 13px; }

@media (max-width: 900px) {
  .approval-item { grid-template-columns: 1fr; }
  .approval-act { flex-wrap: wrap; }
  .approval-act input[type="text"] { width: 100%; }
}

/* ------------------------------------------------------------- accent --- */

/* .btn-accent predates .btn-primary taking the accent; kept as an alias so
   existing markup keeps working and the two can never drift apart. */
.btn-accent { background: var(--secondary); border-color: var(--secondary); color: #fff;
  box-shadow: 0 1px 2px rgba(21,36,42,.06), 0 4px 12px -4px rgba(224,60,74,.42); }
.btn-accent:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); }

.badge-accent { background: var(--secondary-soft); color: var(--secondary-dark); }

/*
 * Focus rings are the deep primary, not the accent. Now that action buttons are
 * themselves coral, a coral ring around a coral button all but disappears; the
 * teal reads clearly against both the white page and the buttons.
 */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Swatch strip under the theme pickers, so the choice is visible before saving. */
.theme-preview { display: flex; gap: 8px; margin: 4px 0 14px; flex-wrap: wrap; }
.theme-swatch {
  flex: 1; min-width: 84px; padding: 10px 12px; border-radius: 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #fff; text-align: center;
  border: 1px solid rgba(21,36,42,.08);
}

/* ------------------------------------------------------------ dropdowns --- */

/*
 * A native <select> popup is drawn by the browser, not the page, so for years
 * the highlight bar was stuck on the browser's own blue no matter what the CSS
 * said. `appearance: base-select` finally hands the popup to us.
 *
 * Support is still Chrome-only, so this is layered:
 *   - the @supports block styles the whole popup where it is understood;
 *   - the rules underneath colour what a native popup will accept elsewhere.
 * Either way the control keeps working — nothing here is load-bearing.
 */

/* Fallback: most browsers honour at least the selected row's colours. */
option:checked { background: var(--secondary); color: #fff; }

@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }

  select {
    display: flex; align-items: center; gap: 8px;
    text-align: left; cursor: pointer;
  }
  select::picker-icon {
    margin-left: auto; color: var(--muted);
    transition: transform .18s ease, color .18s ease;
  }
  select:hover::picker-icon { color: var(--secondary); }
  select:open::picker-icon { transform: rotate(180deg); color: var(--secondary); }

  /* The popup itself. */
  ::picker(select) {
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: 0 12px 32px -8px rgba(21,36,42,.22), 0 2px 6px rgba(21,36,42,.08);
    padding: 5px;
    margin-top: 5px;
    /* Long lists (agents, groups) scroll instead of running off-screen. */
    max-height: 320px; overflow-y: auto;
  }
  ::picker(select):popover-open { animation: picker-in .14s ease-out; }

  option {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: 7px;
    font-size: 13.5px; color: var(--text); cursor: pointer;
  }
  /* :checked is the current value, :hover/:focus is what the pointer or the
     arrow keys are on — both need to read as "this one". */
  option:hover, option:focus {
    background: var(--secondary-soft); color: var(--secondary-dark);
  }
  option:checked { background: var(--secondary); color: #fff; font-weight: 600; }
  option:checked:hover, option:checked:focus { background: var(--secondary-dark); color: #fff; }

  /* Replace the default tick with one that sits in a fixed gutter, so the
     labels line up whether or not a row is selected. */
  option::checkmark { content: '✓'; width: 13px; font-size: 11px; opacity: 0; }
  option:checked::checkmark { opacity: 1; }

  option:disabled { color: var(--muted); opacity: .55; cursor: default; }
  option:disabled:hover { background: none; color: var(--muted); }
}

@keyframes picker-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------- role insignia --- */

/*
 * Each role carries a colour and a crest. --crest is the ink, --crest-ring the
 * halo around the avatar; every rule below reads those two, so adding a role
 * means adding one .av-* / .role-* pair and nothing else.
 */
.av-regal     { --crest: #A9772A; --crest-ring: #E3B457; --crest-soft: #FBF3E0; }
.av-authority { --crest: var(--primary); --crest-ring: #4E717C; --crest-soft: var(--primary-soft); }
.av-desk      { --crest: #2A6F8A; --crest-ring: #5D9BB3; --crest-soft: var(--info-soft); }
.av-seal      { --crest: #0F7B5F; --crest-ring: #46A98D; --crest-soft: var(--ok-soft); }
.av-plain     { --crest: #64777E; --crest-ring: #A9B7BC; --crest-soft: #F0F3F4; }

.av-wrap { position: relative; display: inline-flex; flex: none; }
.av-wrap .avatar {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--crest-ring);
}

.av-crest {
  position: absolute; right: -5px; bottom: -5px;
  width: 19px; height: 19px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--crest); color: #fff;
  border: 2px solid var(--surface);
}
.av-crest .insignia { width: 11px; height: 11px; }

/* Small avatars keep the ring but drop the crest — at 22px a badge is a smudge. */
.av-wrap.avatar-sm .avatar { box-shadow: 0 0 0 2px var(--crest-ring); }
.av-wrap.avatar-sm .av-crest { display: none; }

/* The large profile avatar earns a bigger crest. */
.av-wrap.avatar-xl .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--crest-ring); }
.av-wrap.avatar-xl .av-crest { right: 1px; bottom: 1px; width: 30px; height: 30px; border-width: 3px; }
.av-wrap.avatar-xl .av-crest .insignia { width: 17px; height: 17px; }

/*
 * The super admin is the one role that should read as different across the room,
 * so it gets the only gradient and the only glow in the interface. Everything
 * else stays flat — that contrast is what makes this one land.
 */
.av-regal .av-crest {
  background: linear-gradient(145deg, #E9C46A, #A9772A 62%, #8A5E1E);
  box-shadow: 0 2px 7px -1px rgba(169,119,42,.6);
}
.av-regal.avatar-xl .avatar,
.av-regal .avatar {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #E3B457, 0 3px 14px -3px rgba(169,119,42,.55);
}
.av-regal.avatar-xl .avatar {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px #E3B457, 0 6px 22px -4px rgba(169,119,42,.6);
}

/* ------- labelled chip ------- */

.role-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--crest-soft); color: var(--crest);
  border: 1px solid color-mix(in srgb, var(--crest) 22%, transparent);
}
.role-chip .insignia { width: 12px; height: 12px; flex: none; }

.role-regal     { --crest: #8A5E1E; --crest-soft: #FBF3E0; }
.role-authority { --crest: var(--primary); --crest-soft: var(--primary-soft); }
.role-desk      { --crest: #23617A; --crest-soft: var(--info-soft); }
.role-seal      { --crest: #0C6A52; --crest-soft: var(--ok-soft); }
.role-plain     { --crest: #55666C; --crest-soft: #F0F3F4; }

/* The super admin chip gets a hairline gold gradient border. */
.role-regal {
  background: linear-gradient(180deg, #FDF8EC, #F7EBD2);
  border-color: #E0C489;
}

/* ------- identity block, used on the requester card and the profile ------- */

.identity { display: flex; align-items: center; gap: 13px; }
.identity-body { min-width: 0; }
.identity-name {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-weight: 600; font-size: 14.5px; color: var(--text);
}
.identity-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; word-break: break-word; }
.identity-title { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* ----------------------------------------------------- demo sign-in cards --- */

.demo-grid { display: flex; flex-direction: column; gap: 7px; }
.demo-form { display: block; }

.demo-card {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer; text-align: left;
  font-family: inherit; color: var(--text);
  transition: border-color .13s, box-shadow .13s, transform .13s;
}
.demo-card:hover {
  border-color: var(--secondary);
  box-shadow: 0 4px 14px -6px rgba(224,60,74,.4);
  transform: translateY(-1px);
}
.demo-card:active { transform: none; }

.demo-card-body { min-width: 0; flex: 1; }
.demo-card-role { display: block; font-size: 13px; font-weight: 600; }
.demo-card-blurb {
  display: block; font-size: 11.5px; color: var(--muted);
  line-height: 1.35; margin-top: 1px;
}
.demo-card-go { color: var(--muted); font-size: 15px; flex: none; transition: color .13s, transform .13s; }
.demo-card:hover .demo-card-go { color: var(--secondary); transform: translateX(2px); }

.demo-note {
  margin: 12px 0 0; font-size: 11.5px; color: var(--muted);
  line-height: 1.5; text-align: center;
}
.demo-note code {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: 11px;
}
