/* Bộ nhận diện Aventop – áp lên giao diện đã đóng gói bằng cách ghi đè biến màu, KHÔNG sửa style.css gốc.
   18/11/2026 bản 1: màu thương hiệu, logo. 18/11 bản 2 (theo ảnh demo anh gửi): sidebar xanh đen, thanh trên trắng, nền làm việc xám trắng.
   Bảng màu thương hiệu: navy #0B2D6B · xanh lá #0A8F3C · xanh lá sáng #7AC943 · xanh dương #1E88E5.
   Chế độ: app đặt <html data-theme="dark|light|"> ("" = theo máy). Bảng màu dưới chỉ áp cho chế độ SÁNG; chế độ tối giữ như cũ. */

/* ---- Biến dùng chung (mặc định = giá trị cho chế độ tối, giống giao diện cũ) ---- */
:root {
  --sb-bg: var(--panel);
  --sb-text: var(--text-2);
  --sb-strong: var(--text);
  --sb-muted: var(--text-3);
  --sb-hover: var(--panel-2);
  --sb-active-bg: var(--brand-soft);
  --sb-active-text: var(--brand);
  --sb-accent: #22c55e;
  --sb-border: var(--line);
  --top-bg: color-mix(in srgb, var(--bg) 88%, transparent);
  --av-green: #0a8f3c;
  --av-green-2: #7ac943;
}

/* ---- CHẾ ĐỘ SÁNG (theo máy hoặc chọn "sáng") ---- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f8fc; --panel: #ffffff; --line: #dde5ef;
    --brand: #0b2d6b; --brand-2: #1e88e5; --brand-soft: #e6edf8;
    --ok: #0a8f3c; --ok-soft: #e6f4ea; --aventop: #0a8f3c;
    --sb-bg: #0f1d33; --sb-text: #e2e8f0; --sb-strong: #ffffff; --sb-muted: #9fb0c7;
    --sb-hover: #192b45; --sb-active-bg: #203656; --sb-active-text: #ffffff; --sb-border: #0f1d33;
    --top-bg: #ffffff;
  }
}
:root[data-theme="light"] {
  --bg: #f6f8fc; --panel: #ffffff; --line: #dde5ef;
  --brand: #0b2d6b; --brand-2: #1e88e5; --brand-soft: #e6edf8;
  --ok: #0a8f3c; --ok-soft: #e6f4ea; --aventop: #0a8f3c;
  --sb-bg: #0f1d33; --sb-text: #e2e8f0; --sb-strong: #ffffff; --sb-muted: #9fb0c7;
  --sb-hover: #192b45; --sb-active-bg: #203656; --sb-active-text: #ffffff; --sb-border: #0f1d33;
  --top-bg: #ffffff;
}

/* ---- CHẾ ĐỘ TỐI: chỉ chỉnh màu thương hiệu cho dễ đọc, còn lại giữ như cũ ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --brand: #5b9bf0; --brand-2: #7ab3f5; --brand-soft: #13243f; --ok: #3fbf6a; --aventop: #3fbf6a; }
}
:root[data-theme="dark"] { --brand: #5b9bf0; --brand-2: #7ab3f5; --brand-soft: #13243f; --ok: #3fbf6a; --aventop: #3fbf6a; }

/* ---- Sidebar (dùng chung mọi trang; trên điện thoại là menu trượt) ---- */
.sidebar { background: var(--sb-bg); color: var(--sb-text); border-right-color: var(--sb-border); }
.sidebar .brand { color: var(--sb-strong); }
.sidebar .brand small, .sidebar .nav-group, .sidebar .muted, .sidebar .small.muted { color: var(--sb-muted); }
.sidebar .nav-link { color: var(--sb-text); }
.sidebar .nav-link svg { color: inherit; }
.sidebar a.nav-link:hover { background: var(--sb-hover); color: var(--sb-strong); }
.sidebar .nav-link.active, .sidebar .nav-link.active:hover {
  background: var(--sb-active-bg); color: var(--sb-active-text);
  box-shadow: inset 3px 0 0 var(--sb-accent);
}
/* khối tài khoản: tên sáng (mã gốc đặt màu chữ trực tiếp nên cần !important), vai trò màu phụ (.small.muted) */
.sidebar div.nav-link, .sidebar div.nav-link .ellipsis > div:not(.muted) { color: var(--sb-strong) !important; }
.sidebar::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--sb-text) 25%, transparent); }

