/* Onyx Parking — clone giao dien parking.onyx.vn (Blazor WASM + MudBlazor, Parking.Web 5.1.2)
   Design token lay truc tiep tu CSS variable cua ban dang chay that. */
:root {
  --primary: rgb(9, 82, 180);
  --secondary: rgb(255, 199, 54);
  --appbar-bg: #ffffff;
  --drawer-bg: #ffffff;
  --drawer-text: rgb(66, 66, 66);
  --background: rgb(245, 246, 250);
  --surface: #ffffff;
  --text-primary: rgb(33, 37, 41);
  --text-secondary: rgb(79, 94, 102);
  --divider: rgb(224, 224, 224);
  --success: rgb(0, 200, 83);
  --error: rgb(244, 67, 54);
  --warning: rgb(255, 152, 0);
  --info: rgb(33, 150, 243);
  --action: rgba(0, 0, 0, .537);
  --radius: 3px;
  --drawer-w: 240px;
  --appbar-h: 64px;
  --shadow-appbar: rgba(0,0,0,.2) 0 2px 4px -1px, rgba(0,0,0,.14) 0 4px 5px 0, rgba(0,0,0,.12) 0 1px 10px 0;
  --shadow-drawer: rgba(0,0,0,.06) 0 5px 5px -3px, rgba(0,0,0,.043) 0 8px 10px 1px, rgba(0,0,0,.035) 0 3px 14px 2px;
  --shadow-paper: rgba(0,0,0,.2) 0 2px 1px -1px, rgba(0,0,0,.14) 0 1px 1px 0, rgba(0,0,0,.12) 0 1px 3px 0;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: Montserrat, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.43;
  -webkit-font-smoothing: antialiased;
}

/* ---------- App bar ---------- */
.appbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--appbar-h);
  background: var(--appbar-bg); box-shadow: var(--shadow-appbar); z-index: 1300;
  display: flex; align-items: center; padding: 0 16px; gap: 8px;
}
.appbar .brand-title {
  /* Gray 85% theo yeu cau, khong dung --primary (xanh) nua; --text-primary da
     xap xi gray 85% o theme sang (rgb(33,37,41)) va tu doi mau hop ly o theme toi */
  color: var(--text-primary); text-decoration: none;
  font-size: 20px; font-weight: 400; margin-left: 16px;
  letter-spacing: .0075em; white-space: nowrap;
}
.appbar .spacer { flex: 1 1 auto; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  color: var(--action); cursor: pointer; padding: 0; transition: background .2s;
}
.icon-btn:hover { background: rgba(0,0,0,.06); }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: #fff; margin-left: 8px; text-decoration: none;
}
.avatar img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }

/* ---------- Drawer ---------- */
.drawer {
  position: fixed; top: var(--appbar-h); bottom: 0; left: 0; width: var(--drawer-w);
  background: var(--drawer-bg); box-shadow: var(--shadow-drawer); z-index: 1200;
  display: flex; flex-direction: column; overflow: hidden;
}
.navmenu { flex: 1 1 auto; overflow-y: auto; padding: 8px 0 0; }
.nav-link {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 8px 16px;
  color: var(--drawer-text); text-decoration: none; font-size: 14px; font-weight: 400;
  transition: background .15s; cursor: pointer; user-select: none;
}
.nav-link:hover { background: rgba(0,0,0,.04); }
.nav-link.active { background: rgba(0,0,0,.06); color: var(--primary); }
.nav-link .nav-icon { width: 24px; height: 24px; flex: 0 0 24px; fill: currentColor; opacity: .82; }
.nav-link .nav-text { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link .chev { width: 20px; height: 20px; flex: 0 0 20px; fill: currentColor; transition: transform .2s; opacity: .7; }

/* Nhom menu gap/mo bang <details> — khong can JS, giong hanh vi MudNavGroup */
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group[open] > summary .chev { transform: rotate(180deg); }
.nav-children .nav-link { padding-left: 32px; }
.nav-children .nav-group > summary { padding-left: 32px; }
.nav-children .nav-children .nav-link { padding-left: 52px; }
.nav-children .nav-icon { width: 20px; height: 20px; flex-basis: 20px; }

.drawer-footer { padding: 14px 16px 18px; text-align: center; }
.drawer-footer img { width: 130px; max-width: 100%; display: block; margin: 0 auto; }
.drawer-footer .app-name { font-size: 11px; font-weight: 700; color: var(--text-primary); margin-top: 2px; }
.drawer-footer .app-ver { font-size: 10px; color: var(--text-secondary); }

/* ---------- Vung noi dung ---------- */
.main { margin-left: var(--drawer-w); padding-top: var(--appbar-h); min-height: 100vh; }
.page-toolbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--background); border-bottom: 2px solid var(--primary);
  min-height: 56px; flex-wrap: wrap;
}
.page-title { color: var(--primary); font-size: 15px; font-weight: 700; margin: 0 auto 0 0; }

