/* ============================================================
   VLSC Service Desk — design tokens + component styles
   Clean modern enterprise · navy chrome + cyan accent
   ============================================================ */

:root {
  /* Brand / accent (overridable by Tweaks) */
  --accent: #0891b2;
  --accent-bright: #06b6d4;
  --accent-soft: #cffafe;
  --accent-ghost: #ecfeff;

  /* Navy chrome */
  --navy-900: #0b1220;
  --navy-850: #0f172a;
  --navy-800: #131c30;
  --navy-700: #1e293b;
  --navy-600: #334155;
  --navy-line: rgba(148, 163, 184, 0.14);

  /* Neutrals (content) */
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --line: #e3e8ef;
  --line-strong: #cdd5df;

  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --ink-4: #94a3b8;

  /* Status */
  --blue: #2563eb;     --blue-bg: #eff6ff;   --blue-line:#bfdbfe;
  --amber: #d97706;    --amber-bg:#fffbeb;   --amber-line:#fde68a;
  --green: #15803d;    --green-bg:#f0fdf4;   --green-line:#bbf7d0;
  --red: #dc2626;      --red-bg:#fef2f2;     --red-line:#fecaca;
  --violet:#7c3aed;    --violet-bg:#f5f3ff;  --violet-line:#ddd6fe;
  --slate:#64748b;     --slate-bg:#f1f5f9;   --slate-line:#e2e8f0;

  /* Radius / shadow */
  --r-sm: 6px;
  --r: 9px;
  --r-lg: 13px;
  --r-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 4px 12px rgba(15,23,42,.05);
  --shadow-lg: 0 8px 30px rgba(15,23,42,.12), 0 2px 8px rgba(15,23,42,.06);

  --sidebar-w: 248px;
  --font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--accent-soft); }

/* scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; }

/* ============================== APP SHELL ============================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}
.app.compact { --sidebar-w: 72px; }

/* ----- Sidebar ----- */
.sidebar {
  background: linear-gradient(180deg, var(--navy-850) 0%, var(--navy-900) 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0,0,0,.3);
  position: relative;
  z-index: 5;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 20px 18px;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(6,182,212,.35);
}
.brand-name { font-weight: 600; font-size: 15px; color: #fff; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub { font-size: 11px; color: #64748b; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.app.compact .brand-name, .app.compact .brand-sub { display: none; }
.app.compact .brand { justify-content: center; padding: 20px 0 18px; }

.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #475569; padding: 14px 12px 6px; font-weight: 600; }
.app.compact .nav-label { text-align: center; font-size: 0; padding: 12px 0 6px; }
.app.compact .nav-label::after { content: "·"; font-size: 14px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: #94a3b8; font-size: 13.5px; font-weight: 500;
  border: none; background: none; width: 100%; text-align: left;
  transition: background .13s, color .13s;
  position: relative;
}
.nav-item svg { flex: none; }
.nav-item span { white-space: nowrap; }
.nav-item:hover { background: rgba(148,163,184,.08); color: #e2e8f0; }
.nav-item.active { background: rgba(6,182,212,.12); color: #fff; }
.nav-item.active::before {
  content:""; position:absolute; left:-12px; top:50%; transform:translateY(-50%);
  width:3px; height:20px; border-radius:0 3px 3px 0; background: var(--accent-bright);
}
.nav-item .badge-count {
  margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px;
  background: rgba(148,163,184,.16); color: #cbd5e1; font-variant-numeric: tabular-nums;
}
.nav-item.active .badge-count { background: var(--accent); color: #fff; }
.app.compact .nav-item { justify-content: center; padding: 11px 0; }
.app.compact .nav-item span, .app.compact .nav-item .badge-count { display: none; }
.app.compact .nav-item.active::before { left: 0; }

.sidebar-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid rgba(148,163,184,.1); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .meta { line-height: 1.25; min-width: 0; }
.user-chip .nm { font-size: 13px; color: #e2e8f0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .rl { font-size: 11px; color: #64748b; }
.app.compact .user-chip .meta { display: none; }
.app.compact .user-chip { justify-content: center; }

/* ----- Main column ----- */
.main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.topbar {
  height: 60px; flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}
.topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.topbar .crumb { font-size: 12.5px; color: var(--ink-4); }
.search {
  margin-left: auto; position: relative; width: 320px; max-width: 36vw;
}
.search input {
  width: 100%; height: 38px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface-3); padding: 0 12px 0 38px; font-size: 13.5px; color: var(--ink);
  outline: none; transition: .15s;
}
.search input:focus { background: #fff; border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--accent-ghost); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-4); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; color: var(--ink-3);
  transition: .14s; position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 99px; background: var(--red); border: 1.5px solid #fff; }

.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 26px 28px 60px; }
.content-inner { max-width: 1320px; margin: 0 auto; }

/* ============================== BUTTONS ============================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  height: 38px; padding: 0 15px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: .14s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(8,145,178,.3); }
.btn.primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red-line); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================== CARDS / PANELS ============================== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.card-h .sub { font-size: 12px; color: var(--ink-4); }
.card-b { padding: 18px; }

.section-title { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; margin: 0 0 12px; }

/* ============================== BADGES / PILLS ============================== */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px;
  border-radius: 99px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap; line-height: 1;
}
.pill .pdot { width: 6px; height: 6px; border-radius: 99px; }
.pill.blue { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.pill.amber { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.pill.green { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.pill.red { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
.pill.violet { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-line); }
.pill.slate { background: var(--slate-bg); color: var(--slate); border-color: var(--slate-line); }

.prio { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.prio .bar { width: 3px; height: 13px; border-radius: 2px; }
.prio.critical { color: var(--red); } .prio.critical .bar { background: var(--red); }
.prio.high { color: #ea580c; } .prio.high .bar { background: #ea580c; }
.prio.medium { color: var(--amber); } .prio.medium .bar { background: var(--amber); }
.prio.low { color: var(--slate); } .prio.low .bar { background: var(--slate); }

.type-tag { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; padding:2px 8px; border-radius:6px; }
.type-tag.incident { background:#fef2f2; color:#b91c1c; }
.type-tag.request { background:#eef2ff; color:#4338ca; }

/* ============================== AVATAR ============================== */
.avatar {
  border-radius: 99px; display: grid; place-items: center; color: #fff; font-weight: 600;
  flex: none; letter-spacing: .01em; user-select: none;
}

/* ============================== KPI CARDS ============================== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-icn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.kpi .kpi-label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.kpi .kpi-val { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi .kpi-delta { font-size: 12px; font-weight: 600; margin-top: 9px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .kpi-delta.up { color: var(--green); }
.kpi .kpi-delta.down { color: var(--red); }
.kpi .kpi-delta.flat { color: var(--ink-4); }

/* ============================== TABLE ============================== */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-4); padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--ink-2); }
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
table.tbl tr.row { transition: background .1s; cursor: pointer; }
table.tbl tr.row:hover { background: var(--surface-2); }
table.tbl tr.row.sel { background: var(--accent-ghost); }
table.tbl tr.row.sel:hover { background: var(--accent-soft); }
.tid { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.subj { font-weight: 600; color: var(--ink); }
.muted { color: var(--ink-4); }
.nowrap { white-space: nowrap; }

/* checkbox */
.cbx { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--line-strong); background:#fff; display:grid; place-items:center; transition:.12s; flex:none; }
.cbx.on { background: var(--accent); border-color: var(--accent); }
.cbx.on svg { color:#fff; }

/* ============================== FILTER BAR ============================== */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { height: 30px; padding: 0 13px; border: none; background: none; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); transition: .12s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.select {
  height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 32px 0 12px; font-size: 13px; color: var(--ink-2); font-weight: 500;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.select:focus { outline: none; border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--accent-ghost); }

/* bulk action bar */
.bulkbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px;
  background: var(--navy-850); color: #e2e8f0; border-radius: 11px; box-shadow: var(--shadow);
  animation: slideDown .18s ease;
}
@keyframes slideDown { from { opacity: 1; transform: translateY(-6px);} to { opacity:1; transform: none; } }
.bulkbar .count { font-weight: 600; font-size: 13px; }
.bulkbar .btn { height: 32px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #e2e8f0; }
.bulkbar .btn:hover { background: rgba(255,255,255,.16); }

/* ============================== FORMS ============================== */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.field .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--ink-4); margin-top: 6px; }
.input, .textarea {
  width: 100%; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  padding: 10px 12px; font-size: 13.5px; color: var(--ink); outline: none; transition: .14s;
}
.input { height: 40px; }
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.input:focus, .textarea:focus { border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--accent-ghost); }
.input.err, .textarea.err { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
/* Base error message — red, with the inline alert icon. Applies everywhere .errmsg is
   used (auth login/forgot/reset, request access), not only inside a .field. */
.errmsg { font-size: 12px; color: var(--red); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.field .errmsg { margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }

/* priority radio chips */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-3);
  transition: .12s;
}
.chip:hover { border-color: var(--line-strong); }
.chip.on { border-color: var(--accent); background: var(--accent-ghost); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.chip .bar { width: 3px; height: 14px; border-radius: 2px; }

/* ============================== TICKET DETAIL ============================== */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.timeline { position: relative; padding-left: 4px; }
.tl-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding-bottom: 20px; position: relative; }
.tl-item:not(:last-child)::before { content:""; position: absolute; left: 16px; top: 30px; bottom: -6px; width: 2px; background: var(--line); }
.tl-icn { width: 34px; height: 34px; border-radius: 99px; display: grid; place-items: center; z-index: 1; flex:none; }
.tl-body { padding-top: 5px; }
.tl-head { font-size: 13.5px; color: var(--ink); }
.tl-head b { font-weight: 600; }
.tl-time { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.tl-note { margin-top: 9px; padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.tl-note.agent { background: var(--accent-ghost); border-color: var(--accent-soft); }

.meta-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.meta-row:last-child { border-bottom: none; }
.meta-row .k { font-size: 12.5px; color: var(--ink-4); font-weight: 500; }
.meta-row .v { font-size: 13px; color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 8px; }

.composer { display: flex; gap: 10px; margin-top: 16px; }
.composer .textarea { min-height: 44px; }

/* SLA bar */
.sla-bar { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.sla-bar > i { display: block; height: 100%; border-radius: 99px; }

/* ----- Stage stepper (Change Request delivery phases) ----- */
.stepper { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.stepper .step {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px 6px 7px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line);
  color: var(--ink-3); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .13s, color .13s, border-color .13s;
}
.stepper .step:disabled { cursor: default; }
.stepper .step .step-dot {
  width: 19px; height: 19px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--line-strong); color: #fff;
}
.stepper .step.done { color: var(--ink-2); border-color: var(--green-line); background: var(--green-bg); }
.stepper .step.done .step-dot { background: var(--green); }
.stepper .step.active { color: var(--accent); border-color: var(--accent); background: var(--accent-ghost); }
.stepper .step.active .step-dot { background: var(--accent); }
.stepper .step:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }

/* ----- Approval banner (pending Change/Service Request) ----- */
.approval-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 13px 16px;
  background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: var(--r-lg);
}
.approval-banner .ab-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.approval-banner .ab-icn { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; background: #fff; color: var(--amber); border: 1px solid var(--amber-line); }
.approval-banner .ab-title { font-size: 13.5px; font-weight: 700; color: #92400e; }
.approval-banner .ab-sub { font-size: 12px; color: #b45309; margin-top: 1px; }
.approval-banner .ab-reject { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; justify-content: flex-end; }
.approval-banner .ab-reject .input { height: 34px; max-width: 280px; flex: 1; }

/* ----- Timeline audit sub-note (status / assignment / escalation descriptions) ----- */
.tl-subnote { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }

/* ============================== CHARTS ============================== */
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.legend-item .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend-item b { font-weight: 600; color: var(--ink); margin-left: 2px; font-variant-numeric: tabular-nums; }
.bar-track { background: var(--surface-3); border-radius: 6px; height: 28px; position: relative; overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 6px; transition: width .6s cubic-bezier(.2,.8,.2,1); }

/* ============================== MISC ============================== */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.center { display: flex; align-items: center; }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-4); }
.empty svg { margin-bottom: 14px; color: var(--line-strong); }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--navy-850); color: #fff; padding: 12px 18px; border-radius: 11px;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 100;
  display: flex; align-items: center; gap: 10px; animation: toastIn .25s ease both;
}
@keyframes toastIn { from { opacity:1; transform: translate(-50%, 12px);} to { opacity:1; transform: translate(-50%,0);} }
.toast .ok { color: #34d399; }

.fade-in { animation: fadeIn .22s ease both; }
@keyframes fadeIn { from { opacity: 1; transform: translateY(4px);} to { opacity: 1; transform: none; } }

.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ============================== AUTH (login / signup) ============================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.04fr .96fr; background: var(--surface); }
.auth-aside {
  background: radial-gradient(120% 100% at 0% 0%, #16233d 0%, #0f172a 45%, #0b1220 100%);
  color: #cbd5e1; padding: 52px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.auth-aside::after {
  content:""; position:absolute; right:-120px; bottom:-120px; width:360px; height:360px; border-radius:50%;
  background: radial-gradient(circle, rgba(6,182,212,.25), transparent 70%);
}
.auth-aside .brand-name { font-size: 17px; }
.auth-headline { font-size: 34px; font-weight: 600; color: #fff; letter-spacing: -.025em; line-height: 1.18; margin: auto 0 0; max-width: 460px; text-wrap: balance; }
.auth-sub { font-size: 15px; color: #94a3b8; margin-top: 16px; max-width: 420px; line-height: 1.6; }
.auth-feats { margin-top: 32px; display: flex; flex-direction: column; gap: 14px; }
.auth-feat { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #cbd5e1; }
.auth-feat .fi { width: 32px; height: 32px; border-radius: 9px; background: rgba(6,182,212,.14); color: var(--accent-bright); display: grid; place-items: center; flex: none; }
.auth-foot { margin-top: auto; padding-top: 40px; font-size: 12px; color: #475569; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; position: relative; }
.auth-card { width: 100%; max-width: 384px; }
.auth-title { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-lead { font-size: 14px; color: var(--ink-3); margin: 0 0 28px; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--ink-3); margin-top: 22px; }
.auth-switch button { background: none; border: none; color: var(--accent); font-weight: 600; font-size: 13.5px; padding: 0; }
.auth-switch button:hover { text-decoration: underline; }
.input-wrap { position: relative; }
.input-wrap .pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--ink-4); padding: 4px; }
.input-wrap .pw-toggle:hover { color: var(--ink-2); }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 20px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.link { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.pw-meter { display: flex; gap: 5px; margin-top: 8px; }
.pw-meter i { height: 4px; flex: 1; border-radius: 99px; background: var(--line); transition: background .2s; }
/* "Forgot password?" link-styled button (sits inside .auth-row) */
.linkbtn { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600; padding: 0; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.field .optional { color: var(--ink-4); font-weight: 500; font-size: 12px; margin-left: 2px; }
/* Status confirmation screens (forgot-sent / reset-done / request-submitted) */
.auth-status-icn { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin: 0 0 18px; }
.auth-status-icn.ok { background: var(--green-bg, #f0fdf4); color: var(--green, #16a34a); }
.auth-status-icn.pending { background: #f5f3ff; color: #7c3aed; }
.auth-note { margin-top: 14px; padding: 11px 13px; background: var(--accent-ghost); border: 1px solid var(--accent-soft); border-radius: 10px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.auth-steps { list-style: none; margin: 18px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-steps li { display: flex; align-items: flex-start; gap: 11px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.auth-steps .step-n { flex: none; width: 22px; height: 22px; border-radius: 99px; background: var(--accent-ghost); color: var(--accent); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; margin-top: -1px; }
@media (max-width: 880px) { .auth-wrap { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ============================== PENDING-APPROVAL (admin) ============================== */
.approve-banner { display: flex; align-items: center; gap: 13px; padding: 13px 16px; margin-bottom: 16px; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 12px; }
.approve-banner .ab-icn { flex: none; width: 34px; height: 34px; border-radius: 9px; background: #ede9fe; color: #7c3aed; display: grid; place-items: center; }
.pending-callout { padding: 13px 15px; margin-bottom: 20px; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 11px; color: #6d28d9; }

/* ============================== SLIDE-OVER DRAWER + MODAL ============================== */
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.42); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 452px; max-width: 94vw; background: var(--surface);
  z-index: 51; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.drawer.open { transform: none; }
.drawer-h { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.drawer-h h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.drawer-h .sub { font-size: 12.5px; color: var(--ink-4); }
.drawer-b { padding: 24px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }

.modal-card {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 51;
  width: 420px; max-width: 92vw; background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 26px;
}
.modal-icn { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px; }

/* ============================== TOGGLE SWITCH ============================== */
.switch { width: 40px; height: 23px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .16s; flex: none; cursor: pointer; border: none; padding: 0; }
.switch.on { background: var(--accent); }
.switch i { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 99px; background: #fff; transition: left .16s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.on i { left: 19px; }

/* ============================== TEAM CARDS ============================== */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.team-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.team-card .tc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.team-card .tc-icn { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more { width: 30px; height: 30px; border-radius: 99px; background: var(--surface-3); border: 2px solid var(--surface); margin-left: -8px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink-3); }

/* row action buttons */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.act-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: none; display: grid; place-items: center; color: var(--ink-4); transition: .12s; }
.act-btn:hover { background: var(--surface-3); color: var(--ink-2); border-color: var(--line); }
.act-btn.danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
.act-btn.ok:hover { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.act-btn:disabled { opacity: .28; cursor: not-allowed; pointer-events: none; }

/* ── Drag-and-drop row sorting ─────────────────────────────────── */
.drag-handle { width: 28px; height: 28px; border-radius: 6px; border: none; background: none;
  display: grid; place-items: center; color: var(--ink-5); cursor: grab; transition: .12s; padding: 0; }
.drag-handle:hover { background: var(--surface-3); color: var(--ink-3); }
.drag-handle:active { cursor: grabbing; }
.tbl tbody tr.tr-dragging { opacity: .3; background: var(--surface-2); }
.tbl tbody tr.tr-drop-above td { border-top: 2px solid var(--blue, #3b82f6); }
.tbl tbody tr.tr-drop-above td:first-child { border-top-left-radius: 3px; }
.tbl tbody tr.tr-drop-above td:last-child  { border-top-right-radius: 3px; }
.tbl-sortable .drag-col { width: 36px; text-align: center; }

/* ============================== PROJECT SWITCHER ============================== */
.proj-switch-wrap { padding: 0 12px 8px; position: relative; }
.proj-switch {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px;
  background: rgba(148,163,184,.07); border: 1px solid rgba(148,163,184,.14); color: #e2e8f0;
  transition: .14s; text-align: left;
}
.proj-switch:not(.locked):hover { background: rgba(148,163,184,.13); border-color: rgba(148,163,184,.25); }
.proj-switch.locked { cursor: default; }
.proj-swatch { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.proj-switch .ps-meta { flex: 1; min-width: 0; }
.proj-switch .ps-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.proj-switch .ps-sub { font-size: 10.5px; color: #64748b; letter-spacing: .05em; text-transform: uppercase; margin-top: 1px; }
.proj-switch .ps-chev { color: #64748b; flex: none; }
.app.compact .proj-switch { justify-content: center; padding: 9px 0; }
.app.compact .proj-switch .ps-meta, .app.compact .proj-switch .ps-chev { display: none; }

.proj-menu {
  position: absolute; left: 12px; right: 12px; top: 100%; margin-top: -2px; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; max-height: 70vh; overflow-y: auto;
}
.proj-menu .pm-label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; padding: 8px 10px 5px; }
.proj-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: none; background: none; text-align: left; transition: background .1s; }
.proj-opt:hover { background: var(--surface-3); }
.proj-opt .po-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.proj-opt .po-sub { font-size: 11.5px; color: var(--ink-4); }
.proj-opt .po-count { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--ink-3); background: var(--surface-3); padding: 2px 8px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.proj-opt.on { background: var(--accent-ghost); }
.proj-opt.on .po-count { background: var(--accent-soft); color: var(--accent); }
.proj-menu .pm-foot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }

/* project badge / chip */
.proj-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.proj-badge .pb-dot { width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; color: #fff; font-size: 8.5px; font-weight: 700; flex: none; }
.proj-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 6px; border-radius: 7px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line); }
.proj-chip .pc-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.proj-chips { display: flex; gap: 5px; flex-wrap: wrap; }

/* topbar project context */
.topbar .proj-context { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* ============================== PROJECTS VIEW ============================== */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.proj-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; transition: .15s; cursor: pointer; }
.proj-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); transform: translateY(-1px); }
.proj-card .pc-band { height: 6px; }
.proj-card .pc-body { padding: 18px; }
.proj-card .pc-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 14px; }
.proj-card .pc-icn { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; flex: none; }
.proj-card .pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.proj-card .pc-stat { text-align: center; }
.proj-card .pc-stat .v { font-size: 19px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.proj-card .pc-stat .l { font-size: 11px; color: var(--ink-4); margin-top: 3px; }

/* ============================== SETTINGS POPOVER ============================== */
.tweaks-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--navy-850); color: #e2e8f0; border: 1px solid var(--navy-600);
  display: grid; place-items: center; box-shadow: var(--shadow-lg);
  transition: .16s;
}
.tweaks-fab:hover { background: var(--navy-700); color: #fff; transform: translateY(-1px); }
.tweaks-scrim { position: fixed; inset: 0; z-index: 60; }
.tweaks-panel {
  position: fixed; right: 24px; bottom: 82px; z-index: 61;
  width: 320px; max-width: calc(100vw - 48px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: tweaksIn .18s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes tweaksIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tweaks-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tweaks-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.tweaks-head .icon-btn { width: 32px; height: 32px; border: none; background: transparent; }
.tweaks-head .icon-btn:hover { background: var(--surface-3); }
.tweaks-body { padding: 8px 16px 18px; }
.tweak-section { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; margin: 14px 0 8px; }
.tweak-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; }
.tweak-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tweak-control { display: flex; align-items: center; }
.tweak-swatches { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.tweak-swatch { width: 24px; height: 24px; border-radius: 7px; border: 2px solid transparent; display: grid; place-items: center; color: #fff; transition: .12s; outline: 2px solid transparent; outline-offset: -5px; }
.tweak-swatch:hover { transform: scale(1.06); }
.tweak-swatch.on { border-color: var(--ink); outline-color: #fff; }
.tweaks-body .seg button { height: 28px; padding: 0 10px; font-size: 12px; }

/* ============================== BOOT / LOADING ============================== */
.boot-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--ink-3); font-size: 14px; background: var(--bg); }
.boot-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: bootspin .7s linear infinite; }
@keyframes bootspin { to { transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================== FILE ATTACHMENTS ============================== */
.drop-zone {
  border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 20px;
  text-align: center; cursor: pointer; transition: .15s; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-ghost); }
.drop-zone .dz-icon { color: var(--ink-4); }
.drop-zone.over .dz-icon { color: var(--accent); }
.drop-zone .dz-text { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.drop-zone .dz-sub { font-size: 12px; color: var(--ink-4); }

.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.file-item .fi-icon { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.file-item .fi-name { font-size: 13px; font-weight: 600; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fi-size { font-size: 12px; color: var(--ink-4); white-space: nowrap; flex: none; }
.file-item .fi-remove { border: none; background: none; color: var(--ink-4); cursor: pointer; padding: 4px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.file-item .fi-remove:hover { background: var(--red-bg); color: var(--red); }
.file-item .fi-err { font-size: 12px; color: var(--red); flex: 1; }
.file-item .fi-progress { flex: 1; height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.file-item .fi-progress-bar { height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s; }
.file-item.uploading { opacity: .85; }
.file-item.done .fi-icon { background: var(--green-bg); color: var(--green); }
.file-item.error .fi-icon { background: var(--red-bg); color: var(--red); }

/* attachment list in ticket detail */
.attach-list { display: flex; flex-direction: column; gap: 6px; }
.attach-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  transition: .13s;
}
.attach-item:hover { background: var(--surface-3); border-color: var(--line-strong); }
.attach-item .ai-icon { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.attach-item .ai-meta { flex: 1; min-width: 0; }
.attach-item .ai-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item .ai-sub { font-size: 11.5px; color: var(--ink-4); margin-top: 1px; }
.attach-item a.ai-dl { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ink-3); text-decoration: none; border: 1px solid transparent; transition: .12s; }
.attach-item a.ai-dl:hover { background: var(--surface); border-color: var(--line); color: var(--accent); }
.attach-item .ai-del { border: none; background: none; cursor: pointer; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ink-4); transition: .12s; }
.attach-item .ai-del:hover { background: var(--red-bg); color: var(--red); }

/* ============================== RESPONSIVE / MOBILE ============================== */
/* Hamburger toggle + sidebar scrim are hidden on desktop, shown on mobile. */
.nav-toggle { display: none; }
.nav-scrim  { display: none; }

/* ---- Tablet / phone: sidebar becomes a slide-in drawer ---- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }              /* main column fills the width */

  /* Sidebar → off-canvas drawer (always full, even if the "compact" tweak is on) */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 270px; max-width: 82vw;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 59;
    box-shadow: 0 20px 50px rgba(0,0,0,.45);
  }
  .app.nav-open .sidebar { transform: translateX(0); }

  .app.compact { --sidebar-w: 270px; }
  .app.compact .brand-name, .app.compact .brand-sub,
  .app.compact .nav-item span, .app.compact .nav-item .badge-count,
  .app.compact .user-chip .meta { display: revert; }
  .app.compact .nav-item  { justify-content: flex-start; padding: 9px 12px; }
  .app.compact .nav-label { text-align: left; font-size: 10.5px; padding: 14px 12px 6px; }
  .app.compact .nav-label::after { content: none; }
  .app.compact .brand { justify-content: flex-start; padding: 20px 20px 18px; }

  /* Backdrop behind the open drawer */
  .nav-scrim {
    display: block; position: fixed; inset: 0;
    background: rgba(15,23,42,.5); opacity: 0; pointer-events: none;
    transition: opacity .25s; z-index: 58;
  }
  .app.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

  /* Topbar: show the hamburger, tighten spacing */
  .nav-toggle { display: grid; flex: none; }
  .topbar { height: 56px; padding: 0 12px; gap: 10px; }
  .topbar h1 { font-size: 15.5px; }
  .topbar .crumb { font-size: 11px; }
  .topbar .icon-btn[title="Notifications"] { display: none; }  /* save room */
  .search { width: auto; max-width: none; flex: 1; min-width: 0; margin-left: 6px; }

  .content { padding: 16px 14px 48px; }

  /* Stack the dashboards / forms / detail panes */
  .kpi-grid   { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid-2,
  .grid-3,
  .team-grid  { grid-template-columns: 1fr; }
  .form-grid  { grid-template-columns: 1fr; gap: 0; }
  .detail-grid{ grid-template-columns: 1fr; }
  .proj-card .pc-stats { gap: 8px; }

  /* Wide data tables scroll horizontally instead of crushing */
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
  table.tbl { min-width: 620px; }

  /* Keep the customization popover on-screen */
  .tweaks-panel { right: 12px; left: 12px; width: auto; }
}

/* ---- Small phones ---- */
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 15px; }
  .content { padding: 14px 12px 44px; }
}

/* ---- compact language picker (auth screens) ---- */
.lang-compact-sel {
  appearance: none;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 26px 5px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.lang-compact-sel:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------------- Roles & Permissions (RBAC) ---------------- */
.roles-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.roles-list .card-b { display: flex; flex-direction: column; gap: 4px; }
.role-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 10px 11px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; transition: .12s; }
.role-item:hover { background: var(--surface-2); }
.role-item.on { background: var(--accent-ghost); border-color: var(--accent-soft); }
.role-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); flex: none; }
.role-item.on .role-ic { background: var(--accent); color: #fff; }
.role-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.role-nm { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-sys { color: var(--amber); display: inline-flex; }
.role-sub { font-size: 12px; color: var(--ink-4); }
.role-count { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface-3); border-radius: 99px; padding: 1px 9px; min-width: 24px; text-align: center; flex: none; font-variant-numeric: tabular-nums; }

.perm-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; }
.perm-group { padding: 4px 0; }
.perm-group-h { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-4); margin: 6px 0 8px; }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.perm-row:hover { background: var(--surface-2); }
.perm-row.on { background: var(--accent-ghost); }
.perm-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
@media (max-width: 920px) {
  .roles-layout { grid-template-columns: 1fr; }
  .perm-matrix { grid-template-columns: 1fr; }
}
