/* EstiaSoft POS - Premium Design System */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================
   RESET & BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

:root {
    /* Primary - Warm Espresso */
    --primary: #3C2415;
    --primary-light: #5C3D2E;
    --primary-dark: #2A1A0E;
    --primary-subtle: rgba(60, 36, 21, 0.08);

    /* Accent - Warm Amber */
    --accent: #C8956C;
    --accent-light: #E8C4A0;
    --accent-subtle: rgba(200, 149, 108, 0.15);

    /* Backgrounds */
    --bg: #F6F3F0;
    --bg-warm: #FAF8F5;
    --white: #FFFFFF;

    /* Neutrals */
    --gray-50: #FAFAF9;
    --gray-100: #F0EDEA;
    --gray-200: #E2DFDB;
    --gray-300: #C8C4BF;
    --gray-400: #A8A29E;
    --gray-500: #78716C;
    --gray-600: #57534E;
    --gray-700: #44403C;
    --gray-800: #292524;
    --gray-900: #1C1917;

    /* Semantic */
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --danger-hover: #B91C1C;
    --success: #059669;
    --success-light: #D1FAE5;
    --info: #2563EB;
    --info-light: #DBEAFE;

    /* Tables Mode */
    --occupied: #E67E22;
    --occupied-light: #FFF3E0;
    --time-ok: #059669;
    --time-warning: #F59E0B;
    --time-urgent: #DC2626;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.06), 0 2px 4px -2px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.06), 0 4px 6px -4px rgba(28, 25, 23, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(28, 25, 23, 0.08), 0 8px 10px -6px rgba(28, 25, 23, 0.04);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-base: 200ms var(--ease-out);
    --transition-slow: 300ms var(--ease-out);
}

html, body {
    height: 100%;
    height: 100dvh;
    height: -webkit-fill-available;
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--gray-900);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
}

/* ============================================
   APP HEADER
   ============================================ */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary);
    color: var(--white);
    padding: 0 1.25rem;
    min-height: 48px;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 20;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--white);
}

.header-store-info {
    display: flex;
    align-items: center;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.header-store-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-light);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-store-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-store-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.header-store-select {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 150px;
}

.header-store-select:focus {
    outline: none;
    border-color: var(--accent);
}

.header-store-select option {
    background: var(--white);
    color: var(--gray-900);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-username {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.header-logout-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   TABS NAVIGATION
   ============================================ */

.tabs-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 0 1rem;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xs);
    position: relative;
    z-index: 10;
    min-height: 56px;
    flex-shrink: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--gray-500);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.01em;
}

/* Main tab (Κατάστημα) */
.tab-btn.tab-main {
    padding: 1rem 1.5rem;
    border-bottom: 3px solid transparent;
    min-height: 56px;
    font-size: 1.05rem;
}

.tab-btn.tab-main:hover {
    color: var(--gray-700);
}

.tab-btn.tab-main.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Right side container */
.tabs-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Small tabs (Διαχείριση Καταλόγου, Αναφορές) */
.tab-btn.tab-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    min-height: 36px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.tab-btn.tab-small:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.tab-btn.tab-small.active {
    background: var(--primary);
    color: var(--white);
}

/* ============================================
   TAB CONTENT
   ============================================ */

.tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* Admin tab needs column direction so login/content fill properly */
#admin-tab.tab-content.active {
    flex-direction: column;
}

/* ============================================
   STORE LAYOUT
   ============================================ */

.store-container {
    display: flex;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.products-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

/* Categories Bar */
.categories-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
    flex-shrink: 0;
}

.categories-bar::-webkit-scrollbar {
    height: 0;
}

.category-btn {
    padding: 0.625rem 1.25rem;
    background: var(--bg-warm);
    border: 1.5px solid var(--gray-200);
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-base);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.category-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.category-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(60, 36, 21, 0.25);
}

/* Products Grid */
.products-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 0.875rem;
    padding: 1.25rem;
    overflow-y: auto;
    align-content: start;
}

.product-card {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}

.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-base);
    background: linear-gradient(135deg, rgba(200, 149, 108, 0.08), rgba(60, 36, 21, 0.04));
    pointer-events: none;
}

.product-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-card:hover::after {
    opacity: 1;
}

.product-card:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
    transition-duration: 80ms;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.01em;
}

/* ============================================
   CART SIDEBAR
   ============================================ */

.cart-sidebar {
    width: 380px;
    height: 100%;
    background: var(--white);
    border-left: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: -4px 0 16px rgba(28, 25, 23, 0.03);
}

.cart-header {
    padding: 1rem 1.25rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 56px;
    flex-shrink: 0;
}

.cart-header span {
    font-size: 1.15rem;
}

.cart-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

/* Recent Orders Button */
.recent-orders-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    margin-left: auto;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.recent-orders-btn:hover {
    opacity: 1;
}

/* Recent Orders List */
.recent-orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-warm);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.recent-order-item:hover {
    background: var(--gray-100);
}

.recent-order-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recent-order-id {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

.recent-order-time {
    font-weight: 600;
    color: var(--gray-800);
}

.recent-order-items-count {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.recent-order-total {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.recent-order-actions {
    display: flex;
    gap: 0.5rem;
}

.recent-order-actions .action-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

/* Editing mode */
.cart-editing .cart-header h2 {
    color: var(--accent);
}

.cart-editing .checkout-btn {
    background: var(--accent);
}

.cart-editing .checkout-btn:hover {
    background: #B8855C;
}

.cart-editing .cancel-edit-btn {
    display: block;
}

.cancel-edit-btn {
    display: none;
    width: 100%;
    margin-top: 0.5rem;
}

.cart-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-400);
    font-size: 0.95rem;
    font-weight: 500;
}

.cart-item {
    background: var(--bg-warm);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    transition: background var(--transition-fast);
}

.cart-item:hover {
    background: var(--gray-100);
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.cart-item-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.cart-item-extras {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.cart-item-extra {
    display: flex;
    justify-content: space-between;
    padding: 0.125rem 0;
}

.cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.qty-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.qty-btn:active {
    background: var(--gray-200);
}

.qty-value {
    font-size: 1rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    color: var(--gray-900);
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

.cart-item-price.discounted {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success);
}

.cart-item-price .original-price {
    font-size: 0.85rem;
    color: var(--gray-400);
    text-decoration: line-through;
    font-weight: 500;
}

.cart-item.has-discount {
    background: var(--success-light);
    border-color: var(--success);
}

.cart-item-discount-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    background: var(--success);
    color: white;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

/* Cart Footer */
.cart-footer {
    padding: 1.25rem;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
}

.cart-total-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-total-amount {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: 0.01em;
    min-height: 52px;
    box-shadow: 0 2px 8px rgba(60, 36, 21, 0.2);
}

.checkout-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(60, 36, 21, 0.3);
    transform: translateY(-1px);
}

.checkout-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(60, 36, 21, 0.2);
}

.checkout-btn:disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Discount Button */
.discount-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--gray-100);
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.discount-btn:hover {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: var(--accent);
}

