@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  /* Stageshow & High-Craft Light Tokens (Default) */
  --ss-canvas: #f6f5f4;
  --ss-well: #efeeec;
  --ss-surface: #ffffff;
  --ss-raised: #ffffff;
  --ss-glass: rgba(255, 255, 255, 0.84);

  --ss-ink-1: rgba(0, 0, 0, 0.035);
  --ss-ink-2: rgba(0, 0, 0, 0.055);
  --ss-ink-3: rgba(0, 0, 0, 0.08);
  --ss-ink-4: rgba(0, 0, 0, 0.12);
  --ss-ink-5: rgba(0, 0, 0, 0.18);
  --ss-fill: #ebebea;

  --ss-line: rgba(0, 0, 0, 0.07);
  --ss-line-faint: rgba(0, 0, 0, 0.045);

  --ss-text-strong: #18181b;
  --ss-text: #52525b;
  --ss-text-faint: #8e8e96;

  --ss-icon: #52525b;
  --ss-icon-faint: #a1a1aa;

  /* Singular Brand Accent: EZ-Motel Deep Teal (#0F766E) */
  --ss-accent: #0f766e;
  --ss-accent-hover: #0d635c;
  --ss-accent-soft: rgba(15, 118, 110, 0.1);
  --ss-accent-text: #0f766e;

  /* Zalo Channel Accent */
  --ss-zalo: #0068ff;
  --ss-zalo-soft: rgba(0, 104, 255, 0.1);

  /* Semantic Status Tints */
  --ss-success: #15803d;
  --ss-success-soft: rgba(21, 128, 61, 0.1);
  --ss-success-text: #15803d;

  --ss-warning: #b45309;
  --ss-warning-soft: rgba(245, 158, 11, 0.13);
  --ss-warning-text: #b45309;

  --ss-danger: #b91c1c;
  --ss-danger-soft: rgba(239, 68, 68, 0.1);
  --ss-danger-text: #b91c1c;

  /* Optical Ring Shadows (Stageshow Spec) */
  --ss-shadow-card: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
  --ss-shadow-window: 0 0 0 1px rgba(0, 0, 0, 0.065), 0 8px 24px -4px rgba(24, 24, 27, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03);
  --ss-shadow-float: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 14px 32px -8px rgba(24, 24, 27, 0.14), 0 4px 10px -4px rgba(0, 0, 0, 0.06);
  --ss-shadow-hero: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 28px 56px -14px rgba(24, 24, 27, 0.16), 0 12px 24px -12px rgba(0, 0, 0, 0.1);

  /* Radii & Density Scale */
  --ss-radius-sm: 6px;
  --ss-radius-md: 8px;
  --ss-radius-lg: 12px;
  --ss-radius-window: 16px;
  --ss-radius-pill: 999px;

  --ss-font: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ss-mono: 'Geist Mono', 'SF Mono', ui-monospace, monospace;
  --ss-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --ss-canvas: #0c0d10;
  --ss-well: #121418;
  --ss-surface: #16181d;
  --ss-raised: #1e2028;
  --ss-glass: rgba(22, 24, 29, 0.86);

  --ss-ink-1: rgba(255, 255, 255, 0.035);
  --ss-ink-2: rgba(255, 255, 255, 0.06);
  --ss-ink-3: rgba(255, 255, 255, 0.09);
  --ss-ink-4: rgba(255, 255, 255, 0.14);
  --ss-ink-5: rgba(255, 255, 255, 0.2);
  --ss-fill: #242730;

  --ss-line: rgba(255, 255, 255, 0.075);
  --ss-line-faint: rgba(255, 255, 255, 0.045);

  --ss-text-strong: #f4f4f5;
  --ss-text: #a1a1aa;
  --ss-text-faint: #71717a;

  --ss-icon: #a1a1aa;
  --ss-icon-faint: #52525b;

  --ss-accent: #14b8a6;
  --ss-accent-hover: #0d9488;
  --ss-accent-soft: rgba(20, 184, 166, 0.14);
  --ss-accent-text: #2dd4bf;

  --ss-zalo: #3b82f6;
  --ss-zalo-soft: rgba(59, 130, 246, 0.15);

  --ss-success-soft: rgba(34, 197, 94, 0.14);
  --ss-success-text: #4ade80;

  --ss-warning-soft: rgba(245, 158, 11, 0.15);
  --ss-warning-text: #fbbf24;

  --ss-danger-soft: rgba(239, 68, 68, 0.15);
  --ss-danger-text: #f87171;

  --ss-shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 1px 3px rgba(0, 0, 0, 0.35);
  --ss-shadow-window: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 32px -6px rgba(0, 0, 0, 0.5);
  --ss-shadow-float: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 20px 42px -10px rgba(0, 0, 0, 0.65);
  --ss-shadow-hero: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 30px 60px -12px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ss-font);
  background: var(--ss-canvas);
  color: var(--ss-text-strong);
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* SVG Icon Primitive */
.ico {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}
.ico-sm { width: 13.5px; height: 13.5px; }
.ico-lg { width: 18px; height: 18px; }