/* Truong nhap kieu MudBlazor outlined, label noi tren duong vien */
.field { position: relative; min-width: 170px; }
.field > label {
  position: absolute; top: -8px; left: 9px; padding: 0 4px; background: var(--background);
  font-size: 11px; color: var(--text-secondary); z-index: 1; pointer-events: none;
}
.field select, .field input:not([type=radio]):not([type=checkbox]) {
  width: 100%; height: 40px; padding: 0 10px; font: inherit; font-size: 14px;
  color: var(--text-primary); background: transparent;
  border: 1px solid rgba(0,0,0,.23); border-radius: var(--radius); appearance: none;
}
.field select {
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23757575'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 20px;
}
.field select:focus, .field input:not([type=radio]):not([type=checkbox]):focus { outline: none; border: 2px solid var(--primary); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border: 0; border-radius: var(--radius); font: inherit; font-size: 14px; font-weight: 500;
  letter-spacing: .02857em; text-transform: uppercase; cursor: pointer; text-decoration: none;
  box-shadow: rgba(0,0,0,.2) 0 3px 1px -2px, rgba(0,0,0,.14) 0 2px 2px 0, rgba(0,0,0,.12) 0 1px 5px 0;
  transition: filter .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(.93); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-icon-primary { background: var(--primary); color: #fff; padding: 0 10px; }

.page-body { padding: 12px 16px 16px; }

/* ---------- Paper / Card ---------- */
.paper { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-paper); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { padding: 16px 18px 20px; }
.stat-card .stat-head { display: flex; align-items: center; justify-content: space-between; }
.stat-card .stat-label { color: var(--primary); font-size: 15px; font-weight: 400; }
.stat-card .stat-head svg { width: 22px; height: 22px; fill: var(--primary); }
.stat-card .stat-value { font-size: 30px; font-weight: 700; margin-top: 14px; }
/* Dai tong hop dau trang danh sach (vd San do: Tong/Cho trong/Dang do) — 3
   the thay vi 4 cua stat-grid goc, nen can luoi rieng; tai su dung .stat-card
   cho tung the va bien mau/khoang cach da co, khong dinh mau moi. */
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; }
.list-head {
  padding: 16px 16px 0; font-size: 15px; font-weight: 700;
  color: var(--text-primary);
}

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.chart-card { padding: 16px; min-height: 420px; display: flex; flex-direction: column; }
.chart-card .chart-title { text-align: center; color: var(--primary); font-size: 15px; }
.chart-area { flex: 1 1 auto; position: relative; margin-top: 24px; }
.chart-area .axis-max, .chart-area .axis-min { position: absolute; left: 0; font-size: 12px; color: var(--text-secondary); }
.chart-area .axis-max { top: 0; }
.chart-area .axis-min { bottom: 0; }
.chart-area .baseline { position: absolute; left: 30px; right: 0; bottom: 7px; border-top: 1px solid var(--divider); }
.chart-area .bars { position: absolute; left: 30px; right: 0; bottom: 8px; top: 0; display: flex; align-items: flex-end; gap: 10px; }
.chart-area .bar { flex: 1 1 0; background: var(--primary); opacity: .85; border-radius: 2px 2px 0 0; min-height: 1px; }

/* ---------- Bang du lieu ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data th {
  background: var(--surface); color: var(--text-primary); font-size: 14px; font-weight: 700;
  padding: 8px; text-align: center; border: 1px solid var(--divider);
}
table.data thead tr:last-child th { border-bottom: 2px solid var(--primary); }
table.data td {
  padding: 10px 8px; text-align: center; font-size: 14px;
  border-bottom: 1px solid var(--divider);
}
table.data tbody tr:nth-child(even) { background: #fafafa; }
table.data tbody tr:hover { background: rgba(9,82,180,.04); }
table.data td.muted { color: var(--text-secondary); }
.row-actions { display: flex; gap: 12px; justify-content: flex-end; padding-right: 14px; }
.row-actions svg { width: 20px; height: 20px; }
/* Bieu tuong but chi la mot the <a> that (mo hop thoai sua bang :target) —
   inline-flex de no khong cao hon o va khong an gach chan cua link. */
.row-actions a { display: inline-flex; text-decoration: none; }
.cell-action { white-space: nowrap; }
.act-view { fill: var(--primary); }
.act-edit { fill: var(--warning); }
.act-del  { fill: var(--error); }

.chip {
  display: inline-block; padding: 4px 14px; border-radius: 16px; font-size: 13px;
  border: 1px solid currentColor; background: #fff;
}
.chip-success { color: var(--success); }
.chip-default { color: var(--text-secondary); }
.chip-error { color: var(--error); }
.chip-warn { color: var(--warning); }

.table-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 20px;
  padding: 12px 16px; border-top: 1px solid var(--divider); font-size: 14px;
  color: var(--text-primary); background: var(--surface);
}
.table-footer .pager { display: flex; gap: 4px; align-items: center; }
.table-footer .pager svg { width: 22px; height: 22px; fill: var(--action); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--text-secondary); padding: 60px 0; flex: 1 1 auto;
}
.empty-state svg { width: 96px; height: 96px; }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split-panel { min-height: 570px; display: flex; flex-direction: column; padding: 16px; }
.split-panel .panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.split-panel .panel-head .count-box {
  width: 46px; height: 40px; border: 1px solid rgba(0,0,0,.23); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
}
.split-panel .panel-head .spacer { flex: 1 1 auto; }

