/* ===================================================
   CocoMeo FnB POS Stylesheet - Deep Green Theme (Xanh Lá Đậm)
   With Large Readable Typography & Product Photos
   =================================================== */

:root {
    /* Deep Forest Green Palette */
    --kv-green-header: #14532d;   /* Deep Forest Green Header */
    --kv-green-dark: #166534;     /* Green 800 */
    --kv-green: #15803d;          /* Green 700 (Primary Action & Accent) */
    --kv-green-hover: #16a34a;    /* Green 600 */
    --kv-green-light: #dcfce7;    /* Green 100 */
    --kv-green-tint: #f0fdf4;     /* Green 50 */
    
    --kv-bg: #f3f5f8;
    --kv-white: #ffffff;
    --kv-border: #cbd5e1;
    --kv-border-light: #e2e8f0;
    
    --kv-text: #0f172a;
    --kv-text-sub: #475569;
    --kv-text-dim: #94a3b8;
    
    --kv-red: #ef4444;
    --kv-orange: #ea580c;
    --kv-amber: #d97706;
    
    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 24px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body, button, input, select, textarea, optgroup, option {
    font-family: 'Be Vietnam Pro', 'Segoe UI', Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

button {
    white-space: nowrap;
    line-height: 1.25;
}

body {
    background-color: var(--kv-bg);
    color: var(--kv-text);
    font-size: 14.5px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
}

/* ================= 1. TOP HEADER (DEEP GREEN) ================= */
.app-header {
    background-color: var(--kv-green-header);
    color: #ffffff;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #ffffff;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.brand-title span {
    font-weight: 600;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.22);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    color: #fef08a;
}

/* Branch Dropdown */
.branch-select-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.18);
    padding: 5px 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    white-space: nowrap;
}

.branch-select-container i {
    font-size: 0.88rem;
    color: #fef08a;
}

.branch-select {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    max-width: 175px;
    text-overflow: ellipsis;
}

.branch-select option {
    color: #0f172a;
    background: #ffffff;
}

/* Nav Tabs in Header */
.system-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.sys-tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.92);
    padding: 7px 11px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

.sys-tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.sys-tab-btn.active {
    background: #ffffff;
    color: var(--kv-green-dark);
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.clock-badge {
    font-family: 'Be Vietnam Pro', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 0.84rem;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: #fef08a;
    white-space: nowrap;
    flex-shrink: 0;
}

.cashier-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

.cashier-info #cashierName {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* ================= 2. MAIN WORKSPACE ================= */
.main-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
}

.tab-pane {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
}

.pos-workspace {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ================= 3. LEFT PANEL (61%): PHÒNG BÀN & THỰC ĐƠN ================= */
.pos-left-panel {
    width: 65.5%;
    height: 100%;
    background: #ffffff;
    border-right: 2px solid var(--kv-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sub-Header: [Phòng bàn] [Thực đơn] & Tìm món F3 */
.pos-sub-header {
    height: 52px;
    background: #ffffff;
    border-bottom: 1px solid var(--kv-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    gap: 14px;
    flex-shrink: 0;
}

.left-toggle-buttons {
    display: flex;
    gap: 8px;
}

.btn-sub-toggle {
    background: #ffffff;
    border: 1px solid var(--kv-border);
    color: var(--kv-text-sub);
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-sub-toggle:hover {
    border-color: var(--kv-green);
    color: var(--kv-green);
}

.btn-sub-toggle.active {
    background: var(--kv-green);
    border-color: var(--kv-green);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.35);
}

/* Search Box F3 */
.search-box-f3 {
    flex: 1;
    max-width: 340px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box-f3 i.fa-magnifying-glass {
    position: absolute;
    left: 14px;
    color: var(--kv-text-dim);
    font-size: 0.95rem;
}

.search-box-f3 input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--kv-border);
    color: var(--kv-text);
    padding: 8px 36px 8px 38px;
    border-radius: var(--radius-pill);
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s;
}

.search-box-f3 input:focus {
    background: #ffffff;
    border-color: var(--kv-green);
    box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.2);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--kv-text-dim);
    cursor: pointer;
}

.pos-view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ================= 4. VIEW PHÒNG BÀN (TABLES MATRIX) ================= */
.filter-bar-tables {
    padding: 10px 14px;
    background: var(--kv-green-tint);
    border-bottom: 1px solid var(--kv-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.area-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.area-pill {
    background: #ffffff;
    border: 1px solid var(--kv-border);
    color: var(--kv-text);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.area-pill:hover {
    border-color: var(--kv-green);
}

.area-pill.active {
    background: var(--kv-green);
    color: #ffffff;
    border-color: var(--kv-green);
}

.status-radio-group {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--kv-text-sub);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.tables-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: #ffffff;
}

.tables-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 18px 14px;
    align-content: start;
}

/* KIOTVIET ICONIC TABLE CARD WITH CHAIRS */
.kv-table-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.15s ease;
    user-select: none;
}

.kv-table-card:hover {
    transform: translateY(-2px);
}

.table-shape {
    width: 90px;
    height: 58px;
    border: 2px solid #94a3b8;
    border-radius: 16px;
    background: #ffffff;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Chairs notches */
.table-shape::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 22px;
    right: 22px;
    height: 4px;
    background: #94a3b8;
    border-radius: 2px;
}
.table-shape::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 22px;
    right: 22px;
    height: 4px;
    background: #94a3b8;
    border-radius: 2px;
}

