/* =============================================================
   QUAN LY NHA HANG — Modern Design System (mobile-first)
   Tac gia: nang cap giao dien 2026
   Nap SAU bootstrap de override. Dung CSS variables (tokens).
   ============================================================= */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
    /* Brand — cam terracotta am (khoi goi vi giac, chuyen nghiep) */
    --brand-50:  #fff7ed;
    --brand-100: #ffedd5;
    --brand-200: #fed7aa;
    --brand-300: #fdba74;
    --brand-400: #fb923c;
    --brand-500: #f97316;   /* primary */
    --brand-600: #ea580c;
    --brand-700: #c2410c;
    --brand-800: #9a3412;
    --brand-900: #7c2d12;

    /* Ink / neutral (slate) */
    --ink-0:   #ffffff;
    --ink-50:  #f8fafc;
    --ink-100: #f1f5f9;
    --ink-200: #e2e8f0;
    --ink-300: #cbd5e1;
    --ink-400: #94a3b8;
    --ink-500: #64748b;
    --ink-600: #475569;
    --ink-700: #334155;
    --ink-800: #1e293b;
    --ink-900: #0f172a;

    /* Semantic */
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger:  #dc2626;
    --danger-bg: #fee2e2;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --info:    #2563eb;
    --info-bg: #dbeafe;

    /* Surfaces */
    --bg:        var(--ink-100);
    --surface:   #ffffff;
    --surface-2: var(--ink-50);
    --text:      var(--ink-800);
    --text-muted:var(--ink-500);
    --border:    var(--ink-200);

    /* Shape & depth */
    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 18px;
    --radius-pill: 999px;
    --shadow-xs: 0 1px 2px rgba(15,23,42,.06);
    --shadow-sm: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
    --shadow:    0 4px 12px rgba(15,23,42,.08);
    --shadow-lg: 0 12px 32px rgba(15,23,42,.14);

    /* Typography */
    --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

    /* Layout */
    --sidebar-w: 256px;
    --topbar-h: 60px;
    --bottomnav-h: 62px;
}

/* ---------- 2. BASE ---------- */
body#body,
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--ink-900); line-height: 1.25; }

a { color: var(--brand-600); }
a:hover, a:focus { color: var(--brand-700); }

/* Focus ring — accessibility */
a:focus-visible, button:focus-visible,
.btn:focus-visible, .form-control:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--brand-200);
    outline-offset: 1px;
}

::selection { background: var(--brand-200); }

/* Nicer scrollbars on desktop */
* { scrollbar-color: var(--ink-300) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }

/* ---------- 3. BUTTONS (override Bootstrap .btn) ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: .55rem 1.05rem;
    border: 1px solid transparent;
    transition: all .16s ease;
    box-shadow: var(--shadow-xs);
    display: inline-flex; align-items: center; gap: .45rem;
    line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary,
.btn-danger.btn-brand {
    background: var(--brand-500); border-color: var(--brand-500); color: #fff;
}
.btn-primary:hover, .btn-primary:focus { background: var(--brand-600); border-color: var(--brand-600); color:#fff; }

.btn-success { background: var(--success); border-color: var(--success); color:#fff; }
.btn-success:hover { filter: brightness(.94); color:#fff; }

.btn-danger { background: var(--danger); border-color: var(--danger); color:#fff; }
.btn-danger:hover { filter: brightness(.94); color:#fff; }

.btn-warning { background: var(--warning); border-color: var(--warning); color:#fff; }
.btn-warning:hover { filter: brightness(.94); color:#fff; }

.btn-info { background: var(--info); border-color: var(--info); color:#fff; }

.btn-default, .btn-secondary {
    background: var(--surface); border-color: var(--border); color: var(--ink-700);
}
.btn-default:hover, .btn-secondary:hover { background: var(--ink-50); border-color: var(--ink-300); color: var(--ink-900); }

.btn-outline-primary {
    background: transparent; border-color: var(--brand-500); color: var(--brand-600);
}
.btn-outline-primary:hover { background: var(--brand-500); color:#fff; }

.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- 4. CARDS ---------- */
.card, .app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header, .app-card__header {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700; color: var(--ink-900);
    background: var(--surface);
    display: flex; align-items: center; justify-content: space-between; gap:.75rem;
}
.card-body, .app-card__body { padding: 1.15rem; }

