/* =====================================================================
   Metta Speech — GO-LIVE UI LAYER  (v1.0, 22/10/2026)
   ---------------------------------------------------------------------
   Nạp SAU app.css, cùng thư mục:
     <link rel="stylesheet" href="assets/app.css">
     <link rel="stylesheet" href="assets/golive.css">
   - Dùng lại tên class có sẵn của app (.sidebar, .nav-link, .card, .btn,
     .stat, .badge, .plan-card, .seg, .tabs-inline, .dropzone ...).
   - Class MỚI đều có tiền tố rõ ràng và được liệt kê trong UI_SPEC.md §4.
   - Mọi màu đi qua biến CSS → chế độ tối vẫn hoạt động.
   - Không gọi tài nguyên ngoài (CSP font-src 'self'): font tự host.
   ===================================================================== */

/* ---------------------------------------------------------------- 1. FONT
   Font đã kèm sẵn trong assets/fonts/ (Plus Jakarta Sans + JetBrains Mono, OFL,
   subset vietnamese + latin). Chép cả thư mục vào cạnh app.css.             */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plus-jakarta-sans-vietnamese-400.woff) format("woff"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/plus-jakarta-sans-vietnamese-500.woff) format("woff"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/plus-jakarta-sans-vietnamese-600.woff) format("woff"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/plus-jakarta-sans-vietnamese-700.woff) format("woff"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-400.woff) format("woff"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-500.woff) format("woff"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-600.woff) format("woff"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-700.woff) format("woff"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-vietnamese-500.woff) format("woff"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-latin-500.woff) format("woff"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------------------------------------------------------------- 2. TOKENS (light) */
:root {
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #F5F7FB;
  --surface-3: #E3E8F0;
  --border: #E3E8F0;
  --border-strong: #CBD5E3;
  --row-line: #EEF2F7;         /* đường kẻ giữa các dòng trong thẻ */
  --row-hover: #F8FAFD;
  --text: #0F172A;
  --text-2: #334155;
  --text-3: #5B6B82;           /* 5,4:1 trên trắng */
  --accent: #1559B8;           /* 6,3:1 với chữ trắng */
  --accent-hover: #0E3F86;
  --accent-soft: #EEF4FD;
  --accent-text: #1559B8;
  --accent-dash: #9CB8E0;      /* viền đứt nét vùng kéo thả */
  --on-accent: #FFFFFF;
  --ok: #0F7A4A;   --ok-soft: #E6F6EE;   --ok-border: #B7E4CB;
  --warn: #9A5B00; --warn-soft: #FFF4E0; --warn-border: #F5D9A8; --warn-ink: #6B4100;
  --err: #B42318;  --err-soft: #FDECEA;  --err-border: #F3C4BE; --err-ink: #7A1A12;
  --neutral-soft: #EEF0F4; --neutral-ink: #475569;
  --rec: #B42318;              /* nút ghi âm */

  --navy: #0A1A33;  --navy-2: #10264A;  --navy-3: #16305A;  --navy-line: #1E3A66;
  --navy-ink: #C9D6E8;  --navy-muted: #9FB3CF;  --navy-label: #8095B3;
  --cyan: #22C3E6;  --cyan-ink: #6FD6EE;  --mint: #7CE0B0;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px; --sp-10: 40px;
  --radius-sm: 8px; --radius: 10px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-sm: none;
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, .14);
  --shadow-feature: 0 8px 24px rgba(21, 89, 184, .12);
  --sidebar: 248px;
  --ctl-h: 42px;               /* chiều cao chuẩn nút + ô nhập trong app */
  --ctl-h-lg: 48px;            /* form đăng nhập/đăng ký */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --row-line: #16243C; --row-hover: #111E33; --accent-dash: #2A4A73;
    --warn-ink: #FDCB6E; --err-ink: #FDA29B; --neutral-soft: #192A46; --neutral-ink: #AEBDD2;
  }
}
:root[data-theme="dark"] {
  --row-line: #16243C; --row-hover: #111E33; --accent-dash: #2A4A73;
  --warn-ink: #FDCB6E; --err-ink: #FDA29B; --neutral-soft: #192A46; --neutral-ink: #AEBDD2;
}