.table-name-label {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--kv-text);
    margin-top: 8px;
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Selected Table (Deep Green) */
.kv-table-card.selected .table-shape {
    background: var(--kv-green) !important;
    border-color: var(--kv-green) !important;
    box-shadow: 0 4px 10px rgba(21, 128, 61, 0.4);
}
.kv-table-card.selected .table-shape::before,
.kv-table-card.selected .table-shape::after {
    background: var(--kv-green) !important;
}
.kv-table-card.selected .table-shape .inner-badge {
    color: #ffffff !important;
}
.kv-table-card.selected .table-name-label {
    color: var(--kv-green-dark);
    font-weight: 900;
}

/* Occupied Table */
.kv-table-card.status-occupied .table-shape {
    border-color: #f97316;
    background: #fff7ed;
}
.kv-table-card.status-occupied .table-shape::before,
.kv-table-card.status-occupied .table-shape::after {
    background: #f97316;
}
.kv-table-card.status-occupied .inner-amount {
    font-size: 0.8rem;
    font-weight: 800;
    color: #ea580c;
}

/* Footer Phòng bàn */
.phong-ban-footer {
    height: 42px;
    background: #f8fafc;
    border-top: 1px solid var(--kv-border);
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-size: 0.88rem;
    color: var(--kv-text-sub);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
}

/* ================= 5. VIEW THỰC ĐƠN & NHÓM HÀNG 2 DÒNG ================= */
.category-tabs-bar {
    background: #ffffff;
    border-bottom: 2px solid var(--kv-border);
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 64px;
    max-height: 70px;
    overflow: hidden;
    flex-shrink: 0;
}

.cat-tabs-row {
    display: flex;
    gap: 4px;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cat-tabs-row::-webkit-scrollbar {
    display: none;
}

.cat-tab-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    letter-spacing: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.cat-tab-btn:hover {
    border-color: #15803d;
    color: #15803d;
    background: #f0fdf4;
}

.cat-tab-btn.active {
    background: #14532d !important;
    color: #ffffff !important;
    border-color: #14532d !important;
    box-shadow: 0 2px 4px rgba(20, 83, 45, 0.3) !important;
}

.products-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f8fafc;
}

.products-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
    gap: 12px;
    align-content: start;
}

/* PRODUCT CARD WITH REAL IMAGES */
.kv-product-card {
    background: #ffffff;
    border: 1px solid var(--kv-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.kv-product-card:hover {
    border-color: var(--kv-green);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.12);
}

.kv-product-card:active {
    transform: scale(0.97);
}

.prod-preview-box {
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.prod-preview-box.has-image {
    background-color: #f1f5f9;
}

.prod-preview-text {
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
    text-transform: uppercase;
}

.prod-qty-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--kv-red);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.prod-details-box {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 56px;
    background: #ffffff;
    border-top: 1px solid var(--kv-border-light);
}

.prod-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--kv-green);
    text-align: center;
}

.prod-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--kv-text);
    text-align: center;
    margin-top: 3px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Footer Thực đơn */
.thuc-don-footer {
    height: 44px;
    background: #ffffff;
    border-top: 1px solid var(--kv-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    flex-shrink: 0;
}

.btn-back-tables {
    background: var(--kv-green-tint);
    border: 1px solid var(--kv-green);
    color: var(--kv-green-dark);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}
.btn-back-tables:hover {
    background: var(--kv-green-light);
}

.menu-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--kv-text-sub);
}

.btn-pager {
    background: #ffffff;
    border: 1px solid var(--kv-border);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= 6. RIGHT PANEL (39%): PHẦN TÍNH RA TIỀN HÀNG ================= */
.pos-right-panel {
    width: 34.5%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Cart Top Bar */
.cart-top-bar {
    height: 52px;
    background: #ffffff;
    border-bottom: 1px solid var(--kv-border);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 10px;
    flex-shrink: 0;
}

.active-table-pill {
    background: var(--kv-green-tint);
    border: 1px solid var(--kv-green);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--kv-green-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.table-status-icon {
    font-size: 0.75rem;
    color: var(--kv-green);
}

.customer-search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.customer-search-box i.fa-magnifying-glass {
    position: absolute;
    left: 12px;
    color: var(--kv-text-dim);
    font-size: 0.85rem;
}

.customer-search-box input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--kv-border);
    padding: 6px 32px 6px 34px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
}

.btn-add-customer {
    position: absolute;
    right: 6px;
    background: transparent;
    border: none;
    color: var(--kv-green);
    font-size: 0.95rem;
    cursor: pointer;
}

.price-mode-badge {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--kv-text-sub);
    white-space: nowrap;
    background: #f8fafc;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--kv-border-light);
}

/* Cart Body Area */
.cart-body-area {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
    position: relative;
}

/* Empty State */
.empty-cart-kv {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    color: #94a3b8;
}

.empty-icon-box {
    width: 68px;
    height: 68px;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--kv-green);
    margin-bottom: 14px;
    background: var(--kv-green-tint);
}