.panel { border-radius: var(--radius); border:1px solid var(--border); box-shadow: var(--shadow-sm); overflow:hidden; background:var(--surface); }
.panel-heading { background: var(--surface-2) !important; border-bottom:1px solid var(--border); font-weight:700; }
.panel-default > .panel-heading { color: var(--ink-800); }

/* ---------- 5. KPI STAT TILE ---------- */
.kpi-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.kpi {
    background: var(--surface); border:1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow-sm); position: relative; overflow:hidden;
}
.kpi::after {
    content:""; position:absolute; right:-18px; top:-18px;
    width:76px; height:76px; border-radius:50%;
    background: var(--brand-50);
}
.kpi__icon {
    width:44px; height:44px; border-radius:12px; display:grid; place-items:center;
    font-size:20px; color:var(--brand-600); background:var(--brand-100); margin-bottom:.7rem; position:relative; z-index:1;
}
.kpi__label { color: var(--text-muted); font-size:.82rem; font-weight:600; text-transform:uppercase; letter-spacing:.02em; position:relative; z-index:1; }
.kpi__value { font-size: 1.7rem; font-weight:800; color: var(--ink-900); margin-top:.15rem; position:relative; z-index:1; }
.kpi__trend { font-size:.8rem; font-weight:600; margin-top:.35rem; position:relative; z-index:1; }
.kpi__trend.up { color: var(--success); }
.kpi__trend.down { color: var(--danger); }
.kpi--success .kpi__icon { color: var(--success); background: var(--success-bg); }
.kpi--info .kpi__icon    { color: var(--info);    background: var(--info-bg); }
.kpi--warning .kpi__icon { color: var(--warning); background: var(--warning-bg); }

/* ---------- 6. FORMS ---------- */
.form-control, .form-select, select.form-control, textarea.form-control {
    border-radius: var(--radius-sm);
    border: 1px solid var(--ink-300);
    padding: .6rem .8rem;
    color: var(--ink-800);
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
    background-color: #fff;
}
.form-control:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px var(--brand-100);
}
.form-control::placeholder { color: var(--ink-400); }
label, .control-label { font-weight: 600; color: var(--ink-700); }
.form-group { margin-bottom: 1rem; }

/* Input group nut lien */
.input-group-addon { background: var(--surface-2); border-color: var(--ink-300); }

/* ---------- 7. TABLES ---------- */
.table { background: var(--surface); color: var(--text); margin-bottom: 0; }
.table > thead > tr > th,
.table thead th {
    background: var(--surface-2);
    color: var(--ink-600);
    font-weight: 700; font-size: .8rem;
    text-transform: uppercase; letter-spacing:.02em;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle;
    padding: .7rem .85rem;
}
.table > tbody > tr > td,
.table tbody td {
    padding: .7rem .85rem; vertical-align: middle;
    border-top: 1px solid var(--ink-100);
}
.table-striped > tbody > tr:nth-of-type(odd) { background: var(--ink-50); }
.table-hover > tbody > tr:hover { background: var(--brand-50); }
.table-bordered, .table-bordered > tbody > tr > td, .table-bordered > thead > tr > th { border-color: var(--border); }

.table-card {
    border:1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm); background:var(--surface);
}
.table-card .table { border: 0; }

