/* ============================================================================
   Department of Sam Request Desk — design system
   Dark, confident, premium. Amber accent, Geist type, per-company brand tags.
   Mirrors the Pencil source design (design/ticket-system.pen).
   ========================================================================== */

:root {
  --bg: #0A0B0D;
  --bg-elevated: #101216;
  --surface: #15171C;
  --surface-2: #1B1E24;
  --surface-hover: #22262D;
  --border: #26292F;
  --border-strong: #363A42;
  --text-primary: #F4F5F7;
  --text-secondary: #9AA0AA;
  --text-muted: #666C75;
  --accent: #E0A24B;
  --accent-hover: #EFB463;
  --accent-soft: rgba(224, 162, 75, 0.15);
  --accent-contrast: #1A1206;
  --status-new: #5B9BD5;
  --status-in_progress: #E0A24B;
  --status-waiting: #B07FE0;
  --status-completed: #4FB286;
  --status-declined: #8A8F98;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --font-ui: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw-form: 480px;
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── Brand lockup ───────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
a.brand { cursor: pointer; transition: opacity .15s; }
a.brand:hover { opacity: 0.82; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent);
  color: var(--accent-contrast); font-weight: 700; font-size: 15px;
  display: grid; place-items: center; flex: none;
}
.brand-name { font-weight: 600; font-size: 15px; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.5px; color: var(--text-muted); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600; padding: 13px 22px; line-height: 1;
  transition: background .15s, border-color .15s, opacity .15s, transform .05s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text-primary); border-color: var(--border-strong); font-weight: 500; }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); font-weight: 500; padding: 10px 14px; border-radius: var(--radius-sm); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13.5px; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form fields ────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.field-label .opt { color: var(--text-muted); font-weight: 400; }
.input, .textarea, .select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary); font-family: var(--font-ui);
  font-size: 15px; padding: 13px 15px; transition: border-color .15s, box-shadow .15s; outline: none;
}
.textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .textarea:focus, .select:focus, .select-trigger:focus-visible {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-error { color: #E08585; font-size: 12.5px; }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select-trigger { border-color: #C5705D; }

/* Custom company select (brand-coloured) */
.select-wrap { position: relative; }
.select-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 13px 15px; font-size: 15px; color: var(--text-primary); outline: none;
}
.select-trigger.placeholder { color: var(--text-muted); }
.select-trigger .val { display: flex; align-items: center; gap: 9px; min-width: 0; }
.select-trigger .val .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-trigger .chev { color: var(--text-secondary); flex: none; transition: transform .15s; }
.select-wrap.open .chev { transform: rotate(180deg); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.select-menu {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 6px; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; display: none;
}
.select-wrap.open .select-menu { display: block; }
.select-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14.5px; color: var(--text-secondary); cursor: pointer;
}
.select-option:hover, .select-option.active { background: var(--surface-2); color: var(--text-primary); }
.select-option.soft { color: var(--text-muted); }
.select-option .check { margin-left: auto; color: var(--accent); display: none; }
.select-option.selected .check { display: block; }

/* Native select (for soft timescale) */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%239AA0AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px;
}
.select option { background: var(--bg-elevated); color: var(--text-primary); }

/* ── Dropzone & file chips ──────────────────────────────────────────────── */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 22px 16px; border-radius: var(--radius-md); background: rgba(21, 23, 28, 0.5);
  border: 1px dashed var(--border-strong); text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { color: var(--text-secondary); }
.dropzone .dz-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.dropzone .dz-hint { font-size: 12.5px; color: var(--text-muted); }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-chip {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.file-chip .fi { color: var(--accent); flex: none; }
.file-chip .info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.file-chip .fname { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fsize { font-size: 11.5px; color: var(--text-muted); }
.file-chip .fx { color: var(--text-muted); background: none; border: none; padding: 4px; display: grid; place-items: center; border-radius: 6px; }
.file-chip .fx:hover { color: var(--text-primary); background: var(--surface-hover); }
.file-chip.download { cursor: pointer; }
.file-chip.download:hover { border-color: var(--border-strong); background: var(--surface-hover); }

/* ── Chips: status & company ────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 500; color: var(--text-primary); white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; }

/* ── Icons ──────────────────────────────────────────────────────────────── */
.icon { display: inline-block; vertical-align: middle; }

/* ── Generic helpers ────────────────────────────────────────────────────── */
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); width: 100%; }