.empty-cart-kv h4 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--kv-text);
    margin-bottom: 4px;
}

.empty-cart-kv p {
    font-size: 0.88rem;
    color: var(--kv-text-sub);
}

/* Cart Items Table */
.cart-items-table-container {
    width: 100%;
}

.cart-items-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-items-table th {
    background: #f8fafc;
    color: var(--kv-text-sub);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--kv-border);
}

.cart-item-row td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--kv-border-light);
    vertical-align: middle;
    font-size: 0.88rem;
}

.item-info-col .item-title {
    font-weight: 700;
    color: var(--kv-text);
    line-height: 1.25;
}
.item-info-col .item-code {
    font-size: 0.75rem;
    color: var(--kv-text-dim);
}

.qty-control-kv {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-qty-kv {
    background: #f1f5f9;
    border: 1px solid var(--kv-border);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
}

.qty-val-kv {
    width: 26px;
    text-align: center;
    font-weight: 800;
    font-size: 0.95rem;
}

.item-price-col {
    color: var(--kv-text-sub);
    font-size: 0.88rem;
}

.item-total-col {
    font-weight: 800;
    color: var(--kv-green);
    font-size: 0.95rem;
}

.btn-del-item {
    background: transparent;
    border: none;
    color: var(--kv-red);
    cursor: pointer;
    font-size: 0.95rem;
    opacity: 0.75;
}
.btn-del-item:hover {
    opacity: 1;
}

/* Cart Bottom Area */
.cart-bottom-area {
    background: #ffffff;
    border-top: 1px solid var(--kv-border);
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    gap: 10px;
    flex-shrink: 0;
}

.cart-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
}

.cashier-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: var(--kv-green-dark);
}

.meta-tools {
    display: flex;
    gap: 8px;
}

.btn-meta-tool {
    background: #f8fafc;
    border: 1px solid var(--kv-border);
    color: var(--kv-text);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.expandable-row {
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--kv-border);
}

.expandable-row input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--kv-border);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    outline: none;
}

/* Financial Summary */
.cart-financial-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-top: 1px dashed var(--kv-border);
    padding-top: 8px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--kv-text-sub);
}

.summary-val {
    font-weight: 700;
    color: var(--kv-text);
}

.total-line {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--kv-text);
    margin-top: 4px;
}

.total-label {
    font-weight: 900;
    color: var(--kv-text);
}

.total-val {
    color: var(--kv-green);
    font-size: 1.55rem;
    font-weight: 900;
}

/* Cash Tendered & Change */
.cash-tendered-box {
    background: var(--kv-green-tint);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-cash-chips {
    display: flex;
    gap: 6px;
}

.cash-chip {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--kv-border);
    color: var(--kv-text);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 5px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.cash-chip:hover {
    border-color: var(--kv-green);
    color: var(--kv-green);
}

.tendered-inputs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.t-col {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--kv-text-sub);
}

.t-col input {
    width: 110px;
    background: #ffffff;
    border: 1px solid var(--kv-border);
    padding: 5px 8px;
    font-size: 0.95rem;
    font-weight: 800;
    text-align: right;
    border-radius: var(--radius-sm);
    outline: none;
}

.change-amount-display {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--kv-green-dark);
}

/* 3 Big Action Buttons */
.cart-action-buttons {
    display: flex;
    gap: 10px;
    height: 48px;
    margin-top: 4px;
}