.thumb {
  width: 46px; height: 34px; object-fit: cover; border: 1px solid var(--divider);
  border-radius: 2px; background: #f0f0f0;
}

/* ---------- Trang dang nhap ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #d1dced 0%, var(--background) 100%);
}
.login-card { width: 380px; max-width: 92vw; padding: 32px 28px; text-align: center; }
.login-card img.logo { width: 160px; margin-bottom: 6px; }
.login-card .sub { color: var(--primary); font-size: 15px; font-weight: 700; margin-bottom: 24px; }
.login-card .field { margin-bottom: 22px; min-width: 0; text-align: left; }
.login-card .field > label { background: var(--surface); }
.login-card .btn { width: 100%; justify-content: center; }
.login-error {
  background: rgba(244,67,54,.1); color: var(--error); border-radius: var(--radius);
  padding: 10px; font-size: 13px; margin-bottom: 16px;
}
.login-hint { margin-top: 18px; font-size: 12px; color: var(--text-secondary); line-height: 1.7; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .chart-grid, .split-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .drawer { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Bao cao chi tiet bien so ---------- */
.report-layout { display: flex; gap: 12px; align-items: flex-start; }
.report-main { flex: 1 1 auto; min-width: 0; }
table.plate-table th { white-space: nowrap; }
table.plate-table td { white-space: nowrap; }

.filter-panel {
  width: 240px; flex: 0 0 240px; padding: 14px 16px 18px; display: none;
  flex-direction: column; gap: 18px;
}
.filter-panel.open { display: flex; }
.filter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filter-title { color: var(--primary); font-weight: 700; font-size: 14px; }
.clear-filter {
  color: var(--error); border: 1px solid currentColor; border-radius: var(--radius);
  font-size: 12px; padding: 3px 8px; text-decoration: none; text-transform: uppercase;
}
.filter-panel .field > label { background: var(--surface); }
.filter-panel .check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); }