/* Toast */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--bg-elevated); border: 1px solid var(--border-strong); color: var(--text-primary);
  padding: 11px 16px; border-radius: var(--radius-md); font-size: 14px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px; animation: toastin .2s ease;
}
.toast.error { border-color: #6e3b33; }
.toast.success .ti { color: var(--status-completed); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* Skeleton / loading */
.center-load { display: grid; place-items: center; min-height: 60vh; color: var(--text-muted); gap: 12px; }
.spinner-lg { width: 26px; height: 26px; border: 3px solid var(--surface-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

/* ============================================================================
   PUBLIC FORM + CONFIRMATION (mobile-first)
   ========================================================================== */
.public-shell { max-width: var(--maxw-form); margin: 0 auto; position: relative; min-height: 100vh; }
.glow { position: absolute; top: -90px; left: 50%; transform: translateX(-50%); width: 340px; height: 240px;
  background: radial-gradient(closest-side, rgba(224,162,75,0.20), transparent 70%); filter: blur(20px); pointer-events: none; z-index: 0; }
.glow.green { background: radial-gradient(closest-side, rgba(79,178,134,0.18), transparent 70%); }
.public-shell > *:not(.glow) { position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 8px; }
.hero { padding: 14px 24px 6px; display: flex; flex-direction: column; gap: 10px; }
.hero h1 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.hero p { margin: 0; font-size: 15px; color: var(--text-secondary); line-height: 1.45; }
.form { padding: 18px 24px 36px; display: flex; flex-direction: column; gap: 16px; }
.submit-wrap { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.footnote { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.cf-turnstile { display: flex; justify-content: center; }

/* Confirmation */
.confirm { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 24px 36px; gap: 0; }
.confirm .success-icon { width: 72px; height: 72px; border-radius: 50%; background: rgba(79,178,134,0.13);
  border: 1.5px solid var(--status-completed); display: grid; place-items: center; color: var(--status-completed); margin-top: 4px; }
.confirm h1 { font-size: 26px; font-weight: 600; margin: 20px 0 8px; }
.confirm .sub { color: var(--text-secondary); font-size: 15px; margin: 0; }
.ref-card { width: 100%; margin-top: 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ref-card .ref-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; color: var(--text-muted); }
.ref-card .ref-number { font-family: var(--font-mono); font-size: 34px; font-weight: 600; letter-spacing: 1px; color: var(--accent); }
.ref-card .ref-subject { font-size: 14px; line-height: 1.4; }
.confirm .mail-text { color: var(--text-secondary); font-size: 14px; line-height: 1.5; margin: 24px 0 18px; }
.confirm .hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-top: 18px; }

/* ============================================================================
   REQUESTER TICKET VIEW
   ========================================================================== */
.ticket-shell { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.tv-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 14px; }
.secure-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-secondary); }
.tv-head { padding: 6px 24px 18px; display: flex; flex-direction: column; gap: 12px; }
.tv-head .ref-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tv-head .ref-row .ref { font-family: var(--font-mono); font-size: 14px; color: var(--text-secondary); letter-spacing: .5px; }
.tv-head h1 { font-size: 22px; font-weight: 600; line-height: 1.2; margin: 0; }
.tv-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tv-meta .sub { font-size: 12.5px; color: var(--text-muted); }

.thread { padding: 18px 24px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.msg { display: flex; flex-direction: column; gap: 10px; padding: 15px; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border); }
.msg.admin { background: var(--surface); border-color: var(--border-strong); }
.msg .mhead { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.avatar.req { background: #2A2E36; color: var(--text-secondary); }
.avatar.adm { background: var(--accent-soft); color: var(--accent); }
.msg .mname { font-size: 14px; font-weight: 600; }
.badge { padding: 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 10.5px; font-weight: 600; }
.badge.you { color: var(--text-secondary); }
.badge.adm { color: var(--accent); }
.msg .mtime { font-size: 11.5px; color: var(--text-muted); margin-left: auto; }
.msg .mbody { font-size: 14px; line-height: 1.55; color: var(--text-secondary); white-space: pre-wrap; word-wrap: break-word; }
.msg.admin .mbody { color: var(--text-primary); }
.marker { display: flex; align-items: center; gap: 10px; justify-content: center; }
.marker .line { height: 1px; width: 28px; background: var(--border); }
.marker .mtext { font-size: 11.5px; color: var(--text-muted); }

.composer { padding: 16px 24px 26px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-elevated); border-top: 1px solid var(--border); }
.composer .actions { display: flex; align-items: center; justify-content: space-between; }

/* ============================================================================
   ADMIN DASHBOARD
   ========================================================================== */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: var(--bg-elevated); border-right: 1px solid var(--border);
  padding: 22px 16px 18px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand-block { display: flex; align-items: center; gap: 10px; padding: 2px 4px 8px; }
.sidebar .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
.sidebar .brand-sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .5px; color: var(--text-muted); }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-sec { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px; color: var(--text-muted); padding: 0 4px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--text-secondary); background: none; border: none; width: 100%; text-align: left; }
.nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-item.active { background: var(--surface-2); color: var(--text-primary); font-weight: 600; }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }
.nav-item.active .count { color: var(--text-primary); }
.sidebar .spacer { flex: 1; }
.profile { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: var(--radius-sm); background: var(--surface); }
.profile .avatar { width: 30px; height: 30px; }
.profile .pinfo { flex: 1; min-width: 0; }
.profile .pname { font-size: 13px; font-weight: 600; }
.profile .prole { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.main-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.main-head h1 { font-size: 23px; font-weight: 600; margin: 0; }
.main-head .sub { font-size: 13.5px; color: var(--text-secondary); margin: 2px 0 0; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; gap: 9px; width: 280px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 13px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { background: none; border: none; outline: none; color: var(--text-primary); font-family: var(--font-ui); font-size: 13.5px; width: 100%; }
.search input::placeholder { color: var(--text-muted); }
.search .si { color: var(--text-muted); flex: none; }

.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.pill:hover { color: var(--text-primary); border-color: var(--border-strong); }
.pill.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pill .chev { color: inherit; }
.filters .fspacer { flex: 1; }

.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s; }
.stat-card:hover { border-color: var(--border-strong); }
.stat-card.active { border-color: var(--accent); }
.stat-card .srow { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.stat-card .snum { font-size: 28px; font-weight: 600; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; flex: 1; min-height: 200px; }
.t-head, .t-row { display: grid; grid-template-columns: 88px 1fr 176px 156px 150px 104px; align-items: center; }
.t-head { padding: 12px 18px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.t-head .th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .8px; color: var(--text-muted); }
.t-row { padding: 13px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; text-align: left; background: none; border-left: none; border-right: none; border-top: none; width: 100%; }
.t-row:hover { background: var(--surface-2); }
.t-row.active { background: var(--surface-2); }
.t-row:last-child { border-bottom: none; }
.t-row .c-ref { font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); }
.t-row .c-subj { font-size: 14px; font-weight: 500; padding-right: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-row .c-when { font-size: 13px; color: var(--text-secondary); }
.t-row .c-when.sensitive { color: var(--accent); }
.t-row .c-upd { font-size: 12.5px; color: var(--text-muted); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 64px 20px; color: var(--text-muted); text-align: center; }

/* Admin ticket detail (overlay panel) */
.detail-overlay { position: fixed; inset: 0; z-index: 60; display: none; }
.detail-overlay.open { display: block; }
.detail-overlay .scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); }
.detail-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(1080px, 94vw);
  background: var(--bg); border-left: 1px solid var(--border); display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slidein .2s ease; }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } }
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.detail-top .tl { display: flex; align-items: center; gap: 14px; min-width: 0; }
.detail-top .back { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-secondary); flex: none; }
.detail-top .back:hover { background: var(--surface-hover); color: var(--text-primary); }
.detail-top .tb { min-width: 0; }
.detail-top .ref-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.detail-top .ref { font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); }
.detail-top h2 { font-size: 18px; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-top .tr { display: flex; align-items: center; gap: 10px; flex: none; }
.detail-body { display: flex; gap: 22px; padding: 22px 24px 28px; overflow: auto; flex: 1; align-items: flex-start; }
.detail-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.detail-right { width: 340px; flex: none; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.panel-title { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .8px; color: var(--text-muted);
  display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.panel-title .ptr { margin-left: auto; font-family: var(--font-ui); font-size: 11px; }
.conv { display: flex; flex-direction: column; gap: 14px; }
.msg.internal { background: rgba(224,162,75,0.08); border-color: rgba(224,162,75,0.3); }
.internal-tag { font-size: 10.5px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }

.composer-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.ctab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-muted); background: none; border: 1px solid transparent; }
.ctab.active { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-primary); font-weight: 600; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

.status-list { display: flex; flex-direction: column; gap: 5px; }
.status-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--text-secondary); background: none; border: 1px solid transparent; width: 100%; text-align: left; }
.status-opt:hover { background: var(--surface-2); }
.status-opt.active { background: var(--surface-2); border-color: var(--accent); color: var(--text-primary); font-weight: 600; }
.status-opt .label { flex: 1; }
.status-opt .ck { color: var(--accent); display: none; }
.status-opt.active .ck { display: block; }