/* ---------------------------------------------------------------- 3. BASE */
body { font: 14px/1.6 var(--font); background: var(--bg); color: var(--text); }
h1 { font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 15px; font-weight: 600; }
.num, .stat .value, td.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 4. SHELL */
@media (min-width: 901px) { .app { grid-template-columns: var(--sidebar) minmax(0, 1fr); } }

/* 4.1 Sidebar — navy phẳng, KHÔNG gradient */
.sidebar {
  background: var(--navy); border-right: 0; color: var(--navy-ink);
  padding: 20px 14px; gap: 0;
}
.sidebar .brand-mark { color: #FFFFFF; padding: 4px 8px; margin-bottom: 22px; font-size: 16px; }
.sidebar .brand-logo { width: 30px; height: 30px; border-radius: 8px; }
.sidebar .brand-name span { color: var(--navy-muted); font-weight: 400; }

/* Nút "Tải file lên" đầu thanh bên (MỚI) */
.sidebar-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--ctl-h); border-radius: var(--radius); margin: 0 0 22px;
  background: var(--cyan); color: var(--navy); font-weight: 600; font-size: 14px; border: 0; cursor: pointer;
}
.sidebar-cta:hover { background: #4ED0EC; text-decoration: none; }
.sidebar-cta svg.icon { width: 16px; height: 16px; stroke-width: 2.2; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar .nav-section {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--navy-label); padding: 0 12px 6px; margin-top: 20px;
}
.sidebar .nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: var(--navy-ink); font-weight: 500; font-size: 14px; line-height: 20px; background: none;
}
.sidebar .nav-link svg { color: currentColor; width: 18px; height: 18px; stroke-width: 2; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #FFFFFF; text-decoration: none; }
.sidebar .nav-link[aria-current="page"] { background: var(--navy-3); color: #FFFFFF; font-weight: 600; }
.sidebar .nav-link[aria-current="page"] svg { color: var(--cyan); }
.sidebar .nav-link[aria-current="page"]::before { display: none; }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 0; }
.sidebar .plan-box {
  background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: 12px;
  padding: 14px; margin: 0; display: grid; gap: 10px; color: #FFFFFF;
}
.plan-box .plan-org { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: #FFFFFF; min-width: 0; }
.plan-box .plan-tag { font-size: 11px; font-weight: 600; color: var(--navy); background: var(--mint); padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.plan-box .plan-balance { font-size: 12px; color: var(--navy-muted); }
.plan-box .plan-balance strong { color: #FFFFFF; font-weight: 600; }
.sidebar .plan-box .meter { height: 6px; margin: 0; background: var(--navy-line); }
.sidebar .plan-box .meter > div { background: var(--cyan); }
.sidebar .plan-box a { font-size: 13px; font-weight: 600; color: var(--cyan-ink); }
.sidebar .org-chip { display: none; } /* tên tổ chức đã nằm trong .plan-box */
.sidebar .legal-links { margin-top: 12px; padding: 0 4px; color: var(--navy-label); }
.sidebar .legal-links a { color: var(--navy-muted); }

/* 4.2 Appbar (desktop): ô tìm kiếm + công cụ */
.appbar { height: 64px; padding: 0 40px; gap: 12px; background: var(--bg); backdrop-filter: none; border-bottom: 0; }
.appbar-search { position: relative; width: min(360px, 100%); }
.appbar-search .input { height: 40px; min-height: 40px; padding-left: 38px; background: var(--surface); border-color: #D5DDE8; }
.appbar-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.avatar { width: 40px; height: 40px; background: #DCE8FA; color: var(--accent); font-weight: 700; font-size: 14px; }

/* 4.3 Vùng nội dung */
.content { padding: 8px 40px 48px; max-width: 1440px; }
.page-head { margin-bottom: 24px; align-items: flex-end; }
.page-head p { font-size: 14px; color: var(--text-3); margin-top: 4px; }
.stack-lg > * + * { margin-top: 24px; }

@media (max-width: 900px) {
  .appbar { height: 56px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .appbar-search { display: none; }
  .content { padding: 16px 16px 104px; }   /* chừa chỗ cho .bottom-nav */
  .sidebar { width: min(86vw, 300px); }
}

/* ---------------------------------------------------------------- 5. COMPONENTS */

/* 5.1 Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: none; }
.card-head { margin-bottom: 14px; }
.card-head h2 { font-size: 17px; font-weight: 600; }
.card-head a { font-size: 14px; font-weight: 600; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 18px 22px; margin: 0; border-bottom: 1px solid var(--row-line); }

/* 5.2 Buttons — cao 42px */
.btn {
  min-height: var(--ctl-h); padding: 10px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; line-height: 20px; box-shadow: none; background-image: none;
}
.btn.primary { background-image: none; box-shadow: none; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn.lg { min-height: var(--ctl-h-lg); padding: 13px 20px; font-size: 15px; }
.btn.icon-only { min-height: 40px; min-width: 40px; padding: 10px; }
.btn.cyan { --b-bg: var(--cyan); --b-fg: var(--navy); --b-bd: var(--cyan); font-weight: 700; }
.btn.cyan:hover:not(:disabled) { background: #4ED0EC; }
.btn.on-navy { --b-bg: transparent; --b-fg: #FFFFFF; --b-bd: #355583; }
.btn.on-navy:hover:not(:disabled) { background: rgba(255,255,255,.06); }

/* 5.3 Inputs — cao 42px */
.input, .select, .textarea { min-height: var(--ctl-h); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; }
.select, select.select { padding-right: 34px; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--text-2); }

/* 5.4 Badge — viên thuốc, không viền, không chấm (trừ đang xử lý) */
.badge { padding: 4px 10px; border: 0; font-size: 12px; font-weight: 600; line-height: 16px; gap: 6px; }
.badge::before { display: none; }
.badge.completed, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.processing { background: var(--accent-soft); color: var(--accent); }
.badge.processing::before { display: inline-block; width: 6px; height: 6px; }
.badge.queued { background: var(--warn-soft); color: var(--warn); }
.badge.failed, .badge.err { background: var(--err-soft); color: var(--err); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.neutral { background: var(--neutral-soft); color: var(--neutral-ink); }
.badge.solid { background: var(--accent); color: #FFFFFF; font-weight: 700; }

/* 5.5 Alert / banner trong trang */
.alert { border-radius: 12px; padding: 12px 16px; font-size: 14px; align-items: center; flex-wrap: wrap; }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn-ink); }
.alert.err  { background: var(--err-soft); border-color: var(--err-border); color: var(--err-ink); }
.alert.info { background: var(--accent-soft); border-color: transparent; color: var(--accent-hover); }
.alert .alert-tag { font-size: 12px; font-weight: 700; color: #FFFFFF; padding: 3px 8px; border-radius: 6px; background: var(--accent); flex: none; }
.alert .alert-body { flex: 1; min-width: 220px; color: inherit; }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }

/* 5.6 Meter */
.meter { height: 8px; background: var(--surface-3); }
.meter.thin { height: 6px; }
.meter > div { background: var(--accent); }

/* 5.7 KPI (.stat.kpi) */
.stat { border-radius: var(--radius-lg); padding: 20px; box-shadow: none; display: flex; flex-direction: column; gap: 8px; }
.stat .label { font-size: 13px; font-weight: 600; color: var(--text-3); gap: 8px; }
.stat .label .ico { display: none; }
.stat .value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.stat .value small { font-size: 15px; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.stat .sub, .stat .kpi-delta { font-size: 13px; color: var(--text-3); margin: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* 5.8 Tabs gạch chân có đếm */
.tabs-inline { gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 0; flex-wrap: wrap; }
.tabs-inline button { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--neutral-ink); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-inline button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tabs-inline .count { color: var(--text-3); font-weight: 500; margin-left: 4px; }
.tabs-inline .count.run { color: var(--accent); }
.tabs-inline .count.err { color: var(--err); }

/* 5.9 Segmented (tab dạng nút trong khung xám) */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--neutral-soft); border: 1px solid var(--border); border-radius: 12px; }
.segmented button { height: 44px; border: 0; border-radius: 9px; background: transparent; font: 500 15px var(--font); color: var(--neutral-ink); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }

/* 5.10 Bảng */
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap th {
  text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-3); padding: 12px 8px; background: var(--surface); border-bottom: 0; white-space: nowrap;
}
.table-wrap td { padding: 14px 8px; border-top: 1px solid var(--row-line); color: var(--text-2); vertical-align: middle; }
.table-wrap th:first-child, .table-wrap td:first-child { padding-left: 20px; }
.table-wrap th:last-child, .table-wrap td:last-child { padding-right: 20px; }
.table-wrap tr.clickable { cursor: pointer; }
.table-wrap tr.clickable:hover td { background: var(--row-hover); }
.table-wrap tr.is-selected td { background: #F2F7FE; }
.table-wrap tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table-wrap tr.is-muted td { opacity: .7; }
.cell-title { display: block; font-weight: 600; color: var(--text); }
.cell-sub { display: block; font-size: 13px; color: var(--text-3); }
td.actions { text-align: right; white-space: nowrap; }
td.actions a, td.actions .link-btn { font-size: 13px; font-weight: 600; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--row-line); font-size: 13px; color: var(--text-3); }

/* 5.11 Toolbar lọc phía trên bảng */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-bar .input-icon { flex: 1 1 320px; }
.filter-bar .select { width: auto; }

/* ---------------------------------------------------------------- 6. MÀN TỔNG QUAN */
.quick-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.dropzone.hero {
  flex: 2 1 420px; display: flex; align-items: center; gap: 20px; text-align: left;
  padding: 28px; border: 2px dashed var(--accent-dash); border-radius: var(--radius-lg); background: var(--surface);
}
.dropzone.hero .dz-icon { width: 56px; height: 56px; margin: 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent); box-shadow: none; flex: none; }
.dropzone.hero .dz-text { flex: 1; min-width: 200px; }
.dropzone.hero strong { font-size: 17px; font-weight: 600; color: var(--text); }
.dropzone.hero .dz-sub { font-size: 14px; color: var(--text-3); margin-top: 4px; }
.action-card {
  flex: 1 1 200px; display: flex; flex-direction: column; gap: 10px; padding: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text);
}
.action-card:hover { border-color: var(--accent-dash); text-decoration: none; }
.action-card strong { font-size: 16px; font-weight: 600; }
.action-card span { font-size: 13px; color: var(--text-3); }
.action-card svg.icon { width: 24px; height: 24px; }
.action-card.rec svg.icon { color: var(--rec); }
.action-card.tts svg.icon { color: #0E7490; }

.job-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 22px; }
.job-card .job-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.2s ease-in-out infinite; }
.job-card .job-main { flex: 1; min-width: 240px; }
.job-card .job-title { font-size: 15px; font-weight: 600; }
.job-card .job-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.job-card .job-progress { flex: 0 1 240px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.job-card .job-progress .meter { flex: 1; }

.dash-bottom { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.dash-bottom > .dash-list { flex: 999 1 520px; min-width: 0; }
.dash-bottom > .dash-side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; }

.item-row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--row-line); color: var(--text); }
.item-row:last-child { border-bottom: 0; }
.item-row:hover { background: var(--row-hover); text-decoration: none; }
.item-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.item-ico.rec { background: var(--err-soft); color: var(--rec); }
.item-main { flex: 1; min-width: 0; }
.item-title, .item-sub { display: block; }
.item-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 13px; color: var(--text-3); }

.mini-bars { height: 120px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--border); }
.mini-bars > i { flex: 1; min-height: 2px; background: var(--accent); border-radius: 3px 3px 0 0; }
.mini-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: 8px; }

.setup-list { display: grid; gap: 12px; }
.setup-list a { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text); }
.setup-list .ring { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--accent-dash); flex: none; }