.btn-kv-action {
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-kv-notify {
    flex: 1.1;
    background: var(--kv-green-tint);
    color: var(--kv-green-dark);
    border: 1px solid var(--kv-green);
}
.btn-kv-notify:hover {
    background: var(--kv-green-light);
}

.btn-kv-print-temp {
    flex: 1.1;
    background: #ffffff;
    color: var(--kv-green-dark);
    border: 1px solid var(--kv-green-dark);
}
.btn-kv-print-temp:hover {
    background: var(--kv-green-tint);
}

.btn-kv-checkout {
    flex: 1.8;
    background: var(--kv-green);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(21, 128, 61, 0.4);
}
.btn-kv-checkout:hover {
    background: var(--kv-green-dark);
}

/* ================= 7. MANAGEMENT & DASHBOARD STYLES ================= */
.dashboard-wrapper {
    padding: 24px 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.kpi-card {
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid var(--kv-border);
    box-shadow: var(--shadow-sm);
}

.gradient-emerald { border-left: 5px solid #15803d; }
.gradient-cyan { border-left: 5px solid #06b6d4; }
.gradient-amber { border-left: 5px solid #f59e0b; }
.gradient-purple { border-left: 5px solid #8b5cf6; }

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--kv-green-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--kv-green);
}

.kpi-details { flex: 1; }
.kpi-title { font-size: 0.82rem; color: var(--kv-text-sub); font-weight: 800; text-transform: uppercase; }
.kpi-value { font-size: 1.55rem; font-weight: 900; color: var(--kv-text); margin: 2px 0; }
.kpi-sub { font-size: 0.75rem; color: var(--kv-text-dim); }

.analytics-row { display: flex; gap: 20px; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

.analytics-card {
    background: #ffffff;
    border: 1px solid var(--kv-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--kv-border-light);
    padding-bottom: 10px;
}
.card-head h3 { font-size: 1.05rem; font-weight: 800; color: var(--kv-text); }
.card-desc { font-size: 0.8rem; color: var(--kv-text-sub); }

.revenue-share-body { display: flex; align-items: center; gap: 24px; }
.chart-container { width: 200px; height: 200px; position: relative; flex-shrink: 0; }
.chart-container-bar { height: 240px; width: 100%; position: relative; }

.share-breakdown-list { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.share-item { display: flex; flex-direction: column; gap: 5px; }
.share-item-head { display: flex; justify-content: space-between; font-size: 0.9rem; }
.share-branch-name { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.share-dot { width: 10px; height: 10px; border-radius: 50%; }
.share-percentage { font-weight: 900; }
.share-value { font-size: 0.82rem; color: var(--kv-text-sub); }

.progress-bar-bg { width: 100%; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; }

.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th { background: #f8fafc; padding: 12px 14px; font-weight: 800; color: var(--kv-text-sub); border-bottom: 2px solid var(--kv-border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--kv-border-light); color: var(--kv-text); }
.percent-badge { background: var(--kv-green-tint); color: var(--kv-green-dark); padding: 4px 10px; border-radius: 12px; font-weight: 800; font-size: 0.84rem; border: 1px solid #bbf7d0; }

.top-list { display: flex; flex-direction: column; gap: 10px; }
.top-cat-item { display: flex; justify-content: space-between; padding: 10px 14px; background: #f8fafc; border-radius: var(--radius-sm); border: 1px solid var(--kv-border-light); }
.top-cat-name { font-weight: 800; font-size: 0.88rem; }
.top-cat-badge { font-size: 0.8rem; background: #ffffff; color: var(--kv-green); padding: 3px 8px; border-radius: var(--radius-sm); border: 1px solid var(--kv-border); font-weight: 700; }

/* Invoices tab */
.invoices-wrapper, .sync-wrapper { padding: 24px 30px; max-width: 1300px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 16px; }
.invoices-filter-bar { display: flex; justify-content: space-between; align-items: center; background: #ffffff; padding: 14px 18px; border-radius: var(--radius-md); border: 1px solid var(--kv-border); }
.invoices-table-container { background: #ffffff; border-radius: var(--radius-md); border: 1px solid var(--kv-border); }
.btn-refresh { background: var(--kv-green); color: #fff; border: none; padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 800; cursor: pointer; }

/* Sync Tab */
.sync-hero { text-align: center; padding: 16px; }
.sync-hero-icon { font-size: 3rem; color: var(--kv-green); margin-bottom: 10px; }
.sync-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.sync-store-card { background: #ffffff; border: 1px solid var(--kv-border); border-radius: var(--radius-md); padding: 18px; position: relative; }
.store-badge { position: absolute; top: 14px; right: 14px; background: var(--kv-green-tint); color: var(--kv-green-dark); font-size: 0.75rem; font-weight: 800; padding: 3px 8px; border-radius: 4px; border: 1px solid #bbf7d0; }
.btn-sync-single { margin-top: 14px; background: #f1f5f9; color: var(--kv-green-dark); border: 1px solid var(--kv-border); padding: 9px; width: 100%; border-radius: var(--radius-sm); font-weight: 800; cursor: pointer; }
.btn-sync-single:hover { background: var(--kv-green); color: #fff; }
.btn-sync-all { background: var(--kv-green); color: #fff; border: none; padding: 14px 32px; border-radius: var(--radius-md); font-weight: 900; font-size: 1rem; cursor: pointer; box-shadow: 0 4px 12px rgba(21, 128, 61, 0.35); }
.sync-status-log { margin-top: 16px; background: #0f172a; color: #4ade80; padding: 14px; border-radius: var(--radius-sm); font-family: monospace; font-size: 0.88rem; text-align: left; }

/* Modal & Receipt */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #ffffff; border-radius: var(--radius-md); width: 90%; max-width: 460px; box-shadow: 0 12px 30px rgba(0,0,0,0.25); overflow: hidden; display: flex; flex-direction: column; }
.modal-header { padding: 14px 18px; background: #f8fafc; border-bottom: 1px solid var(--kv-border); display: flex; align-items: center; justify-content: space-between; font-weight: 800; }
.close-modal-btn { background: transparent; border: none; font-size: 1.2rem; color: #64748b; cursor: pointer; }
.modal-body { padding: 18px; max-height: 75vh; overflow-y: auto; }
.modal-actions { padding: 12px 18px; background: #f8fafc; border-top: 1px solid var(--kv-border); display: flex; justify-content: flex-end; gap: 10px; }
.btn-print { background: var(--kv-green); color: #fff; border: none; padding: 8px 18px; border-radius: var(--radius-sm); font-weight: 800; cursor: pointer; }
.btn-close { background: #e2e8f0; color: #334155; border: none; padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; }

/* Printable Receipt Paper */
.receipt-paper {
    background: #fff;
    color: #111827;
    padding: 16px 14px;
    font-family: 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    line-height: 1.45;
}
.receipt-store-header { text-align: center; }
.receipt-main-title { font-size: 18px; font-weight: 900; margin: 0 0 2px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.receipt-slogan { font-size: 11px; font-style: italic; color: #475569; margin: 0 0 8px 0; }
.receipt-contact-info { font-size: 11.5px; margin: 6px 0; line-height: 1.4; text-align: center; }
.receipt-contact-info p { margin: 2px 0; }
.receipt-sale-date-row { font-size: 12px; margin: 6px 0 2px 0; font-weight: 600; text-align: center; }
.receipt-bill-heading { font-size: 16px; font-weight: 900; margin: 6px 0 2px 0; letter-spacing: 1px; }
.receipt-code-highlight { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.receipt-meta { font-size: 12px; margin: 6px 0; }
.receipt-meta-line { display: flex; justify-content: space-between; margin: 3px 0; }
.receipt-divider { text-align: center; margin: 6px 0; letter-spacing: -1px; color: #475569; font-weight: bold; }
.receipt-items-table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 12px; }
.receipt-items-table th { border-bottom: 1px dashed #475569; padding: 4px 2px; font-weight: 700; }
.receipt-items-table td { padding: 4px 2px; }
.receipt-totals { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.receipt-total-row { display: flex; justify-content: space-between; }
.receipt-grand-total { font-size: 15px; font-weight: 900; border-top: 1px dashed #111827; border-bottom: 1px dashed #111827; padding: 5px 0; margin: 4px 0; }
.receipt-footer { text-align: center; margin-top: 10px; font-size: 11.5px; }

@media print {
    body * { visibility: hidden; }
    #receiptPrintArea, #receiptPrintArea * { visibility: visible; }
    #receiptPrintArea { position: absolute; left: 0; top: 0; width: 80mm; margin: 0; padding: 5mm; }
}

/* ===================================================
   NEW STYLES FOR REVISED USER REQUIREMENTS
   =================================================== */

/* 1. AUTHENTICATION & LOGIN OVERLAY */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.88), rgba(6, 78, 59, 0.95));
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.login-box {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: loginFadeIn 0.25s ease-out;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-header {
    background: linear-gradient(135deg, var(--kv-green-header), var(--kv-green-dark));
    color: #ffffff;
    padding: 18px 20px 14px;
    text-align: center;
}

.login-logo-img {
    width: 46px;
    height: 46px;
    background: #ffffff;
    padding: 3px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    margin-bottom: 6px;
}

.login-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.login-header p {
    font-size: 0.85rem;
    color: #bbf7d0;
    margin-top: 2px;
}

.login-form {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--kv-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-field label i {
    color: var(--kv-green);
}

.login-field input {
    background: #f8fafc;
    border: 1.5px solid var(--kv-border);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    font-size: 0.95rem;
    color: var(--kv-text);
    outline: none;
    transition: all 0.2s;
}

.login-field input:focus {
    background: #ffffff;
    border-color: var(--kv-green);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.2);
}

.login-remember-row {
    display: flex;
    align-items: center;
    margin-top: -2px;
    margin-bottom: 2px;
}

.remember-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--kv-green-dark);
    cursor: pointer;
    user-select: none;
}

.remember-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--kv-green);
    cursor: pointer;
}

.remember-checkbox-label i {
    color: var(--kv-green);
    font-size: 0.9rem;
}

.login-error-msg {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
}

.btn-login-submit {
    background: linear-gradient(135deg, var(--kv-green), var(--kv-green-dark));
    color: #ffffff;
    border: none;
    padding: 13px;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-top: 4px;
}

.btn-login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(21, 128, 61, 0.45);
}

.quick-login-section {
    padding: 0 24px 24px;
    border-top: 1px solid var(--kv-border-light);
}

.quick-login-title {
    text-align: center;
    position: relative;
    margin: 14px 0 12px;
}

.quick-login-title span {
    background: #ffffff;
    padding: 0 10px;
    font-size: 0.8rem;
    color: var(--kv-text-dim);
    font-weight: 700;
}

.quick-accounts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.btn-quick-acc {
    background: #f8fafc;
    border: 1px solid var(--kv-border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.btn-quick-acc:hover {
    background: var(--kv-green-tint);
    border-color: var(--kv-green);
}

.btn-quick-acc i {
    font-size: 1.15rem;
    color: var(--kv-green);
    width: 22px;
    text-align: center;
}

.btn-quick-acc div {
    display: flex;
    flex-direction: column;
}

.btn-quick-acc strong {
    font-size: 0.82rem;
    color: var(--kv-text);
}

.btn-quick-acc small {
    font-size: 0.72rem;
    color: var(--kv-text-sub);
}

.btn-quick-acc.acc-admin {
    grid-column: span 2;
    background: #fffbeb;
    border-color: #fde68a;
}

.btn-quick-acc.acc-admin i {
    color: #d97706;
}

/* User Profile in Header */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.16);
    padding: 4px 8px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.user-role-tag {
    background: #fef08a;
    color: #854d0e;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.user-role-tag.role-cashier {
    background: #dcfce7;
    color: #166534;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: #ef4444;
    color: #ffffff;
}

.branch-lock-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fef08a;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Logo CocoMeo trên nền trắng */
.brand-logo-white-badge {
    background: #ffffff;
    padding: 3px 10px 3px 5px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
    flex-shrink: 0;
    white-space: nowrap;
}

.brand-text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.brand-logo-img {
    width: 40px;
    height: 34px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.brand-logo-text {
    font-size: 0.96rem;
    font-weight: 800;
    color: #14532d;
    white-space: nowrap;
}

.brand-author-text {
    font-size: 0.62rem;
    font-weight: 700;
    color: #047857;
    white-space: nowrap;
}

.brand-sub-badge {
    display: none;
}

/* Chế độ Online / Offline & Tự động đồng bộ */
.network-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 800;
    cursor: default;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 1560px) {
    .app-header {
        padding: 0 8px;
        gap: 6px;
    }
    .header-left {
        gap: 6px;
    }
    .system-nav {
        gap: 4px;
    }
    .sys-tab-btn {
        padding: 6px 8px;
        font-size: 0.76rem;
        gap: 5px;
    }
    .brand-logo-white-badge {
        padding: 3px 8px 3px 4px;
        gap: 5px;
    }
    .brand-logo-img {
        width: 34px;
        height: 30px;
    }
    .brand-logo-text {
        font-size: 0.84rem;
    }
    .brand-author-text {
        font-size: 0.56rem;
    }
    .branch-select-container {
        padding: 4px 8px;
        gap: 5px;
    }
    .branch-select {
        max-width: 135px;
        font-size: 0.78rem;
    }
    .header-right {
        gap: 6px;
    }
    .network-status-badge {
        padding: 3px 8px;
        font-size: 0.72rem;
    }
    .clock-badge {
        font-size: 0.78rem;
        padding: 3px 6px;
    }
    .user-profile-badge {
        padding: 3px 6px;
        gap: 5px;
    }
    .cashier-info {
        font-size: 0.78rem;
    }
    .cashier-info #cashierName {
        max-width: 95px;
    }
}

.network-status-badge.online {
    background: rgba(34, 197, 94, 0.22);
    border: 1px solid rgba(74, 222, 128, 0.45);
    color: #bbf7d0;
}

.network-status-badge.offline {
    background: #ea580c;
    border: 1px solid #ffedd5;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.4);
    animation: offlinePulse 1.6s infinite;
}

@keyframes offlinePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.88; transform: scale(1.03); }
}

.status-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    box-shadow: 0 0 8px #4ade80;
}

.network-status-badge.offline .status-pulse-dot {
    background: #fef08a;
    box-shadow: 0 0 8px #fef08a;
}

.network-toast {
    position: fixed;
    top: 68px;
    right: 20px;
    z-index: 999999;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDownToast 0.3s ease-out;
}

@keyframes slideDownToast {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

.network-toast.warning {
    background: #ea580c;
    color: #ffffff;
    border: 1px solid #f97316;
}

.network-toast.success {
    background: #15803d;
    color: #ffffff;
    border: 1px solid #16a34a;
}

/* 2. OPTIMIZED TABLE CARDS SIZE & SOFT BLUE PASTEL BACKGROUND */
.tables-matrix-large {
    grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)) !important;
    gap: 14px 10px !important;
    padding: 14px !important;
}

.tables-matrix-large .table-shape {
    width: 108px !important;
    height: 66px !important;
    border-width: 2px !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

/* NỀN MÀU XANH DƯƠNG NHẠT NHẠT Ở CÁC PHÒNG BÀN THEO YÊU CẦU */
.tables-matrix-large .table-shape.empty {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    color: #0369a1 !important;
}

.tables-matrix-large .table-shape.empty::before,
.tables-matrix-large .table-shape.empty::after {
    background: #7dd3fc !important;
    left: 24px !important;
    right: 24px !important;
    height: 4px !important;
}

.tables-matrix-large .table-shape.empty:hover {
    background: #bae6fd !important;
    border-color: #38bdf8 !important;
}

/* BÀN ĐANG ĐƯỢC CHỌN (ACTIVE / SELECTED) */
.tables-matrix-large .kv-table-card.is-selected .table-shape,
.tables-matrix-large .kv-table-card.selected .table-shape {
    background: #15803d !important;
    border-color: #166534 !important;
    box-shadow: 0 4px 14px rgba(22, 101, 52, 0.45) !important;
}

.tables-matrix-large .kv-table-card.is-selected .table-shape .table-name,
.tables-matrix-large .kv-table-card.selected .table-shape .table-name {
    color: #ffffff !important;
}

.tables-matrix-large .kv-table-card.is-selected .table-shape::before,
.tables-matrix-large .kv-table-card.is-selected .table-shape::after,
.tables-matrix-large .kv-table-card.selected .table-shape::before,
.tables-matrix-large .kv-table-card.selected .table-shape::after {
    background: #166534 !important;
    left: 24px !important;
    right: 24px !important;
    height: 4px !important;
}

.tables-matrix-large .table-shape.occupied {
    background: #fff7ed !important;
    border-color: #f97316 !important;
}

.tables-matrix-large .table-shape.occupied::before,
.tables-matrix-large .table-shape.occupied::after {
    background: #fb923c !important;
    left: 24px !important;
    right: 24px !important;
    height: 4px !important;
}

.tables-matrix-large .table-name {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.2px !important;
}

.tables-matrix-large .table-shape.empty .table-name {
    color: #1e3a8a !important;
}

.tables-matrix-large .table-shape.occupied .table-name {
    color: #9a3412 !important;
}

.tables-matrix-large .table-bill {
    font-size: 0.84rem !important;
    font-weight: 800 !important;
    color: #ea580c !important;
    margin-top: 1px !important;
}

/* Ở DƯỚI TÊN CÁC PHÒNG BÀN TO RA MỘT CHÚT VÀ IN ĐẬM THEO YÊU CẦU */
.tables-matrix-large .table-subgroup {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #1e40af !important;
    margin-top: 3px !important;
    letter-spacing: -0.1px !important;
    text-align: center !important;
}

.kv-table-card.is-occupied .table-subgroup {
    color: #c2410c !important;
}

/* 3. ENLARGED PRODUCT CARDS */
.products-matrix-large {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 15px !important;
}

.products-matrix-large .kv-product-card {
    min-height: 200px !important;
    border-radius: var(--radius-md) !important;
}

.products-matrix-large .prod-preview-box {
    height: 115px !important;
}

.products-matrix-large .prod-info {
    padding: 10px 12px !important;
}

.products-matrix-large .prod-title {
    font-size: 0.96rem !important;
    font-weight: 700 !important;
    min-height: 40px !important;
    line-height: 1.25 !important;
}

.products-matrix-large .prod-price {
    font-size: 1.18rem !important;
    font-weight: 900 !important;
    color: var(--kv-green) !important;
}

/* 4. BILLING SECTION & PROMINENT TRANSFER TABLE */
.btn-top-transfer {
    background: #ecfdf5;
    border: 1.5px solid #10b981;
    color: #047857;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-top-transfer:hover {
    background: #10b981;
    color: #ffffff;
}

.btn-meta-tool.highlight-transfer {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
}

.highlight-table-name {
    color: var(--kv-green);
    font-size: 1.1rem;
}

/* 2-line Note Textarea */
.row-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--kv-text-sub);
    margin-bottom: 5px;
}

.note-textarea-2lines {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid var(--kv-border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.92rem;
    resize: none;
    outline: none;
}

.note-textarea-2lines:focus {
    border-color: var(--kv-green);
}

/* Dual-mode Discount */
.discount-mode-selector {
    margin-bottom: 8px;
}

.discount-type-tabs {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.btn-discount-type {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--kv-border);
    padding: 6px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--kv-text-sub);
    cursor: pointer;
}

.btn-discount-type.active {
    background: var(--kv-green);
    border-color: var(--kv-green);
    color: #ffffff;
}

.discount-inputs-subgroup {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-with-addon {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid var(--kv-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.input-with-addon input {
    flex: 1;
    border: none !important;
    padding: 8px 10px !important;
    outline: none !important;
    font-size: 0.95rem !important;
}

.addon-badge {
    background: #f1f5f9;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--kv-text-sub);
    border-left: 1px solid var(--kv-border);
}

.quick-percent-chips {
    display: flex;
    gap: 6px;
}

.p-chip, .c-chip {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--kv-border);
    border-radius: var(--radius-sm);
    padding: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--kv-text);
}

.p-chip:hover, .c-chip:hover {
    border-color: var(--kv-green);
    color: var(--kv-green);
}

/* VAT 8% summary line */
.vat-summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.vat-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--kv-text);
    cursor: pointer;
}

.vat-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--kv-green);
}

.text-rose { color: #e11d48 !important; }
.text-amber { color: #d97706 !important; }

/* Prominent Total Line Right Above Checkout Bar */
.total-line-prominent {
    background: #f0fdf4 !important;
    border: 1.5px solid #86efac !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 14px !important;
    margin-top: 6px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.total-label-box {
    display: flex;
    flex-direction: column;
}

.total-label-main {
    font-size: 1rem;
    font-weight: 900;
    color: #14532d;
    letter-spacing: -0.2px;
}

.total-label-sub {
    font-size: 0.75rem;
    color: #166534;
}

.total-val-huge {
    font-size: 1.85rem !important;
    font-weight: 900 !important;
    color: #15803d !important;
    letter-spacing: -0.5px !important;
    text-shadow: 0 1px 2px rgba(21, 128, 61, 0.15);
}

/* 5. MANAGEMENT TAB SUB-NAVIGATION & PRODUCT LIST & HOLIDAY SURCHARGE */
.manage-sub-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-manage-sub {
    background: #ffffff;
    border: 1.5px solid var(--kv-border);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--kv-text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-manage-sub.active {
    background: var(--kv-green);
    border-color: var(--kv-green);
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(21, 128, 61, 0.3);
}

.holiday-config-card {
    margin-bottom: 24px;
    border-left: 4px solid #f59e0b;
}

.holiday-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 1.2fr 1.5fr 1.5fr;
    gap: 14px;
    align-items: flex-end;
    background: #fffbeb;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid #fef3c7;
}

.holiday-form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.holiday-form-grid label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #92400e;
}

.holiday-form-grid input {
    background: #ffffff;
    border: 1px solid #fde68a;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
}

.form-check-group {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    height: 38px;
}

.btn-save-holiday {
    background: #d97706;
    color: #ffffff;
    border: none;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-save-holiday:hover {
    background: #b45309;
}

/* Switch container */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch-container input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider { background-color: #d97706; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }

.holiday-list-container {
    margin-top: 16px;
}

.holiday-list-container h4 {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--kv-text);
    margin-bottom: 10px;
}

.holiday-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.holiday-card-item {
    background: #ffffff;
    border: 1px solid var(--kv-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.holiday-card-item.active {
    border-color: #f59e0b;
    background: #fffbeb;
}

.holiday-card-info h5 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--kv-text);
}

.holiday-card-info p {
    font-size: 0.8rem;
    color: var(--kv-text-sub);
    margin-top: 2px;
}

.btn-del-holiday {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
}

/* Products Management Table */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-add-new-product {
    background: var(--kv-green);
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.3);
}

.btn-add-new-product:hover {
    background: var(--kv-green-dark);
}

.product-mgmt-filter-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--kv-border-light);
    margin-bottom: 14px;
}

.p-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
}

.p-filter-search {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.p-filter-search i {
    position: absolute;
    left: 12px;
    color: var(--kv-text-dim);
}

.p-filter-search input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--kv-border);
    padding: 7px 12px 7px 34px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    outline: none;
}

.p-count-badge {
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    color: var(--kv-text-sub);
    white-space: nowrap;
}

.prod-tbl-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    border: 1px solid var(--kv-border);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 2px;
}

.modal-text-input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid var(--kv-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.92rem;
    outline: none;
}

.modal-text-input:focus {
    border-color: var(--kv-green);
    background: #ffffff;
}

/* ================= REVENUE PERIOD CONTROLS & COMPARISONS ================= */
.revenue-period-header {
    background: #ffffff;
    border: 1px solid var(--kv-border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

.period-toggle-group {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
}

.btn-period-toggle {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 7px;
}

.btn-period-toggle:hover {
    color: var(--kv-green);
}

.btn-period-toggle.active {
    background: var(--kv-green);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(20, 83, 45, 0.3);
}

.period-date-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input-wrapper i {
    position: absolute;
    left: 10px;
    color: #64748b;
    pointer-events: none;
}

.date-input-wrapper input {
    background: #f8fafc;
    border: 1.5px solid var(--kv-border);
    border-radius: var(--radius-sm);
    padding: 7px 10px 7px 32px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--kv-text);
    outline: none;
    cursor: pointer;
}

.date-input-wrapper input:focus {
    border-color: var(--kv-green);
    background: #ffffff;
}

.quick-date-buttons {
    display: flex;
    gap: 5px;
}

.btn-quick-date {
    background: #f8fafc;
    border: 1px solid var(--kv-border);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-quick-date:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.period-status-badge {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 800;
    display: flex;
    align-items: center;
}

/* KPI Growth & Comparison */
.kpi-growth-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.kpi-growth-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 800;
}

.kpi-growth-badge.positive {
    background: #dcfce7;
    color: #15803d;
}

.kpi-growth-badge.negative {
    background: #fee2e2;
    color: #b91c1c;
}

/* Area Split Cards (Kid vs Cafe / Garden) */
.area-split-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
}

.branch-split-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--kv-border);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
}

.badge-branch-total {
    background: #14532d;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.92rem;
    font-weight: 900;
}

.split-card-body {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.split-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.split-stat-box {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.split-stat-box.kid-box {
    background: #fffbeb;
    border-color: #fde68a;
}

.split-stat-box.cafe-box {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.split-stat-box.garden-box {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.split-stat-header {
    font-size: 0.8rem;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kid-box .split-stat-header { color: #b45309; }
.cafe-box .split-stat-header { color: #15803d; }
.garden-box .split-stat-header { color: #047857; }

.split-stat-amount {
    font-size: 1.25rem;
    font-weight: 900;
    color: #0f172a;
}

.split-stat-sub {
    font-size: 0.76rem;
    color: #64748b;
    margin-top: 2px;
}

.split-divider-vs {
    font-size: 0.78rem;
    font-weight: 900;
    color: #94a3b8;
    background: #f1f5f9;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.split-progress-container {
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    background: #e2e8f0;
}

.split-bar-kid {
    background: #f59e0b;
    height: 100%;
    transition: width 0.3s ease;
}

.split-bar-cafe {
    background: #15803d;
    height: 100%;
    transition: width 0.3s ease;
}

.split-bar-garden {
    background: #059669;
    height: 100%;
    transition: width 0.3s ease;
}

.split-drinks-indicator {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0369a1;
    background: #f0f9ff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #bae6fd;
}

/* Drinks 7-Categories Breakdown List */
.drinks-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.drink-breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.drink-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e293b;
}

.drink-item-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--kv-green);
}

.drink-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drink-item-amt {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
}

.drink-item-pct {
    background: #dcfce7;
    color: #15803d;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 42px;
    text-align: center;
}

/* Table % Nước chế biến badges */
.badge-drinks-ratio {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
}

.growth-badge-tbl {
    font-weight: 800;
    font-size: 0.8rem;
    padding: 2px 7px;
    border-radius: 10px;
}
.growth-badge-tbl.up { background: #dcfce7; color: #166534; }
.growth-badge-tbl.down { background: #fee2e2; color: #991b1b; }