/* ---------- 8. BADGES / STATUS PILLS ---------- */
.badge, .pill {
    display:inline-flex; align-items:center; gap:.3rem;
    padding: .25rem .6rem; border-radius: var(--radius-pill);
    font-size: .74rem; font-weight: 700; line-height:1.4;
}
.pill--success { background: var(--success-bg); color: #166534; }
.pill--danger  { background: var(--danger-bg);  color: #991b1b; }
.pill--warning { background: var(--warning-bg); color: #92400e; }
.pill--info    { background: var(--info-bg);    color: #1e40af; }
.pill--muted   { background: var(--ink-100);    color: var(--ink-600); }

/* ---------- 9. ALERTS ---------- */
.alert { border-radius: var(--radius); border: 1px solid transparent; padding: .85rem 1rem; }
.alert-success { background: var(--success-bg); border-color:#bbf7d0; color:#166534; }
.alert-danger  { background: var(--danger-bg);  border-color:#fecaca; color:#991b1b; }
.alert-warning { background: var(--warning-bg); border-color:#fde68a; color:#92400e; }
.alert-info    { background: var(--info-bg);    border-color:#bfdbfe; color:#1e40af; }

/* ---------- 10. UTILITIES ---------- */
.text-muted { color: var(--text-muted) !important; }
.text-brand { color: var(--brand-600) !important; }
.bg-brand { background: var(--brand-500) !important; color:#fff; }
.shadow-card { box-shadow: var(--shadow-sm); }
.rounded-xl { border-radius: var(--radius-lg); }
.stack > * + * { margin-top: 1rem; }
.container-app { max-width: 1240px; margin-inline: auto; padding-inline: 1rem; }

/* Section headings for pages */
.page-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin-bottom:1.1rem; }
.page-head h1, .page-head h2 { margin:0; font-size:1.4rem; }
.page-head .subtitle { color:var(--text-muted); font-size:.9rem; }

/* ---------- 11. RESPONSIVE TABLE -> CARD (mobile) ---------- */
@media (max-width: 640px) {
    .table-responsive-cards thead { display:none; }
    .table-responsive-cards, .table-responsive-cards tbody,
    .table-responsive-cards tr, .table-responsive-cards td { display:block; width:100%; }
    .table-responsive-cards tr {
        margin-bottom:.8rem; border:1px solid var(--border);
        border-radius: var(--radius); box-shadow: var(--shadow-xs); overflow:hidden; background:var(--surface);
    }
    .table-responsive-cards td {
        display:flex; justify-content:space-between; align-items:center; gap:1rem;
        padding:.6rem .85rem; border:0; border-bottom:1px solid var(--ink-100); text-align:right;
    }
    .table-responsive-cards td:last-child { border-bottom:0; }
    .table-responsive-cards td::before {
        content: attr(data-label);
        font-weight:700; color:var(--ink-600); text-align:left; font-size:.8rem;
        text-transform:uppercase; letter-spacing:.02em;
    }
}

/* Utility: hide-on-mobile / show-on-mobile */
@media (max-width:768px){ .hide-mobile{ display:none !important; } }
@media (min-width:769px){ .only-mobile{ display:none !important; } }

/* ---------- 12. AUTH / LOGIN ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 1.1rem;
    background:
        radial-gradient(1200px 600px at 100% 0%, var(--brand-100), transparent 60%),
        radial-gradient(1000px 500px at 0% 100%, #e0f2fe, transparent 55%),
        var(--ink-100);
}
.auth-card {
    width: 100%; max-width: 940px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
}
.auth-hero {
    background: linear-gradient(160deg, var(--brand-600), var(--brand-800));
    color: #fff; padding: 2rem 1.75rem;
    position: relative;
}
.auth-hero__inner { position: relative; z-index: 1; }
.auth-logo {
    width: 54px; height: 54px; border-radius: 14px;
    background: rgba(255,255,255,.16); backdrop-filter: blur(4px);
    display: grid; place-items: center; font-size: 24px; margin-bottom: 1rem;
}
.auth-hero h2 { color:#fff; font-size: 1.5rem; margin: 0 0 .5rem; }
.auth-hero p { color: rgba(255,255,255,.85); margin: 0 0 1.1rem; font-size: .95rem; }
.auth-hero__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.auth-hero__list li { color: rgba(255,255,255,.92); font-size: .9rem; }
.auth-hero__list i { color: var(--brand-200); margin-right: .4rem; }

.auth-form { padding: 2rem 1.75rem; }
.auth-form__title { margin: 0 0 .25rem; font-size: 1.5rem; }
.auth-form__sub { color: var(--text-muted); margin: 0 0 1.4rem; font-size: .92rem; }
.auth-form__row { display:flex; align-items:center; justify-content:space-between; margin-bottom: 1.1rem; }

.field-icon { position: relative; }
.field-icon > i {
    position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
    color: var(--ink-400); pointer-events: none;
}
.field-icon .form-control { padding-left: 2.4rem; height: 46px; }

.auth-check { display:inline-flex; align-items:center; gap:.5rem; font-weight:500; color:var(--ink-600); margin:0; cursor:pointer; }
.auth-check input { width:16px; height:16px; accent-color: var(--brand-500); }

.auth-submit { margin-top: .3rem; height: 48px; font-size: 1.02rem; }
.auth-form__foot { text-align:center; color: var(--ink-400); font-size:.8rem; margin: 1.3rem 0 0; }

/* Desktop: hai cot */
@media (min-width: 820px) {
    .auth-card { grid-template-columns: 1.05fr 1fr; }
    .auth-hero { padding: 2.6rem 2.2rem; display: grid; align-content: center; }
    .auth-form { padding: 2.6rem 2.4rem; display: grid; align-content: center; }
}

/* ---------- 13. CASHIER — O BAN (table tiles) ---------- */
.table-legend {
    display: flex; flex-wrap: wrap; gap: .6rem 1.4rem;
    margin: .2rem 0 1.2rem; font-size: .9rem; color: var(--ink-600); font-weight: 600;
}
.table-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.table-legend .dot { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.table-legend .dot--free { background: var(--success); }
.table-legend .dot--busy { background: var(--brand-500); }
.table-legend .dot--reserved { background: var(--info); }

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px; margin: 0 0 1.5rem;
}
@media (max-width: 520px) {
    .table-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

.table-tile {
    position: relative; aspect-ratio: 1 / 1;
    border-radius: var(--radius); border: 2px solid var(--border);
    background: var(--surface);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .25rem; cursor: pointer; text-align: center; padding: .6rem;
    box-shadow: var(--shadow-xs); user-select: none;
    transition: transform .14s, box-shadow .14s, border-color .14s;
}
.table-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.table-tile:active { transform: translateY(0); }
.table-tile__icon { font-size: 1.8rem; line-height: 1; }
.table-tile__name { font-weight: 800; font-size: 1.18rem; color: var(--ink-900); }
.table-tile__region { font-size: .78rem; color: var(--text-muted); }
.table-tile__status {
    position: absolute; top: 8px; right: 8px;
    font-size: .64rem; font-weight: 700; padding: .16rem .5rem; border-radius: 999px;
    text-transform: uppercase; letter-spacing: .02em;
}

/* Trong (green) */
.table-tile--free { border-color: #bbf7d0; background: linear-gradient(180deg, #f0fdf4, #fff); }
.table-tile--free .table-tile__icon { color: var(--success); }
.table-tile--free .table-tile__status { background: var(--success-bg); color: #166534; }
.table-tile--free:hover { border-color: var(--success); }

/* Dang phuc vu (orange) */
.table-tile--busy { border-color: var(--brand-300); background: linear-gradient(180deg, var(--brand-50), #fff); }
.table-tile--busy .table-tile__icon { color: var(--brand-600); }
.table-tile--busy .table-tile__status { background: var(--brand-100); color: var(--brand-700); }
.table-tile--busy:hover { border-color: var(--brand-500); }

/* Da dat truoc (blue) */
.table-tile--reserved { border-color: #bfdbfe; background: linear-gradient(180deg, var(--info-bg), #fff); }
.table-tile--reserved .table-tile__icon { color: var(--info); }
.table-tile--reserved .table-tile__status { background: var(--info-bg); color: #1e40af; }
.table-tile--reserved:hover { border-color: var(--info); }

/* Cham mau dung chung (legend + chip) */
.dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.dot--free { background: var(--success); }
.dot--busy { background: var(--brand-500); }
.dot--reserved { background: var(--info); }

/* ---------- 14. FILTER CHIPS (tag bam) ---------- */
.cashier-filter { margin: .2rem 0 1.1rem; }
.filter-group { margin-bottom: .9rem; }
.filter-group__label {
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    color: var(--ink-500); margin-bottom: .45rem;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .55rem 1rem; border-radius: 999px;
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--ink-700); font-weight: 600; font-size: .92rem;
    cursor: pointer; user-select: none; white-space: nowrap;
    transition: background .14s, border-color .14s, color .14s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--brand-300); color: var(--brand-700); }
.chip:active { transform: scale(.97); }
.chip.active { background: var(--brand-500); border-color: var(--brand-500); color: #fff; box-shadow: var(--shadow-sm); }
.chip.active .dot { background: rgba(255,255,255,.92) !important; }
.chip--ghost { color: var(--ink-500); border-style: dashed; }
.chip--ghost:hover { color: var(--ink-800); border-color: var(--ink-400); background: var(--ink-50); }

/* Muc tieu cham lon hon tren dien thoai */
@media (max-width: 520px) {
    .chip { padding: .62rem 1.05rem; font-size: .98rem; }
    .filter-chips { gap: .55rem; }
}

/* ---------- 15. ORDER SCREEN (dat mon) ---------- */
/* Stack 2 cot (menu / gio hang) tren mobile-tablet */
@media (max-width: 991px) {
    #team .w-50 { width: 100% !important; float: none !important; display: block; }
}
/* Padding man hinh order (trang nay khong co .container) */
#team > .section-header, #team > .row { padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
#team > .row { padding-top: .2rem; padding-bottom: 2.2rem; }
#team .w-50 .col-md-12 { padding-left: 0; padding-right: 0; }
@media (min-width: 992px) { #team > .row > .w-50 { padding: 0 10px; box-sizing: border-box; } }

/* Thanh loc mon: o tim + chip danh muc */
.order-search { position: relative; margin-bottom: .8rem; }
.order-search > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--ink-400); }
.order-search input.form-control { padding-left: 2.3rem; height: 46px; }
.order-cats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }

/* Luoi mon dang tile (khong anh) */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0; }
@media (max-width: 520px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.product-tile {
    position: relative; border: 1.5px solid var(--border); border-radius: var(--radius);
    background: var(--surface); padding: .85rem .85rem 3.1rem; cursor: pointer;
    box-shadow: var(--shadow-xs); user-select: none; min-height: 116px;
    display: flex; flex-direction: column; gap: .3rem;
    transition: transform .12s, box-shadow .12s, border-color .12s;
    -webkit-tap-highlight-color: transparent;
}
.product-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-300); }
.product-tile:active { transform: scale(.98); }
.product-tile__name { font-weight: 700; color: var(--ink-900); font-size: .95rem; line-height: 1.3; }
.product-tile__price { color: var(--brand-600); font-weight: 800; font-size: 1.05rem; margin-top: auto; }
.product-tile__add {
    position: absolute; right: .6rem; bottom: .6rem;
    width: 36px; height: 36px; border-radius: 11px; border: 0;
    background: var(--brand-500); color: #fff; font-size: 16px;
    display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.product-tile:hover .product-tile__add { background: var(--brand-600); }

/* ===== BANG DA ORDER (#cart) — the sang, GIU nguyen DOM cho JS ===== */
.cartproduct { margin-top: 1rem !important; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); overflow: hidden; }
#cart { font-size: .95rem; background: var(--surface); width: 100%; margin-bottom: 0; }
#cart img { display: none; }
#cart > thead > tr > th {
    background: var(--surface-2); color: var(--ink-500); font-size: .76rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .02em;
    border: 0 !important; border-bottom: 2px solid var(--border) !important; padding: .85rem .8rem;
}
#cart > tbody > tr > td { vertical-align: middle; padding: .8rem; border: 0 !important; border-top: 1px solid var(--ink-100) !important; }
#cart td[data-th="Product"] h4 { font-size: .95rem; font-weight: 700; margin: 0; color: var(--ink-900); }
#cart td[data-th="Price"], #cart td[data-th="Subtotal"], #cart td.text-center { white-space: nowrap; font-weight: 700; color: var(--ink-900); }
#cart td.service { white-space: nowrap; color: var(--info); font-weight: 600; }
#cart .qttOrder input[type=number], #cart input[type=number] {
    width: 72px; padding: .42rem; display: inline-block; text-align: center;
    border: 1.5px solid var(--ink-300); border-radius: 8px;
}
#cart td.actions .btn, #cart .DeleteOrder {
    width: 38px; height: 38px; padding: 0 !important; border-radius: 9px; border: 0 !important;
    display: inline-grid; place-items: center; background: var(--danger-bg) !important; color: #b91c1c !important;
}
#cart td.actions .btn:hover { background: #fecaca !important; }

/* Cot STT */
#cart .stt-col, #cart .stt-cell { width: 46px; text-align: center; color: var(--ink-400); font-weight: 700; }
#cart td.stt-cell { color: var(--ink-500); }

/* Stepper tang/giam so luong */
.qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--ink-300); border-radius: 9px; overflow: hidden; background: #fff; }
.qty-stepper .qty-btn {
    border: 0; background: var(--ink-50); color: var(--ink-700); width: 34px; height: 38px;
    font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; font-weight: 800;
    -webkit-tap-highlight-color: transparent; transition: background .12s, color .12s;
}
.qty-stepper .qty-btn:hover { background: var(--brand-100); color: var(--brand-700); }
.qty-stepper .qty-btn:active { background: var(--brand-200); }
#cart .qty-stepper .qty-input {
    width: 46px !important; height: 38px; padding: 0 !important; text-align: center; font-weight: 700;
    border: 0 !important; border-left: 1px solid var(--ink-200) !important; border-right: 1px solid var(--ink-200) !important;
    border-radius: 0 !important; box-shadow: none !important; -moz-appearance: textfield;
}
#cart .qty-stepper .qty-input:focus { box-shadow: none !important; }
.qty-stepper .qty-input::-webkit-outer-spin-button,
.qty-stepper .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Mobile: STT = huy hieu so nho, NAM CUNG HANG voi ten san pham */
@media (max-width: 991px) {
    #cart > tbody > tr > td.stt-cell {
        float: left; margin: .1rem .55rem 0 0;
        display: inline-flex; align-items: center; justify-content: center;
        min-width: 26px; height: 26px; padding: 0 .45rem !important;
        border-radius: 999px; background: var(--brand-100); color: var(--brand-700);
        font-weight: 800; font-size: .8rem;
        border: 0 !important; border-bottom: 0 !important;
    }
    #cart > tbody > tr > td.stt-cell::before { content: "" !important; display: none; }
    /* Ten san pham chay ben canh huy hieu STT */
    #cart > tbody > tr > td[data-th="Product"] { overflow: hidden; }
    #cart > tbody > tr > td[data-th="Product"] h4 { display: inline; }
}

/* ---------- 16. MODAL (Gop ban) ---------- */
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header {
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem 1.2rem;
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-weight: 800; color: var(--ink-900); font-size: 1.2rem; margin: 0; }
.modal-header .close { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--ink-500); opacity: 1; cursor: pointer; }
.modal-header .close:hover { color: var(--danger); }
.modal-body { padding: 1.2rem; }
.modal-footer { border-top: 1px solid var(--border); padding: .9rem 1.2rem; display: flex; gap: .6rem; justify-content: flex-end; }

#ModalDivideOrder .modal-body .form-group { margin-bottom: 1.1rem; }
/* Hang chon ban nhan */
#ModalDivideOrder .form-group:first-child > .row { display: flex; align-items: center; gap: .7rem; margin: 0; }
#ModalDivideOrder .form-group:first-child .col-sm-2 { width: auto; flex: 0 0 auto; padding: 0; }
#ModalDivideOrder .form-group:first-child .col-sm-10 { flex: 1; padding: 0; }
#ModalDivideOrder .control-label { text-align: left; font-weight: 500; color: var(--ink-700); margin: 0; }

/* Grid san pham -> hang flex gon (ke ca mobile) */
#ModalDivideOrder .form-group:last-child > .row {
    display: flex; align-items: center; gap: .6rem; margin: 0;
    padding: .6rem .4rem; border-bottom: 1px solid var(--ink-100);
}
#ModalDivideOrder .form-group:last-child > .row:first-child {
    background: var(--surface-2); border-radius: 8px; border-bottom: 0; margin-bottom: .3rem;
}
#ModalDivideOrder .form-group:last-child > .row:first-child .control-label {
    font-weight: 700; color: var(--ink-500); text-transform: uppercase; font-size: .74rem; letter-spacing: .02em;
}
#ModalDivideOrder [class^="col-sm-"] { padding: 0; float: none; width: auto; }
#ModalDivideOrder .col-sm-1 { flex: 0 0 26px; text-align: center; }
#ModalDivideOrder .col-sm-4 { flex: 1 1 0; min-width: 0; }
#ModalDivideOrder .col-sm-3 { flex: 0 0 92px; }
#ModalDivideOrder input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand-500); }
#ModalDivideOrder input[type=number] { width: 88px; padding: .38rem; border: 1.5px solid var(--ink-300); border-radius: 8px; text-align: center; }

