/* VN-ONE admin. One complete stylesheet for the light interface. */
:root {
  color-scheme: light;
  --bg-app: #fff;
  --bg-surface: #fff;
  --bg-subtle: #f3f6fa;
  --bg-hover: #f8fafc;
  --border-light: #edf1f6;
  --border-subtle: #e3e9f1;
  --border-strong: #cbd5e1;
  --text-main: #182230;
  --text-body: #334155;
  --text-muted: #718198;
  --text-hint: #94a3b8;
  --primary: #334155;
  --primary-hover: #1e293b;
  --primary-subtle: #f2f5f9;
  --primary-border: #cbd5e1;
  --success: #22c55e;
  --success-bg: #effbf4;
  --success-border: #bbf7d0;
  --success-text: #15803d;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #a16207;
  --danger: #ef4444;
  --danger-bg: #fff1f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;
  --radius-sm: 4px;
  --radius-md: 5px;
  --radius-lg: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #fff; scrollbar-gutter: stable; scroll-padding-top: 76px; }
body { margin: 0; background: #fff; color: var(--text-body); font: 13px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
input, select, textarea { min-width: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid #64748b; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 10px 16px; background: #fff; border: 1px solid var(--border-subtle); border-radius: 5px; }
.skip-link:focus { top: 12px; }

/* The sidebar and working area always share the same white surface. */
.admin-shell { display: flex; width: 100%; min-height: 100dvh; background: #fff; }
.sidebar { position: sticky; top: 0; z-index: 40; display: flex; flex: 0 0 auto; flex-direction: column; width: 240px; height: 100dvh; background: #fff; color: #334155; border-right: 1px solid var(--border-subtle); transition: width .18s ease, transform .18s ease; }
.sidebar-header { display: flex; align-items: center; flex-shrink: 0; height: 60px; padding: 0 22px; border-bottom: 1px solid var(--border-light); }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-slash { color: #334155; font-size: 25px; line-height: 1; font-weight: 500; letter-spacing: -3px; transform: skew(-12deg); }
.brand-title { color: #263244; font-size: 14px; font-weight: 650; }
.nav { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 23px; overflow-y: auto; overflow-x: hidden; padding: 22px 12px; scrollbar-width: thin; scrollbar-color: #d4dce7 transparent; }
.nav-group-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 11px; color: #475569; font-size: 11px; font-weight: 600; }
.nav-chevron { color: #94a3b8; font-size: 12px; }
.nav-group-body { display: flex; flex-direction: column; gap: 3px; margin-left: 13px; border-left: 1px solid #bbc7d7; }
.nav-item { position: relative; display: flex; align-items: center; gap: 9px; width: 100%; min-height: 39px; padding: 9px 9px 9px 11px; border-radius: 0 4px 4px 0; color: #475569; text-align: left; font-size: 12px; font-weight: 500; transition: background .12s ease; }
.nav-item:hover { background: #f8fafc; color: #182230; }
.nav-item.active { color: #263244; background: #f1f5f9; }
.nav-item.active::before { content: ''; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: #718198; }
.nav-icon { display: inline-flex; justify-content: center; align-items: center; flex: 0 0 17px; color: #475569; }
.nav-icon svg { width: 16px; height: 16px; }
.nav-text { flex: 1; min-width: 0; white-space: nowrap; }
.nav-badge { flex-shrink: 0; min-width: 17px; padding: 0 4px; border-radius: 6px; color: #718198; background: #edf2f7; font-size: 10px; font-weight: 600; text-align: center; }
.sidebar-footer { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; padding: 14px 20px; border-top: 1px solid var(--border-light); }
.panel-version { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.pulse-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.store-link { align-self: flex-start; font-size: 11px; color: #64748b; }
.store-link:hover { text-decoration: underline; }
.sidebar-edge-toggle { position: absolute; top: 50%; right: -14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-subtle); color: #718198; background: #fff; font-size: 18px; }
.sidebar-edge-toggle:hover { background: #f8fafc; }
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .brand-title, .sidebar.collapsed .nav-group-header, .sidebar.collapsed .nav-text, .sidebar.collapsed .nav-badge, .sidebar.collapsed .sidebar-footer { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 0; }
.sidebar.collapsed .nav { padding-inline: 10px; }
.sidebar.collapsed .nav-group-body { margin-left: 0; border: 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; border-radius: 4px; }
.sidebar.collapsed .nav-item.active::before { display: none; }
.sidebar.collapsed .sidebar-edge-toggle { transform: rotate(180deg); }
.sidebar-backdrop { display: none; }
.page { flex: 1; min-width: 0; background: #fff; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; padding: 0 28px; background: #fff; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-left { min-width: 0; }
.topbar-right { flex-shrink: 0; }
.mobile-menu-btn { display: none; flex-shrink: 0; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border-subtle); border-radius: 5px; }
.search-box { display: flex; align-items: center; gap: 8px; width: 265px; height: 34px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: 5px; background: #fff; }
.search-box:focus-within, .table-search-input:focus-within { border-color: #94a3b8; }
.search-ico svg { width: 14px; height: 14px; }
.search-box input { width: 100%; padding: 0; outline: none; border: 0; background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #475569; }
.search-box kbd { flex-shrink: 0; padding: 1px 4px; border-radius: 3px; background: #f1f5f9; color: #64748b; font-family: inherit; font-size: 10px; line-height: 1.6; white-space: nowrap; }
.top-icon-btn { display: grid; place-items: center; width: 30px; height: 32px; border-radius: 5px; color: #334155; background: #fff; }
.top-icon-btn:hover, .user-profile:hover { background: #f3f6fa; }
.top-icon-btn svg { width: 18px; height: 18px; }
.lang-selector { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #334155; }
.flag-icon { font-size: 12px; }
.notif-btn { position: relative; }
.notif-badge { position: absolute; top: 0; right: -1px; display: grid; place-items: center; min-width: 14px; height: 14px; padding: 0 3px; border: 2px solid #fff; border-radius: 8px; background: #ef4444; color: #fff; font-size: 8px; }
.user-profile { display: flex; align-items: center; padding: 2px; border-radius: 50%; }
.user-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: #50335e; font-size: 12px; font-weight: 600; }
.user-meta, .user-arrow { display: none; }

/* Main content */
main { min-width: 0; padding: 20px 28px 28px; }
#view { width: 100%; min-width: 0; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding: 8px 12px; border: 1px solid var(--border-subtle); border-radius: 5px; color: #64748b; background: #f8fafc; font-size: 11px; }
.demo-banner-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.demo-pill { flex-shrink: 0; padding: 2px 6px; border-radius: 3px; color: #475569; background: #e9eef5; font-size: 9px; font-weight: 600; }
.btn-demo-reset { flex-shrink: 0; font-size: 11px; text-decoration: underline; color: #475569; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head > div { min-width: 0; }
.page-head h1 { margin: 0 0 5px; color: var(--text-main); font-size: 22px; line-height: 1.4; font-weight: 700; letter-spacing: -.6px; }
.page-sub { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.head-actions { display: flex; align-items: center; flex-wrap: wrap; flex-shrink: 0; gap: 8px; max-width: 100%; }
.period-select { max-width: 100%; height: 33px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: 5px; background: #fff; font-size: 12px; }
.btn-primary, .btn-secondary, .btn-primary-sm, .btn-outline-sm { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: 5px; font-weight: 500; white-space: nowrap; }
.btn-primary, .btn-secondary { min-height: 32px; padding: 6px 11px; font-size: 12px; }
.btn-primary, .btn-primary-sm { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary-sm:hover { background: var(--primary-hover); }
.btn-secondary, .btn-outline-sm { border-color: var(--border-subtle); background: #fff; color: #334155; }
.btn-secondary:hover, .btn-outline-sm:hover { background: #f8fafc; }
.btn-primary-sm, .btn-outline-sm { padding: 3px 8px; font-size: 11px; }

/* Dashboard */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-width: 0; padding: 16px 18px; border: 1px solid var(--border-subtle); border-radius: 6px; background: #fff; }
.metric-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #64748b; font-size: 12px; font-weight: 500; }
.metric-card-icon { flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; font-size: 14px; }
.metric-card-icon.teal { color: #0d9488; background: #f0fdfa; }
.metric-card-icon.blue { color: #3b82f6; background: #eff6ff; }
.metric-card-icon.yellow { color: #d97706; background: #fffbeb; }
.metric-card-icon.red { color: #ef4444; background: #fff1f2; }
.metric-card strong { display: block; margin: 8px 0 4px; color: var(--text-main); font-size: clamp(21px, 1.8vw, 28px); line-height: 1.4; font-weight: 700; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.metric-card small { color: var(--text-muted); font-size: 11px; }
.trend-up { color: #16a34a; }
.trend-down { color: #ef4444; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 18px; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--border-subtle); border-radius: 6px; background: #fff; }
.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.panel-title { margin: 0; font-size: 15px; font-weight: 650; color: var(--text-main); }
.panel-link { color: #475569; font-size: 12px; font-weight: 500; }
.panel-link:hover { text-decoration: underline; }
.chart { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding: 24px 6px 0; border-bottom: 1px solid var(--border-subtle); background: repeating-linear-gradient(to bottom, transparent 0, transparent 42px, #f1f5f9 43px); }
.bar-item { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; color: var(--text-muted); font-size: 10px; }
.bar { display: block; flex-shrink: 0; width: min(36px, 85%); min-height: 8px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #42c9b9, #08a88f); }
/* Line chart doanh thu (đường lên xuống) */
.chart-line { padding-top: 6px; }
.chart-plot { position: relative; height: 190px; border-bottom: 1px solid var(--border-subtle); background: repeating-linear-gradient(to bottom, transparent 0, transparent 42px, #f1f5f9 43px); }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.rev-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #08a88f; border: 2px solid #fff; box-shadow: 0 0 0 1px #08a88f; cursor: pointer; }
.rev-dot .rev-tip { position: absolute; bottom: 160%; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #0f172a; color: #fff; font-size: 11px; line-height: 1; padding: 5px 8px; border-radius: 5px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; }
.rev-dot:hover { transform: scale(1.25); }
.rev-dot:hover .rev-tip { opacity: 1; }
.chart-xaxis { position: relative; height: 14px; margin-top: 8px; color: var(--text-muted); font-size: 10px; }
.chart-xaxis span { position: absolute; transform: translateX(-50%); }
/* Tổng quan doanh thu (full width) */
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rev-panel { margin-bottom: 18px; padding: 24px 28px 20px; color: var(--text-main); }
.rev-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.rev-period { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rev-controls { display: flex; align-items: center; gap: 10px; }
.rev-select { height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--border-subtle); border-radius: 6px; background: var(--bg-surface); color: var(--text-main); font: inherit; font-size: 13px; cursor: pointer; }
.rev-toggle { display: inline-flex; padding: 3px; border-radius: 7px; background: var(--bg-subtle); }
.rev-toggle button { height: 30px; padding: 0 14px; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.rev-toggle button[aria-pressed="true"] { background: var(--bg-surface); color: var(--text-main); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.rev-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 22px 0 18px; }
.rev-stats > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rev-stats span { color: var(--text-muted); font-size: 13px; }
.rev-stats strong { margin: 4px 0 6px; color: var(--text-main); font-size: clamp(20px, 1.8vw, 26px); font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.rev-stats small { color: var(--text-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.rev-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 260px auto; column-gap: 10px; padding-right: 14px; }
.rev-yaxis { position: relative; min-width: 56px; color: var(--text-muted); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.rev-yaxis span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.rev-plot { position: relative; border-bottom: 1px solid var(--border-subtle); cursor: crosshair; touch-action: pan-y; }
.rev-grid i { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border-light); }
.rev-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; color: var(--text-main); }
.rev-cross { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--border-strong); pointer-events: none; }
.rev-cross-dot { position: absolute; left: 0; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--text-main); box-shadow: 0 0 0 2px var(--bg-surface); }
.rev-tip { position: absolute; top: 8px; z-index: 3; display: flex; flex-direction: column; gap: 3px; min-width: 150px; margin-left: 12px; padding: 9px 11px; border: 1px solid var(--border-subtle); border-radius: 6px; background: var(--bg-surface); box-shadow: 0 6px 18px rgba(15, 23, 42, .1); color: var(--text-muted); font-size: 12px; pointer-events: none; font-variant-numeric: tabular-nums; }
.rev-tip.flip { transform: translateX(-100%); margin-left: -12px; }
.rev-tip > b { color: var(--text-main); margin-bottom: 2px; }
.rev-tip span { display: flex; justify-content: space-between; gap: 14px; }
.rev-tip span b { color: var(--text-main); }
.rev-xaxis { grid-column: 2; position: relative; height: 22px; margin-top: 7px; color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rev-xaxis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rev-chart { container-type: inline-size; }
@container (max-width: 1300px) { .rev-x-minor { display: none; } }
@media (max-width: 640px) {
  .rev-panel { padding: 18px 16px; }
  .rev-stats { grid-template-columns: 1fr; gap: 14px; }
  .rev-chart { grid-template-rows: 200px auto; padding-right: 8px; }
}
.health-list, .task-list { display: flex; flex-direction: column; gap: 14px; font-size: 12px; }
.health-row, .task-row { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border-light); }
.health-row > div, .task-row > div { min-width: 0; }
.health-row:last-child, .task-row:last-child { padding-bottom: 0; border-bottom: 0; }
.status-dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; }
.status-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px #effbf4; }
.status-dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px #fffbeb; }
.status-dot.bad { background: #ef4444; box-shadow: 0 0 0 3px #fff1f2; }
.task-badge-count { flex-shrink: 0; margin-left: auto; padding: 1px 6px; border-radius: 5px; color: #718198; background: #f1f5f9; font-size: 10px; }

/* Toolbar, tables and pagination */
.table-panel { min-width: 0; margin-top: 16px; }
.table-toolbar, .toolbar-left, .toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.table-toolbar { padding-bottom: 14px; }
.table-toolbar .btn-primary { border-color: var(--border-subtle); background: #fff; color: #334155; }
.table-toolbar .btn-primary:hover { background: #f8fafc; }
.table-search-input { display: flex; align-items: center; gap: 8px; width: 240px; height: 33px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: 5px; background: #fff; color: #718198; }
.table-search-input input { width: 100%; outline: none; border: 0; padding: 0; background: transparent; color: #334155; font-size: 12px; }
.table-search-input input::placeholder { color: #94a3b8; }
.filter-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 33px; padding: 5px 9px; border: 1px dashed var(--border-subtle); border-radius: 5px; background: #fff; font-size: 11px; }
.filter-chip:hover { background: #f8fafc; }
.filter-chip select { max-width: 100%; border: 0; background: transparent; font-size: 11px; cursor: pointer; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 5px; scrollbar-width: thin; scrollbar-color: #cbd5e1 #f8fafc; }
.data-table { width: 100%; min-width: 960px; border-collapse: collapse; text-align: left; font-size: 12px; }
.data-table th { padding: 11px 13px; border-bottom: 1px solid var(--border-subtle); background: #fff; color: #718198; font-size: 11px; font-weight: 500; white-space: nowrap; }
.data-table td { padding: 11px 13px; border-bottom: 1px solid var(--border-subtle); background: #fff; color: #334155; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #f8fafc; }
.order-status-cell { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 150px; }
.order-more { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 4px; color: #182230; font-size: 20px; line-height: 1; }
.order-more:hover, .order-more[aria-expanded="true"] { background: #eef2f7; }
.order-action-menu { position: fixed; inset: auto; width: 185px; max-width: calc(100vw - 16px); margin: 0; padding: 5px; border: 1px solid var(--border-subtle); border-radius: 6px; background: #fff; box-shadow: 0 3px 9px #18223021; color: #182230; }
.order-action-menu:popover-open { display: flex; flex-direction: column; }
.menu-action { width: 100%; padding: 8px 9px; border-radius: 3px; text-align: left; font-size: 12px; line-height: 1.5; }
.menu-action:hover, .menu-action:focus { background: #f3f6fa; outline: none; }
.danger-text { color: #ef4444; }
.btn-danger { min-height: 32px; padding: 6px 11px; border: 1px solid #ef4444; border-radius: 5px; background: #ef4444; color: #fff; font-size: 12px; }
.btn-danger:hover { background: #dc2626; }
.table-empty { height: 110px; text-align: center; color: #718198 !important; }
.manual-order-summary { display: grid; gap: 5px; padding: 14px; margin-bottom: 14px; border: 1px solid var(--border-subtle); border-radius: 5px; background: #f8fafc; }
.manual-order-summary strong { color: #182230; font-size: 21px; }
.manual-order-summary span { color: #718198; font-size: 12px; }
.modal-help { margin: 0 0 14px; color: #718198; font-size: 12px; line-height: 1.7; }
.form .check-label { display: flex; align-items: flex-start; gap: 8px; line-height: 1.6; font-weight: 400; }
.form .check-label input { flex-shrink: 0; width: 15px; height: 15px; margin: 2px 0 0; }
.form-error { padding: 10px 12px; border-radius: 5px; color: #b91c1c; background: #fff1f2; font-size: 12px; }
.methods-toolbar { justify-content: space-between; }
.methods-table { min-width: 780px; }
.methods-table th, .methods-table td { padding-block: 11px; }
.methods-table th:first-child { width: 72px; }
.methods-table th:nth-child(2) { width: 70px; }
.methods-table th:nth-child(3) { width: 235px; }
.methods-table th:nth-child(4) { width: 190px; }
.methods-table th:last-child { width: 96px; border-left: 1px solid var(--border-light); }
.methods-table td:last-child { border-left: 1px solid var(--border-light); }
.method-id { display: inline-block; min-width: 24px; padding: 1px 6px; border: 1px solid var(--border-subtle); border-radius: 4px; text-align: center; font-size: 10px; }
.method-name { font-weight: 500; }
.payment-switch { display: inline-flex; align-items: center; width: 30px; height: 17px; padding: 2px; border-radius: 10px; background: #e2e8f0; transition: background .15s; }
.payment-switch span { width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #18223020; transition: transform .15s; }
.payment-switch.on { background: #182230; }
.payment-switch.on span { transform: translateX(13px); }
.method-actions { display: flex; justify-content: center; gap: 14px; }
.method-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; color: #8190a6; }
.method-icon:hover { color: #334155; background: #f1f5f9; }
.webhook-cell { min-width: 220px; color: #718198 !important; }
.webhook-pending { font-size: 11px; }
.payment-setup-note { margin-top: 24px; max-width: 800px; color: #718198; font-size: 12px; line-height: 1.8; }
.text-link { color: #475569; text-decoration: underline; }
/* Phương thức thanh toán (MySQL) + trang cấu hình riêng */
.pay-loading { padding: 40px 0; color: var(--text-muted); font-size: 13px; text-align: center; }
.pay-table { min-width: 960px; }
.pay-table th:nth-child(5) { width: auto; }
.pay-name-link { padding: 0; color: var(--text-main); font-weight: 600; text-align: left; }
.pay-name-link:hover { text-decoration: underline; }
.pay-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
.pay-missing { color: var(--warning-text); font-size: 12px; }
.pay-back { margin-bottom: 10px; padding: 0; color: var(--text-muted); font-size: 12px; font-weight: 500; }
.pay-back:hover { color: var(--text-main); }
.pay-detail .page-head > div:last-child { display: flex; gap: 8px; flex-shrink: 0; }
.danger-text { color: var(--danger-text); }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pay-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pay-card { padding: 22px 24px; }
.pay-card .panel-title { margin-bottom: 2px; }
.pay-card-sub { margin: 2px 0 4px; }
.pay-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pay-enable { display: flex !important; align-items: flex-start; gap: 10px; margin-top: 18px !important; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 6px; cursor: pointer; }
.pay-enable input { width: 16px !important; height: 16px; margin: 2px 0 0 !important; flex-shrink: 0; accent-color: #182230; }
.pay-enable span { display: flex; flex-direction: column; gap: 2px; }
.pay-enable small { color: var(--text-muted); font-weight: 400; }
.pay-optional { color: var(--text-hint); font-weight: 400; }
.pay-hint { margin: 14px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.pay-copy-row { display: flex; gap: 6px; margin-top: 6px; }
.pay-copy-row input, .pay-copy-row select { margin-top: 0 !important; min-width: 0; background: var(--bg-hover) !important; }
.pay-copy-row .btn-secondary { flex-shrink: 0; white-space: nowrap; }
.pay-rotate { margin-top: 10px; padding: 0; font-size: 12px; }
.pay-steps { margin: 14px 0 4px; padding-left: 18px; color: var(--text-body); font-size: 12.5px; line-height: 1.9; }
.pay-health { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; }
.pay-health .status-dot { margin-top: 0; }
.pay-subtitle { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 24px 0 10px; color: var(--text-main); font-size: 13px; font-weight: 650; }
.pay-subtitle span { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.pay-tx { min-width: 640px; }
.pay-tx td { font-size: 12px; }
.pay-content { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.pay-badge.ok { color: var(--success-text); background: var(--success-bg); }
.pay-badge.warn { color: var(--warning-text); background: var(--warning-bg); }
.pay-badge.bad { color: var(--danger-text); background: var(--danger-bg); }
.pay-badge.muted { color: var(--text-muted); background: var(--bg-subtle); }
.pay-side { position: sticky; top: 76px; min-width: 0; }
.pay-qr { display: block; width: 100%; max-width: 260px; aspect-ratio: 540 / 640; margin: 14px auto 6px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--bg-hover); object-fit: contain; }
.pay-qr-empty { display: grid; place-items: center; aspect-ratio: 1; padding: 24px; color: var(--text-muted); font-size: 12px; line-height: 1.6; text-align: center; border-style: dashed; }
.pay-kv { margin: 10px 0 0; }
.pay-kv div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 12.5px; }
.pay-kv div:last-child { border-bottom: 0; }
.pay-kv dt { color: var(--text-muted); }
.pay-kv dd { margin: 0; color: var(--text-main); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.pay-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 6px; background: var(--bg-subtle); color: var(--text-body); font-size: 12px; line-height: 1.6; }
@media (max-width: 1100px) {
  .pay-grid { grid-template-columns: 1fr; }
  .pay-side { position: static; }
}
@media (max-width: 640px) {
  .pay-card { padding: 18px 16px; }
  .pay-copy-row { flex-wrap: wrap; }
  .pay-copy-row input { flex: 1 1 100%; }
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.method-order-list { display: grid; gap: 10px; }
.method-order-row { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border-subtle); border-radius: 5px; }
.method-order-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.order-code-btn { color: #334155; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.order-code-btn:hover { text-decoration: underline; }
.cell-sub { margin-top: 3px; color: var(--text-muted); font-size: 11px; line-height: 1.55; }
.customer-name { color: #263244; font-weight: 500; white-space: nowrap; }
.plan-tag { display: inline-block; padding: 2px 6px; border-radius: 4px; background: #f3f6fa; color: #475569; font-size: 11px; }
.amount-cell { color: #334155; font: 500 12px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; color: #334155; font-size: 11px; white-space: nowrap; }
.status-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 13px; height: 13px; border: 1px solid currentColor; border-radius: 50%; font: 9px/1 sans-serif; }
.paid .status-icon { color: #22c55e; }
.review .status-icon { color: #f59e0b; }
.unpaid .status-icon { color: #ef4444; }
.status-badge.neutral { padding: 2px 6px; border-radius: 4px; background: #f1f5f9; color: #64748b; }
.table-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 18px 4px 4px; color: #718198; font-size: 11px; }
.footer-left, .footer-right, .item-per-page, .page-nav-btns { display: flex; align-items: center; gap: 8px; }
.footer-right { flex-wrap: wrap; gap: 14px; }
.item-per-page select { padding: 4px 7px; border: 1px solid var(--border-subtle); border-radius: 4px; background: #fff; font-size: 11px; }
.page-indicator { white-space: nowrap; }
.page-nav-btns { gap: 5px; }
.page-nav-btns button { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--border-subtle); border-radius: 4px; background: #fff; color: #64748b; font-size: 11px; }
.page-nav-btns button.active { background: #f1f5f9; color: #334155; }
.page-nav-btns button:disabled { color: #b8c2d0; opacity: .6; }

/* Payment review, inventory, dialogs */
.payment-reviews { margin-top: 28px; scroll-margin-top: 76px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; padding: 12px 16px; border: 1px solid #fde68a; border-radius: 5px; background: #fffbeb; color: #92400e; font-size: 12px; }
.notice button { flex-shrink: 0; text-decoration: underline; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.review-card { padding: 16px; margin-bottom: 12px; border: 1px solid var(--border-subtle); border-radius: 5px; background: #fff; }
.review-card:last-child { margin-bottom: 0; }
.review-card.selected { border-color: #94a3b8; background: #f8fafc; }
.review-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.review-card h3 { margin: 0; color: var(--text-main); font-size: 13px; }
.review-card p { margin: 6px 0; color: var(--text-muted); font-size: 12px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.review-detail { position: sticky; top: 76px; scroll-margin-top: 76px; }
.detail-banner { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #fef3c7; border-radius: 5px; background: #fffbeb; color: #92400e; font-size: 12px; line-height: 1.6; }
.kv { display: grid; grid-template-columns: minmax(80px, .7fr) minmax(0, 1.3fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.kv > span { color: var(--text-muted); }
.kv > b { min-width: 0; color: var(--text-main); text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.timeline { margin: 20px 4px; padding-left: 20px; border-left: 2px solid var(--border-subtle); }
.timeline p { position: relative; margin: 0 0 16px; font-size: 12px; }
.timeline p::before { content: ''; position: absolute; top: 5px; left: -25px; width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.inventory-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stock-card { min-width: 0; padding: 20px; border: 1px solid var(--border-subtle); border-radius: 6px; background: #fff; }
.stock-card h3 { margin: 0 0 6px; color: var(--text-main); font-size: 15px; }
.stock-number { display: block; margin: 12px 0 2px; color: var(--text-main); font-size: 32px; }
.progress { height: 7px; margin: 14px 0; overflow: hidden; border-radius: 8px; background: #f1f5f9; }
.progress span { display: block; height: 100%; border-radius: inherit; background: #22c55e; }
.progress.low span { background: #f59e0b; }
dialog { width: min(580px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: 8px; background: #fff; color: var(--text-body); box-shadow: 0 20px 60px #0f172a26; }
dialog::backdrop { background: #0f172a66; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dialog-head h2 { margin: 0; color: var(--text-main); font-size: 18px; }
.dialog-head button { flex-shrink: 0; width: 30px; height: 30px; border-radius: 5px; background: #f1f5f9; font-size: 22px; line-height: 1; }
.form label { display: block; margin: 14px 0 6px; color: var(--text-main); font-size: 12px; font-weight: 500; }
.form input, .form textarea, .form select { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--border-subtle); border-radius: 5px; background: #fff; font-size: 12px; }
.form textarea { min-height: 90px; resize: vertical; }
#toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; transform: translateX(-50%); border-radius: 6px; background: #263244; color: #fff; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
#toast.show { opacity: 1; }

@media (max-width: 1200px) {
  .sidebar { width: 240px; }
  main { padding-inline: 22px; }
  .topbar { padding-inline: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-layout { grid-template-columns: 1fr; }
  .review-detail { position: static; }
  .demo-banner-left { flex-wrap: wrap; }
  .page-head { flex-wrap: wrap; }
}
@media (max-width: 1000px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .inventory-cards { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  html { scrollbar-gutter: auto; }
  body.menu-open { overflow: hidden; }
  .sidebar { position: fixed; left: 0; width: 240px; max-width: calc(100vw - 48px); transform: translateX(-100%); visibility: hidden; transition: transform .18s ease, visibility .18s; }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop:not([hidden]) { position: fixed; inset: 0; z-index: 35; display: block; width: 100%; height: 100dvh; background: #0f172a55; }
  .sidebar-edge-toggle { display: none; }
  .topbar { height: 58px; padding: 0 14px; gap: 10px; }
  .topbar-left { flex: 1; gap: 8px; }
  .topbar-right { gap: 5px; }
  .mobile-menu-btn { display: grid; }
  .search-box { width: min(265px, 100%); min-width: 0; }
  .search-box kbd { display: none; }
  .lang-selector, .notif-btn { display: none; }
  .top-icon-btn { width: 26px; }
  main { padding: 12px 14px 24px; }
  .demo-banner { align-items: flex-start; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
  .demo-banner-left { gap: 6px; }
  .page-head h1 { font-size: 20px; }
  .page-sub { font-size: 12px; }
  .metrics { gap: 10px; }
  .metric-card { padding: 13px; }
  .metric-card-top { font-size: 11px; }
  .metric-card-icon { width: 22px; height: 22px; }
  .metric-card strong { font-size: 20px; }
  .panel { padding: 16px; }
  .panel-title { font-size: 14px; }
  .panel-header { align-items: flex-start; }
  .table-toolbar, .toolbar-left, .toolbar-right { width: 100%; }
  .table-search-input { flex: 1; width: auto; min-width: 150px; }
  .table-footer, .footer-right { gap: 12px; }
  .footer-right { width: 100%; }
  .notice { align-items: flex-start; padding: 12px; }
  dialog { padding: 18px; }
  .dialog-head h2 { font-size: 16px; overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
  .metrics { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Nhóm sản phẩm */
.btn-outline-sm.danger { border-color: #fecaca; color: #dc2626; }
.btn-outline-sm.danger:hover { background: #fef2f2; }
.btn-primary.danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-primary.danger:hover { background: #b91c1c; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow: auto; margin: 4px 0; border: 1px solid var(--border-subtle); border-radius: 6px; padding: 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.pick-row:hover { background: #f8fafc; }
.pick-row input { width: 15px; height: 15px; flex-shrink: 0; }
.pick-name { flex: 1; font-weight: 500; color: var(--text-main); }
.pick-meta { color: var(--text-muted); font-size: 11px; white-space: nowrap; }

/* Khách hàng (MySQL) + ngăn kéo hồ sơ bên phải */
.cust-filter { height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--border-subtle); border-radius: 5px; background: var(--bg-surface); color: var(--text-body); font: inherit; font-size: 12px; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.cust-table { min-width: 960px; }
.cust-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cust-avatar { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-subtle); color: var(--text-main); font-size: 12px; font-weight: 700; }
.cust-avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.cust-role { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--bg-subtle); color: var(--text-body); font-size: 11px; font-weight: 500; white-space: nowrap; }
.cust-role.super_admin, .cust-role.admin { background: #182230; color: #fff; }
.cust-role.staff { background: #e0f2fe; color: #075985; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .45); animation: drawer-fade .15s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; display: flex; flex-direction: column; width: min(520px, 100vw); background: var(--bg-surface); box-shadow: -12px 0 32px rgba(15, 23, 42, .18); animation: drawer-in .2s ease; }
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
body.drawer-open { overflow: hidden; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes drawer-fade { from { opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border-light); }
.drawer-head h2 { margin: 0; color: var(--text-main); font-size: 16px; font-weight: 650; }
.drawer-close { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border-subtle); border-radius: 50%; color: var(--text-muted); font-size: 20px; line-height: 1; }
.drawer-close:hover { color: var(--text-main); background: var(--bg-hover); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px 32px; }
.cust-id { display: flex; align-items: center; gap: 14px; }
.cust-id h3 { margin: 0; color: var(--text-main); font-size: 17px; }
.cust-id p { margin: 2px 0 6px; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.cust-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.cust-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 8px; }
.cust-stats div { padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 6px; }
.cust-stats dt { color: var(--text-muted); font-size: 11px; }
.cust-stats dd { margin: 4px 0 0; color: var(--text-main); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cust-meta { margin: 0; color: var(--text-muted); font-size: 11.5px; }
.drawer-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.drawer-section h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; color: var(--text-main); font-size: 13.5px; font-weight: 650; }
.drawer-section .form-actions { margin-top: 14px; }
.cust-note { margin: 6px 0 4px; padding: 9px 11px; border-radius: 6px; background: var(--bg-subtle); }
.cust-lock { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 6px; }
.cust-lock div { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.cust-lock small { color: var(--text-muted); }
.cust-lock button { flex-shrink: 0; }
.cust-lock button:disabled, #custSaveRole:disabled { opacity: .5; cursor: not-allowed; }
.cust-count { padding: 1px 8px; border-radius: 10px; background: var(--bg-subtle); color: var(--text-muted); font-size: 11px; font-weight: 500; }
.cust-orders { margin: 10px 0 0; padding: 0; list-style: none; }
.cust-order { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.cust-order:last-child { border-bottom: 0; }
.cust-order > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cust-order span { color: var(--text-body); overflow-wrap: anywhere; }
.cust-order small { color: var(--text-muted); }
.cust-order-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
@media (max-width: 640px) {
  .drawer-head, .drawer-body { padding-inline: 16px; }
  .cust-stats { grid-template-columns: 1fr 1fr; }
}

/* Sản phẩm (MySQL) + ngăn kéo chỉnh sửa */
.prod-table { min-width: 900px; }
.prod-table tr.prod-hidden td { color: var(--text-hint); }
.prod-table tr.prod-hidden .pay-name-link { color: var(--text-muted); }
.prod-swatch { flex-shrink: 0; width: 30px; height: 20px; border-radius: 4px; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.prod-star { width: 26px; height: 26px; border-radius: 5px; color: var(--border-strong); font-size: 16px; line-height: 1; }
.prod-star.on { color: #f59e0b; }
.prod-star:hover { background: var(--bg-hover); }
.prod-preview { display: flex; gap: 16px; align-items: center; margin-bottom: 4px; padding: 14px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--bg-hover); }
.prod-art { flex-shrink: 0; display: flex; flex-direction: column; justify-content: space-between; width: 168px; aspect-ratio: 1.58; padding: 10px 12px; border-radius: 10px; background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); box-shadow: 0 6px 16px rgba(15, 23, 42, .15); }
.prod-art-top { display: flex; justify-content: space-between; gap: 6px; font-size: 9px; letter-spacing: .3px; }
.prod-art-top span { padding: 1px 6px; border-radius: 8px; background: rgba(255, 255, 255, .25); }
.prod-art-data { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.prod-art-sub { font-size: 8.5px; letter-spacing: .5px; opacity: .9; }
.prod-preview-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; }
.prod-preview-info b { color: var(--text-main); font-size: 13px; overflow-wrap: anywhere; }
.prod-preview-info span { color: var(--text-muted); }
.prod-preview-info strong { margin-top: 4px; color: var(--text-main); font-size: 15px; font-variant-numeric: tabular-nums; }
.prod-preview-info small { color: var(--text-muted); }
.prod-color { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.prod-color input[type="color"] { width: 44px !important; height: 34px; margin: 0 !important; padding: 2px !important; cursor: pointer; }
.prod-color code { color: var(--text-muted); font-size: 12px; }
.prod-codes { margin-top: 8px; }
.prod-actions span { flex: 1; }
.prod-actions .danger-text { margin-right: auto; }
#prodForm .pay-enable { margin-top: 12px !important; }
@media (max-width: 480px) { .prod-preview { flex-direction: column; align-items: flex-start; } }

/* Hỗ trợ (tickets) */
.pay-badge.info { color: #075985; background: #e0f2fe; }
.tk-tabs { gap: 4px; }
.tk-tab { height: 32px; padding: 0 12px; border-radius: 6px; color: var(--text-muted); font-size: 12.5px; font-weight: 500; }
.tk-tab span { margin-left: 4px; padding: 0 6px; border-radius: 8px; background: var(--bg-subtle); font-size: 11px; }
.tk-tab.active { background: var(--bg-subtle); color: var(--text-main); font-weight: 600; }
.tk-tab.active span { background: #182230; color: #fff; }
.tk-table { min-width: 1000px; }
.tk-subject { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tk-unread td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.drawer-wide { width: min(640px, 100vw); }
.tk-body { display: flex; flex-direction: column; }
.tk-title { margin: 0 0 14px; color: var(--text-main); font-size: 16px; line-height: 1.5; }
.tk-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tk-meta span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 6px; font-size: 12.5px; min-width: 0; }
.tk-meta small { color: var(--text-muted); font-size: 11px; }
.tk-meta b { color: var(--text-main); overflow-wrap: anywhere; }
.tk-meta em { color: var(--text-muted); font-size: 11.5px; font-style: normal; }
.tk-meta .text-link { align-self: flex-start; padding: 0; font-size: 11.5px; }
.tk-controls { margin-top: 4px; }
.tk-thread { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 160px; margin-top: 18px; padding: 14px; border-radius: 8px; background: var(--bg-hover); overflow-y: auto; }
.tk-msg { max-width: 86%; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 10px; background: var(--bg-surface); }
.tk-msg.staff { align-self: flex-end; border-color: #182230; background: #182230; color: #fff; }
.tk-msg.note { align-self: center; max-width: 94%; border: 1px dashed #f59e0b; background: #fffbeb; }
.tk-msg-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-size: 11px; }
.tk-msg-head span { color: var(--text-muted); }
.tk-msg.staff .tk-msg-head span { color: #cbd5e1; }
.tk-msg-body { font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-reply { margin-top: 12px; }
.tk-reply textarea { margin-top: 0 !important; min-height: 90px; }
.tk-reply-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-reply-bar select { width: auto !important; margin: 0 0 0 auto !important; }
.tk-note-toggle { display: flex !important; align-items: center; gap: 6px; margin: 0 !important; color: var(--text-muted) !important; font-weight: 400 !important; }
.tk-note-toggle input { width: 14px !important; margin: 0 !important; }
@media (max-width: 640px) { .tk-meta { grid-template-columns: 1fr; } .tk-reply-bar select { margin-left: 0 !important; width: 100% !important; } }

/* Nhóm sản phẩm (MySQL) — cùng kiểu bảng với Phương thức thanh toán */
.grp-table { min-width: 860px; }
.grp-table th:nth-child(2) { width: 220px; }
.grp-table th:nth-child(3) { width: auto; }
.grp-table th:nth-child(4) { width: 120px; }
.grp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.grp-chip { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 8px; border-radius: 4px; background: var(--primary-subtle); color: var(--text-body); font-size: 11px; }
.grp-chip.off { color: var(--text-hint); text-decoration: line-through; }
.grp-chip.more { background: var(--bg-subtle); color: var(--text-muted); font-weight: 600; }
.grp-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 8px; font-size: 12.5px; }
.grp-pick-head b { color: var(--text-main); }
.grp-pick-head span { color: var(--text-muted); font-weight: 400; }
.grp-pick-head input { width: 180px !important; margin: 0 !important; padding: 6px 10px !important; }
.grp-pick { max-height: none; }
.form .pick-row input { display: inline-block; width: 15px; height: 15px; margin: 0; padding: 0; }
.pick-name .pay-badge { margin-left: 4px; }
.form .pick-row { display: flex; margin: 0; color: var(--text-main); font-weight: 400; }
.form .pick-row input { accent-color: #182230; }

/* Chi tiết đơn (MySQL) */
.order-lines-admin, .order-tx { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 6px; font-size: 12px; }
.order-lines-admin p, .order-tx p { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0; }
.order-tx > b { display: block; margin-bottom: 4px; color: var(--text-main); }

/* Cấu hình Email */
.email-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.email-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.email-preview { margin-top: 12px; border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden; font-size: 12px; color: var(--text-body); }
.email-preview-head { display: flex; flex-direction: column; padding: 12px 14px; background: linear-gradient(135deg, #13b79f, #079fee); color: #fff; }
.email-preview-head b { font-size: 15px; }
.email-preview-head span { font-size: 11px; opacity: .9; }
.email-preview > p { margin: 12px 14px 8px; line-height: 1.6; }
.email-preview-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 14px; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 8px; }
.email-preview-code span { display: flex; flex-direction: column; }
.email-preview-code small { color: var(--text-muted); font-size: 11px; }
.email-preview-code b { padding: 5px 9px; border-radius: 6px; background: #ecfdf5; color: #047857; font-family: ui-monospace, Consolas, monospace; letter-spacing: .5px; }
.email-preview > small { display: block; margin: 10px 14px 12px; color: var(--text-muted); }
.email-log td { font-size: 11.5px; }
.email-err-row td { padding-top: 0 !important; color: var(--danger-text); font-size: 11px; border-top: 0; }
.panel-title .cust-count { margin-left: 6px; }

/* Kho mã thẻ */
.inv-table { min-width: 760px; }
.inv-codes td { font-size: 12px; }
.inv-toggle { margin-left: auto; padding: 0; font-size: 12px; font-weight: 400; }
#invImportForm textarea { margin-top: 10px !important; font-size: 12px; }
#invImportForm .tk-note-toggle { margin-top: 10px !important; }

/* Chi tiết đơn: mã đã giao */
.order-codes-admin { margin-top: 12px; padding: 10px 12px; border: 1px solid #bbf7d0; border-radius: 6px; background: #f0fdf4; font-size: 12px; }
.order-codes-admin > b { display: block; margin-bottom: 4px; color: var(--text-main); }
.order-codes-admin > p { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; }
.order-codes-admin > p span { display: flex; flex-direction: column; }
.order-codes-admin small { color: var(--text-muted); font-size: 11px; }
.order-codes-admin .order-email-line { justify-content: flex-start; flex-wrap: wrap; }
.order-codes-admin .form-actions { margin-top: 8px; }
.email-log, .inv-codes { min-width: 0 !important; width: 100%; table-layout: fixed; }
.email-log th, .email-log td, .inv-codes th, .inv-codes td { padding-left: 8px !important; padding-right: 8px !important; overflow-wrap: anywhere; white-space: normal; }
.email-log th:nth-child(1) { width: 74px; } .email-log th:nth-child(3) { width: 84px; } .email-log th:nth-child(4) { width: 62px; }
.inv-codes th:nth-child(3) { width: 84px; } .inv-codes th:nth-child(4) { width: 96px; } .inv-codes th:nth-child(5) { width: 40px; }
