:root {
    --color-primary: #c9a227;
    --color-text: #222;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-bg: #f8f7f4;
    --color-ok: #15803d;
    --color-warn: #b45309;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-bg);
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.app-header {
    background: #fff;
    border-bottom: 2px solid var(--color-primary);
}

.app-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.4px;
}

.app-header nav a {
    margin-left: 16px;
    color: var(--color-muted);
    text-decoration: none;
}

.app-header nav a:hover { color: var(--color-primary); }

main.container { padding-top: 24px; padding-bottom: 40px; }

h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 12px; }

.lead { color: var(--color-muted); margin-top: 0; }

.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

table.kv { width: 100%; border-collapse: collapse; }
table.kv th,
table.kv td {
    text-align: left;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}
table.kv th { width: 180px; font-weight: 600; color: var(--color-muted); }
table.kv tr:last-child th,
table.kv tr:last-child td { border-bottom: 0; }

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-ok   { background: #dcfce7; color: var(--color-ok); }
.badge-warn { background: #fef3c7; color: var(--color-warn); }

code {
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 13px;
}

ol, ul { padding-left: 20px; }
ol li, ul li { margin-bottom: 6px; }

.app-footer {
    border-top: 1px solid var(--color-border);
    padding: 16px 0;
    color: var(--color-muted);
    font-size: 13px;
}

.error-card { text-align: center; margin-top: 60px; }
.error-card h1 { font-size: 48px; color: var(--color-primary); }

/* Bang du lieu dung chung cho cac man hinh danh sach */
table.data {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
table.data th {
    background: #faf7ee;
    border-bottom: 2px solid var(--color-primary);
    padding: 10px;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
table.data td {
    border-bottom: 1px solid var(--color-border);
    padding: 10px;
}
table.data td.num { text-align: right; white-space: nowrap; }
table.data tr.combo-parent td { font-weight: 600; }
table.data tr.combo-child td:first-child { padding-left: 28px; color: var(--color-muted); }

@media (max-width: 640px) {
    table.kv th { width: 120px; }
}

a { color: #8a6c10; }
.muted { color: var(--color-muted); font-size: 13px; }

label {
    display: block;
    margin: 0 0 6px;
    font-weight: 600;
}

input,
select {
    width: 100%;
    min-height: 40px;
    margin: 0 0 16px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    font: inherit;
}

.button {
    display: inline-block;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    color: var(--color-text);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.button-primary { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.button-danger { border-color: #b91c1c; background: #b91c1c; color: #fff; }
.button:disabled { cursor: not-allowed; opacity: 0.6; }
.button-block { width: 100%; }
.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #8a6c10;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.alert { margin-bottom: 16px; padding: 10px 12px; border-radius: 6px; }
.alert-error { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.alert-success { border: 1px solid #bbf7d0; background: #f0fdf4; color: #166534; }
.danger-zone { border-color: #fecaca; background: #fff7f7; }
.danger-zone textarea { width: 100%; margin: 0 0 16px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
}
.auth-card {
    width: min(100%, 420px);
    padding: 32px;
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-primary);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 12px 30px rgb(0 0 0 / 8%);
}
.auth-brand { margin-bottom: 20px; color: var(--color-primary); font-size: 20px; font-weight: 800; }

.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { padding: 22px 16px; background: #222; color: #fff; }
.sidebar-brand { display: block; margin-bottom: 24px; color: var(--color-primary); font-size: 20px; font-weight: 800; text-decoration: none; }
.sidebar-nav { display: grid; gap: 4px; }
.sidebar-nav a,
.nav-disabled { padding: 9px 10px; border-radius: 6px; color: #f3f4f6; text-decoration: none; }
.sidebar-nav a:hover { background: #343434; }
.nav-disabled { color: #9ca3af; font-size: 13px; }
.admin-main { min-width: 0; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--color-border);
    background: #fff;
}
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-actions form,
.actions form { display: inline; }
.admin-content { padding: 24px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.form-card { max-width: 680px; }
.field-help { margin-top: -10px; color: var(--color-muted); font-size: 13px; }
.filter-bar { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; margin-bottom: 16px; }
.filter-bar input,
.filter-bar select { margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius); }
.actions { min-width: 180px; }
.actions > * { margin-right: 8px; }
.inline-reset { display: inline-flex !important; align-items: center; gap: 6px; margin-top: 6px; }
.inline-reset input { width: 125px; min-height: 30px; margin: 0; padding: 4px 7px; }
.pagination { display: flex; gap: 6px; margin-top: 16px; }
.pagination a { min-width: 32px; padding: 5px; border: 1px solid var(--color-border); border-radius: 4px; text-align: center; text-decoration: none; }
.pagination a.active { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.filter-grid input, .filter-grid select { margin-bottom: 0; }
.filter-actions { padding-bottom: 1px; }
.report-export-actions { margin-top: 16px; }

@media (max-width: 900px) {
    .filter-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

@media (max-width: 560px) {
    .filter-grid { grid-template-columns: 1fr; }
}
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.permission-group { margin: 0; }
.permission-group legend { padding: 0 5px; font-weight: 700; }
.checkbox-row { display: flex; gap: 9px; margin-bottom: 10px; font-weight: 400; }
.checkbox-row input { width: auto; min-height: auto; margin: 4px 0 0; }
.checkbox-row small { display: block; color: var(--color-muted); }
.sticky-actions { position: sticky; bottom: 0; margin-top: 16px; padding: 12px 0; background: var(--color-bg); }

@media (max-width: 800px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { padding: 14px; }
    .sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar,
    .permission-grid { grid-template-columns: 1fr; }
}

/* Form tao booking nhap M5-C3. */
.booking-form { max-width: 1180px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid > .full { grid-column: 1 / -1; }
.form-grid textarea { width: 100%; margin-bottom: 16px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.booking-toolbar { display: flex; align-items: flex-start; gap: 8px; }
.booking-toolbar select { min-width: 300px; margin: 0; }
.booking-lines { display: grid; gap: 12px; }
.booking-line { padding: 14px; border: 1px solid var(--color-border); border-radius: 6px; background: #fff; }
.combo-summary, .combo-child-line { border-left: 4px solid var(--color-primary); background: #fffdf5; }
.booking-line-title { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.booking-line-title strong { margin-right: auto; }
.booking-line-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.booking-line-grid input, .booking-line-grid select { margin-bottom: 0; }
.button-small { min-height: 30px; padding: 3px 9px; }
.booking-customer-picker { position: relative; }
.lookup-results { position: absolute; z-index: 20; width: 100%; max-height: 260px; overflow-y: auto; margin: -14px 0 0; padding: 0; border: 1px solid var(--color-border); border-radius: 6px; background: #fff; box-shadow: 0 8px 20px rgb(0 0 0 / 12%); }
.lookup-results li { margin: 0; padding: 9px 12px; list-style: none; cursor: pointer; }
.lookup-results li:hover, .lookup-results li:focus { background: #faf7ee; outline: none; }
.booking-totals { display: grid; gap: 8px; max-width: 520px; margin-left: auto; }
.booking-totals div { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--color-border); }
.booking-totals dd { margin: 0; font-weight: 700; }
.booking-actions { display: flex; align-items: center; gap: 10px; z-index: 5; }
.alert-warning { border: 1px solid #fde68a; background: #fffbeb; color: #92400e; }
.combo-balance-error { margin: 8px 0 0; color: #991b1b; font-weight: 600; }
.combo-balance-ok { margin: 8px 0 0; color: var(--color-ok); }

@media (max-width: 900px) {
    .section-heading, .booking-toolbar { display: grid; grid-template-columns: 1fr; }
    .booking-toolbar select { min-width: 0; }
    .booking-line-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .form-grid, .booking-line-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
}

/* ---------------------------------------------------------------
   O chon dia ban hanh chinh 2 cap (resources/views/partials/area-picker.php)
   --------------------------------------------------------------- */
.area-picker { position: relative; }
.area-picker .area-picker-input { width: 100%; padding-right: 2rem; }
.area-picker .area-picker-clear {
    position: absolute; top: 0.35rem; right: 0.4rem;
    border: 0; background: transparent; cursor: pointer;
    font-size: 1.1rem; line-height: 1; color: #6b7280;
}
.area-picker .area-picker-clear:hover { color: #111827; }
.area-picker-results {
    position: absolute; z-index: 40; left: 0; right: 0; top: 100%;
    margin: 0.15rem 0 0; padding: 0; list-style: none;
    max-height: 18rem; overflow-y: auto;
    background: #fff; border: 1px solid #d1d5db; border-radius: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.area-picker-results li {
    display: flex; flex-direction: column; gap: 0.15rem;
    padding: 0.5rem 0.7rem; cursor: pointer; border-bottom: 1px solid #f1f5f9;
}
.area-picker-results li:last-child { border-bottom: 0; }
.area-picker-results li:hover,
.area-picker-results li:focus { background: #eff6ff; outline: none; }
.area-picker-results .area-picker-name { font-weight: 600; }
.area-picker-results .badge { align-self: flex-start; }
.area-picker-results .area-picker-note { color: #b45309; }
.area-picker-results .area-picker-empty { color: #6b7280; cursor: default; }
.area-picker-results .area-picker-empty:hover { background: transparent; }
.area-picker-results .area-picker-guidance { cursor: not-allowed; background: #fff7ed; }
.area-picker-results .area-picker-guidance:hover { background: #fff7ed; }
.area-picker-results .area-picker-candidate { padding-left: 1.35rem; border-left: 3px solid #0f766e; }
.area-picker-hint { margin: 0.3rem 0 0; font-size: 0.82rem; }

/* Form sua nhanh tung khoang gia ngay trong bang */
.inline-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.inline-form label { display: flex; flex-direction: column; font-size: 0.82rem; gap: 0.2rem; }
.inline-form input { min-width: 8rem; }
.card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:1rem; margin:1rem 0; }
.calendar-event { border-left:6px solid #64748b; margin:.65rem 0; }
.calendar-event summary { cursor:pointer; }
.calendar-event.status-draft { border-left-color:#94a3b8; }
.calendar-event.status-pending_deposit { border-left-color:#f59e0b; }
.calendar-event.status-confirmed { border-left-color:#0ea5e9; }
.calendar-event.status-assigned,.calendar-event.status-accepted { border-left-color:#8b5cf6; }
.calendar-event.status-in_progress { border-left-color:#f97316; }
.calendar-event.status-completed { border-left-color:#22c55e; }
.calendar-event.status-cancelled,.calendar-event.status-customer_cancelled,.calendar-event.status-no_show { border-left-color:#ef4444; }

/* Prototype integration approved for the production PHP views.
   ========================================================================== */
/* ========================================================================== 
   FE refresh 2026 — mobile-first application design system
   Source of truth for visual language: FE/style.css (prototype remains intact).
   ========================================================================== */
:root {
    --color-primary: #176b5b;
    --color-primary-hover: #105447;
    --color-primary-soft: #e4f3ed;
    --color-text: #1f2933;
    --color-muted: #74808a;
    --color-border: #e3e9e5;
    --color-bg: #f5f7f5;
    --color-surface: #fff;
    --color-ok: #187054;
    --color-warn: #b86525;
    --color-danger: #b43c38;
    --color-blue: #3e75bd;
    --radius: 14px;
    --radius-small: 10px;
    --shadow: 0 12px 30px rgb(28 52 46 / 8%);
    --sidebar-width: 252px;
}

html { min-width: 320px; background: var(--color-bg); }
body { color: var(--color-text); background: var(--color-bg); font-size: 15px; overflow-x: hidden; }
a { color: var(--color-primary); }
svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgb(23 107 91 / 28%); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 5px; color: var(--color-muted); font-size: 11px; font-weight: 800; letter-spacing: 1px; }
h1 { font-size: clamp(25px, 3vw, 34px); letter-spacing: -.8px; line-height: 1.16; }
h2 { font-size: 18px; letter-spacing: -.25px; }
.lead { margin: 6px 0 0; }

/* Shell */
.admin-shell { display: block; min-height: 100vh; }
.sidebar {
    position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar-width);
    display: flex; flex-direction: column; padding: 24px 15px 16px;
    color: var(--color-text); background: #fff; border-right: 1px solid var(--color-border);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin: 0 8px 22px; color: var(--color-text); font-size: 23px; letter-spacing: -.8px; }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; color: #fff; background: var(--color-primary); font-weight: 850; font-size: 17px; }
.sidebar-nav { display: grid; gap: 3px; min-height: 0; padding-right: 3px; overflow-y: auto; scrollbar-width: thin; }
.sidebar-nav a { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 9px 11px; border-radius: 11px; color: #5f6a73; font-weight: 650; }
.sidebar-nav a:hover, .sidebar-nav a.is-active { color: var(--color-primary); background: var(--color-primary-soft); }
.nav-icon { display: grid; flex: 0 0 21px; place-items: center; width: 21px; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--color-border); }
.sidebar-profile > span:last-child { min-width: 0; }
.sidebar-profile strong, .sidebar-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile strong { font-size: 13px; }.sidebar-profile small { margin-top: 2px; color: var(--color-muted); font-size: 11px; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #673d22; background: #f4c698; font-weight: 800; text-decoration: none; }
.admin-main { min-width: 0; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 20; top: 0; min-height: 76px; padding: 10px clamp(18px, 3vw, 40px); background: rgb(245 247 245 / 92%); border: 0; backdrop-filter: blur(12px); }
.topbar-title { display: flex; align-items: center; gap: 10px; }.topbar-title > div > strong { font-size: 17px; }.mobile-brand { display: none; }
.topbar-actions { gap: 10px; }.topbar-actions form { margin: 0; }.topbar-actions input { margin: 0; }
.icon-button { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--color-border); border-radius: 11px; color: #617079; background: #fff; text-decoration: none; }
.icon-button:hover { color: var(--color-primary); border-color: #b9c9c3; }
.logout-button { min-height: 40px; padding: 0 4px; color: var(--color-muted); text-decoration: none; }
.admin-content { width: min(100%, 1480px); margin: 0 auto; padding: 12px clamp(18px, 3vw, 40px) 64px; }
.bottom-nav { display: none; }

/* Components */
.card { padding: clamp(16px, 2.2vw, 23px); border: 1px solid var(--color-border); border-radius: 16px; background: #fff; box-shadow: 0 4px 12px rgb(38 62 55 / 3%); }
.page-heading { align-items: center; margin: 7px 0 22px; }.page-heading h1 { margin-bottom: 0; }
.button { min-height: 42px; padding: 9px 15px; border-radius: 10px; font-weight: 700; }
.button-primary { border-color: var(--color-primary); background: var(--color-primary); box-shadow: 0 5px 12px rgb(23 107 91 / 18%); }
.button-primary:hover { border-color: var(--color-primary-hover); background: var(--color-primary-hover); }
.button-danger { border-color: var(--color-danger); background: var(--color-danger); }
input, select, textarea { min-height: 43px; border-color: #d5ded9; border-radius: 9px; background: #fff; }
textarea { width: 100%; margin: 0 0 16px; padding: 10px 12px; font: inherit; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #70a99d; box-shadow: 0 0 0 3px rgb(23 107 91 / 10%); outline: 0; }
.filter-bar, .filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; gap: 10px; padding: 13px; margin-bottom: 18px; border: 1px solid var(--color-border); border-radius: 14px; background: #fff; }
.filter-bar input, .filter-bar select, .filter-grid input, .filter-grid select { margin-bottom: 0; }
.filter-bar > input:first-child, .booking-filter .search-field { grid-column: span 2; }
.filter-fixed-value { min-height: 46px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 10px; background: #f8faf9; }
.filter-fixed-value span { color: var(--color-muted); font-size: 12px; }
.filter-fixed-value strong { font-size: 14px; }
.payout-self-summary { grid-template-columns: minmax(240px, 420px); }
.payout-self-summary .metric-card { align-items: flex-start; flex-direction: column; gap: 5px; }
.search-field { position: relative; margin: 0; }.search-field input { padding-left: 37px; }.search-field::before { content: '⌕'; position: absolute; z-index: 1; left: 13px; top: 9px; color: var(--color-muted); font-size: 20px; }
.table-wrap { max-width: 100%; border-radius: 13px; border-color: var(--color-border); background: #fff; }
table.data th { padding: 12px; color: #68747a; background: #f7f9f7; border-bottom: 1px solid var(--color-border); font-size: 11px; }
table.data td { padding: 12px; }.actions { min-width: 0; }.actions > * { margin-bottom: 6px; }
.badge { padding: 4px 9px; font-size: 11px; line-height: 1.3; }
.badge.status-draft, .status-draft.badge { color: #64748b; background: #eef2f4; }
.badge.status-pending_deposit, .status-pending_deposit.badge { color: #a85d18; background: #fff0df; }
.badge.status-confirmed, .status-confirmed.badge { color: #187054; background: #dcf3e8; }
.badge.status-assigned, .badge.status-accepted, .status-assigned.badge, .status-accepted.badge { color: #396da9; background: #e7f0fb; }
.badge.status-in_progress, .status-in_progress.badge { color: #7055ad; background: #eee8fb; }
.badge.status-completed, .status-completed.badge { color: #187054; background: #dff2e9; }
.badge.status-cancelled, .badge.status-customer_cancelled, .badge.status-no_show,
.status-cancelled.badge, .status-customer_cancelled.badge, .status-no_show.badge { color: #a63b38; background: #fde9e8; }
.alert { border-radius: 11px; }.pagination { flex-wrap: wrap; }.pagination a { min-width: 38px; min-height: 38px; display: grid; place-items: center; border-radius: 9px; }
.empty-state { padding: 42px 18px; text-align: center; color: var(--color-muted); }.empty-state.compact { padding: 22px 8px; }
.sticky-actions, .booking-actions { border-top: 1px solid var(--color-border); background: rgb(245 247 245 / 94%); backdrop-filter: blur(8px); }

/* Dashboard */
.dashboard-hero { align-items: end; }.compact-filter { display: flex; align-items: end; gap: 9px; }.compact-filter label { margin: 0; }.compact-filter input { min-width: 170px; margin: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { display: flex; gap: 13px; min-height: 132px; padding: 19px; border: 1px solid transparent; border-radius: 16px; background: #dff2e9; }
.metric-card.metric-tone-1 { background: #fff0e1; }.metric-card.metric-tone-2 { background: #e5effb; }
.metric-dot { flex: 0 0 auto; width: 37px; height: 37px; border-radius: 12px; background: rgb(255 255 255 / 84%); }
.metric-card h3 { margin: 1px 0 5px; color: #68747a; font-size: 12px; }.metric-card strong { display: block; font-size: 27px; letter-spacing: -1px; }.metric-card p { margin: 3px 0 0; color: #748087; font-size: 10px; }
.dashboard-panels { display: grid; grid-template-columns: 1.35fr .8fr; gap: 16px; }.dashboard-panel { margin-bottom: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }.panel-heading h2 { margin: 0; }.panel-accent { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-weight: 800; }.accent-orange { color: #b86525; background: #fff0e3; }.accent-green { color: var(--color-primary); background: var(--color-primary-soft); }
.dashboard-list-row { display: flex; justify-content: space-between; gap: 15px; margin: 0; padding: 11px 0; border-bottom: 1px solid var(--color-border); }.dashboard-list-row:last-child { border-bottom: 0; }.dashboard-list-row span { color: var(--color-muted); text-align: right; }
.calendar-panel { margin-top: 0; }.calendar-filter { padding: 0 0 15px; border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; }.calendar-semantics { color: var(--color-primary); font-weight: 700; }
.calendar-day-group { padding: 4px 0 10px; }.calendar-day-group > h3 { margin: 15px 0 8px; font-size: 14px; color: #536067; }.calendar-day-events { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.calendar-event { margin: 0; padding: 13px 15px; border-radius: 12px; box-shadow: none; }.calendar-event summary { min-height: 24px; }.calendar-event p { margin: 8px 0 0; color: var(--color-muted); font-size: 13px; }

/* Booking list and forms */
.booking-card-list { display: grid; gap: 11px; }.booking-table { display: none; }
.booking-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-width: 0; padding: 16px 18px; border: 1px solid var(--color-border); border-radius: 15px; background: #fff; box-shadow: 0 3px 9px rgb(28 52 46 / 3%); }
.booking-card:hover { border-color: #afd0c4; box-shadow: var(--shadow); }.booking-card.status-no_show, .booking-card.status-cancelled { border-left: 4px solid #d8655e; }
.booking-date { display: grid; place-items: center; align-content: center; width: 58px; height: 58px; border-radius: 13px; color: var(--color-primary); background: #eef5f1; text-decoration: none; }.booking-date strong { font-size: 21px; line-height: 1; }.booking-date span { margin-top: 5px; font-size: 9px; font-weight: 800; }
.booking-card-main { min-width: 0; }.booking-card-title { display: flex; align-items: center; gap: 8px; }.booking-card-title > a { overflow: hidden; color: var(--color-text); font-size: 15px; font-weight: 750; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }.booking-card-main > p { margin: 7px 0; overflow: hidden; color: #68757d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.booking-card-meta { display: flex; gap: 14px; color: var(--color-muted); font-size: 11px; }.booking-card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-card-price { display: flex; align-items: center; gap: 12px; text-align: right; }.booking-card-price > strong { white-space: nowrap; font-size: 13px; }
.booking-form { max-width: 1200px; margin: 0 auto; }.booking-line { border-radius: 12px; }.combo-summary, .combo-child-line { border-left-color: var(--color-primary); background: #f7fbf9; }
.lookup-results { border-radius: 10px; }.lookup-results li:hover, .lookup-results li:focus { background: var(--color-primary-soft); }
.booking-actions { padding: 13px; border-radius: 12px 12px 0 0; }

/* Sheets/dialogs and long modules */
.modal, .dialog, [role="dialog"] { max-width: calc(100vw - 24px); }
.permission-group { border-color: var(--color-border); border-radius: 12px; background: #fff; }
.form-card { max-width: 760px; }.card-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .dashboard-panels { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .admin-shell { display: block; }.sidebar { display: none; }.admin-main { margin-left: 0; }
    .topbar { min-height: 68px; padding: 8px 16px; background: rgb(255 255 255 / 94%); border-bottom: 1px solid var(--color-border); }.mobile-brand { display: inline-flex; }.topbar-title .eyebrow { display: none; }.topbar-title > div > strong { font-size: 15px; }.logout-button { display: none; }
    .admin-content { padding: 18px 16px 104px; }.topbar-avatar { display: none; }
    .bottom-nav { position: fixed; z-index: 50; inset: auto 0 0; display: flex; align-items: center; justify-content: space-around; min-height: 72px; padding: 6px max(7px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)); border-top: 1px solid var(--color-border); background: rgb(255 255 255 / 97%); box-shadow: 0 -8px 25px rgb(28 52 46 / 7%); }
    .bottom-nav a { display: grid; place-items: center; gap: 3px; min-width: 52px; min-height: 45px; color: #849097; font-size: 10px; text-decoration: none; }.bottom-nav a.is-active { color: var(--color-primary); }.bottom-nav a svg { width: 21px; height: 21px; }
    .bottom-nav .quick-create { min-width: 56px; width: 56px; height: 56px; min-height: 56px; margin-top: -31px; border: 5px solid var(--color-bg); border-radius: 50%; color: #fff; background: var(--color-primary); box-shadow: 0 6px 15px rgb(23 107 91 / 28%); }
    .page-heading { align-items: flex-end; }.page-primary-action { min-width: 44px; }
    .filter-bar, .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.filter-bar > input:first-child, .booking-filter .search-field { grid-column: 1 / -1; }
    .form-grid { grid-template-columns: 1fr; }.form-grid .span-2 { grid-column: auto; }
    .booking-line-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sticky-actions { bottom: 72px; }
}

@media (max-width: 600px) {
    body { font-size: 14px; }.admin-content { padding-inline: 13px; }.topbar { padding-inline: 13px; }
    .page-heading { gap: 10px; }.page-heading h1 { font-size: 24px; }.page-heading .lead { font-size: 12px; }.page-primary-action { padding-inline: 11px; }.page-primary-action span + * { display: none; }
    .compact-filter { width: 100%; margin-top: 13px; }.dashboard-hero { display: block; }.compact-filter label { flex: 1; }.compact-filter input { min-width: 0; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }.metric-card { display: block; min-height: 126px; padding: 14px 12px; }.metric-dot { width: 30px; height: 30px; margin-bottom: 8px; }.metric-card strong { font-size: 22px; }.metric-card p { line-height: 1.25; }
    .filter-bar, .filter-grid { grid-template-columns: 1fr; }.filter-bar > input:first-child, .booking-filter .search-field { grid-column: auto; }.filter-grid label, .filter-bar label { min-width: 0; }
    .booking-filter select[multiple] { min-height: 92px; }
    .booking-card { grid-template-columns: 51px minmax(0, 1fr) 34px; gap: 10px; padding: 12px; }.booking-date { width: 49px; height: 49px; }.booking-date strong { font-size: 18px; }.booking-card-title { align-items: flex-start; flex-direction: column; gap: 4px; }.booking-card-title > a { max-width: 100%; font-size: 13px; }.booking-card-main > p { font-size: 11px; }.booking-card-meta { flex-wrap: wrap; gap: 5px 10px; font-size: 10px; }.booking-card-price > strong { display: none; }.booking-card-price { gap: 0; }
    .calendar-day-events { grid-template-columns: 1fr; }.calendar-event { padding: 12px; }
    .dashboard-list-row { display: grid; gap: 3px; }.dashboard-list-row span { text-align: left; }
    .card { padding: 15px; margin-bottom: 14px; }.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }.table-wrap table { min-width: 680px; }
    .booking-line-grid { grid-template-columns: 1fr; }.booking-toolbar { width: 100%; }.booking-actions { bottom: 72px; display: grid; grid-template-columns: 1fr; }.booking-actions .button { width: 100%; text-align: center; }
    .permission-grid { grid-template-columns: 1fr; }.actions { display: flex; flex-wrap: wrap; gap: 6px; }.actions > * { margin: 0; }
    [role="dialog"] { max-height: calc(100dvh - 16px); overflow-y: auto; border-radius: 18px 18px 0 0; }
}

/* ========================================================================== 
   Studio Operations UI — unified application layer
   ========================================================================== */
.sidebar-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.sidebar-heading .sidebar-brand { min-width: 0; }
.sidebar-brand > span:last-child { line-height: 1; text-transform: lowercase; }
.sidebar-brand small { display: block; margin-top: 5px; color: #93a09b; font-size: 8px; font-weight: 800; letter-spacing: 1.25px; text-transform: uppercase; }
.sidebar-close, .mobile-menu-toggle, .sidebar-scrim { display: none; }

/* Dashboard: editorial hero with operational data immediately below. */
.studio-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 18px 4px 30px; }
.studio-hero h1 { max-width: 720px; margin: 7px 0 0; font-size: clamp(38px, 5vw, 62px); line-height: .98; letter-spacing: -2.6px; }
.studio-hero h1 em { color: var(--color-primary); font-style: normal; font-weight: 500; }
.studio-hero > div:first-child > p:last-child { max-width: 460px; margin: 18px 0 0; color: var(--color-muted); }
.date-bubble { display: grid; place-items: center; align-content: center; flex: 0 0 auto; width: 108px; height: 108px; border-radius: 34px 34px 12px 34px; color: #fff; background: var(--color-primary); box-shadow: 0 14px 28px rgb(23 107 91 / 22%); transform: rotate(3deg); }
.date-bubble > * { transform: rotate(-3deg); }
.date-bubble b { font-size: 38px; line-height: 1; letter-spacing: -1px; }
.date-bubble small { font-size: 8px; font-weight: 850; letter-spacing: 1px; }
.dashboard-date-filter { justify-content: flex-end; margin: -73px 132px 31px 0; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 0 12px; }
.section-title h2 { margin: 0; font-size: 22px; }
.link { border: 0; color: var(--color-primary); background: transparent; font-weight: 750; text-decoration: none; }
.metric-card { position: relative; overflow: hidden; }
.metric-card::after { content: ''; position: absolute; width: 76px; height: 76px; right: -24px; bottom: -31px; border: 14px solid rgb(255 255 255 / 37%); border-radius: 50%; }
.metric-dot { display: grid; place-items: center; color: var(--color-primary); font-weight: 900; }
.metric-card:nth-child(1) .metric-dot::before { content: '◷'; }.metric-card:nth-child(2) .metric-dot::before { content: '↗'; }
.metric-card:nth-child(3) .metric-dot::before { content: '✓'; }.metric-card:nth-child(4) .metric-dot::before { content: '7'; }
.metric-card:nth-child(5) .metric-dot::before { content: '₫'; }.metric-card:nth-child(6) .metric-dot::before { content: '↗'; }
.metric-card:nth-child(7) .metric-dot::before { content: '＋'; }.metric-card:nth-child(8) .metric-dot::before { content: '≋'; }
.studio-appointment { display: grid; grid-template-columns: 78px 48px minmax(0, 1fr) 28px; align-items: center; gap: 13px; min-height: 78px; padding: 12px 14px; border: 1px solid var(--color-border); border-left: 3px solid #74b8aa; border-radius: 14px; color: var(--color-text); background: #fff; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.studio-appointment:hover { border-color: #acd0c6; box-shadow: var(--shadow); transform: translateY(-1px); }
.studio-appointment + .studio-appointment { margin-top: 9px; }
.studio-appointment.status-no_show, .studio-appointment.status-cancelled, .studio-appointment.status-customer_cancelled { border-left-color: #de706b; }
.studio-appointment time { display: grid; gap: 2px; }
.studio-appointment time b { font-size: 15px; }.studio-appointment time small { color: var(--color-muted); font-size: 9px; }
.service-art { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: var(--color-primary); background: var(--color-primary-soft); font-size: 20px; }
.appointment-copy { display: grid; min-width: 0; gap: 3px; }.appointment-copy strong, .appointment-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appointment-copy strong { font-size: 14px; }.appointment-copy > span { color: var(--color-muted); font-size: 11px; }.appointment-copy .tag { justify-self: start; }
.appointment-arrow { color: var(--color-muted); font-size: 20px; }

/* Customer and collaborator cards: primary representation on small screens. */
.entity-card-list { display: none; }
.entity-card { display: grid; grid-template-columns: 50px minmax(0, 1fr) 36px; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--color-border); border-radius: 15px; background: #fff; box-shadow: 0 3px 10px rgb(28 52 46 / 3%); }
.entity-avatar { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px 15px 5px 15px; color: #176b5b; background: #dff2e9; font-size: 18px; font-weight: 850; text-decoration: none; }
.collaborator-avatar { color: #6b508e; background: #eee8fa; }
.entity-main { min-width: 0; }.entity-title { display: flex; align-items: center; gap: 7px; }.entity-title > a { overflow: hidden; color: var(--color-text); font-weight: 800; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.entity-title .badge { flex: 0 0 auto; }.entity-main p { margin: 5px 0 2px; color: #5f6c72; font-size: 12px; }.entity-main p span, .entity-main small { color: var(--color-muted); }
.entity-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }.entity-chips .chip { padding: 2px 7px; border-radius: 999px; color: var(--chip-color); background: color-mix(in srgb, var(--chip-color) 12%, white); font-size: 9px; }
.entity-next { display: grid; place-items: center; width: 34px; height: 38px; border: 1px solid var(--color-border); border-radius: 11px; color: var(--color-primary); font-size: 21px; text-decoration: none; }

/* Finance, reminders and other data-heavy screens. */
#payout-app { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 15px; }
#payout-app > .card { grid-column: 1 / -1; margin: 0; }
#payout-app > .card:first-of-type { grid-column: span 5; }
#payout-app > .card:nth-of-type(2) { grid-column: span 7; }
#payout-app textarea { min-height: 43px; }
#notifications-app > .card { margin-bottom: 16px; }
.notification-table { table-layout: fixed; width: 100%; }
.notification-table th:nth-child(1) { width: 15%; }
.notification-table th:nth-child(2) { width: 13%; }
.notification-table th:nth-child(3) { width: 14%; }
.notification-table th:nth-child(4) { width: 16%; }
.notification-table th:nth-child(5) { width: 20%; }
.notification-table th:nth-child(6) { width: 12%; }
.notification-table th:nth-child(7) { width: 10%; }
.notification-table td { vertical-align: middle; }
.notification-table tbody tr { transition: background-color .15s ease; }
.notification-table tbody tr:hover { background: #fafcfb; }
.notification-booking-link { color: var(--color-text); font-weight: 800; text-decoration: none; }
.notification-booking-link:hover { color: var(--color-primary); text-decoration: underline; }
.notification-recipient, .notification-schedule { white-space: nowrap; }
#notification-templates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.notification-template { padding: 15px; border: 1px solid var(--color-border); border-radius: 13px; background: #fbfcfb; }
.notification-template label { color: #59656b; font-size: 11px; }
.notification-template input, .notification-template textarea, .notification-template select { margin-bottom: 10px; }
.notification-template textarea { min-height: 98px; }
.template-heading, .template-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.template-heading { margin-bottom: 13px; }.template-heading strong { overflow-wrap: anywhere; font-size: 12px; }
.template-footer select { flex: 1; margin: 0; }.template-footer .button { flex: 0 0 auto; }

/* Login is part of the product, not a detached utility page. */
.auth-page { position: relative; isolation: isolate; background: radial-gradient(circle at 18% 18%, #d7eee6 0, transparent 33%), linear-gradient(135deg, #f7faf8 0%, #edf4f0 100%); }
.auth-page::before { content: 'SANAZU'; position: fixed; z-index: -1; right: -20px; bottom: -52px; color: rgb(23 107 91 / 4%); font-size: min(21vw, 280px); font-weight: 900; letter-spacing: -12px; }
.auth-card { border: 1px solid rgb(255 255 255 / 75%); border-top: 0; border-radius: 22px; box-shadow: 0 24px 65px rgb(36 69 59 / 13%); }
.auth-brand { display: flex; align-items: center; gap: 9px; color: var(--color-text); font-size: 19px; }
.auth-brand::before { content: 'S'; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: var(--color-primary); font-size: 16px; }

@media (max-width: 1100px) {
    .dashboard-date-filter { margin: 0 0 20px; justify-content: flex-start; }
    #payout-app > .card:first-of-type, #payout-app > .card:nth-of-type(2) { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    body.menu-open { overflow: hidden; }
    .sidebar { display: flex; width: min(316px, 86vw); visibility: hidden; pointer-events: none; transform: translateX(-104%); transition: transform .22s ease, visibility 0s linear .22s; box-shadow: 18px 0 42px rgb(21 45 38 / 18%); }
    .sidebar.is-open { visibility: visible; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
    .sidebar-close { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--color-border); border-radius: 11px; color: var(--color-muted); background: #fff; }
    .sidebar-scrim { position: fixed; z-index: 29; inset: 0; border: 0; background: rgb(17 39 33 / 45%); backdrop-filter: blur(2px); }
    .menu-open .sidebar-scrim { display: block; }
    .mobile-menu-toggle { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--color-border); border-radius: 11px; color: var(--color-primary); background: #fff; }
    .mobile-brand { display: none; }
    .studio-hero { padding-top: 8px; }
}

@media (max-width: 700px) {
    .entity-card-list { display: grid; gap: 9px; }
    .entity-table { display: none; }
    .studio-hero { align-items: center; padding-bottom: 23px; }
    .studio-hero h1 { font-size: 40px; letter-spacing: -1.8px; }
    .studio-hero > div:first-child > p:last-child { max-width: 270px; margin-top: 13px; font-size: 12px; }
    .date-bubble { width: 77px; height: 77px; border-radius: 24px 24px 9px 24px; }.date-bubble b { font-size: 27px; }.date-bubble small { font-size: 6px; }
    #payout-app { display: block; } #payout-app > .card { margin-bottom: 14px; }
    #notification-templates { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .topbar-title > div > strong { max-width: 178px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .studio-hero h1 { font-size: clamp(34px, 10.5vw, 42px); }
    .studio-hero .eyebrow { font-size: 9px; }
    .date-bubble { width: 68px; height: 68px; }
    .dashboard-date-filter { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }.dashboard-date-filter label { min-width: 0; }.dashboard-date-filter input { width: 100%; min-width: 0; }
    .section-title h2 { font-size: 20px; }
    .studio-appointment { grid-template-columns: 58px 38px minmax(0, 1fr) 18px; gap: 8px; padding: 10px; }.service-art { width: 38px; height: 38px; border-radius: 11px; }.studio-appointment time b { font-size: 13px; }
    .entity-title { align-items: flex-start; flex-direction: column; gap: 3px; }
    .page-heading > .actions { justify-content: flex-end; }.page-heading > .actions .button { padding-inline: 10px; }
    .page-heading h1 { white-space: nowrap; }
    #payout-app .table-wrap, #notifications-app .table-wrap { overflow: visible; border: 0; background: transparent; }
    #payout-app table.data, #notifications-app table.data { display: block; min-width: 0; background: transparent; }
    #payout-app table.data thead, #notifications-app table.data thead { display: none; }
    #payout-app table.data tbody, #notifications-app table.data tbody { display: grid; gap: 9px; }
    #payout-app table.data tr, #notifications-app table.data tr { display: grid; gap: 0; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; }
    #payout-app table.data td, #notifications-app table.data td { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 34px; padding: 6px 0; border-bottom: 1px solid #edf1ef; overflow-wrap: anywhere; }
    #payout-app table.data td:last-child, #notifications-app table.data td:last-child { border-bottom: 0; }
    #payout-app table.data td::before, #notifications-app table.data td::before { content: attr(data-label); color: var(--color-muted); font-size: 9px; font-weight: 850; letter-spacing: .5px; text-transform: uppercase; }
    #payout-app table.data td[colspan], #notifications-app table.data td[colspan] { display: block; min-height: 0; border: 0; color: var(--color-muted); text-align: center; }
    #payout-app table.data td[colspan]::before, #notifications-app table.data td[colspan]::before { content: none; }
    #payout-app table.data td input { width: 100%; margin: 4px 0; }
    #payout-app table.data td[data-label="Thao tác"] { grid-template-columns: 1fr; }
    #payout-app table.data td[data-label="Thao tác"]::before { margin-bottom: 2px; }
}

/* ========================================================================== 
   Prototype parity pass — navigation, entity cards and mobile data layouts
   ========================================================================== */
.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.menu-button, .sidebar-close, .nav-scrim { display: none; }
.dashboard-heading-actions { display: flex; align-items: end; gap: 12px; }
.dashboard-heading-actions .compact-filter { margin: 0; }
.metric-card .metric-dot::before { content: none !important; }
.text-link { color: var(--color-primary); font-weight: 750; text-decoration: none; }
.entity-card-grid { display: none; }
.entity-card-main { min-width: 0; }
.entity-card-main .entity-title { display: block; overflow: hidden; color: var(--color-text); font-weight: 800; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.entity-card-main p { margin: 4px 0 7px; color: var(--color-muted); font-size: 11px; }
.entity-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.entity-meta { display: block; margin-top: 7px; color: var(--color-muted); font-size: 10px; }
.entity-actions { display: grid; justify-items: center; gap: 7px; font-size: 10px; }
.icon-link { display: grid; place-items: center; width: 35px; height: 40px; border: 1px solid var(--color-border); border-radius: 11px; color: var(--color-primary); font-size: 23px; text-decoration: none; }
.avatar-violet { color: #6d518e; background: #eee8fa; }
.payout-filter-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 14px; }
.payout-filter-grid .filter-actions { grid-column: 1 / -1; }
.payout-filter-grid .button { min-width: 110px; }
.reconciliation-table th, .reconciliation-table td { white-space: nowrap; }
.reconciliation-table td.num { font-weight: 750; }
.payable-table td[data-label="Thao tác"], .payout-history-table td[data-label="Thao tác"] { min-width: 250px; }
.payable-table td[data-label="Thao tác"] { display: grid; grid-template-columns: minmax(115px, .8fr) minmax(170px, 1.2fr) auto; gap: 8px; align-items: center; }
.payable-table td[data-label="Thao tác"] input, .payout-history-table td[data-label="Thao tác"] input { margin: 0; }
.finance-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.finance-status.status-pending { color: #8a5d1c; background: #fff0d7; }
.finance-status.status-approved, .finance-status.status-success { color: #26745d; background: #ddf2e8; }
.finance-status.status-paid { color: #315f8a; background: #e1edf9; }
.finance-status.status-cancelled, .finance-status.status-voided { color: #667078; background: #edf0f1; }
.collaborator-filter { grid-template-columns: minmax(250px, 2fr) repeat(3, minmax(160px, 1fr)); }
.collaborator-filter .collaborator-area-filter { min-width: 0; }
.collaborator-filter .area-picker-hint { display: none; }
.collaborator-filter .filter-actions { display: flex; gap: 8px; }
.report-table-wrap { position: relative; }
.report-table { min-width: max-content; }
.report-table th, .report-table td { white-space: nowrap; }
.report-table td.num { min-width: 112px; }
.report-value { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; width: 100%; }
.report-drill-button { display: inline-grid; place-items: center; width: 27px; height: 27px; min-height: 27px; padding: 0; border: 1px solid #d7e3df; border-radius: 8px; color: var(--color-primary); background: #f4faf7; font-size: 0; text-decoration: none; }
.report-drill-button::before { content: '↗'; font-size: 13px; font-weight: 900; }
.report-drill-button:hover { border-color: #a9cdc3; background: #e7f4ef; }
.report-semantics { margin: 14px 0 10px; padding: 9px 12px; border-radius: 10px; color: #596863; background: #f4f8f6; font-size: 11px; }
.payout-create-form label { display: grid; align-content: start; }
.payout-create-form button { align-self: end; min-height: 44px; }
.notification-page { display: grid; gap: 16px; }
.notification-page > * { margin: 0; }
.template-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.template-card { display: grid; gap: 10px; margin: 0; }
.template-card label { display: grid; gap: 5px; color: var(--color-muted); font-size: 11px; font-weight: 700; }
.template-card input, .template-card select, .template-card textarea { margin: 0; }
.template-card textarea { min-height: 118px; resize: vertical; }
.template-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notification-status.status-pending { color: #916120; background: #fff0d7; }
.notification-status.status-sending { color: #3f6e98; background: #e1edf9; }
.notification-status.status-sent { color: #26745d; background: #ddf2e8; }
.notification-status.status-failed { color: #a6493e; background: #fee6e2; }
.notification-status.status-cancelled { color: #667078; background: #edf0f1; }

/* Booking payment summary. */
.payment-summary-note { display: flex; align-items: flex-start; gap: 11px; margin: 12px 0 18px; padding: 12px 14px; border: 1px solid #d9e9e3; border-radius: 13px; color: #52635e; background: #f4faf7; }
.payment-summary-note-icon { display: grid; flex: 0 0 auto; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--color-primary); font-size: 12px; font-weight: 900; font-family: Georgia, serif; }
.payment-summary-note p { margin: 0; font-size: 12px; line-height: 1.55; }
.payment-summary-note strong { display: block; margin-bottom: 1px; color: var(--color-text); font-size: 11px; letter-spacing: .25px; text-transform: uppercase; }
.payment-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.payment-summary-card { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 112px; padding: 16px; overflow: hidden; border: 1px solid var(--payment-border); border-radius: 15px; background: var(--payment-bg); }
.payment-summary-card::after { content: ''; position: absolute; right: -30px; bottom: -38px; width: 92px; height: 92px; border: 16px solid rgb(255 255 255 / 48%); border-radius: 50%; pointer-events: none; }
.payment-summary-card > div { min-width: 0; }
.payment-summary-label { display: block; margin: 0 0 4px; color: var(--payment-label); font-size: 11px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
.payment-summary-card strong[id^="payment-"] { display: block; color: var(--color-text); font-size: clamp(20px, 2.1vw, 28px); font-weight: 900; letter-spacing: -.8px; line-height: 1.15; white-space: nowrap; }
.payment-summary-card small { display: block; margin-top: 6px; color: var(--payment-label); font-size: 10px; line-height: 1.25; }
.payment-summary-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--payment-accent); background: rgb(255 255 255 / 72%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 80%); font-size: 19px; font-weight: 900; }
.payment-summary-payable { --payment-bg: #edf3fb; --payment-border: #dbe6f3; --payment-accent: #49759d; --payment-label: #60788d; }
.payment-summary-received { --payment-bg: #e5f5ed; --payment-border: #d0eadf; --payment-accent: #24795f; --payment-label: #52786b; }
.payment-summary-remaining { --payment-bg: #fff2df; --payment-border: #f3e0c5; --payment-accent: #a56b20; --payment-label: #876d4b; }

/* Reusable label/value details. */
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.detail-grid > div { min-width: 0; padding: 13px 14px; border: 1px solid #e6ece9; border-radius: 12px; background: #fafcfb; }
.detail-grid dt { margin: 0 0 5px; color: var(--color-muted); font-size: 10px; font-weight: 850; letter-spacing: .45px; text-transform: uppercase; }
.detail-grid dd { margin: 0; color: var(--color-text); font-size: 13px; font-weight: 750; line-height: 1.5; overflow-wrap: anywhere; }
.detail-grid dd small { display: block; margin-top: 2px; color: var(--color-muted); font-size: 11px; font-weight: 600; }
.detail-grid > div > .muted { display: block; margin: 0 0 5px; font-size: 10px; font-weight: 850; letter-spacing: .45px; text-transform: uppercase; }
.detail-grid > div > strong { display: block; margin-top: 4px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.detail-grid .detail-span-2 { grid-column: span 2; }
.detail-grid .detail-span-full { grid-column: 1 / -1; }
.detail-grid .detail-note { border-color: #dce9e4; background: #f3f8f6; }

/* Booking financial breakdown. */
.financial-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.financial-summary > div { position: relative; min-width: 0; min-height: 98px; padding: 15px; overflow: hidden; border: 1px solid var(--financial-border, #e5ebe8); border-radius: 13px; background: var(--financial-bg, #fafcfb); }
.financial-summary > div::after { content: ''; position: absolute; right: -25px; bottom: -35px; width: 78px; height: 78px; border: 13px solid rgb(255 255 255 / 55%); border-radius: 50%; }
.financial-summary dt { position: relative; z-index: 1; margin: 0 0 9px; color: var(--financial-label, var(--color-muted)); font-size: 10px; font-weight: 850; letter-spacing: .4px; text-transform: uppercase; }
.financial-summary dd { position: relative; z-index: 1; margin: 0; color: var(--color-text); font-size: clamp(18px, 1.8vw, 24px); font-weight: 900; letter-spacing: -.55px; line-height: 1.2; white-space: nowrap; }
.financial-payable { --financial-bg: #edf3fb; --financial-border: #dbe6f3; --financial-label: #60788d; }
.financial-received { --financial-bg: #e5f5ed; --financial-border: #d0eadf; --financial-label: #52786b; }
.financial-remaining { --financial-bg: #fff2df; --financial-border: #f3e0c5; --financial-label: #876d4b; }
.financial-cost { --financial-bg: #f3eff9; --financial-border: #e6ddf2; --financial-label: #75658a; }
.financial-profit { --financial-bg: #e5f5ed; --financial-border: #d0eadf; --financial-label: #52786b; }

/* Collaborator performance and reconciliation metrics. */
.collaborator-metrics { overflow: hidden; }
.period-filter { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)) auto; align-items: end; gap: 12px; margin: 14px 0 12px; padding: 15px; border: 1px solid #e0e8e4; border-radius: 14px; background: #fafcfb; }
.period-filter label { margin: 0; }
.period-filter input { margin: 7px 0 0; }
.period-filter .button { min-width: 116px; min-height: 43px; margin: 0; }
.metrics-help { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 20px; color: var(--color-muted); font-size: 11px; line-height: 1.55; }
.metrics-help > span { display: grid; flex: 0 0 auto; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: #7aa99f; font-family: Georgia, serif; font-size: 11px; font-weight: 900; }
.metrics-group-title { margin: 18px 0 10px; color: #53615d; font-size: 11px; font-weight: 850; letter-spacing: .6px; text-transform: uppercase; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats-grid > div { position: relative; min-width: 0; min-height: 104px; padding: 15px; overflow: hidden; border: 1px solid #e4ebe8; border-radius: 14px; background: #fafcfb; }
.stats-grid > div::after { content: ''; position: absolute; right: -27px; bottom: -38px; width: 82px; height: 82px; border: 14px solid rgb(255 255 255 / 55%); border-radius: 50%; }
.stats-grid strong, .stats-grid span { position: relative; z-index: 1; display: block; }
.stats-grid strong { color: var(--color-text); font-size: clamp(22px, 2.2vw, 29px); font-weight: 900; letter-spacing: -.75px; line-height: 1.15; white-space: nowrap; }
.stats-grid span { margin-top: 8px; color: var(--color-muted); font-size: 11px; font-weight: 700; line-height: 1.35; }
.stats-grid-activity > div:nth-child(1), .stats-grid-activity > div:nth-child(5) { border-color: #dbe6f3; background: #edf3fb; }
.stats-grid-activity > div:nth-child(2), .stats-grid-activity > div:nth-child(6) { border-color: #d0eadf; background: #e5f5ed; }
.stats-grid-activity > div:nth-child(3), .stats-grid-activity > div:nth-child(4) { border-color: #f3e0c5; background: #fff2df; }
.stats-grid-finance > div { border-color: #dce9e4; background: #f1f8f5; }
.stats-grid-finance > div:nth-child(2), .stats-grid-finance > div:nth-child(4) { border-color: #f3e0c5; background: #fff2df; }
.stats-grid-finance > div:nth-child(3), .stats-grid-finance > div:nth-child(6) { border-color: #d0eadf; background: #e5f5ed; }
.stats-grid-finance > div:nth-child(5) { border-color: #e6ddf2; background: #f3eff9; }

/* Collaborator service-area editor. */
.collaborator-area-card > .alert-info { margin: 12px 0 22px; padding: 12px 14px; border: 1px solid #d9e9e3; border-radius: 12px; color: #52635e; background: #f4faf7; }
.service-area-form { gap: 16px 20px; margin: 0 0 22px; }
.service-area-form > label, .service-area-picker > label { margin: 0; }
.service-area-form input, .service-area-form select { margin-bottom: 0; }
.service-area-form .area-picker-hint { margin-top: 9px; }
.service-area-actions { grid-column: 1 / -1; padding-top: 2px; }
.service-area-table th:first-child { width: 42%; }
.service-area-table th:nth-child(2) { width: 38%; }
.service-area-table td form { display: flex; align-items: center; gap: 11px; }
.service-area-table td form select { min-width: 170px; margin: 0; }
.service-area-table td form .link-button { flex: 0 0 auto; }

/* Collaborator cooperation status. */
.collaborator-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.collaborator-title-row h1 { margin: 0; }
.status-section-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.status-section-heading h2 { margin: 0; }
.current-status-badge { padding: 5px 10px; font-size: 10px; letter-spacing: .15px; }
.collaborator-status-form { gap: 14px 16px; margin: 0; }
.collaborator-status-form input, .collaborator-status-form select { margin-bottom: 0; }
.collaborator-status-actions { grid-column: 1 / -1; padding-top: 2px; }
.status-history-table { margin-top: 22px; }

/* Collaborator create/edit form. */
.collaborator-editor-form { align-items: start; gap: 18px 22px; }
.collaborator-editor-form > .full { grid-column: 1 / -1; }
.collaborator-editor-form > label { margin: 0; }
.collaborator-editor-form > label > input,
.collaborator-editor-form > label > select,
.collaborator-editor-form > label > textarea { margin: 7px 0 0; }
.collaborator-editor-form label > small { display: block; margin-top: 8px; line-height: 1.45; }
.collaborator-bank-fields { margin: 2px 0 0; padding: 18px; border: 1px solid #dfe7e3; border-radius: 14px; background: #fafcfb; }
.collaborator-bank-fields legend { padding: 0 8px; font-weight: 800; }
.collaborator-bank-fields .form-grid { gap: 16px 20px; }
.collaborator-bank-fields .form-grid > .full { grid-column: 1 / -1; }
.collaborator-bank-fields label { margin: 0; }
.collaborator-bank-fields input { margin: 7px 0 0; }
.collaborator-note { margin-top: 2px; }
.collaborator-note textarea { min-height: 120px; }
.collaborator-form-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 2px; }

/* Booking transition forms are separate actions, not one continuous form. */
#booking-transition-panel > form { display: grid; gap: 13px; margin: 14px 0 0; padding: 16px; border: 1px solid #e3eae7; border-radius: 14px; background: #fafcfb; }
#booking-transition-panel > form > p { margin: 0; color: var(--color-muted); font-size: 12px; line-height: 1.55; }
#booking-transition-panel > form > label { margin: 0; }
#booking-transition-panel > form > label > input,
#booking-transition-panel > form > label > select,
#booking-transition-panel > form > label > textarea { margin: 7px 0 0; }
#booking-transition-panel > form > label.checkbox-control { display: flex; align-items: center; gap: 9px; }
#booking-transition-panel > form > label.checkbox-control > input[type="checkbox"] { margin: 0; }
#booking-transition-panel > form > button { justify-self: start; margin-top: 2px; }
#booking-transition-panel > form[data-transition-action="cancel"] { border-color: #f1d8d5; background: #fffafa; }
#booking-transition-panel > form[data-transition-action="reschedule"] { border-color: #dbe7e2; background: #f7fbf9; }
#booking-transition-loading { margin-top: 12px; }

/* Native choice controls must not inherit full-width text input sizing. */
input[type="checkbox"], input[type="radio"] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--color-primary); cursor: pointer; }
label.checkbox, label.checkbox-control { display: flex; align-items: center; gap: 9px; font-weight: 650; cursor: pointer; }

@media (max-width: 900px) {
    .menu-button { display: grid; }
    .mobile-brand { display: none; }
    .sidebar { display: flex; width: min(316px, 88vw); visibility: hidden; pointer-events: none; transform: translateX(-104%); transition: transform .22s ease, visibility 0s linear .22s; }
    .sidebar.is-open { visibility: visible; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
    .sidebar-close { display: grid; }
    .nav-scrim { position: fixed; z-index: 29; inset: 0; width: 100%; height: 100%; border: 0; background: rgb(17 39 33 / 48%); backdrop-filter: blur(2px); }
    .nav-scrim:not([hidden]) { display: block; }
    .dashboard-hero { align-items: flex-start; }
    .dashboard-heading-actions { align-items: stretch; flex-direction: column; }
    .dashboard-heading-actions > .button { align-self: flex-end; }
    .payout-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .collaborator-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .collaborator-filter > :first-child { grid-column: 1 / -1; }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .financial-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .entity-card-grid { display: grid; gap: 10px; }
    .entity-table-wrap { display: none; }
    .template-card-grid { grid-template-columns: 1fr; }
    .mobile-card-table { display: block; min-width: 0 !important; background: transparent; }
    .mobile-card-table thead { display: none; }
    .mobile-card-table tbody { display: grid; gap: 10px; }
    .mobile-card-table tr { display: grid; gap: 0; padding: 11px 13px; border: 1px solid var(--color-border); border-radius: 14px; background: #fff; box-shadow: 0 3px 10px rgb(28 52 46 / 3%); }
    .mobile-card-table td { display: grid; grid-template-columns: minmax(88px, 34%) minmax(0, 1fr); align-items: center; gap: 9px; min-height: 34px; padding: 6px 0 !important; border: 0 !important; border-bottom: 1px solid #edf1ef !important; text-align: left !important; overflow-wrap: anywhere; }
    .mobile-card-table td:last-child { border-bottom: 0 !important; }
    .mobile-card-table td::before { content: attr(data-label); color: var(--color-muted); font-size: 9px; font-weight: 850; letter-spacing: .45px; text-transform: uppercase; }
    .mobile-card-table td[colspan] { display: block; border: 0 !important; color: var(--color-muted); text-align: center !important; }
    .mobile-card-table td[colspan]::before { content: none; }
    .mobile-card-table .card-actions { display: flex; justify-content: flex-end; }
    .mobile-card-table td input { width: 100%; margin: 3px 0; }
    #reports-app { padding: 16px; }
    #reports-app .table-wrap, #payout-app .table-wrap, #notifications-app .table-wrap { overflow: visible; border: 0; background: transparent; }
    .report-drill-button { display: inline-grid; min-height: 32px; width: 32px; height: 32px; margin: 3px 0 0; }
}

@media (max-width: 600px) {
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading > div:first-child { min-width: 0; }
    .page-heading h1 { white-space: normal; }
    .page-heading > .actions { width: 100%; justify-content: flex-start; }
    .dashboard-heading-actions { width: 100%; }
    .dashboard-heading-actions > .button { align-self: stretch; text-align: center; }
    .dashboard-heading-actions .compact-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .dashboard-heading-actions .compact-filter input { width: 100%; min-width: 0; }
    .payout-filter-grid { grid-template-columns: 1fr; }
    .payout-filter-grid .filter-actions { grid-column: auto; }
    .payout-filter-grid .button { width: 100%; }
    .collaborator-filter { grid-template-columns: 1fr; }
    .collaborator-filter > :first-child { grid-column: auto; }
    .payable-table td[data-label="Thao tác"] { display: grid; grid-template-columns: 1fr; }
    .entity-card { grid-template-columns: 48px minmax(0, 1fr) 38px; padding: 12px; }
    .entity-avatar { width: 48px; height: 48px; }
    .filter-card h2 { margin-top: 0; }
    .sticky-actions, .booking-actions { bottom: calc(72px + env(safe-area-inset-bottom)); }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid .detail-span-2, .detail-grid .detail-span-full { grid-column: auto; }
    .financial-summary { grid-template-columns: 1fr; gap: 8px; }
    .financial-summary > div { min-height: 84px; }
    .period-filter { grid-template-columns: 1fr; padding: 13px; }
    .period-filter .button { width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stats-grid > div { min-height: 98px; padding: 13px; }
    .stats-grid strong { font-size: 20px; }
    .service-area-form { grid-template-columns: 1fr; }
    .service-area-actions { grid-column: auto; }
    .collaborator-status-form { grid-template-columns: 1fr; }
    .collaborator-status-actions { grid-column: auto; }
    .collaborator-editor-form { grid-template-columns: 1fr; gap: 15px; }
    .collaborator-editor-form > .full,
    .collaborator-bank-fields .form-grid > .full { grid-column: auto; }
    .collaborator-bank-fields .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .admin-content { padding-inline: 11px; }
    .topbar { padding-inline: 10px; }
    .topbar-actions { gap: 5px; }
    .logout-button { display: none; }
    .bottom-nav a { min-width: 48px; font-size: 9px; }
    .bottom-nav .quick-create { min-width: 52px; width: 52px; height: 52px; min-height: 52px; }
    .page-heading h1 { font-size: 26px; }
    .page-heading { gap: 10px; }
    .page-heading .button { padding-inline: 10px; }
    .mobile-card-table td { grid-template-columns: 82px minmax(0, 1fr); }
}

@media (max-width: 700px) {
    .payment-summary-grid { grid-template-columns: 1fr; gap: 9px; }
    .payment-summary-card { min-height: 92px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