/* Top Chrome Bar (52px precision) */
header.top-chrome {
  height: 54px;
  background: var(--ss-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ss-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 14px;
  flex-shrink: 0;
  z-index: 40;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ss-text-strong);
  color: var(--ss-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ss-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.03em;
}

.brand-name {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.02em;
  color: var(--ss-text-strong);
}

.brand-tag {
  font-family: var(--ss-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ss-accent-text);
  background: var(--ss-accent-soft);
  padding: 2px 7px;
  border-radius: var(--ss-radius-sm);
}

/* Segmented Navigation Track (Stageshow Segmented Control) */
.segmented-nav {
  display: inline-flex;
  align-items: center;
  background: var(--ss-well);
  padding: 3px;
  border-radius: var(--ss-radius-md);
  box-shadow: inset 0 0 0 1px var(--ss-line-faint);
  gap: 2px;
  overflow-x: auto;
}

.seg-btn {
  background: transparent;
  color: var(--ss-text);
  border: none;
  padding: 5px 11px;
  border-radius: var(--ss-radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s var(--ss-ease);
}

.seg-btn:hover {
  color: var(--ss-text-strong);
}

.seg-btn.active {
  background: var(--ss-surface);
  color: var(--ss-text-strong);
  font-weight: 600;
  box-shadow: var(--ss-shadow-card);
}

.seg-count {
  font-family: var(--ss-mono);
  font-size: 11px;
  padding: 0 5px;
  border-radius: var(--ss-radius-pill);
  background: var(--ss-ink-2);
  color: var(--ss-text-strong);
}

.seg-count.warn {
  background: var(--ss-warning-soft);
  color: var(--ss-warning-text);
  font-weight: 600;
}

.chrome-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.period-pill {
  background: var(--ss-surface);
  color: var(--ss-text-strong);
  border: none;
  box-shadow: var(--ss-shadow-card);
  padding: 5px 10px;
  border-radius: var(--ss-radius-sm);
  font-family: var(--ss-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--ss-radius-pill);
  background: var(--ss-surface);
  box-shadow: var(--ss-shadow-card);
  font-size: 12px;
  font-weight: 500;
  color: var(--ss-text);
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s var(--ss-ease);
}
.live-pill:active { transform: scale(0.97); }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  position: relative;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid #22c55e;
  opacity: 0;
  animation: ssPulse 2.2s infinite var(--ss-ease);
}
.live-pill.paused .pulse-dot { background: var(--ss-text-faint); }
.live-pill.paused .pulse-dot::after { display: none; }

@keyframes ssPulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* Tactile Buttons */
.btn {
  background: var(--ss-text-strong);
  color: var(--ss-surface);
  border: none;
  padding: 6px 12px;
  height: 32px;
  border-radius: var(--ss-radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.18s var(--ss-ease);
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-accent {
  background: var(--ss-accent);
  color: #ffffff;
}
.btn-accent:hover { background: var(--ss-accent-hover); opacity: 1; }

.btn-zalo {
  background: var(--ss-zalo);
  color: #ffffff;
}
.btn-zalo:hover { filter: brightness(1.08); opacity: 1; }

.btn-surface {
  background: var(--ss-surface);
  color: var(--ss-text-strong);
  box-shadow: var(--ss-shadow-card);
}
.btn-surface:hover { background: var(--ss-ink-1); opacity: 1; }

.btn-danger {
  background: var(--ss-danger-soft);
  color: var(--ss-danger-text);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.18); opacity: 1; }

.btn-warn {
  background: var(--ss-warning-soft);
  color: var(--ss-warning-text);
}

.btn-sm {
  height: 27px;
  padding: 0 9px;
  font-size: 11.5px;
  border-radius: 5px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--ss-radius-sm);
  background: var(--ss-surface);
  color: var(--ss-icon);
  box-shadow: var(--ss-shadow-card);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ss-ease);
}
.icon-btn:hover { color: var(--ss-text-strong); background: var(--ss-ink-1); }

