/* ==========================================================================
   Thiên Gia — Design System (xem docs/04_UI_DESIGN_SYSTEM.md)
   - Admin  : data-accent="admin"  → xanh neon / glass tối (ảnh mẫu 1 & 3)
   - Nhân viên: data-accent="staff" → đỏ-cam ember trên nền đen (ảnh mẫu 2)
   Chỉ đổi biến màu ở :root[data-accent=...] là đổi toàn bộ giao diện.
   ========================================================================== */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(255, 255, 255, .09);
  --border: rgba(255, 255, 255, .10);
  --text: #eef2ff;
  --muted: #8d97b8;
  --ok: #34d399; --warn: #fbbf24; --danger: #fb5d6e; --info: #60a5fa;
  --rainbow: linear-gradient(90deg, #ff5d5d, #ffb84d, #f5e663, #4ade80, #38bdf8, #8b5cf6);
  --shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
:root[data-accent="admin"] {
  --bg-0: #050a1c; --bg-1: #0b1534;
  --accent: #5b7cff; --accent-2: #9b6bff; --accent-soft: rgba(91, 124, 255, .18);
  --glow-a: rgba(64, 98, 255, .38); --glow-b: rgba(139, 92, 246, .26);
}
:root[data-accent="staff"] {
  --bg-0: #060d14; --bg-1: #0b1a24;
  --accent: #1796b8; --accent-2: #4f7df0; --accent-soft: rgba(23, 150, 184, .20);
  --glow-a: rgba(23, 150, 184, .26); --glow-b: rgba(79, 125, 240, .16);
}

html, body { min-height: 100%; }
body {
  font-family: var(--font); color: var(--text); background-color: var(--bg-0);
  background-image:
    radial-gradient(900px 520px at 85% -10%, var(--glow-a), transparent 60%),
    radial-gradient(700px 480px at -10% 105%, var(--glow-b), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
.text-muted, .muted { color: var(--muted) !important; }

/* ---------- Khung ứng dụng ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; gap: 0; padding: 16px; gap: 16px; }
.sidebar {
  position: sticky; top: 16px; height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 6px;
  padding: 18px 12px; background: var(--glass); border: 1px solid var(--border);
  border-radius: 28px; backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-weight: 700; letter-spacing: .2px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-size: 1.15rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 24px var(--accent-soft);
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--muted);
  font-weight: 500; transition: .18s;
}
.nav-item i { font-size: 1.15rem; width: 22px; text-align: center; }
.nav-item:hover { color: var(--text); background: var(--glass); }
.nav-item.active {
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 28px var(--accent-soft);
}
.nav-sep { margin: 10px 14px 4px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sidebar-foot { margin-top: auto; }

.main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--glass);
  border: 1px solid var(--border); border-radius: 24px; backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.topbar h1 { font-size: 1.25rem; margin: 0; font-weight: 600; }
.search {
  flex: 1; max-width: 420px; margin-left: 16px; display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border); border-radius: 14px; color: var(--muted);
}
.search input { background: transparent; border: 0; outline: 0; color: var(--text); width: 100%; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--text);
  background: var(--glass); border: 1px solid var(--border); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--glass-strong); }
.dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}
.user-chip small { display: block; color: var(--muted); line-height: 1.1; }

.content { display: grid; gap: 16px; }
.content-pad { padding-bottom: 24px; }

/* ---------- Glass card ---------- */
.glass {
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow);
}
.glass-pad { padding: 20px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h2 { font-size: 1.02rem; margin: 0; font-weight: 600; }
.card-sub { color: var(--muted); font-size: .85rem; }

.grid-12 { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }

/* ---------- Số liệu lớn + thanh cầu vồng (giống "Used per month" ở ảnh 1) ---------- */
.hello small { color: var(--muted); font-size: 1rem; }
.hello h2 { font-size: 2.1rem; font-weight: 700; margin: 0; }
.kpi-value { font-size: 2.6rem; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.kpi-value small { font-size: 1.1rem; color: var(--muted); font-weight: 500; }
.meter { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 8px; background: var(--rainbow); }
.meter.accent > i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.mini-stat { display: flex; align-items: center; gap: 14px; }
.mini-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 1.3rem; background: var(--accent-soft); color: var(--accent); }
.mini-stat b { font-size: 1.5rem; display: block; line-height: 1.1; }
.mini-stat span { color: var(--muted); font-size: .85rem; }

/* ---------- Danh sách / hàng ---------- */
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid transparent; }
.row-item + .row-item { margin-top: 8px; }
.row-item:hover { border-color: var(--border); background: var(--glass); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .s { color: var(--muted); font-size: .82rem; }
.file-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1.15rem; }

/* ---------- Badge trạng thái ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--glass-strong); border: 1px solid var(--border); }
.st-NEW, .st-OPEN { color: var(--info); } .st-ASSIGNED, .st-INVESTIGATING { color: var(--warn); }
.st-IN_PROGRESS { color: var(--accent-2); } .st-DONE, .st-RESOLVED, .st-CLOSED { color: var(--ok); } .st-CANCELLED { color: var(--muted); }
.pr-P1 { color: #fff; background: var(--danger); border-color: transparent; box-shadow: 0 0 14px rgba(251, 93, 110, .5); }
.pr-P2 { color: #1b1304; background: var(--warn); border-color: transparent; }
.pr-P3 { color: var(--text); }

/* ---------- Nút ---------- */
.btn-glow, .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; font-weight: 600; font-size: .9rem;
  padding: 9px 18px; border-radius: 12px; transition: .18s; color: #fff;
}
.btn-glow { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 22px var(--accent-soft); }
.btn-glow:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-ghost { background: var(--glass-strong); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.btn-sm2 { padding: 6px 12px; font-size: .8rem; border-radius: 10px; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Bảng ---------- */
.table-glass { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.table-glass th { color: var(--muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; padding: 4px 14px; border: 0; }
.table-glass td { padding: 13px 14px; background: rgba(255, 255, 255, .04); vertical-align: middle; }
.table-glass td:first-child { border-radius: 14px 0 0 14px; } .table-glass td:last-child { border-radius: 0 14px 14px 0; }
.table-glass tbody tr:hover td { background: var(--glass-strong); }
.table-wrap { overflow-x: auto; }

/* ---------- Form ---------- */
.field label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea, .form-glass {
  width: 100%; padding: 11px 14px; border-radius: 12px; color: var(--text);
  background: rgba(0, 0, 0, .3); border: 1px solid var(--border); outline: none; font: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field select option { background: #101733; color: #fff; }
.field-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.field-grid .full { grid-column: 1 / -1; }

/* ---------- Modal (không dùng JS bootstrap, tự viết gọn) ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(2, 4, 12, .72); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 1050; padding: 16px; }
.modal-back.show { display: flex; }
.modal-box { width: min(620px, 100%); max-height: 92vh; overflow: auto; background: #0e1530; border: 1px solid var(--border); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); }
:root[data-accent="staff"] .modal-box { background: #1a0a0d; }

/* ---------- Radar Care Live (SVG) ---------- */
.radar-wrap { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 520px; margin: 0 auto; }
.radar-wrap svg { width: 100%; height: 100%; }
.radar-ring { fill: none; stroke: rgba(255, 255, 255, .10); stroke-dasharray: 3 5; }
.radar-sweep { transform-origin: 50% 50%; animation: sweep 4s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.staff-dot { fill: var(--accent-2); filter: drop-shadow(0 0 6px var(--accent-2)); cursor: pointer; }
.staff-dot.sel { fill: var(--ok); filter: drop-shadow(0 0 10px var(--ok)); }
.cust-dot { fill: #fff; filter: drop-shadow(0 0 10px var(--accent)); }

/* ---------- Biểu đồ cột ---------- */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 150px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar i { width: 100%; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 0 18px var(--accent-soft); min-height: 4px; transition: height .6s; }
.bar span { font-size: .72rem; color: var(--muted); text-align: center; }
.bar b { font-size: .8rem; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 2000; }
.toast-i { padding: 12px 16px; border-radius: 14px; background: #101733; border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 220px; animation: pop .25s; }
.toast-i.err { border-color: var(--danger); } .toast-i.ok { border-color: var(--ok); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Đăng nhập ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(430px, 100%); padding: 34px; }
.login-card h1 { font-size: 1.6rem; font-weight: 700; margin: 14px 0 4px; }
.alert-glass { padding: 10px 14px; border-radius: 12px; font-size: .88rem; margin-bottom: 14px; background: rgba(251, 93, 110, .15); border: 1px solid var(--danger); }
.alert-ok { background: rgba(52, 211, 153, .12); border-color: var(--ok); }

/* ---------- Nhân viên: nhịp "thermal" ---------- */
.thermal { position: relative; overflow: hidden; }
.thermal::before {
  content: ""; position: absolute; width: 360px; height: 360px; right: -90px; top: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 61, .45), rgba(255, 59, 78, .18) 45%, transparent 70%); filter: blur(6px);
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.12); opacity: .75; } }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); display: inline-block; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.switch { position: relative; width: 52px; height: 30px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: rgba(255, 255, 255, .15); cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 22px; height: 22px; left: 4px; top: 4px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch input:checked + span::before { transform: translateX(22px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .span-8, .span-7, .span-6, .span-5, .span-4, .span-3 { grid-column: span 12; } }
@media (max-width: 991px) {
  .app { grid-template-columns: 1fr; padding: 10px; padding-bottom: 86px; }
  .sidebar {
    position: fixed; top: auto; bottom: 10px; left: 10px; right: 10px; height: auto; flex-direction: row; justify-content: space-around;
    padding: 8px; border-radius: 22px; z-index: 1040; overflow-x: auto;
  }
  .brand, .nav-sep, .sidebar-foot, .nav-item span { display: none; }
  .nav-item { padding: 12px; flex: 0 0 auto; } .nav-item i { font-size: 1.3rem; }
  .search { display: none; }
  .hello h2 { font-size: 1.6rem; } .kpi-value { font-size: 2.1rem; }
  .field-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Accent cho NGƯỜI ĐẶT (xanh lá kiểu Grab trên nền tối) ---------- */
:root[data-accent="customer"] {
  --bg-0: #03120e; --bg-1: #07201a;
  --accent: #14d27c; --accent-2: #21c7e8; --accent-soft: rgba(20, 210, 124, .2);
  --glow-a: rgba(20, 210, 124, .28); --glow-b: rgba(33, 199, 232, .18);
}
.st-EN_ROUTE { color: var(--warn); } .st-ARRIVED { color: var(--info); }

/* ---------- Ảnh đại diện & trạng thái trực tuyến (quản lý người dùng, danh sách đơn) ---------- */
img.avatar { object-fit: cover; background: rgba(255,255,255,.06); }
.avatar-sm { width: 34px; height: 34px; font-size: .85rem; flex: none; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.6rem; flex: none; }
.avatar-wrap { position: relative; display: inline-block; flex: none; }
.online-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #6b7280; border: 2px solid var(--bg, #0b1020); }
.online-dot.on { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.u-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.u-toolbar input, .u-toolbar select { padding: 7px 10px; }
.chip { border: 1px solid var(--line, rgba(255,255,255,.14)); background: transparent; color: inherit; border-radius: 999px; padding: 5px 12px; font-size: .82rem; cursor: pointer; }
.chip.on { background: var(--accent, #14d27c); color: #04110b; border-color: transparent; font-weight: 600; }
.u-row { cursor: pointer; }
.u-row:hover { background: rgba(255,255,255,.04); }
.u-sub { color: var(--muted); font-size: .78rem; }
.u-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.u-box { border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 12px; }
.u-box h3 { font-size: .8rem; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; }
.u-kv { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; padding: 3px 0; border-bottom: 1px dashed rgba(255,255,255,.07); }
.u-kv span:first-child { color: var(--muted); }
.u-ai { border: 1px solid rgba(20,210,124,.35); background: rgba(20,210,124,.06); border-radius: 14px; padding: 12px; }
.u-ai.high { border-color: rgba(255,90,90,.5); background: rgba(255,90,90,.07); }
.u-ai.medium { border-color: rgba(255,190,60,.5); background: rgba(255,190,60,.07); }
.modal-box.wide { max-width: 980px; width: 96vw; max-height: 92vh; overflow: auto; }
.u-toolbar .form-glass { width: auto; }

/* ---------- Di động (iOS/Android): quản trị dùng được bằng một tay ---------- */
.topbar { flex-wrap: nowrap; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .icon-btn { flex: none; }
@media (max-width: 991px) {
  .app { padding-bottom: calc(86px + env(safe-area-inset-bottom)); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .sidebar { bottom: calc(10px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; scrollbar-width: none; justify-content: flex-start; }
  .sidebar::-webkit-scrollbar { display: none; }
  .nav-item { min-width: 48px; min-height: 48px; justify-content: center; }   /* vùng chạm tối thiểu 48px */
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar h1 { font-size: 1.05rem; }
  .table-wrap { -webkit-overflow-scrolling: touch; margin: 0 -4px; }
  .table-glass { min-width: 640px; }
  .modal-back { align-items: flex-end; padding: 0; }
  .modal-box, .modal-box.wide { width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  /* iOS tự phóng to khi ô nhập < 16px */
  .field input, .field select, .field textarea, .form-glass, input, select, textarea { font-size: 16px; }
  .u-toolbar > * { flex: 1 1 auto; }
  .u-toolbar input[type="search"] { min-width: 0 !important; width: 100%; }
  .chip { padding: 8px 14px; }
  .btn-sm2 { min-height: 40px; }
}
@media (max-width: 480px) { .user-chip .avatar { width: 34px; height: 34px; } .tiles { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Cổng "Của tôi" (khách + người làm) ---------- */
.portal { max-width: 1100px; margin: 0 auto; padding: 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.hello-card { background: linear-gradient(150deg, rgba(255,255,255,.09), rgba(255,255,255,.03)); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.pbox { padding: 16px 18px; border-radius: 18px; background: rgba(255,255,255,.045); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.pbox > span { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.pbox .kpi-value { font-size: 2rem; }
.pcols { align-items: start; display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chart-bars { min-height: 170px; }
.chart-bars.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; }
.chart-bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; min-width: 0; }
.chart-bars .bar i { display: block; width: 100%; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.chart-bars .bar b { font-size: .64rem; color: var(--muted); font-weight: 600; } .chart-bars .bar span { font-size: .62rem; color: var(--muted); }
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.row-item .grow { flex: 1; min-width: 0; } .row-item .t { font-weight: 600; } .row-item .s { color: var(--muted); font-size: .82rem; }
.pos { color: var(--ok); font-weight: 700; } .neg { color: var(--danger); font-weight: 700; }
.portal textarea, .portal input:not([type=checkbox]):not([type=radio]), .portal select { width: 100%; }
.portal input[type=checkbox], .portal input[type=radio] { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 3px; }
@media (max-width: 600px) { .pcols { grid-template-columns: 1fr; } .portal { padding: 10px; } }
.chart-bars.bars { gap: 3px; overflow: hidden; } .chart-bars .bar b { font-size: .55rem; max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; } .chart-bars .bar span { font-size: .55rem; }

/* ---------- Hạng người làm ---------- */
.tier { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 800; letter-spacing: .02em; border: 1px solid transparent; white-space: nowrap; }
.tier-NEW { background: rgba(148,160,196,.16); color: #b9c4e6; border-color: rgba(148,160,196,.3); }
.tier-BRONZE { background: rgba(205,127,50,.18); color: #f0b27a; border-color: rgba(205,127,50,.45); }
.tier-SILVER { background: rgba(203,213,225,.16); color: #e2e8f0; border-color: rgba(203,213,225,.45); }
.tier-GOLD { background: linear-gradient(135deg, rgba(245,199,107,.28), rgba(233,169,58,.16)); color: #ffd98a; border-color: rgba(245,199,107,.6); box-shadow: 0 0 14px rgba(245,199,107,.25); }
.tier-DIAMOND { background: linear-gradient(135deg, rgba(91,124,255,.32), rgba(56,189,248,.2)); color: #b9d4ff; border-color: rgba(125,170,255,.7); box-shadow: 0 0 18px rgba(91,124,255,.4); }
.staff-table td { vertical-align: top; } .staff-table td:nth-child(5) { min-width: 220px; } .staff-table td:nth-child(2) { min-width: 150px; }
.staff-table { min-width: 1180px; } .staff-table th { white-space: nowrap; }
.staff-table td:nth-child(1) { min-width: 190px; } .staff-table td:nth-child(3) { min-width: 120px; white-space: nowrap; } .staff-table td:nth-child(4) { min-width: 90px; }
.staff-table td:nth-child(7) { min-width: 170px; } .staff-table td:nth-child(7) .pill { display: inline-block; white-space: nowrap; margin-bottom: 4px; }
.staff-table td:nth-child(8), .staff-table td:nth-child(9) { min-width: 130px; } .staff-table .pill { white-space: nowrap; }
.content > * { min-width: 0; } .table-wrap { max-width: 100%; }

/* ---------- Nhật ký hệ thống: màu theo nhóm ---------- */
.pill.cat-SECURITY { background: rgba(251,93,110,.16); color: #ff9aa6; } .pill.cat-USER { background: rgba(91,124,255,.18); color: #a9bcff; }
.pill.cat-BOOKING { background: rgba(56,189,248,.16); color: #8fdcff; } .pill.cat-FINANCE { background: rgba(245,199,107,.18); color: #ffd98a; }
.pill.cat-SAFETY { background: rgba(251,146,60,.2); color: #ffbb85; } .pill.cat-SYSTEM { background: rgba(148,160,196,.16); color: #c4cdee; }
.audit-table td { vertical-align: top; } .audit-detail { max-width: 460px; word-break: break-word; } .audit-table { min-width: 960px; }
.audit-table tr[hidden] { display: none; }
.audit-table td:nth-child(4) .pill { white-space: nowrap; } .audit-table td:nth-child(3) { min-width: 210px; }

/* ---------- Danh mục dịch vụ: ảnh & link ---------- */
.svc-thumb { width: 56px; height: 36px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,.06); flex: none; }
.svc-img-box { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.svc-img-box img { width: 160px; height: 96px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.05); }
[data-page="accounting"] .tile b { font-size: 1.35rem; white-space: nowrap; } [data-page="accounting"] .tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* Logo thương hiệu: dùng chung MỘT biểu tượng (img/icon.svg) cho mọi giao diện — khách, người làm, quản trị, trang chủ */
.brand-logo, .lp-logo { background: none !important; padding: 0; overflow: hidden; }
.brand-logo .logo-icon, .lp-logo .logo-icon { width: 100%; height: 100%; display: block; border-radius: inherit; }

/* ===== Trạng thái: mất mạng, đang tải (khung xương), lỗi, rỗng — dùng chung mọi trang ===== */
.net-banner { position: fixed; z-index: 3000; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); display: none; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; background: #3b1218; border: 1px solid #f43f5e; color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.net-banner.show { display: flex; } .net-banner.ok { background: #0c3b27; border-color: #22c55e; } .net-banner span { flex: 1; font-size: .9rem; }
.net-retry { border: 0; border-radius: 10px; padding: 6px 12px; font-weight: 700; background: rgba(255,255,255,.18); color: #fff; cursor: pointer; } .net-banner.ok .net-retry { display: none; }
@media (min-width: 700px) { .net-banner { left: 50%; right: auto; transform: translateX(-50%); min-width: 420px; } }
.sk-list { display: grid; gap: 12px; padding: 4px 0; } .sk-row { display: flex; gap: 12px; align-items: center; }
.sk-ic { width: 44px; height: 44px; border-radius: 14px; flex: none; } .sk-tx { flex: 1; display: grid; gap: 8px; } .sk-l1, .sk-l2 { display: block; height: 12px; border-radius: 8px; } .sk-l1 { width: 62%; } .sk-l2 { width: 38%; height: 10px; }
.sk-ic, .sk-l1, .sk-l2 { background: linear-gradient(100deg, rgba(255,255,255,.06) 20%, rgba(255,255,255,.16) 40%, rgba(255,255,255,.06) 60%); background-size: 220% 100%; animation: skShine 1.3s linear infinite; }
@keyframes skShine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .sk-ic, .sk-l1, .sk-l2 { animation: none; } }
.state-box { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 14px; color: var(--muted); }
.state-box > i { font-size: 2.2rem; color: var(--accent); opacity: .9; } .state-box > b { color: var(--text, #fff); font-size: 1.02rem; } .state-box p { margin: 0; max-width: 34ch; font-size: .9rem; }
.state-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
/* trang lỗi 404 / 403 / 500 */
.err-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.err-card { max-width: 440px; width: 100%; text-align: center; padding: 34px 26px; }
.err-code { font-size: 4.2rem; font-weight: 800; letter-spacing: -.03em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; margin: 14px 0 6px; }
.err-card h1 { font-size: 1.3rem; margin: 0 0 8px; } .err-card p { color: var(--muted); margin: 0 0 20px; }
.err-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Tìm kiếm toàn hệ thống (thanh trên khu quản trị) ---------- */
.topbar .gs { position: relative; }
.gs-res { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 1200; min-width: 320px; max-height: 70vh; overflow: auto; padding: 8px; border-radius: 16px; background: #0e1530; border: 1px solid var(--border); box-shadow: var(--shadow); }
.gs-res[hidden] { display: none; }
.gs-h { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.gs-it { display: block; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; } .gs-it .s { font-size: .78rem; color: var(--muted); }
.gs-it:hover, .gs-it:focus-visible { background: var(--accent-soft); outline: 0; }
.gs-empty { padding: 14px 10px; color: var(--muted); font-size: .9rem; }

.topbar:has(.gs-res:not([hidden])) { position: relative; z-index: 1300; }

/* ---------- Ô mật khẩu có nút con mắt (pw-eye.js; trang đăng nhập/đăng ký dùng cùng lớp) ---------- */
.pw-wrap { position: relative; display: block; } .pw-wrap input { padding-right: 46px; width: 100%; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--text); background: rgba(127, 127, 160, .15); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-auto { display: block; }

/* ---------- Ẩn/hiện số tiền (money-eye.js) ---------- */
.money-eye { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--glass); color: var(--text); cursor: pointer; display: grid; place-items: center; z-index: 2; }
.money-eye:hover { background: var(--accent-soft); } .money-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hello-card { position: relative; }
.money-hidden { letter-spacing: .12em; user-select: none; }

/* Ảnh đính kèm đánh giá (TG.photoPicker) */
.rv-pick { margin: 8px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.rv-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-th { position: relative; }
.rv-th img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; display: block; }
.rv-th button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; line-height: 1; }
.rv-block { margin-top: 8px; } .rv-side { margin-top: 8px; } .rv-big { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; display: block; }