/* Nut modal */
#ModalDivideOrder .btn-secondary {
    background: var(--surface); border: 1.5px solid var(--border); color: var(--ink-700);
    border-radius: var(--radius-sm); font-weight: 700; padding: .6rem 1.2rem;
}
#ModalDivideOrder .btn-secondary:hover { background: var(--ink-50); }
#ModalDivideOrder #SubmitChange {
    background: var(--brand-500); border: 0; color: #fff; border-radius: var(--radius-sm); font-weight: 700; padding: .6rem 1.4rem;
}
#ModalDivideOrder #SubmitChange:hover { background: var(--brand-600); }

/* ---------- 17. NUT CHUYEN MAN HINH + TOOLBAR ---------- */
.btn-switch {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .55rem 1rem; border-radius: var(--radius-pill); font-weight: 700; font-size: .9rem;
    background: var(--brand-500); color: #fff !important; border: 0; text-decoration: none !important;
    box-shadow: var(--shadow-xs); transition: background .14s, transform .12s; white-space: nowrap; cursor: pointer;
}
.btn-switch:hover { background: var(--brand-600); color: #fff !important; transform: translateY(-1px); }
.btn-switch--ghost { background: var(--surface); color: var(--ink-700) !important; border: 1.5px solid var(--border); box-shadow: none; }
.btn-switch--ghost:hover { background: var(--ink-50); color: var(--ink-900) !important; border-color: var(--ink-300); }

/* Thanh cong cu (breadcrumb trai + nut phai) cho man thu ngan / order */
.page-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin: 0 0 1.1rem;
}
.page-toolbar .breadcrumb { margin: 0; background: transparent; padding: 0; }
.page-toolbar__actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { background: transparent; }