/* Cart Subtotal & Discount */
.cart-subtotal,
.cart-discount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--gray-200);
}

.cart-discount {
    color: var(--success);
    position: relative;
}

.cart-discount #cart-discount-amount {
    font-weight: 600;
}

.discount-remove-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.discount-remove-btn:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* Discount Modal */
.discount-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.discount-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-warm);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.discount-item:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.discount-item.selected {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.discount-item.has-discount {
    background: var(--success-light);
    border-color: var(--success);
}

.discount-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.discount-item-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.discount-item-qty {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.discount-item-price {
    font-weight: 700;
    color: var(--primary);
}

.discount-item-price.discounted {
    color: var(--success);
}

.discount-item-original {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-right: 0.25rem;
}

.discount-item-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.discount-item-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    background: var(--success);
    color: white;
    border-radius: var(--radius-sm);
}

.discount-options {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.discount-type-btns {
    display: flex;
    gap: 0.5rem;
}

.discount-type-btn {
    flex: 1;
    padding: 0.625rem 0.5rem;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.discount-type-btn:hover {
    background: var(--gray-200);
}

.discount-type-btn.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--primary);
}

.discount-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--success-light);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-weight: 600;
}

.discount-preview span:last-child {
    font-size: 1.25rem;
    color: var(--success);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(28, 25, 23, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 200ms var(--ease-out);
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 300ms var(--ease-out);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   EXTRAS SELECTION
   ============================================ */

.extras-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.extra-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--bg-warm);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 48px;
}

.extra-item:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.extra-item.selected {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.extra-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.extra-name {
    flex: 1;
    font-weight: 500;
    color: var(--gray-800);
}

.extra-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    letter-spacing: 0.01em;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 1px 3px rgba(60, 36, 21, 0.15);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 6px rgba(60, 36, 21, 0.25);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(60, 36, 21, 0.15);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

/* ============================================
   ADMIN PANEL
   ============================================ */

.admin-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.admin-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-store-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-store-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: 500;
}

.admin-store-select {
    background: var(--white);
    color: var(--gray-800);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 150px;
}

.admin-store-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(60, 36, 21, 0.08);
}

.admin-user-info {
    padding: 0.5rem 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}

.admin-username {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Account Dropdown */
.account-dropdown {
    position: relative;
}

.account-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.account-dropdown-btn:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.account-dropdown.open .account-dropdown-btn {
    background: var(--gray-200);
    border-color: var(--primary);
}

.account-dropdown-icon {
    font-size: 1rem;
}

.account-dropdown-arrow {
    font-size: 0.6rem;
    transition: transform var(--transition-fast);
}

.account-dropdown.open .account-dropdown-arrow {
    transform: rotate(180deg);
}

.account-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.account-dropdown.open .account-dropdown-menu {
    display: block;
    animation: dropdownSlide 150ms var(--ease-out);
}

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

.account-dropdown-header {
    padding: 0.875rem 1rem;
    background: var(--bg-warm);
}

.account-dropdown-username {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
}

.account-dropdown-divider {
    height: 1px;
    background: var(--gray-200);
}

.account-dropdown-item {
    padding: 0.75rem 1rem;
}

.account-dropdown-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.375rem;
}

.account-dropdown-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-800);
    cursor: pointer;
}

.account-dropdown-select:focus {
    outline: none;
    border-color: var(--primary);
}

.account-dropdown-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
}

.account-dropdown-action:hover {
    background: var(--gray-100);
}

.account-dropdown-action.account-dropdown-danger {
    color: var(--danger);
}

.account-dropdown-action.account-dropdown-danger:hover {
    background: var(--danger-light);
}

.account-dropdown-section-title {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Modal Small */
.modal.modal-sm {
    max-width: 380px;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

/* Password Change Modals */
.modal.modal-password {
    max-width: 420px;
}

.modal-password .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-bottom: none;
}

.modal-password .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
}

.modal-password .modal-close {
    color: var(--white);
    opacity: 0.8;
}

.modal-password .modal-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.modal-password .modal-body {
    padding: 1.5rem;
}

.modal-password .modal-description {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.password-form .form-group {
    margin-bottom: 1.25rem;
}

.password-form .form-label {
    font-size: 0.8rem;
    margin-bottom: 0.375rem;
}

.password-form .form-input {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.password-form .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(60, 36, 21, 0.1);
}

.password-form .form-error {
    background: var(--danger-light);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-weight: 500;
}

.password-form .modal-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.password-form .btn-primary {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.password-form .btn-secondary {
    padding: 0.75rem 1.25rem;
}

.admin-nav-btn {
    padding: 0.625rem 1.25rem;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.admin-nav-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.admin-nav-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-height: 36px;
}

.admin-section {
    display: none;
    flex: 1;
    min-height: 0;      /* Allow flex shrink below intrinsic size */
    overflow-y: auto;
}

.admin-section.active {
    display: flex;
    flex-direction: column;
}

/* ============================================
   SETTINGS PAGE
   ============================================ */

/* Settings Layout with Sidebar */
.settings-layout {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.settings-sidebar {
    width: 220px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 1rem;
    flex-shrink: 0;
    overflow-y: auto;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.settings-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.settings-nav-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.settings-nav-btn.active {
    background: var(--primary);
    color: var(--white);
}

.settings-nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
}

.settings-panel {
    display: none;
    padding: 2rem;
    max-width: 800px;
}

.settings-panel.active {
    display: block;
}

.settings-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    height: 100%;
    overflow-y: auto;
}

.settings-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.settings-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--gray-900);
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    letter-spacing: -0.01em;
}

.section-description {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

/* Shortcuts category button */
.category-shortcuts {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--primary);
}

.category-shortcuts:hover {
    background: var(--accent-light);
}