/* Inputs & Selects */
.input {
  width: 100%;
  height: 34px;
  background: var(--ss-surface);
  color: var(--ss-text-strong);
  border: none;
  box-shadow: var(--ss-shadow-card);
  border-radius: var(--ss-radius-sm);
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  font-variant-numeric: tabular-nums;
  transition: box-shadow 0.15s var(--ss-ease);
}
.input:focus {
  box-shadow: 0 0 0 2px var(--ss-accent), var(--ss-shadow-card);
}
.input:disabled {
  background: var(--ss-well);
  color: var(--ss-text-faint);
}

/* Views & Scroll Containers */
.view-section {
  display: none;
  flex: 1;
  overflow: hidden;
}
.view-section.active {
  display: flex;
}

.stage-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 36px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ========================================================================= */
/* STAGESHOW HERO WALKTHROUGH STAGE (Interactive Product Stage + Satellites) */
/* ========================================================================= */
.ss-hero-stage {
  background: var(--ss-well);
  border-radius: var(--ss-radius-window);
  box-shadow: inset 0 0 0 1px var(--ss-line);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

@media (max-width: 960px) {
  .ss-hero-stage { grid-template-columns: 1fr; }
}

.ss-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ss-eyebrow {
  font-family: var(--ss-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ss-accent-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ss-headline {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.22;
  color: var(--ss-text-strong);
}

.ss-subcopy {
  font-size: 13px;
  color: var(--ss-text);
  max-width: 58ch;
  line-height: 1.5;
}

/* Miniature Stageshow Window + Satellite Notification */
.ss-mini-scene {
  position: relative;
  min-height: 158px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
}

.ss-mini-window {
  width: 100%;
  max-width: 430px;
  background: var(--ss-surface);
  border-radius: 11px;
  box-shadow: var(--ss-shadow-hero);
  overflow: hidden;
  font-size: 12px;
}

.ss-mini-bar {
  height: 30px;
  padding: 0 11px;
  border-bottom: 1px solid var(--ss-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ss-ink-1);
}

.ss-dots {
  display: flex;
  gap: 5px;
}
.ss-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ss-ink-4);
}

.ss-mini-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--ss-line-faint);
}
.ss-mini-row:last-child { border-bottom: none; }

.ss-bar-placeholder {
  height: 6px;
  border-radius: 99px;
  background: var(--ss-ink-3);
}

/* Satellite Card straddling the hero window edge (Stageshow signature) */
.ss-satellite-toast {
  position: absolute;
  bottom: -6px;
  left: 0;
  background: var(--ss-raised);
  box-shadow: var(--ss-shadow-float);
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 275px;
  animation: ssFloatIn 5s infinite ease-in-out;
}