/* ---------- 18. RESERVATION (dat cho) ---------- */
.res-filter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.1rem; }
.res-filter .form-control { height: 44px; }
.res-filter .res-field { flex: 1 1 180px; min-width: 150px; }
.res-filter .btn { height: 44px; }
@media (max-width: 640px) { .res-filter .res-field, .res-filter .btn { flex: 1 1 100%; width: 100%; } }

.res-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: 0 0 .9rem; font-size: .85rem; color: var(--ink-600); font-weight: 600; }
.res-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.res-legend .sw { width: 16px; height: 16px; border-radius: 5px; display: inline-block; border: 1px solid var(--border); }
.res-legend .sw--free { background: #fff; }
.res-legend .sw--reserved { background: var(--danger); border-color: var(--danger); }
.res-legend .sw--past { background: var(--ink-200); }

.reservation-grid-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface);
}
.reservation-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; }
.reservation-grid th, .reservation-grid td { border-bottom: 1px solid var(--ink-100); border-right: 1px solid var(--ink-100); }
.reservation-grid thead th { background: var(--ink-800); color: #fff; font-size: .8rem; font-weight: 700; padding: .65rem .4rem; text-align: center; white-space: nowrap; }
.reservation-grid thead th.rg-corner { background: var(--brand-600); text-align: left; padding-left: .9rem; }
.reservation-grid .rg-corner, .reservation-grid .rg-tablename { position: sticky; left: 0; z-index: 2; min-width: 106px; }
.reservation-grid .rg-tablename { background: var(--surface-2); font-weight: 700; color: var(--ink-800); text-align: left; padding: .7rem .9rem; white-space: nowrap; }
.reservation-grid .rg-group td { background: var(--ink-100); color: var(--ink-600); font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .02em; padding: .5rem .9rem; position: sticky; left: 0; z-index: 2; }
.reservation-grid .slot { width: 46px; min-width: 46px; height: 42px; text-align: center; cursor: pointer; background: #fff; transition: background .1s, box-shadow .1s; }
.reservation-grid .slot.reservable:hover { background: var(--brand-100); box-shadow: inset 0 0 0 2px var(--brand-300); }
.reservation-grid .slot.reserved { background: var(--danger); }
.reservation-grid .slot.reserved:hover { background: #b91c1c; }
.reservation-grid .slot.pasttime { background: var(--ink-100); cursor: not-allowed; }

/* Form tao/chi tiet dat cho */
#team .app-card, .container > .app-card { margin-bottom: 1.5rem; }
.res-form-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.2rem; }
.res-form-actions .btn { display: inline-flex; align-items: center; gap: .4rem; }
.res-form-actions .btn-default a { color: inherit; text-decoration: none; }
@media (max-width: 560px) {
    .res-form-actions { flex-direction: column-reverse; align-items: stretch; }
    .res-form-actions .btn { width: 100%; justify-content: center; }
}
/* form-row gutter dep hon */
#checkout .form-row, .app-card .form-row { display: flex; flex-wrap: wrap; margin-right: -8px; margin-left: -8px; }
.app-card .form-row > [class*="col-"] { padding-right: 8px; padding-left: 8px; }

/* Mobile: moi dong = 1 the (card mode), GIU DOM cho JS */
@media (max-width: 991px) {
    .cartproduct { border: 0; box-shadow: none; background: transparent; overflow: visible; }
    #cart { display: block; }
    #cart > thead { display: none; }
    #cart > tbody { display: block; }
    #cart > tbody > tr {
        display: block; background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); box-shadow: var(--shadow-xs); padding: .3rem .9rem; margin-bottom: .7rem;
    }
    #cart > tbody > tr > td {
        display: flex; align-items: center; justify-content: space-between; gap: 1rem;
        padding: .58rem 0 !important; border: 0 !important; border-bottom: 1px dashed var(--ink-100) !important; text-align: right;
    }
    #cart > tbody > tr > td:last-child { border-bottom: 0 !important; }
    #cart > tbody > tr > td.hidden, #cart td.thanhtien { display: none !important; }
    #cart > tbody > tr > td[data-th]::before {
        content: attr(data-th); font-weight: 700; color: var(--ink-500); text-align: left;
        font-size: .74rem; text-transform: uppercase; letter-spacing: .02em;
    }
    #cart > tbody > tr > td[data-th="Price"]::before { content: "Giá"; }
    #cart > tbody > tr > td[data-th="Quantity"]::before { content: "Số lượng"; }
    #cart > tbody > tr > td[data-th="Subtotal"]::before { content: "Thành tiền"; }
    #cart > tbody > tr > td[data-th="Service"]::before { content: "Thời gian"; }
    #cart > tbody > tr > td[data-th="Product"] {
        display: block; text-align: left; border-bottom: 1px solid var(--ink-100) !important; padding-bottom: .55rem !important;
    }
    #cart > tbody > tr > td[data-th="Product"]::before { display: none; }
    #cart td[data-th="Product"] .row, #cart td[data-th="Product"] [class^="col-"] { display: block; width: 100%; margin: 0; padding: 0; }
    #cart td.actions, #cart td[data-th=""] { justify-content: flex-end; }
    #cart td.actions::before { content: "" !important; }
}