/* ---------------------------------------------------------------- 7. MÀN DANH SÁCH */
.tx-name { display: flex; flex-direction: column; gap: 2px; }

/* ---------------------------------------------------------------- 8. MÀN CHI TIẾT */
.detail-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 32px; margin: -8px -40px 24px; }
.detail-head .back { width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid #D5DDE8; display: grid; place-items: center; color: var(--text-2); flex: none; }
@media (max-width: 900px) { .detail-head { margin: -16px -16px 16px; padding: 12px 16px; } .detail-title h1 { font-size: 19px; white-space: normal; } }
.row.nowrap-row { flex-wrap: nowrap; }
.detail-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.detail-title h1 { font-size: 22px; }
.detail-meta { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; display: grid; }
.menu-pop a { padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.menu-pop a:hover { background: var(--row-hover); text-decoration: none; }
.menu-pop a strong { display: block; font-weight: 600; }
.menu-pop a span { display: block; font-size: 12px; color: var(--text-3); }

.editor-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; grid-template-columns: none; }
.editor-layout > .editor-main { flex: 999 1 600px; min-width: 0; }
.editor-layout > .side-col { flex: 1 1 340px; display: flex; flex-direction: column; gap: 16px; position: static; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--row-line); background: var(--surface); }
.editor-toolbar .input-icon { flex: 1 1 260px; }
.editor-toolbar .input { min-height: 38px; height: 38px; }
.speaker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.speaker-chip { padding: 6px 10px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; border: 0; cursor: pointer; }
.spk-1 { --spk: #1559B8; --spk-bg: #EEF4FD; }
.spk-2 { --spk: #A1430B; --spk-bg: #FFF1E6; }
.spk-3 { --spk: #475569; --spk-bg: #EEF0F4; }
.spk-4 { --spk: #0E7490; --spk-bg: #E3F6FA; }
.speaker-chip { color: var(--spk); background: var(--spk-bg); }

.segments { padding: 8px 0; }
.seg { grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 14px 24px; border-radius: 0; border-left: 0; }
.seg:hover { background: var(--row-hover); }
.seg.active { background: #F2F7FE; box-shadow: inset 3px 0 0 var(--accent); }
.seg .seg-who { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.seg .spk-name { font-size: 14px; font-weight: 600; color: var(--spk, var(--text)); background: none; border: 0; padding: 0; cursor: pointer; }
.seg .ts { font-family: var(--mono); font-size: 12px; color: var(--text-3); padding: 0; border: 0; background: none; cursor: pointer; }
.seg .ts:hover { color: var(--accent); background: none; }
.seg textarea { font-size: 16px; line-height: 1.7; color: var(--text); padding: 0 6px; }
@media (max-width: 900px) {
  .seg { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 16px; }
  .seg .seg-who { flex-direction: row; gap: 10px; align-items: baseline; }
  .seg textarea { font-size: 15px; padding: 0; }
  .editor-toolbar { padding: 12px 16px; }
  .player { padding: 10px 12px; gap: 10px; }
  .player .wave { display: none; }
}

.player { position: sticky; bottom: 0; margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none;
  background: #FAFBFD; padding: 12px 20px; gap: 14px; }
.player .play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--accent); color: #FFFFFF; display: grid; place-items: center; cursor: pointer; flex: none; }
.player .time { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.player .wave { flex: 1 1 240px; height: 32px; display: flex; align-items: center; gap: 2px; }
.player .wave > i { flex: 1; border-radius: 2px; background: #C7D3E3; }
.player .wave > i.played { background: var(--accent); }

.side-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--row-line); }
.side-tabs button { height: 46px; border: 0; border-bottom: 2px solid transparent; background: var(--surface); font: 500 14px var(--font); color: var(--neutral-ink); cursor: pointer; }
.side-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
.summary { padding: 20px; display: grid; gap: 18px; }
.summary h3 { font-size: 15px; margin: 0 0 8px; }
.summary p, .summary li { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.summary ul { margin: 0; padding-left: 18px; }
.kv-grid { margin: 0; padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; font-size: 14px; }
.kv-grid dt { color: var(--text-3); }
.kv-grid dd { margin: 0; font-weight: 600; }

/* ---------------------------------------------------------------- 9. MÀN THANH TOÁN */
.billing-top { display: flex; flex-wrap: wrap; gap: 16px; }
.balance-hero {
  flex: 2 1 420px; background: var(--navy); color: #E6EDF7; border-radius: var(--radius-lg); padding: 24px 28px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.balance-hero .bh-label { font-size: 13px; color: var(--navy-muted); }
.balance-hero .bh-value { font-size: 40px; font-weight: 700; color: #FFFFFF; letter-spacing: -0.02em; line-height: 1.2; }
.balance-hero .bh-value small { font-size: 18px; font-weight: 500; color: var(--navy-muted); }
.balance-hero .bh-sub { font-size: 14px; color: #B7C6DB; }
.contact-card { flex: 1 1 260px; display: grid; gap: 8px; align-content: center; }
.contact-card .cc-label { font-size: 13px; font-weight: 600; color: var(--text-3); }
.contact-card .cc-phone { font-size: 18px; font-weight: 700; }
.contact-card .cc-sub { font-size: 14px; color: var(--text-3); }

.plans { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.plan-card { border-radius: var(--radius-lg); padding: 22px; gap: 14px; box-shadow: none; transform: none; transition: none; }
.plan-card:hover { transform: none; box-shadow: none; }
.plan-card.current { border-color: var(--border); box-shadow: none; }
.plan-card.featured { border: 2px solid var(--accent); box-shadow: var(--shadow-feature); padding: 21px; }
.plan-card h3 { font-size: 17px; font-weight: 700; }
.plan-card .plan-who { font-size: 13px; color: var(--text-3); }
.plan-card .price { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.plan-card .price small { display: none; }
.plan-card .plan-minutes { font-size: 15px; font-weight: 600; }
.plan-card .plan-rate { font-size: 13px; font-weight: 600; color: var(--ok); }
.plan-card .price-sub { display: none; }       /* thay bằng .plan-minutes + .plan-rate */
.plan-card ul { border-top: 1px solid var(--row-line); padding-top: 14px; gap: 8px; font-size: 14px; color: var(--text-2); }
.plan-card li .i { color: var(--accent); }
.plan-card .btn { margin-top: auto; width: 100%; }
.plan-card .plan-flag { align-self: flex-start; }

/* ---------------------------------------------------------------- 10. ĐĂNG NHẬP / ĐĂNG KÝ */
.auth-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth-aside { background: var(--navy); color: #E6EDF7; padding: 48px 56px; gap: 48px; }
.auth-aside h2 { font-size: 40px; line-height: 1.2; font-weight: 700; color: #FFFFFF; letter-spacing: -0.02em; max-width: 520px; }
.auth-aside .auth-lead { font-size: 17px; line-height: 1.6; color: #B7C6DB; max-width: 520px; margin-top: 28px; }
.auth-sample { margin-top: 28px; max-width: 520px; background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: 14px; padding: 20px; display: grid; gap: 12px; }
.auth-sample .as-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--navy-muted); }
.auth-sample .as-ok { font-size: 12px; font-weight: 600; color: var(--mint); }
.auth-sample .as-line { display: flex; gap: 12px; font-size: 14px; line-height: 1.5; color: #E6EDF7; }
.auth-sample .as-line .ts { font-family: var(--mono); color: var(--cyan-ink); }
.auth-sample .as-line strong { color: #FFFFFF; }
.auth-points { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; color: #B7C6DB; margin-top: 28px; }
.auth-foot { font-size: 13px; color: var(--navy-label); }
.auth-main { padding: 48px 24px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 24px; }
.auth-card h1 { font-size: 28px; margin: 0; }
.auth-card .auth-sub { font-size: 15px; color: var(--text-3); margin-top: 6px; }
.auth-card .input { min-height: var(--ctl-h-lg); font-size: 15px; padding: 12px 14px; }
.auth-card .btn.primary { min-height: var(--ctl-h-lg); font-size: 15px; width: 100%; }
.btn.oauth { min-height: var(--ctl-h-lg); width: 100%; font-size: 15px; }
.or-line { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-3); }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.kind-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kind-pick button { text-align: left; display: grid; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; color: var(--text); cursor: pointer; }
.kind-pick button strong { font-size: 15px; }
.kind-pick button span { font-size: 13px; color: var(--text-3); }
.kind-pick button[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); padding: 13px; }
.auth-legal { font-size: 13px; line-height: 1.5; color: var(--text-3); }
@media (max-width: 860px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: flex; padding: 24px 20px; gap: 16px; }          /* KHÔNG ẩn: thu gọn */
  .auth-aside h2 { font-size: 24px; }
  .auth-aside .auth-lead, .auth-sample, .auth-points, .auth-foot { display: none; }
}

/* ---------------------------------------------------------------- 11. MOBILE (≤ 600px) */
.bottom-nav, .fab-rec { display: none; }
@media (max-width: 900px) {
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    height: 76px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--text-3); }
  .bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .bottom-nav svg.icon { width: 22px; height: 22px; stroke-width: 2; }
  .fab-rec { display: grid; place-items: center; position: fixed; right: 16px; bottom: 92px; z-index: 26; width: 60px; height: 60px; border-radius: 50%;
    background: var(--rec); color: #FFFFFF; box-shadow: 0 10px 24px rgba(180, 35, 24, .35); }
  .fab-rec svg.icon { width: 24px; height: 24px; stroke-width: 2.2; }
  .quick-actions .action-card { display: none; }       /* đã có FAB + bottom nav */
  .dropzone.hero { padding: 20px; flex-wrap: wrap; gap: 16px; flex-basis: 100%; }
  .dropzone.hero .dz-icon { width: 44px; height: 44px; }
  .dropzone.hero .dz-text { min-width: 0; flex: 1 1 200px; }
  .dropzone.hero strong { font-size: 16px; }
  .dropzone.hero .btn { width: 100%; }
}
@media (max-width: 600px) {
  /* Danh sách bản chép lời: bảng → thẻ, KHÔNG cần đổi JS */
  .tx-table thead { display: none; }
  .tx-table, .tx-table tbody { display: block; }
  .tx-table tr { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: start;
    margin: 0 0 10px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
  .tx-table td { display: block; padding: 0 !important; border: 0; background: none !important; }
  .tx-table td.check, .tx-table td.col-speakers, .tx-table td.col-created, .tx-table td.actions { display: none; }
  .tx-table td.col-icon { grid-row: 1 / span 3; }
  .tx-table td.col-name, .tx-table td.col-meta, .tx-table td.col-status { grid-column: 2; }
  .tx-table td.col-duration { display: none; }
  .tx-table .cell-title { white-space: normal; line-height: 1.35; font-size: 15px; }
  .card.tx-card { background: none; border: 0; padding: 0; overflow: visible; }
  .card.tx-card .pager { border: 0; padding: 4px 0; }
  .filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
  .tabs-inline.as-chips { border: 0; gap: 8px; flex-wrap: nowrap; overflow-x: auto; }
  .tabs-inline.as-chips button { height: 34px; padding: 0 14px; border: 1px solid #D5DDE8; border-radius: var(--radius-pill); background: var(--surface); white-space: nowrap; font-size: 13px; margin: 0; }
  .tabs-inline.as-chips button[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
  .tabs-inline.as-chips button[aria-selected="true"] .count { color: #C9D6E8; }
  .page-head .head-actions .btn:not(.primary) { display: none; }
  .filter-bar label.select-wrap { display: none; }
  h1 { font-size: 22px; }
}
@media (min-width: 601px) { .tx-table .col-meta, .tx-table .col-icon { display: none; } }

/* ---------------------------------------------------------------- 12. ADMIN */
.app.admin .sidebar { background: var(--surface); border-right: 1px solid var(--border); color: var(--text-2); }
.app.admin .sidebar .brand-mark { color: var(--text); }
.app.admin .brand-sub { display: block; font-size: 12px; font-weight: 600; color: #A1430B; }
.app.admin .sidebar .nav-section { color: var(--text-3); }
.app.admin .sidebar .nav-link { color: var(--text-2); }
.app.admin .sidebar .nav-link:hover { background: var(--surface-2); color: var(--text); }
.app.admin .sidebar .nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.app.admin .sidebar .nav-link[aria-current="page"] svg { color: var(--accent); }
.app.admin .content { background: none; }
.attention { display: grid; gap: 12px; }
.attention h2 { font-size: 16px; font-weight: 700; }
.attention .alert { margin: 0; }
.alert.err .alert-tag { background: var(--err); }
.alert.warn .alert-tag { background: var(--warn); }
.alert.info .alert-tag { background: var(--accent); }
.health-list { display: grid; gap: 12px; }
.health-list .h-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.health-list .h-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.health-list .h-dot.warn { background: var(--warn); }
.health-list .h-dot.err { background: var(--err); }
.health-list .h-state { margin-left: auto; font-size: 13px; color: var(--text-3); }
.tag-internal { font-size: 11px; font-weight: 700; color: var(--neutral-ink); background: var(--neutral-soft); padding: 2px 8px; border-radius: 6px; }
.org-panel { display: grid; gap: 16px; }
.org-panel[hidden] { display: none; } /* empty until an organization is picked */
.org-panel .op-eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.org-panel .op-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.org-panel .op-quick > div { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.org-panel .op-quick span { display: block; font-size: 12px; color: var(--text-3); }
.org-panel .op-quick strong { font-size: 18px; }
.org-panel section { border-top: 1px solid var(--row-line); padding-top: 16px; display: grid; gap: 10px; }
.audit-item { font-size: 13px; color: var(--text-2); }
.audit-item time { display: block; color: var(--text-3); }
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .split-main { flex: 999 1 560px; min-width: 0; }
.split > .split-side { flex: 1 1 320px; }

/* ---------------------------------------------------------------- 13. GHI ĐÈ CUỐI CHO MOBILE (đặt cuối file để thắng thứ tự) */
@media (max-width: 900px) {
  .player .wave { display: none; }
  .player { position: sticky; bottom: 76px; }      /* nằm trên .bottom-nav */
  .menu-pop { right: auto; left: 0; }
}

/* ---------------------------------------------------------------- 14. DARK FIXES (added in the app, 23/10/2026)
   golive.css v1.0 hard-codes a few light backgrounds; in dark mode they were white glare (UI_SPEC §6). */
:root[data-theme="dark"] .player { background: var(--surface-2); }
:root[data-theme="dark"] .seg.active,
:root[data-theme="dark"] .table-wrap tr.is-selected td { background: var(--accent-soft); }
:root[data-theme="dark"] .avatar { background: var(--surface-3); color: var(--text); }
:root[data-theme="dark"] .appbar-search .input,
:root[data-theme="dark"] .detail-head .back,
:root[data-theme="dark"] .tabs-inline.as-chips button { border-color: var(--border); }

/* Gói & thanh toán: switch between the two services (icon cards) */
.svc-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.svc-switch button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border-radius: var(--radius-lg);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.svc-switch button:hover { border-color: var(--accent); }
.svc-switch button[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.svc-switch .svc-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--text-2); }
.svc-switch button[aria-selected="true"] .svc-ic { background: var(--accent); color: #fff; }
.svc-switch .svc-txt { display: grid; gap: 2px; min-width: 0; }
.svc-switch strong { font-size: 15px; font-weight: 600; }
.svc-switch small { font-size: 13px; color: var(--text-3); }

/* "Đọc văn bản": "Nghe thử" next to the voice picker; voice sample recorded in the browser */
.voice-pick { display: flex; gap: 8px; align-items: stretch; }
.voice-pick .select { flex: 1; min-width: 0; }
.voice-pick .btn { flex: none; }
.voice-src { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.voice-src button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.voice-src button:hover { color: var(--text); }
.voice-src button.on { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.voice-rec { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.voice-upload { margin: 10px 0 0; }
.voice-rec[hidden], .voice-upload[hidden] { display: none; }
.voice-rec-prompt { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 15px; line-height: 1.6; }
.voice-rec-player { width: 100%; height: 40px; }
.voice-rec-player[hidden] { display: none; }
.voice-rec-clock { font-size: 14px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.voice-rec-clock.live { color: var(--err); }
.voice-rec-clock.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--err); animation: pulse 1.2s ease-in-out infinite; }
@media (max-width: 480px) { .voice-pick { flex-wrap: wrap; } .voice-pick .btn { width: 100%; justify-content: center; } }