@media (max-width: 1400px) {
  .report-layout { flex-direction: column; }
  .filter-panel { width: 100%; flex: 1 1 auto; }
}

.chart-svg { width: 100%; height: auto; flex: 1 1 auto; margin-top: 8px; }

/* ---------- Trang dang form (Ho so ca nhan, Tham so he thong) ---------- */
.form-card { padding: 24px; max-width: 760px; }
.form-subtitle { color: var(--primary); font-weight: 700; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 20px; }
.form-card .field > label { background: var(--surface); }
.form-card .field input[readonly] { background: #fafafa; }
.radio-row { display: flex; align-items: center; gap: 18px; height: 40px; padding: 0 10px;
  border: 1px solid rgba(0,0,0,.23); border-radius: var(--radius); }
.radio-row .radio { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.form-actions { display: flex; gap: 12px; margin-top: 28px; }

.cell-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; background: #e3ecf9;
  color: var(--primary); font-weight: 700; font-size: 14px;
}

@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.radio-row input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.filter-panel .check input { width: 16px; height: 16px; margin: 0; }

/* ==========================================================================
   Giao dien toi — bang mau lay truc tiep tu bien MudBlazor khi bat dark mode
   tren ban that (appbar/drawer #27272f, nen #32333d, surface #373740,
   primary chuyen sang tim #776be7).
   ========================================================================== */
html[data-theme="dark"] {
  --primary: rgb(119, 107, 231);
  --appbar-bg: rgb(39, 39, 47);
  --drawer-bg: rgb(39, 39, 47);
  --drawer-text: rgba(255, 255, 255, .5);
  --background: rgb(50, 51, 61);
  --surface: rgb(55, 55, 64);
  --text-primary: rgba(255, 255, 255, .7);
  --text-secondary: rgba(255, 255, 255, .5);
  --divider: rgba(255, 255, 255, .12);
  --action: rgba(255, 255, 255, .5);
  --shadow-appbar: none;
  --shadow-drawer: none;
  --shadow-paper: rgba(0,0,0,.3) 0 2px 1px -1px, rgba(0,0,0,.24) 0 1px 1px 0, rgba(0,0,0,.22) 0 1px 3px 0;
}
html[data-theme="dark"] table.data tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }
html[data-theme="dark"] table.data tbody tr:hover { background: rgba(255,255,255,.05); }
html[data-theme="dark"] .nav-link:hover { background: rgba(255,255,255,.06); }
html[data-theme="dark"] .nav-link.active { background: rgba(255,255,255,.09); color: #fff; }
html[data-theme="dark"] .chip { background: transparent; }
html[data-theme="dark"] .field select, html[data-theme="dark"] .field input { border-color: rgba(255,255,255,.3); color: var(--text-primary); }
html[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b0b0b0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .field select option { background: var(--surface); color: var(--text-primary); }
html[data-theme="dark"] .form-card .field input[readonly] { background: rgba(255,255,255,.04); }
html[data-theme="dark"] .avatar { background: #fff; }
html[data-theme="dark"] .drawer-footer img,
html[data-theme="dark"] .login-card img.logo { filter: invert(1) brightness(1.6); }
/* Nut mat troi / mat trang: chi hien dung mot cai theo giao dien dang bat. */
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* ---------- Drawer thu gon ---------- */
body.drawer-collapsed { --drawer-w: 56px; }
body.drawer-collapsed .nav-link { padding-left: 16px; padding-right: 16px; }
body.drawer-collapsed .nav-text,
body.drawer-collapsed .chev,
body.drawer-collapsed .drawer-footer .app-name,
body.drawer-collapsed .drawer-footer .app-ver { display: none; }
body.drawer-collapsed .drawer-footer img { width: 40px; }
body.drawer-collapsed .nav-children { display: none; }
body.drawer-collapsed .nav-children .nav-link { padding-left: 16px; }

/* ---------- Hop thoai (MudDialog) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 1400; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(0, 0, 0, .32);
}
.modal:target, .modal.open { display: flex; }
.modal-card {
  background: var(--surface); border-radius: 4px; width: 600px; max-width: 100%;
  max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: rgba(0,0,0,.2) 0 11px 15px -7px, rgba(0,0,0,.14) 0 24px 38px 3px, rgba(0,0,0,.12) 0 9px 46px 8px;
}
.modal-title {
  text-align: center; color: var(--primary); font-size: 16px; font-weight: 500;
  padding: 16px 24px 8px;
}
.modal-body { padding: 8px 20px 16px; overflow-y: auto; display: grid; gap: 22px; }
.modal-body .field > label { background: var(--surface); }
.modal-body .upload-box {
  border: 1px solid rgba(0,0,0,.23); border-radius: var(--radius); height: 190px;
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
}
html[data-theme="dark"] .modal-body .upload-box { border-color: rgba(255,255,255,.3); }
/* O chon tep + anh dang co xep doc trong cung mot khung; anh phai bi kep lai
   khong thi mot anh 4000px se keo gian ca hop thoai. */
.upload-box {
  flex-direction: column; gap: 8px; padding: 8px; overflow: hidden;
}
.upload-box input[type="file"] { max-width: 100%; font-size: 13px; }
.upload-box .thumb { max-height: 130px; max-width: 100%; object-fit: contain; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 12px; padding: 12px 20px 16px;
}
.btn-outline {
  background: transparent; color: var(--primary); border: 1px solid rgba(9,82,180,.5);
  box-shadow: none;
}
.req { color: var(--error); }

/* ---------- Xem anh phong to (lightbox) ---------- */
/* Nen mo (khong den kin) de nguoi dung con thay trang cu phia sau khung popup. */
.lightbox {
  position: fixed; inset: 0; z-index: 1500; display: none;
  align-items: center; justify-content: center; background: rgba(0,0,0,.4);
}
.lightbox:target { display: flex; }
/* Khung popup co vien/nen/bong, anh phong to lon hon 200x200 cu (theo vw/vh). */
.lightbox-panel {
  position: relative; background: var(--surface); border: 1px solid var(--divider);
  border-radius: var(--radius); box-shadow: var(--shadow-paper); padding: 20px;
  max-width: 94vw; max-height: 94vh; display: flex;
}
.lightbox img { max-width: 90vw; max-height: 85vh; display: block; }
.lightbox .close {
  position: absolute; top: -14px; right: -14px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--divider); color: var(--text-primary);
  font-size: 18px; text-decoration: none; line-height: 1; box-shadow: var(--shadow-paper);
}

/* ---------- Nut co menu con (split button) ---------- */
.split-btn { position: relative; display: inline-flex; }
.split-btn > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-btn > .btn + .btn {
  border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 8px;
  border-left: 1px solid rgba(255,255,255,.3);
}
.split-menu {
  position: absolute; top: 44px; right: 0; min-width: 180px; z-index: 1350;
  background: var(--surface); border-radius: var(--radius); padding: 6px 0;
  box-shadow: var(--shadow-appbar); display: none;
}
.split-btn.open .split-menu { display: block; }
.split-menu a {
  display: block; padding: 9px 16px; color: var(--text-primary);
  text-decoration: none; font-size: 14px;
}
.split-menu a:hover { background: rgba(0,0,0,.05); }
html[data-theme="dark"] .split-menu a:hover { background: rgba(255,255,255,.07); }

/* ---------- Panel chi tiet thiet bi / lan ---------- */
.detail-panel { padding: 16px 18px; display: flex; flex-direction: column; min-height: 570px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.detail-head .detail-title { font-size: 15px; color: var(--text-primary); }
.btn-danger-outline {
  background: transparent; color: var(--error); border: 1px solid rgba(244,67,54,.5);
  box-shadow: none; height: 32px; padding: 0 14px; font-size: 13px;
}
.detail-body { flex: 1 1 auto; overflow-y: auto; padding-right: 6px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 20px; }
.detail-grid .field { min-width: 0; }
.detail-grid .field > label { background: var(--surface); }
.detail-grid .full { grid-column: 1 / -1; }
.section-head {
  grid-column: 1 / -1; color: var(--primary); font-size: 14px; margin: 8px 0 -6px;
}
.col-label { grid-column: span 1; color: var(--text-primary); font-size: 14px; margin-bottom: -12px; }
table.data tbody tr.selected { background: var(--primary) !important; color: #fff; }
table.data tbody tr.selected td { color: #fff; }
table.data tbody tr.row-link { cursor: pointer; }
table.data tbody tr.row-link td a { color: inherit; text-decoration: none; display: block; }

@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

/* --- Thong bao loi validate --- */
.field-error {
  color: #d32f2f;
  font-size: 12px;
  margin-top: 4px;
}
.form-error {
  background: #fdecea;
  color: #611a15;
  border-radius: 3px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}
/* Modal mo san khi server tra ve loi (khong dua vao :target) */
.modal.open { display: flex; }
.modal-card.modal-sm { width: 400px; }
.btn-danger {
  background: #d32f2f;
  color: #fff;
  border: none;
}
/* --- Cay quyen hai cap (trang Phan quyen) --- */
.perm-tree { max-height: 420px; overflow-y: auto; padding: 4px 2px; }
.perm-all {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; padding: 6px 0; border-bottom: 1px solid var(--divider);
  margin-bottom: 8px;
}
.perm-group { margin-bottom: 6px; }
.perm-parent { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.perm-children {
  display: flex; flex-wrap: wrap; gap: 4px 20px;
  padding: 4px 0 4px 28px;
}
.perm-child { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.perm-tree input[type="checkbox"] { width: auto; height: auto; margin: 0; }
/* --- Bang phi con cua Nhom phuong tien --- */
.fee-table { grid-column: 1 / -1; margin-top: 12px; }
.fee-table table { width: 100%; }
.fee-table td { padding: 4px 8px; }
.fee-table select, .fee-table input { width: 100%; }
.pager-off { opacity: .35; cursor: default; }
.yard-summary { font-size: 18px; margin-bottom: 12px; }
.yard-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.yard-slot { width: 96px; padding: 8px; border-radius: 6px; text-align: center; }
.yard-slot.is-free { background: #e8f5e9; }
.yard-slot.is-occupied { background: #ffebee; }
.yard-slot-name { font-weight: 600; }
.yard-slot-plate { font-size: 12px; }
.yard-slot-since { font-size: 11px; opacity: .7; }
.yard-line { padding: 4px 0; }

/* Bo loc hai tang cua trang bao cao (vd Luot do). Cac o loc nam trong MOT
   form GET nen phai tu xuong dong theo tang; toolbar cha la flex mot hang. */
.filter-bar { display: flex; flex-direction: column; gap: 18px; width: 100%; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

/* Nut xoa tren tung dong: <button> mac dinh mang vien va nen rieng, phai go
   het de no trong y het cac bieu tuong <svg> ben canh. */
.row-actions form { display: inline-flex; margin: 0; }
.row-actions .icon-btn { width: auto; height: auto; padding: 0; border: 0; background: none; }
.row-actions .icon-btn svg { width: 20px; height: 20px; }

/* O bang nhieu dong (vd Nguon = ten san + ten o do). Dong duoi la thong tin
   phu nen nho va nhat hon, de mat van bat duoc dong dau truoc. */
.cell-line + .cell-line { font-size: 12px; color: var(--text-secondary); }

/* Nut con mat trong o mat khau. .field da la position:relative nen dat tuyet
   doi theo no; input phai chua padding phai de chu khong chui xuong duoi nut. */
.field.has-pw-toggle input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 4px; top: 4px; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  color: var(--text-secondary);
}
.pw-toggle:hover { background: rgba(0,0,0,.06); }
.pw-toggle svg { width: 20px; height: 20px; fill: currentColor; }