/* ===== Panel tong ket (tong tien + nut) — la <div> ngoai bang ===== */
.order-summary { margin-top: 1rem; }
.order-summary .order-total {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .2rem .1rem 1rem; border-bottom: 1px dashed var(--border); margin-bottom: 1rem;
}
.order-total__label { font-weight: 700; color: var(--ink-600); font-size: 1.05rem; }
.order-total__value { font-size: 1.7rem; font-weight: 800; color: var(--brand-700); line-height: 1; }

.order-summary .order-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.order-summary .oa-item { flex: 1 1 140px; display: block; }
.order-summary .oa-item .btn-style-2 { width: 100%; }
@media (max-width: 520px) { .order-summary .oa-item { flex: 1 1 100%; } }

.checkout.btn-style-2, .btn-style-2 {
    border-radius: var(--radius-sm) !important; font-weight: 700 !important;
    padding: .72rem 1rem !important; border: 1.5px solid var(--border) !important;
    background: var(--surface); color: var(--ink-700) !important; width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; transition: all .14s;
}
.btn-style-2:hover { border-color: var(--ink-300) !important; background: var(--ink-50); transform: translateY(-1px); }
.btn-pay.btn-style-2 { background: var(--brand-500) !important; border-color: var(--brand-500) !important; color: #fff !important; box-shadow: var(--shadow-sm); }
.btn-pay.btn-style-2:hover { background: var(--brand-600) !important; }
.CanncelOrder.btn-style-2 { color: #b91c1c !important; border-color: #fecaca !important; }
.CanncelOrder.btn-style-2:hover { background: var(--danger-bg) !important; }

/* ===== DESKTOP: panel tong ket = dai footer to mau lien trong the ===== */
@media (min-width: 992px) {
    .order-summary {
        margin-top: 0; background: var(--surface-2);
        border-top: 1px solid var(--border); padding: 1.2rem 1.3rem 1.3rem;
    }
    .order-total__value { font-size: 1.95rem; }
    /* Thanh toan full-width noi bat, 3 nut phu chia deu 1 hang */
    .order-summary .oa-item.oa-pay { flex: 1 1 100%; }
    .order-summary .oa-item.oa-pay .btn-pay { padding: 1rem 1rem !important; font-size: 1.08rem; }
    .order-summary .oa-item:not(.oa-pay) { flex: 1 1 0; }
    .order-summary .oa-item:not(.oa-pay) .btn-style-2 { padding: .72rem .5rem !important; }
}