@keyframes ssFloatIn {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ========================================================================= */
/* ARCHITECTURAL METRIC STRIP (Ruled Bento - No Bloated Box Clutter)         */
/* ========================================================================= */
.metric-ledger {
  background: var(--ss-surface);
  border-radius: var(--ss-radius-lg);
  box-shadow: var(--ss-shadow-window);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  overflow: hidden;
}

.metric-cell {
  padding: 15px 18px;
  border-right: 1px solid var(--ss-line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-cell:last-child { border-right: none; }

.metric-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ss-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-value {
  font-family: var(--ss-mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ss-text-strong);
  margin-top: 2px;
}

.metric-foot {
  font-size: 11.5px;
  color: var(--ss-text-faint);
}

/* ========================================================================= */
/* STATUS PILLS (Explicit Text + Dot per DESIGN-OVERVIEW-001 & Stageshow)    */
/* ========================================================================= */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: var(--ss-radius-pill);
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  background: currentColor;
}

.st-DANG_THUE, .st-DA_THU_DU, .st-HIEU_LUC, .st-DA_GAN {
  background: var(--ss-success-soft);
  color: var(--ss-success-text);
}
.st-TRONG, .st-NHAP {
  background: var(--ss-ink-2);
  color: var(--ss-text);
}
.st-DA_DAT_COC, .st-THU_MOT_PHAN, .st-SAP_HET_HAN, .st-CHO_KHOP, .st-DA_CHOT {
  background: var(--ss-warning-soft);
  color: var(--ss-warning-text);
}
.st-DANG_DON, .st-QUA_HAN, .st-DA_KET_THUC, .st-BO_QUA {
  background: var(--ss-danger-soft);
  color: var(--ss-danger-text);
}

/* ========================================================================= */
/* ROOM CARDS & WINDOWS                                                      */
/* ========================================================================= */
.toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.room-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.room-tile {
  background: var(--ss-surface);
  border-radius: var(--ss-radius-lg);
  box-shadow: var(--ss-shadow-window);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s var(--ss-ease), box-shadow 0.2s var(--ss-ease);
}
.room-tile:hover {
  box-shadow: var(--ss-shadow-float);
}

.room-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.room-id-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-number {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ss-text-strong);
}

.code-chip {
  font-family: var(--ss-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ss-accent-text);
  background: var(--ss-accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
}

.room-specs {
  background: var(--ss-well);
  border-radius: var(--ss-radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.spec-label { color: var(--ss-text); }
.spec-val {
  font-weight: 600;
  color: var(--ss-text-strong);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.spec-val.mono { font-family: var(--ss-mono); }

.room-tile-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 2px;
}

/* ========================================================================= */
/* PRODUCT WINDOWS & DATA TABLES                                             */
/* ========================================================================= */
.ss-window-card {
  background: var(--ss-surface);
  border-radius: var(--ss-radius-lg);
  box-shadow: var(--ss-shadow-window);
  overflow: hidden;
}

.ss-window-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--ss-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ss-window-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ss-text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ss-window-sub {
  font-size: 12px;
  color: var(--ss-text);
  margin-top: 2px;
}

.ss-window-body {
  padding: 16px 18px;
}

table.ss-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.ss-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--ss-well);
  border-bottom: 1px solid var(--ss-line);
  color: var(--ss-text);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table.ss-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ss-line-faint);
  vertical-align: middle;
}

table.ss-table tr:last-child td { border-bottom: none; }
table.ss-table tr:hover td { background: var(--ss-ink-1); }

.num-col {
  text-align: right !important;
  font-family: var(--ss-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ========================================================================= */
/* ZALO LIVE MESSENGER WORKSPACE (iOS / macOS Messages Fidelity)             */
/* ========================================================================= */
.inbox-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr 300px;
  background: var(--ss-surface);
  overflow: hidden;
}

@media (max-width: 1024px) {
  .inbox-workspace { grid-template-columns: 280px 1fr; }
  .inbox-inspector { display: none !important; }
}

.inbox-sidebar {
  background: var(--ss-well);
  border-right: 1px solid var(--ss-line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inbox-sidebar-top {
  padding: 12px;
  border-bottom: 1px solid var(--ss-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label-scroll {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.label-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--ss-radius-pill);
  background: var(--ss-surface);
  color: var(--ss-text);
  box-shadow: var(--ss-shadow-card);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.label-chip.active {
  background: var(--ss-text-strong);
  color: var(--ss-surface);
}

.thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.thread-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--ss-radius-md);
  cursor: pointer;
  transition: background 0.12s;
}
.thread-row:hover { background: var(--ss-ink-1); }
.thread-row.active {
  background: var(--ss-surface);
  box-shadow: var(--ss-shadow-card);
}

.ss-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ss-fill);
  color: var(--ss-text-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  object-fit: cover;
}

.thread-meta { flex: 1; min-width: 0; }
.thread-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.thread-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ss-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-time {
  font-family: var(--ss-mono);
  font-size: 10.5px;
  color: var(--ss-text-faint);
  flex-shrink: 0;
}
.thread-snippet {
  font-size: 12px;
  color: var(--ss-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.mini-label-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
  margin-top: 3px;
  color: #fff;
}

/* Center Chat Thread */
.inbox-center {
  display: flex;
  flex-direction: column;
  background: var(--ss-surface);
  overflow: hidden;
}

.inbox-header {
  height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--ss-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.inbox-messages {
  flex: 1;
  padding: 18px 22px;
  overflow-y: auto;
  background: var(--ss-canvas);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg-bubble {
  max-width: 68%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  background: var(--ss-surface);
  color: var(--ss-text-strong);
  box-shadow: var(--ss-shadow-card);
  align-self: flex-start;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-bubble.me {
  background: var(--ss-zalo);
  color: #ffffff;
  box-shadow: none;
  align-self: flex-end;
}

.msg-meta {
  font-family: var(--ss-mono);
  font-size: 10.5px;
  opacity: 0.68;
  margin-top: 4px;
}

.msg-img {
  max-width: 260px;
  max-height: 260px;
  border-radius: 9px;
  display: block;
  margin-bottom: 5px;
  cursor: zoom-in;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.msg-sticker {
  width: 104px;
  height: 104px;
  object-fit: contain;
  display: block;
  margin-bottom: 4px;
}

.msg-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--ss-ink-2);
  color: inherit;
  text-decoration: none;
  font-size: 12px;
  margin-bottom: 4px;
}

.quick-bar {
  padding: 8px 16px;
  background: var(--ss-surface);
  border-top: 1px solid var(--ss-line);
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.tpl-pill {
  font-size: 11.5px;
  font-weight: 500;
  background: var(--ss-well);
  color: var(--ss-text);
  padding: 4px 10px;
  border-radius: var(--ss-radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tpl-pill:hover {
  background: var(--ss-ink-3);
  color: var(--ss-text-strong);
}

.composer-bar {
  padding: 12px 16px;
  background: var(--ss-surface);
  border-top: 1px solid var(--ss-line);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.composer-bar textarea {
  flex: 1;
  height: 52px;
  resize: none;
  background: var(--ss-well);
  color: var(--ss-text-strong);
  border: none;
  box-shadow: inset 0 0 0 1px var(--ss-line);
  border-radius: var(--ss-radius-md);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}
.composer-bar textarea:focus {
  background: var(--ss-surface);
  box-shadow: 0 0 0 2px var(--ss-zalo);
}

.inbox-inspector {
  background: var(--ss-well);
  border-left: 1px solid var(--ss-line);
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Modals & Receipt Sheet (Stageshow Document / Receipt Geometry) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 13, 16, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal-sheet {
  background: var(--ss-surface);
  border-radius: var(--ss-radius-window);
  box-shadow: var(--ss-shadow-hero);
  width: 100%;
  max-width: 540px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ss-text);
}

/* Physical Receipt Card for Invoice Preview (SCREEN-012) */
.ss-receipt-paper {
  background: #ffffff;
  color: #18181b;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.88);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 80dvh;
  border-radius: 10px;
  box-shadow: var(--ss-shadow-hero);
  object-fit: contain;
}

.ss-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ss-text-strong);
  color: var(--ss-surface);
  padding: 10px 15px;
  border-radius: var(--ss-radius-md);
  box-shadow: var(--ss-shadow-float);
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  display: none;
}

/* ========================================================================= */
/* ROOM ZALO CONTACT STRIP & QUICK CONTACT                                   */
/* ========================================================================= */
.room-zalo-box {
  background: var(--ss-surface);
  border-radius: var(--ss-radius-md);
  box-shadow: inset 0 0 0 1px var(--ss-line);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.room-zalo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.room-zalo-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ss-text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.room-zalo-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.room-zalo-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--ss-well);
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.room-zalo-user {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ss-zalo-soft);
  color: var(--ss-zalo);
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}

.room-zalo-name {
  font-weight: 600;
  color: var(--ss-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-zalo-role {
  font-size: 10.5px;
  color: var(--ss-text);
  background: var(--ss-surface);
  padding: 1px 5px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--ss-line);
  white-space: nowrap;
}

.room-zalo-btns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-xs {
  height: 23px;
  padding: 0 7px;
  font-size: 11px;
  border-radius: 5px;
}

/* Searchable Zalo Contact Picker in Modal */
.picker-list {
  max-height: 230px;
  overflow-y: auto;
  background: var(--ss-well);
  border-radius: var(--ss-radius-md);
  box-shadow: inset 0 0 0 1px var(--ss-line);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--ss-surface);
  box-shadow: var(--ss-shadow-card);
}

/* ========================================================================= */
/* ZALO TRANSFER RECEIPT IMAGE SCANNER & USER CONFIRMATION                   */
/* ========================================================================= */
.receipt-scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.receipt-scan-card {
  background: var(--ss-surface);
  border-radius: var(--ss-radius-lg);
  box-shadow: var(--ss-shadow-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-scan-top {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: start;
}

.receipt-thumb-wrap {
  position: relative;
  width: 112px;
  height: 148px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ss-well);
  box-shadow: 0 0 0 1px var(--ss-line);
  cursor: zoom-in;
}

.receipt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s var(--ss-ease);
}

.receipt-thumb-wrap:hover .receipt-thumb {
  transform: scale(1.04);
}

.receipt-zoom-tag {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(15, 16, 18, 0.76);
  color: #fff;
  font-size: 10px;
  font-family: var(--ss-mono);
  padding: 2px 6px;
  border-radius: 4px;
}

.time-evidence-box {
  background: var(--ss-well);
  border-radius: var(--ss-radius-md);
  padding: 8px 10px;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 0 0 1px var(--ss-line);
}

.confirm-action-box {
  background: var(--ss-canvas);
  border-radius: var(--ss-radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 0 0 1px var(--ss-line);
}
