/* ==========================================================================
   OMNI · theme navy + gold
   Nạp CUỐI trong omni_tw_head.html để thắng dark overrides phía trước.
   Nguyên tắc: nền navy đậm, viền gold mảnh, chữ kem, nút gold.
   ========================================================================== */

html.dark {
  color-scheme: dark;
  --primary: #e8cf8f;
  --primary-hover: #f4dfa6;
  --primary-soft: rgba(232, 207, 143, .12);
  --bg: #0b1722;
  --card-bg: #16242f;
  --border: rgba(232, 207, 143, .16);
  --border-strong: rgba(232, 207, 143, .32);
  --form-border: rgba(143, 163, 179, .3);
  --text: #e6eef4;
  --text-secondary: #c3d1da;
  --muted: #8fa3b3;
  --sidebar-bg: #091420;
  --sidebar-bg-2: #0e1e2a;
  --sidebar-active-bg: linear-gradient(90deg, rgba(232,207,143,.20), rgba(232,207,143,.04));
  --sidebar-active-border: #e8cf8f;
  --shadow: 0 4px 18px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55);
}

/* ---- Nền trang ---------------------------------------------------------- */
html.dark body:not(.login-page):not(.projects-page),
html.dark body.app-layout {
  background:
    radial-gradient(1100px 560px at 6% -12%, rgba(232,207,143,.07), transparent 58%),
    radial-gradient(900px 520px at 100% 0%, rgba(88,124,150,.12), transparent 55%),
    #0b1722 !important;
  color: #e6eef4 !important;
}
/* login + projects đã có theme riêng: giữ nguyên chi tiết của chúng */
html.dark body.login-page h2.operated-by { color: #e8cf8f !important; }
html.dark body.projects-page .project-card h3 { color: #f4e8c9 !important; }
html.dark .main-wrapper,
html.dark .content,
html.dark main.content {
  background: transparent !important;
  color: #e6eef4 !important;
}

/* ---- Topbar ------------------------------------------------------------- */
html.dark .topbar,
html.dark header.topbar {
  background: rgba(9, 20, 32, .94) !important;
  border-bottom-color: rgba(232, 207, 143, .22) !important;
  color: #e6eef4 !important;
  backdrop-filter: blur(8px);
}
html.dark .topbar .logo,
html.dark .topbar .user,
html.dark .topbar .project-selector {
  color: #f4e8c9 !important;
}
html.dark .topbar .lang-switch a {
  color: #a9bccb !important;
  border: 1px solid rgba(143, 163, 179, .25) !important;
  background: rgba(9, 20, 32, .6) !important;
}
html.dark .topbar .lang-switch a.active {
  background: linear-gradient(180deg, #f4dfa6, #e6c780) !important;
  border-color: rgba(232, 207, 143, .9) !important;
  color: #1b2530 !important;
}
html.dark .topbar .btn,
html.dark .topbar a.btn {
  background: rgba(9, 20, 32, .6) !important;
  border-color: rgba(143, 163, 179, .28) !important;
  color: #cfdbe4 !important;
}
html.dark .topbar .btn:hover {
  border-color: rgba(232, 207, 143, .5) !important;
  color: #f4e8c9 !important;
}

/* ---- Card / panel ------------------------------------------------------- */
html.dark .page-card,
html.dark .panel,
html.dark .kpi,
html.dark .flow-board,
html.dark .card,
html.dark .ads-panel-card,
html.dark .ads-os .page-card,
html.dark body.ads-os .page-card,
html.dark .ads-mix-crm,
html.dark .ads-cat-card,
html.dark details.ads-subfold,
html.dark .login-card,
html.dark .auth-card {
  background: linear-gradient(180deg, #1b2b38 0%, #152430 55%, #12202b 100%) !important;
  border-color: rgba(232, 207, 143, .18) !important;
  color: #e6eef4 !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45) !important;
}
html.dark details.ads-subfold > summary {
  background: #14232f !important;
  color: #e8cf8f !important;
}
html.dark details.ads-subfold > .fold-body {
  border-top-color: rgba(232, 207, 143, .14) !important;
}

/* ---- Chữ ---------------------------------------------------------------- */
html.dark .page-header h1,
html.dark .page-header h2,
html.dark h1, html.dark h2, html.dark h3 {
  color: #f4e8c9 !important;
}
html.dark .page-header .desc,
html.dark .help,
html.dark .muted,
html.dark .text-muted,
html.dark .empty {
  color: #8fa3b3 !important;
}
html.dark .page-header p,
html.dark .page-header .subtitle { color: #8fa3b3 !important; }

/* ---- Form --------------------------------------------------------------- */
html.dark label,
html.dark .form-row label,
html.dark .form-row > label,
html.dark .form-group label {
  color: #c3d1da !important;
}
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
html.dark select,
html.dark textarea,
html.dark .omni-input,
html.dark input.money {
  background: #0e1c26 !important;
  border-color: rgba(143, 163, 179, .3) !important;
  color: #eef5f9 !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder { color: #6f8495 !important; }
html.dark select option { background: #0e1c26; color: #eef5f9; }
html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: rgba(232, 207, 143, .85) !important;
  box-shadow: 0 0 0 3px rgba(232, 207, 143, .16) !important;
}

/* ---- Buttons ------------------------------------------------------------ */
html.dark .btn {
  background: rgba(9, 20, 32, .55) !important;
  border-color: rgba(143, 163, 179, .3) !important;
  color: #cfdbe4 !important;
}
html.dark .btn:hover {
  background: rgba(20, 36, 48, .82) !important;
  border-color: rgba(232, 207, 143, .45) !important;
  color: #f4e8c9 !important;
}
html.dark .btn.primary,
html.dark .btn.p,
html.dark a.btn.primary,
html.dark button.btn.primary,
html.dark .btn-ads {
  background: linear-gradient(180deg, #f4dfa6 0%, #e6c780 100%) !important;
  border-color: rgba(255, 255, 255, .22) !important;
  color: #1b2530 !important;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(232, 207, 143, .16) !important;
}
html.dark .btn.primary:hover,
html.dark .btn.p:hover {
  background: linear-gradient(180deg, #f9e7b6 0%, #edd194 100%) !important;
  color: #161f28 !important;
}
html.dark .btn.danger,
html.dark .btn.danger:hover {
  background: #b91c1c !important;
  border-color: #991b1b !important;
  color: #fff !important;
}

/* ---- Tabs / stepper ----------------------------------------------------- */
html.dark .g-tabs,
html.dark .ads-ops-stepper .ads-step-row {
  background: #12202b !important;
  border-color: rgba(232, 207, 143, .16) !important;
}
html.dark .g-tab {
  background: #14232f !important;
  border-color: rgba(143, 163, 179, .28) !important;
  color: #c3d1da !important;
}
html.dark .g-tab:hover { background: #1b2b38 !important; }
html.dark .g-tab.active {
  background: linear-gradient(180deg, #f4dfa6, #e6c780) !important;
  border-color: transparent !important;
  color: #1b2530 !important;
}
html.dark .g-tab.active .tab-desc { color: rgba(27, 37, 48, .75) !important; }
html.dark .ads-step-num {
  background: #1b2b38 !important;
  color: #8fa3b3 !important;
}
html.dark .ads-hero {
  background: linear-gradient(135deg, #16242f 0%, #0b1722 50%, #14232f 100%) !important;
  border-color: rgba(232, 207, 143, .18) !important;
}
html.dark .ads-hero h1,
html.dark .ads-hero .desc { color: #e6eef4 !important; }

/* ---- Pills / badge / tag ------------------------------------------------ */
html.dark .ads-pill,
html.dark .bot-pill,
html.dark .badge,
html.dark .pill,
html.dark .tag,
html.dark .chip {
  background: rgba(232, 207, 143, .12) !important;
  border: 1px solid rgba(232, 207, 143, .22) !important;
  color: #e8cf8f !important;
}

/* ---- Flash / alert ------------------------------------------------------ */
html.dark .flash,
html.dark .alert-success {
  background: rgba(34, 197, 94, .12) !important;
  border-color: rgba(74, 222, 128, .32) !important;
  color: #86efac !important;
}
html.dark .flash.error,
html.dark .alert-error,
html.dark .alert-danger {
  background: rgba(220, 38, 38, .14) !important;
  border-color: rgba(248, 113, 113, .34) !important;
  color: #fca5a5 !important;
}

/* ---- Bảng --------------------------------------------------------------- */
html.dark table,
html.dark .table { color: #e6eef4 !important; }
html.dark table th,
html.dark table td,
html.dark .table th,
html.dark .table td {
  border-color: rgba(255, 255, 255, .07) !important;
}
html.dark table thead th,
html.dark .table thead th {
  background: #14232f !important;
  color: #c3d1da !important;
}
html.dark table tbody tr:hover,
html.dark .table tbody tr:hover {
  background: #152430 !important;
}

/* ---- Link --------------------------------------------------------------- */
html.dark a:not(.btn):not(.g-tab):not([class*="nav-"]) { color: #e8cf8f; }
html.dark a:not(.btn):not(.g-tab):hover { color: #f4dfa6; }

/* ---- Sidebar ------------------------------------------------------------ */
html.dark #omni-sidebar,
html.dark aside[data-omni-sidebar],
html.dark .sidebar {
  background: linear-gradient(180deg, #091420 0%, #0e1e2a 100%) !important;
  border-right-color: rgba(232, 207, 143, .14) !important;
}
html.dark .sidebar .nav-link,
html.dark .sidebar a { color: #8fa3b3 !important; }
html.dark .sidebar .nav-link.active,
html.dark .sidebar a.active {
  background: rgba(232, 207, 143, .14) !important;
  color: #f4e8c9 !important;
  box-shadow: inset 2px 0 0 #e8cf8f;
}

/* ---- Modal / dropdown --------------------------------------------------- */
html.dark .modal {
  background: rgba(4, 10, 16, .72) !important;
  backdrop-filter: blur(3px);
}
html.dark .modal-content,
html.dark .dropdown-menu,
html.dark .popover {
  background: linear-gradient(180deg, #1b2b38 0%, #152430 60%, #12202b 100%) !important;
  border-color: rgba(232, 207, 143, .22) !important;
  color: #e6eef4 !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6) !important;
}
html.dark .modal-content h2 { color: #f4e8c9 !important; }

/* ---- Đường kẻ / utility -------------------------------------------------- */
html.dark hr { border-color: rgba(255, 255, 255, .08) !important; }
html.dark .border,
html.dark [class*="border-slate"],
html.dark [class*="border-gray"] {
  border-color: rgba(232, 207, 143, .16) !important;
}
html.dark .bg-white { background-color: #16242f !important; }
html.dark .bg-slate-50,
html.dark .bg-gray-50,
html.dark .bg-slate-100 { background-color: #0b1722 !important; }
html.dark .text-slate-800,
html.dark .text-slate-900,
html.dark .text-ink { color: #f4e8c9 !important; }
html.dark .text-slate-700 { color: #c3d1da !important; }
html.dark .text-slate-600,
html.dark .text-slate-500,
html.dark .text-slate-400 { color: #8fa3b3 !important; }

/* ---- Empty state -------------------------------------------------------- */
html.dark .empty-state,
html.dark .empty { color: #8fa3b3 !important; }
html.dark .empty-state {
  background: rgba(18, 32, 43, .6) !important;
  border-color: rgba(143, 163, 179, .3) !important;
}