.prop { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.prop:last-child { margin-bottom: 0; }
.prop .plabel { font-size: 12px; color: var(--text-secondary); }
.prop .pbox { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.prop .pbox.col { flex-direction: column; align-items: flex-start; gap: 2px; }
.prop .pval { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.prop .pemail { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); word-break: break-all; }

.canned-list { display: flex; flex-direction: column; gap: 6px; }
.canned-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); width: 100%; text-align: left; }
.canned-item:hover { color: var(--text-primary); border-color: var(--border-strong); }
.canned-item .label { flex: 1; }
.note { display: flex; flex-direction: column; gap: 5px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: rgba(224,162,75,0.08); border-left: 2px solid var(--accent); margin-bottom: 10px; }
.note .nbody { font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.note .ntime { font-size: 11px; color: var(--text-muted); }
.note-input { display: flex; flex-direction: column; gap: 8px; }
.note-input textarea { min-height: 64px; }

/* ── Admin login gate ───────────────────────────────────────────────────── */
.login-overlay { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; padding: 24px;
  background: radial-gradient(closest-side at 50% 0%, rgba(224,162,75,0.10), transparent 60%), var(--bg); }
.login-overlay.show { display: grid; }
.login-card { width: min(380px, 92vw); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 22px; font-weight: 600; margin: 6px 0 0; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .sidebar { display: none; }
  .detail-body { flex-direction: column; }
  .detail-right { width: 100%; }
  .t-head { display: none; }
  .t-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; }
  .t-row .c-ref { grid-column: 1; }
  .t-row .c-subj { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .t-row .c-co { grid-column: 1; grid-row: 3; }
  .t-row .c-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .t-row .c-when { grid-column: 2; grid-row: 3; justify-self: end; }
  .t-row .c-upd { display: none; }
  .main { padding: 16px; }
  .search { width: 100%; }
  .main-head { flex-direction: column; align-items: stretch; }
  .head-actions { flex-direction: column; align-items: stretch; }
}
@media (max-width: 520px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .detail-panel { width: 100vw; border-left: none; }
}