.category-shortcuts.active {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: var(--white);
    color: var(--gray-900);
    min-height: 44px;
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(60, 36, 21, 0.08);
}

/* ============================================
   DATA TABLE
   ============================================ */

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.data-table th {
    background: var(--bg-warm);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Compact tables in reports */
.reports-column .data-table th,
.reports-column .data-table td {
    padding: 0.5rem 0.625rem;
    font-size: 0.85rem;
}

.reports-column .data-table th {
    font-size: 0.7rem;
}

.data-table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.data-table td {
    font-size: 0.95rem;
    color: var(--gray-800);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 0.375rem;
}

.action-btn {
    padding: 0.5rem 0.875rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.action-btn-edit {
    background: var(--gray-100);
    color: var(--gray-700);
}

.action-btn-edit:hover {
    background: var(--gray-200);
}

.action-btn-delete {
    background: var(--danger-light);
    color: var(--danger);
}

.action-btn-delete:hover {
    background: rgba(220, 38, 38, 0.15);
    color: var(--danger-hover);
}

/* ============================================
   LOGIN
   ============================================ */

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    background: var(--bg);
}

.login-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 700;
}

.login-error {
    background: var(--danger-light);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    text-align: center;
    display: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.login-error.show {
    display: block;
}

/* ============================================
   REPORTS PAGE
   ============================================ */

.reports-container {
    width: 100%;
    padding: 1.5rem 2rem;
    flex: 1;
    height: 100%;
    overflow-y: auto;
}

.reports-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.reports-header .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    min-height: 36px;
}

.reports-header .form-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-height: 36px;
}

.date-filter {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.date-filter .form-label {
    margin: 0;
    text-transform: none;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: box-shadow var(--transition-base);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.stat-card.profit .stat-value {
    color: var(--success);
}

/* ============================================
   REPORTS GRID LAYOUT
   ============================================ */

.reports-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: start;
}

.reports-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reports-column .settings-section {
    margin-bottom: 0;
    padding: 1.25rem;
}

.reports-column .settings-section h3 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}

/* Align numeric columns to the right in report tables */
.reports-column .data-table th:not(:first-child),
.reports-column .data-table td:not(:first-child) {
    text-align: right;
}

/* Ensure all columns in reports have equal stretch */
.reports-column .settings-section {
    flex: 1;
}

/* Make tables fill available space */
.reports-column .data-table {
    table-layout: fixed;
}

.reports-column .data-table th:first-child,
.reports-column .data-table td:first-child {
    width: 45%;
}

/* Daily sales table specific alignment */
#daily-sales-table th:first-child,
#daily-sales-table td:first-child {
    width: 40%;
}

#daily-sales-table th:not(:first-child),
#daily-sales-table td:not(:first-child) {
    width: 30%;
}

/* Section header with filters */
.section-header-with-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.section-header-with-filters h3 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 0.95rem;
}

.time-interval-filters {
    display: flex;
    gap: 0.25rem;
}

.interval-btn {
    padding: 0.3rem 0.6rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.interval-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.interval-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Reports Sub-Navigation */
.reports-sub-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.reports-sub-btn {
    padding: 0.625rem 1.25rem;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reports-sub-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.reports-sub-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Reports Panels */
.reports-panel {
    display: none;
}

.reports-panel.active {
    display: block;
}

/* Empty State */
.reports-empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

/* Chart Section - Full Width */
.reports-chart-section {
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.reports-chart-section h3 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}

/* Hourly Sales Chart */
.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

/* Percentage badge */
.percentage-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--accent-subtle);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
}

/* Store badge */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
}

.badge-active {
    background: var(--success-light);
    color: var(--success);
}

@media (max-width: 1600px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1400px) {
    .reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 4.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--gray-900);
    color: var(--white);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 300ms var(--ease-out);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

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

/* ============================================
   INLINE FORM
   ============================================ */

.inline-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form .form-input {
    flex: 1;
    min-width: 200px;
}

#new-table-name {
    flex: 2 1 280px;
    min-width: 280px;
}

#new-table-capacity {
    flex: 0 0 100px;
    min-width: 100px;
}

#new-table-zone {
    flex: 0 1 180px;
    min-width: 150px;
}

/* ============================================
   EXTRAS MANAGEMENT
   ============================================ */

.product-extras-section {
    margin-top: 1rem;
    padding: 1.25rem;
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100);
}

.product-extras-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Show scrollbar only on hover for cleaner look */
.cart-items::-webkit-scrollbar-thumb,
.products-grid::-webkit-scrollbar-thumb,
.settings-container::-webkit-scrollbar-thumb,
.reports-container::-webkit-scrollbar-thumb {
    background: transparent;
}

.cart-items:hover::-webkit-scrollbar-thumb,
.products-grid:hover::-webkit-scrollbar-thumb,
.settings-container:hover::-webkit-scrollbar-thumb,
.reports-container:hover::-webkit-scrollbar-thumb {
    background: var(--gray-300);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .header-store-selector {
        display: none;
    }
}

/* Tablet landscape and smaller desktops */
@media (max-width: 1024px) {
    .cart-sidebar {
        width: 320px;
    }
}

/* Tablet portrait */
@media (max-width: 900px) {
    .cart-sidebar {
        width: 280px;
        min-width: 280px;
    }

    .cart-footer {
        padding: 1rem;
        flex-shrink: 0;
    }

    .checkout-btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 0.75rem;
        min-height: 44px;
    }

    .header-logo {
        font-size: 0.95rem;
    }

    .header-store-info {
        display: none;
    }

    .cart-sidebar {
        width: 260px;
        min-width: 260px;
    }

    .cart-header {
        padding: 0.75rem 1rem;
    }

    .cart-header h2 {
        font-size: 1rem;
    }

    .cart-footer {
        padding: 0.875rem;
    }

    .cart-total {
        margin-bottom: 0.75rem;
    }

    .cart-total-amount {
        font-size: 1.25rem;
    }

    .checkout-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.625rem;
        padding: 0.875rem;
    }

    .product-card {
        padding: 1rem 0.75rem;
        min-height: 100px;
    }

    .settings-container,
    .reports-container {
        padding: 1.25rem;
    }

    /* Settings sidebar responsive */
    .settings-sidebar {
        width: 60px;
        padding: 0.5rem;
    }

    .settings-nav-btn {
        padding: 0.75rem;
        justify-content: center;
    }

    .settings-nav-btn span:not(.settings-nav-icon) {
        display: none;
    }

    .settings-nav-icon {
        margin: 0;
    }

    .settings-panel {
        padding: 1rem;
    }

    /* Admin nav responsive */
    .admin-nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem;
    }

    .admin-nav-right {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-start;
    }
}