/* Logo Aventop trong ô trắng bo góc để rõ trên nền tối */
.logo {
  background: #fff url(/brand-symbol.png) center / 80% no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  box-shadow: 0 0 0 1px rgba(15, 29, 51, .12);
}
.brand .logo { width: 34px; height: 34px; border-radius: 9px; }

/* ---- Thanh trên ---- */
.topbar { background: var(--top-bg); border-bottom-color: var(--line); }

/* Nút mặt trăng có sẵn: ẩn theo yêu cầu anh (18/11) – chế độ sáng/tối chỉnh trong menu tài khoản (menu vẫn bấm hộ nút này) */
.topbar .icon-btn[title="Giao diện sáng/tối"] { display: none !important; }

/* ---- Menu tài khoản góc phải – bản 2 (public/assets/account-menu.js) ---- */
.am-wrap { position: relative; flex: none; }
.am-avatar { display: grid; place-items: center; border-radius: 50%; font-weight: 700; letter-spacing: .02em; }
.am-btn { width: 38px; height: 38px; border: 0; cursor: pointer; font-size: 14px; background: var(--brand-soft); color: var(--brand); }
.am-btn:hover, .am-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.am-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 330px; max-width: calc(100vw - 16px);
  max-height: calc(100vh - 80px); overflow-y: auto;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.am-panel[hidden] { display: none; }
.am-head { display: flex; align-items: center; gap: 14px; padding: 18px 18px 16px; border-bottom: 1px solid var(--line); }
.am-avatar-lg { width: 54px; height: 54px; flex: none; font-size: 19px; background: #0b2d6b; color: #fff; }
.am-who { min-width: 0; }
.am-name { font-weight: 700; font-size: 16.5px; line-height: 1.25; }
.am-sub { color: var(--text-3); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-body { padding: 12px 14px 10px; }
.am-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 4px 2px 8px; }
.am-seg { display: grid; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.am-seg-3 { grid-template-columns: repeat(3, 1fr); } .am-seg-2 { grid-template-columns: repeat(2, 1fr); }
.am-seg button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 4px; border: 0; background: none; border-radius: 9px; color: var(--text-2); font-size: 13.5px; cursor: pointer; }
.am-seg button.on { background: var(--panel); color: var(--brand); font-weight: 700; box-shadow: var(--shadow); }
.am-switch { display: flex; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; margin: 0 2px 4px; user-select: none; }
.am-switch input { position: absolute; opacity: 0; pointer-events: none; }
.am-track { width: 40px; height: 22px; border-radius: 11px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.am-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.am-switch input:checked + .am-track { background: var(--av-green, #0a8f3c); }
.am-switch input:checked + .am-track::after { transform: translateX(18px); }
.am-switch input:focus-visible + .am-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.am-sep { height: 1px; background: var(--line); }
.am-links { padding: 6px 8px 8px; }
.am-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 10px; border: 0; background: none; border-radius: 10px; font-size: 14.5px; color: var(--text); text-align: left; cursor: pointer; }
.am-item svg { color: var(--text-2); flex: none; }
.am-item:hover { background: var(--panel-2); }
.am-logout, .am-logout svg { color: var(--danger) !important; }
@media (max-width: 860px) { .am-btn { width: 34px; height: 34px; font-size: 13px; } .am-desktop { display: none; } }

/* ---- Cỡ chữ "Lớn": phóng toàn giao diện 112% (giao diện gốc dùng cỡ px cố định) ---- */
html.am-chu-lon body { zoom: 1.12; }

/* ---- Thu gọn menu trái (chỉ máy tính): chỉ còn biểu tượng, rê chuột hiện tên ---- */
@media (min-width: 861px) {
  html.am-thu-gon { --sidebar: 68px; }
  html.am-thu-gon .sidebar { padding-left: 8px; padding-right: 8px; overflow-x: hidden; }
  html.am-thu-gon .sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  html.am-thu-gon .sidebar .brand > div:not(.logo) { display: none; }
  html.am-thu-gon .sidebar .nav-group { font-size: 0; height: 1px; margin: 10px 6px; background: color-mix(in srgb, var(--sb-text) 18%, transparent); }
  html.am-thu-gon .sidebar .nav-link { font-size: 0; justify-content: center; gap: 0; padding: 9px 0; }
  html.am-thu-gon .sidebar .nav-link svg { width: 20px; height: 20px; font-size: 20px; }
  html.am-thu-gon .sidebar .nav-link .count { display: none; }
  html.am-thu-gon .sidebar div.nav-link > :not(.avatar) { display: none; }
}