/* Tablet landscape - limited height */
@media (max-height: 600px) and (orientation: landscape) {
    .app-header {
        min-height: 40px;
        padding: 0 0.75rem;
    }

    .header-logo {
        font-size: 0.9rem;
    }

    .tabs-nav {
        min-height: 44px;
    }

    .tab-btn.tab-main {
        padding: 0.5rem 1rem;
    }

    .cart-header {
        padding: 0.5rem 0.75rem;
        min-height: 40px;
    }

    .cart-header h2 {
        font-size: 0.9rem;
    }

    .cart-items {
        padding: 0.5rem;
    }

    .cart-item {
        padding: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .cart-footer {
        padding: 0.5rem 0.75rem;
    }

    .cart-total {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    .cart-total-amount {
        font-size: 1.1rem;
    }

    .checkout-btn {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .categories-bar {
        padding: 0.5rem;
        gap: 0.375rem;
    }

    .category-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .products-grid {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .product-card {
        padding: 0.5rem;
        min-height: 70px;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 0.9rem;
    }
}

/* Tablet landscape - very limited height */
@media (max-height: 500px) and (orientation: landscape) {
    .app-header {
        min-height: 34px;
    }

    .tabs-nav {
        min-height: 36px;
    }

    .cart-sidebar {
        width: 240px;
        min-width: 240px;
    }
}

/* Small tablets and large phones */
@media (max-width: 600px) {
    .store-container {
        flex-direction: column;
    }

    .products-section {
        flex: none;
        height: 55%;
        min-height: 200px;
    }

    .cart-sidebar {
        width: 100%;
        min-width: 100%;
        height: 45%;
        border-left: none;
        border-top: 1px solid var(--gray-200);
    }

    .cart-items {
        flex: 1;
        min-height: 0;
    }

    .checkout-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* ============================================
   FINANCIAL REPORTS MODULE
   ============================================ */

/* Financial Sub-Navigation */
.financial-sub-nav {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.financial-tab-btn {
    padding: 0.5rem 0.875rem;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.financial-tab-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.financial-tab-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Financial Header (Date Range) */
.financial-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.financial-header .date-filter {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.financial-header .date-filter label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
}

.financial-header .form-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-height: 36px;
    width: auto;
}

.financial-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-height: 36px;
}

/* Financial Tab Content */
.financial-tab-content {
    display: none;
}

.financial-tab-content.active {
    display: block;
}

/* Financial KPI Grid */
.fin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.fin-kpi-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.fin-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.fin-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
}

.fin-kpi-value.profit {
    color: var(--success);
}

.fin-kpi-value.loss {
    color: var(--danger);
}

/* VAT Summary */
.fin-vat-summary {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.fin-vat-summary h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.fin-vat-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fin-vat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.fin-vat-item span:first-child {
    color: var(--gray-600);
}

.fin-vat-item span:last-child {
    font-weight: 600;
    color: var(--gray-800);
}

.fin-vat-item.total {
    border-top: 1px solid var(--gray-200);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.fin-vat-item.total span:last-child {
    color: var(--primary);
    font-weight: 700;
}

/* P&L Statement */
.pnl-statement,
.cashflow-statement {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    max-width: 700px;
}

.pnl-statement h4,
.cashflow-statement h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid var(--primary);
}

.pnl-section,
.cashflow-section {
    margin-bottom: 1rem;
}

.pnl-row,
.cashflow-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.pnl-row span:first-child,
.cashflow-row span:first-child {
    color: var(--gray-700);
}

.pnl-row span:last-child,
.cashflow-row span:last-child {
    font-weight: 600;
    color: var(--gray-800);
}

.pnl-row.header,
.cashflow-row.header {
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.375rem;
    margin-bottom: 0.25rem;
}

.pnl-row.header span:last-child,
.cashflow-row.header span:last-child {
    font-weight: 600;
}

.pnl-row.indent {
    padding-left: 1rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.pnl-row.subtotal,
.cashflow-row.subtotal {
    border-top: 1px dashed var(--gray-200);
    padding-top: 0.625rem;
    margin-top: 0.25rem;
}

.pnl-row.subtotal span:last-child,
.cashflow-row.subtotal span:last-child {
    font-weight: 700;
}

.pnl-row.total,
.cashflow-row.total {
    border-top: 2px solid var(--gray-300);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 700;
}

.pnl-row.total span:last-child,
.cashflow-row.total span:last-child {
    font-size: 1.1rem;
    color: var(--primary);
}

.pnl-row.profit span:last-child,
.cashflow-row.profit span:last-child {
    color: var(--success);
}

.pnl-row.loss span:last-child,
.cashflow-row.loss span:last-child {
    color: var(--danger);
}

/* Balance Sheet */
.balance-sheet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.balance-column {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.balance-column h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid var(--primary);
}

.balance-section {
    margin-bottom: 1rem;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.balance-row span:first-child {
    color: var(--gray-700);
}

.balance-row span:last-child {
    font-weight: 600;
    color: var(--gray-800);
}

.balance-row.header {
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.375rem;
    margin-bottom: 0.25rem;
}

.balance-row.subtotal {
    border-top: 1px dashed var(--gray-200);
    padding-top: 0.625rem;
    margin-top: 0.25rem;
}

.balance-row.subtotal span:last-child {
    font-weight: 700;
}

.balance-row.total {
    border-top: 2px solid var(--gray-300);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 700;
}

.balance-row.total span:last-child {
    font-size: 1.1rem;
    color: var(--primary);
}

.balance-row.profit span:last-child {
    color: var(--success);
}

/* Expense Actions */
.expense-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Forecast Section */
.forecast-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.forecast-controls label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
}

.forecast-controls .form-select {
    width: auto;
    min-width: 120px;
}

.forecast-summary {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.forecast-summary h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.forecast-avg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.forecast-avg-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.forecast-avg-item span:first-child {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
}

.forecast-avg-item span:last-child {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.forecast-table-container {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.forecast-table-container h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

/* Table profit/loss colors */
.data-table td.profit {
    color: var(--success);
    font-weight: 600;
}

.data-table td.loss {
    color: var(--danger);
    font-weight: 600;
}

/* Responsive Financial Styles */
@media (max-width: 900px) {
    .balance-sheet {
        grid-template-columns: 1fr;
    }

    .forecast-avg-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .fin-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .financial-sub-nav {
        gap: 0.25rem;
    }

    .financial-tab-btn {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }

    .pnl-statement,
    .cashflow-statement,
    .balance-column {
        padding: 1rem;
    }
}

/* ============================================
   ENHANCED FINANCIAL REPORTS - NEW MODULES
   ============================================ */

/* Section Header with Actions */
.fin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.fin-section-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.fin-section-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Financial Card */
.fin-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.fin-card h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.fin-card.total-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.fin-card.total-card h5 {
    color: var(--white);
    border-bottom-color: rgba(255,255,255,0.2);
}

.total-tax-amount {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    padding: 1rem 0;
}

/* VAT Breakdown Grid */
.vat-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vat-rate-card {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.vat-rate-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.vat-rate-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.35rem 0;
}

.vat-rate-row span:first-child {
    color: var(--gray-600);
}

.vat-rate-row span:last-child {
    font-weight: 600;
    color: var(--gray-800);
}

.vat-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--gray-200);
}

.vat-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
}

.vat-summary-item span:first-child {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
}

.vat-summary-item .amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.vat-summary-item.highlight .amount {
    color: var(--primary);
}

/* Tax Calculation Grid */
.tax-calculation-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tax-calc-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--gray-50);
}

.tax-calc-row span:first-child {
    font-size: 0.9rem;
    color: var(--gray-700);
}

.tax-calc-row span:last-child {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.tax-calc-row.highlight {
    background: var(--primary);
    color: var(--white);
}

.tax-calc-row.highlight span {
    color: var(--white);
}

/* EFKA Grid */
.efka-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.efka-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.efka-item span:first-child {
    color: var(--gray-600);
}

.efka-item span:last-child {
    font-weight: 600;
    color: var(--gray-800);
}

/* Cost Breakdown Grid */
.cost-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.cost-type-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    position: relative;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
    transition: all var(--transition-fast);
}

.cost-type-card:hover {
    box-shadow: var(--shadow-sm);
}

/* Status-based left border colors */
.cost-type-card[data-status="ok"] {
    border-left-color: var(--success);
}

.cost-type-card[data-status="warning"] {
    border-left-color: #F59E0B;
}

.cost-type-card[data-status="danger"] {
    border-left-color: var(--danger);
}

/* Legacy support for .alert class */
.cost-type-card.alert {
    border-left-color: var(--danger);
}

.cost-type-card.warning {
    border-left-color: #F59E0B;
}

.cost-type-card.danger {
    border-left-color: var(--danger);
}

.cost-type-card.success {
    border-left-color: var(--success);
}

.cost-type-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.cost-type-icon {
    font-size: 1.1rem;
}

.cost-type-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.cost-type-percent {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.cost-type-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.cost-type-target {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Cost Card Progress Bar */
.cost-progress-container {
    position: relative;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    margin-top: 0.75rem;
    overflow: visible;
}

.cost-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-out;
    position: relative;
    z-index: 1;
}

/* Progress bar colors based on status */
.cost-progress-bar[data-status="ok"] {
    background: linear-gradient(90deg, #10B981, #059669);
}

.cost-progress-bar[data-status="warning"] {
    background: linear-gradient(90deg, #FBBF24, #F59E0B);
}

.cost-progress-bar[data-status="danger"] {
    background: linear-gradient(90deg, #F87171, #DC2626);
}

/* Target zone indicator - translucent band */
.cost-target-zone {
    position: absolute;
    top: -2px;
    height: 12px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px dashed rgba(59, 130, 246, 0.4);
    border-radius: 4px;
    z-index: 0;
}

.cost-target-zone::before,
.cost-target-zone::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 1px;
    height: 16px;
    background: rgba(59, 130, 246, 0.5);
    transform: translateY(-50%);
}

.cost-target-zone::before { left: 0; }
.cost-target-zone::after { right: 0; }

/* Cost Alerts */
.cost-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cost-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--warning-light, #fff3cd);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--warning);
    font-size: 0.85rem;
    color: var(--gray-700);
}

.cost-alert.danger {
    background: var(--danger-light, #f8d7da);
    border-left-color: var(--danger);
}

.cost-alert.success {
    background: var(--success-light, #d1fae5);
    border-left-color: var(--success);
}

.cost-alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #F59E0B;
}

.cost-alert.info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3B82F6;
}

/* Cost Alert Icon */
.cost-alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.cost-alert.success .cost-alert-icon { color: var(--success); }
.cost-alert.warning .cost-alert-icon { color: #F59E0B; }
.cost-alert.danger .cost-alert-icon { color: var(--danger); }
.cost-alert.info .cost-alert-icon { color: #3B82F6; }

/* ============================================
   COSTING SETTINGS PANEL
   ============================================ */

/* Costing Header with Settings Button */
.fin-costing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.fin-costing-header h4 {
    margin: 0;
}

/* Settings Panel */
.costing-settings-panel {
    border: 2px solid var(--primary-subtle);
    background: var(--bg-warm);
}

.costing-settings-panel h5 {
    color: var(--primary);
}

.settings-subsection {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.settings-subsection:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-subsection h6 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.settings-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

/* Product Type Table Container */
.product-type-table-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.product-type-table-container .data-table {
    margin: 0;
}

.product-type-table-container thead {
    position: sticky;
    top: 0;
    background: var(--gray-50);
    z-index: 1;
}

/* Product Type Select in Table */
.product-type-select {
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-300);
    font-size: 0.85rem;
    min-width: 130px;
    background: var(--white);
    cursor: pointer;
}

.product-type-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-subtle);
}

/* Thresholds Grid */
.thresholds-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
    margin-bottom: 1rem;
}

.threshold-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.threshold-row label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.threshold-row input {
    width: 70px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.9rem;
}

.threshold-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-subtle);
}

.threshold-row span {
    color: var(--gray-500);
    font-size: 0.85rem;
    width: 20px;
}

.threshold-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Responsive for settings panel */
@media (max-width: 768px) {
    .fin-costing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .thresholds-grid {
        grid-template-columns: 1fr;
    }

    .threshold-row {
        flex-wrap: wrap;
    }

    .threshold-row label {
        flex-basis: 100%;
        margin-bottom: 0.25rem;
    }

    .threshold-actions {
        flex-direction: column;
    }
}

/* Matrix Legend */
.matrix-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.legend-item {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.legend-item.star {
    color: var(--warning);
}

.legend-item.puzzle {
    color: var(--info);
}

.legend-item.plowhorse {
    color: var(--success);
}

.legend-item.dog {
    color: var(--gray-400);
}

/* Matrix Summary */
.matrix-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.matrix-summary-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.matrix-summary-item .count {
    font-size: 1.5rem;
    font-weight: 700;
}

.matrix-summary-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gray-500);
}

.matrix-summary-item.star .count { color: var(--warning); }
.matrix-summary-item.puzzle .count { color: var(--info); }
.matrix-summary-item.plowhorse .count { color: var(--success); }
.matrix-summary-item.dog .count { color: var(--gray-400); }

/* Classification Badge */
.classification-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.classification-badge.star {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.classification-badge.puzzle {
    background: rgba(23, 162, 184, 0.15);
    color: #0c5460;
}

.classification-badge.plowhorse {
    background: rgba(40, 167, 69, 0.15);
    color: #155724;
}

.classification-badge.dog {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Recommendations List */
.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.recommendation-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.recommendation-content {
    flex: 1;
}

.recommendation-product {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.recommendation-reason {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.recommendation-item.reprice .recommendation-icon { color: var(--warning); }
.recommendation-item.promote .recommendation-icon { color: var(--success); }
.recommendation-item.remove .recommendation-icon { color: var(--danger); }

/* Simple Recommendation Alerts */
.recommendation {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.recommendation .cost-alert-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.recommendation.info {
    background: rgba(59, 130, 246, 0.08);
    border-left: 4px solid #3B82F6;
    color: #1e40af;
}

.recommendation.info .cost-alert-icon {
    color: #3B82F6;
}

.recommendation.warning {
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid #F59E0B;
    color: #92400e;
}

.recommendation.warning .cost-alert-icon {
    color: #F59E0B;
}

.recommendation.danger {
    background: rgba(239, 68, 68, 0.08);
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.recommendation.danger .cost-alert-icon {
    color: var(--danger);
}

.recommendation.success {
    background: rgba(5, 150, 105, 0.08);
    border-left: 4px solid #059669;
    color: #166534;
}

.recommendation.success .cost-alert-icon {
    color: #059669;
}

/* Payment Method Grid */
.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.payment-method-card {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.payment-method-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.payment-method-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.payment-method-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.payment-method-count {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* RevPASH Benchmark Colors */
.revpash-benchmark.excellent { color: var(--success); }
.revpash-benchmark.good { color: #22c55e; }
.revpash-benchmark.average { color: var(--warning); }
.revpash-benchmark.low { color: var(--danger); }

/* Matrix Summary Items - Enhanced */
.matrix-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.matrix-summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all var(--transition-fast);
}

.matrix-summary-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.matrix-summary-item strong {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.matrix-summary-item.star {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #F59E0B;
    color: #92400e;
}

.matrix-summary-item.star strong { color: #F59E0B; }

.matrix-summary-item.puzzle {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3B82F6;
    color: #1e40af;
}

.matrix-summary-item.puzzle strong { color: #3B82F6; }

.matrix-summary-item.plowhorse {
    background: rgba(5, 150, 105, 0.1);
    border-left-color: #059669;
    color: #065f46;
}

.matrix-summary-item.plowhorse strong { color: #059669; }

.matrix-summary-item.dog {
    background: rgba(168, 162, 158, 0.15);
    border-left-color: #A8A29E;
    color: #57534E;
}

.matrix-summary-item.dog strong { color: #78716C; }

/* Matrix Summary Emoji */
.matrix-summary-item::before {
    font-size: 1.25rem;
}

.matrix-summary-item.star::before { content: '⭐'; }
.matrix-summary-item.puzzle::before { content: '🧩'; }
.matrix-summary-item.plowhorse::before { content: '🐴'; }
.matrix-summary-item.dog::before { content: '🐕'; }

/* Category Inline Progress Bars */
.margin-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.margin-value {
    font-weight: 600;
    font-size: 0.85rem;
}

.margin-progress {
    height: 4px;
    background: var(--gray-100);
    border-radius: 2px;
    overflow: hidden;
    width: 80px;
}

.margin-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease-out;
}

.margin-progress-bar.excellent { background: #059669; }
.margin-progress-bar.good { background: #10B981; }
.margin-progress-bar.average { background: #F59E0B; }
.margin-progress-bar.low { background: var(--danger); }

/* Donut Chart Container */
.cost-donut-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 0;
}

.cost-donut-chart {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.cost-donut-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cost-donut-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cost-donut-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.cost-donut-legend-label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.cost-donut-legend-value {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-800);
}

/* Scatter Plot Container */
.matrix-scatter-container {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

.matrix-scatter-chart {
    height: 100%;
}

/* Budget Status Badge */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.2);
    color: #166534;
}

.status-badge.inactive {
    background: rgba(156, 163, 175, 0.2);
    color: #4b5563;
}

/* Budget Comparison Grid */
.budget-comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.budget-metric {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.budget-metric .label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.budget-metric .value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

.budget-metric.positive .value { color: var(--success); }
.budget-metric.negative .value { color: var(--danger); }

/* Labor KPI Grid */
.labor-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.labor-kpi {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.labor-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.labor-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.labor-kpi-target {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

/* RevPASH Styles */
.revpash-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.revpash-input {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.revpash-input label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
}

.revpash-input .form-input {
    width: 100px;
}

.revpash-result {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    color: var(--white);
}

.revpash-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.revpash-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.revpash-benchmark {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Sales Chart Container */
.sales-chart-container {
    height: 300px;
    position: relative;
}

/* Payment Method Grid */
.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.payment-method-card {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.payment-method-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.payment-method-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.payment-method-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.payment-method-count {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Basket KPI Grid */
.basket-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.basket-kpi {
    text-align: center;
    padding: 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.basket-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.basket-kpi-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* Budget Comparison Grid */
.budget-comparison-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.budget-comparison-item {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.budget-comparison-item.favorable {
    background: rgba(40, 167, 69, 0.1);
}

.budget-comparison-item.unfavorable {
    background: rgba(220, 53, 69, 0.1);
}

.budget-comparison-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.budget-comparison-actual {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.budget-comparison-target {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.budget-comparison-variance {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.budget-comparison-item.favorable .budget-comparison-variance {
    color: var(--success);
}

.budget-comparison-item.unfavorable .budget-comparison-variance {
    color: var(--danger);
}

/* Break-Even Styles */
.breakeven-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.breakeven-results {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.breakeven-main {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.breakeven-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.breakeven-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.breakeven-orders {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.breakeven-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.breakeven-item {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.breakeven-item span:first-child {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.breakeven-item span:last-child {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* Responsive for new modules */
@media (max-width: 1024px) {
    .vat-breakdown-grid,
    .vat-summary-grid {
        grid-template-columns: 1fr;
    }

    .labor-kpi-grid,
    .breakeven-grid,
    .budget-comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .matrix-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .cost-breakdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cost-donut-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .cost-donut-chart {
        width: 160px;
        height: 160px;
    }

    .cost-donut-legend {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .labor-kpi-grid,
    .breakeven-grid,
    .budget-comparison-grid,
    .basket-kpi-grid {
        grid-template-columns: 1fr;
    }

    .revpash-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .revpash-input .form-input {
        width: 100%;
    }

    .cost-breakdown-grid {
        grid-template-columns: 1fr;
    }

    .matrix-summary {
        grid-template-columns: 1fr;
    }

    .matrix-scatter-container {
        height: 250px;
    }

    .cost-type-card {
        padding: 0.875rem 1rem;
    }

    .cost-type-value {
        font-size: 1.5rem;
    }

    .recommendation {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .recommendation .cost-alert-icon {
        width: 16px;
        height: 16px;
    }
}

/* ============================================
   TABLES MODE - FLOOR PLAN
   ============================================ */

.floor-plan-view {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 105px);
    height: calc(100vh - 105px);
    flex: 1;
    min-height: 0;
    background: var(--bg);
}

.floor-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.floor-plan-zones {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.zone-filter-btn {
    padding: 0.5rem 1rem;
    min-height: 40px;
    border-radius: 20px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.zone-filter-btn.active,
.zone-filter-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.floor-plan-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-free { background: var(--success); }
.legend-occupied { background: var(--occupied); }
.legend-reserved { background: var(--info); }

.floor-plan-canvas {
    flex: 1;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    align-content: start;
    overflow-y: auto;
}

.floor-plan-canvas.positioned {
    display: block;
    position: relative;
    flex: 1;
    padding: 0;
    overflow: hidden;
}

/* Table Card */
.table-card {
    background: var(--white);
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    padding: 0;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    position: relative;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.table-card:active {
    transform: scale(0.96);
    transition: transform 80ms ease;
}

/* Status bar at top of card */
.table-card-status-bar {
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    flex-shrink: 0;
}

.table-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.75rem 1rem;
    width: 100%;
    flex: 1;
}

.table-card.table-free {
    border-color: var(--success);
    background: var(--success-light);
}

.table-card.table-free .table-card-status-bar {
    background: var(--success);
}

.table-card.table-occupied {
    border-color: var(--occupied);
    background: var(--occupied-light);
}

.table-card.table-occupied .table-card-status-bar {
    background: var(--occupied);
}

.table-card.table-reserved {
    border-color: var(--info);
    background: var(--info-light);
}

.table-card.table-reserved .table-card-status-bar {
    background: var(--info);
}

.table-card.table-inactive {
    opacity: 0.4;
    pointer-events: none;
}

.table-card.table-shape-round {
    border-radius: 50%;
}

.table-card.table-shape-round .table-card-status-bar {
    display: none;
}

.table-card.table-shape-rectangle {
    border-radius: 12px;
}

/* Positioned table card overrides */
.floor-plan-canvas.positioned .table-card {
    min-height: 0;
    font-size: 0.8rem;
}

.floor-plan-canvas.positioned .table-card-body {
    padding: 0.2rem 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floor-plan-canvas.positioned .table-card-zone {
    display: none;
}

.floor-plan-canvas.positioned .table-card-name {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

.floor-plan-canvas.positioned .table-card-amount {
    font-size: 0.8rem;
}

.floor-plan-canvas.positioned .table-card-time {
    font-size: 0.6rem;
    margin-top: 0.1rem;
}

.floor-plan-canvas.positioned .table-card-capacity,
.floor-plan-canvas.positioned .table-card-covers {
    display: none;
}

.floor-plan-canvas.positioned .table-card-status-bar {
    height: 3px;
}

.table-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.15rem;
}

.table-card-zone {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: rgba(0,0,0,0.06);
    color: var(--gray-600);
    margin-bottom: 0.35rem;
}

.table-card-amount {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--occupied);
}

.table-card-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.2rem;
    font-weight: 500;
}

.table-card-time.time-ok {
    color: var(--time-ok);
}

.table-card-time.time-warning {
    color: var(--time-warning);
}

.table-card-time.time-urgent {
    color: var(--time-urgent);
    font-weight: 700;
}

.table-card-capacity {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.table-card-covers {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.2rem;
    font-weight: 500;
}

/* Empty state */
.floor-plan-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-400);
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.floor-plan-empty-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.floor-plan-empty-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Slide Transitions */
.floor-plan-view,
.store-container,
.table-order-header {
    transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out);
}

.floor-plan-view.slide-out-left {
    transform: translateX(-100%);
    opacity: 0;
}

.store-container.slide-in-right {
    animation: slideInRight 0.35s var(--ease-out) forwards;
}

.store-container.slide-out-right {
    animation: slideOutRight 0.3s var(--ease-out) forwards;
}

@keyframes slideInRight {
    from { transform: translateX(30%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(30%); opacity: 0; }
}

@keyframes slideInLeft {
    from { transform: translateX(-30%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Table Order Header */
.table-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: var(--primary);
    color: var(--white);
}

.table-order-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-order-header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

.table-order-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.table-order-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.table-order-stat-value {
    font-size: 1rem;
    font-weight: 700;
}

.table-back-btn {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border: none;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-back-btn:hover {
    background: rgba(255,255,255,0.25);
}

.table-order-title {
    font-size: 1rem;
    font-weight: 600;
}

.table-order-zone {
    font-size: 0.75rem;
    opacity: 0.75;
    font-weight: 400;
}

/* ============================================
   TABLE ACTION MODAL
   ============================================ */

/* Action modal context header */
.table-action-context {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.table-action-context-amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--occupied);
}

.table-action-context-time {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 500;
}

.table-action-context-covers {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-left: auto;
}

.table-action-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.table-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    width: 100%;
    text-align: left;
}

.table-action-btn:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.table-action-btn .action-icon {
    font-size: 1.3rem;
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
}

.table-action-btn.action-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    font-weight: 600;
    padding: 1rem 1rem;
    justify-content: center;
    font-size: 0.95rem;
}

.table-action-btn.action-primary:hover {
    background: var(--primary-dark);
}

.table-action-btn.action-danger {
    color: var(--danger);
    border-color: var(--danger-light);
}

.table-action-btn.action-danger:hover {
    background: var(--danger-light);
    border-color: var(--danger);
}

.table-action-btn:disabled {
    display: none;
}

/* ============================================
   BILL VIEW MODAL
   ============================================ */

.bill-orders-list {
    max-height: 400px;
    overflow-y: auto;
}

.bill-order-group {
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.bill-order-header {
    background: var(--gray-50);
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
    border-bottom: 1px solid var(--gray-200);
}

.bill-order-items {
    padding: 0.5rem 0.75rem;
}

.bill-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.9rem;
}

.bill-item-name {
    color: var(--gray-700);
}

.bill-item-price {
    font-weight: 600;
    color: var(--gray-800);
}

.bill-total-bar {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--primary);
    color: var(--white);
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ============================================
   TRANSFER & SPLIT BILL MODALS
   ============================================ */

.transfer-label {
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.transfer-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.transfer-table-btn {
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: all 0.15s;
}

.transfer-table-btn:hover {
    background: var(--success-light);
    border-color: var(--success);
}

.transfer-table-btn.selected {
    background: var(--success-light);
    border-color: var(--success);
    box-shadow: 0 0 0 2px var(--success);
}

.transfer-items-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.transfer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
}

.transfer-item:last-child {
    border-bottom: none;
}

.transfer-toggle-all-row {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    justify-content: center;
    padding: 0.5rem;
}

.transfer-toggle-all-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--white);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.transfer-toggle-all-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.transfer-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.transfer-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: var(--white);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--gray-700);
    line-height: 1;
}

.qty-btn:active {
    background: var(--gray-100);
    transform: scale(0.95);
}

.transfer-qty-input {
    width: 32px;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 0;
    background: var(--gray-50);
    color: var(--gray-800);
    -moz-appearance: textfield;
}

.transfer-qty-input::-webkit-outer-spin-button,
.transfer-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.transfer-item-max {
    font-size: 0.75rem;
    color: var(--gray-400);
    min-width: 24px;
}

.transfer-item-price {
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    color: var(--primary);
    flex-shrink: 0;
}

.reservation-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--gray-100);
}

.reservation-info-row:last-child {
    border-bottom: none;
}

.split-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.split-tab-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
}

.split-tab-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.split-result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================
   PAYMENT MODAL
   ============================================ */

.payment-total {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    transition: all 0.15s;
}

.payment-method-btn:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
    color: var(--primary);
}

.payment-icon {
    font-size: 2rem;
}

/* ============================================
   ADMIN TABLES SETTINGS
   ============================================ */

.form-color {
    width: 50px;
    height: 38px;
    padding: 2px;
    cursor: pointer;
}

.zone-color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    vertical-align: middle;
    border: 1px solid var(--gray-300);
}

.modal-sm {
    max-width: 420px;
}

/* ============================================
   FLOOR PLAN EDITOR
   ============================================ */

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.editor-toolbar .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.editor-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

.editor-toggle input[type="checkbox"] {
    accent-color: var(--primary);
}

.editor-toolbar-spacer {
    flex: 1;
}

.editor-layout {
    display: flex;
    gap: 1rem;
}

.editor-canvas-wrapper {
    flex: 1;
    min-width: 0;
}

.editor-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    overflow: hidden;
    touch-action: none;
}

.editor-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--gray-200) 1px, transparent 1px),
        linear-gradient(to bottom, var(--gray-200) 1px, transparent 1px);
    background-size: 5% 5%;
    opacity: 0.6;
}

.editor-grid-overlay.hidden {
    display: none;
}

.editor-table {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--primary-light, #e8dfd6);
    border: 2px solid var(--primary);
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.15s;
    z-index: 1;
    overflow: hidden;
}

.editor-table:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.editor-table.selected {
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.3);
    z-index: 10;
}

.editor-table.dragging {
    cursor: grabbing;
    opacity: 0.85;
    z-index: 20;
}

.editor-table.inactive {
    opacity: 0.4;
    border-style: dashed;
}

.editor-table.shape-square {
    border-radius: 6px;
}

.editor-table.shape-round {
    border-radius: 50%;
}

.editor-table.shape-rectangle {
    border-radius: 6px;
}

.editor-table-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    line-height: 1.2;
    pointer-events: none;
}

.editor-table-capacity {
    font-size: 0.6rem;
    color: var(--gray-500);
    pointer-events: none;
}

.editor-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, var(--primary) 50%);
    border-radius: 0 0 4px 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.editor-table.selected .editor-resize-handle,
.editor-table:hover .editor-resize-handle {
    opacity: 0.7;
}

.editor-table.selected .editor-resize-handle:hover {
    opacity: 1;
}

/* Properties panel */
.editor-properties {
    width: 200px;
    flex-shrink: 0;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.editor-properties h4 {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.editor-no-selection {
    color: var(--gray-400);
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem 0;
}

.editor-props-form .form-group {
    margin-bottom: 0.5rem;
}

.editor-props-form .form-label {
    font-size: 0.75rem;
    margin-bottom: 0.15rem;
}

.editor-props-form .form-input,
.editor-props-form .form-select {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

/* ============================================
   TABLES MODE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .floor-plan-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .floor-plan-canvas {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .table-card {
        min-height: 100px;
        padding: 0.75rem;
    }

    .table-action-btn {
        padding: 0.8rem 0.75rem;
        font-size: 0.85rem;
    }

    .table-order-header-right {
        gap: 0.75rem;
    }

    .table-order-stat-value {
        font-size: 0.9rem;
    }

    .editor-layout {
        flex-direction: column;
    }

    .editor-properties {
        width: 100%;
    }

    .editor-toolbar {
        flex-wrap: wrap;
    }
}
