﻿/* ???????????????????????????????????????????????????????
   RestoSaaS ï؟½ Global Styles
   ??????????????????????????????????????????????????????? */

:root {
    --bg-main: #F5F6FA;
    --bg-card: #FFFFFF;
    --border: #E8EAF0;
    --text-primary: #18182B;
    --text-secondary: #787891;
    --accent: #7C3AED;
    --accent-light: #F3E8FF;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);

    height: 100%;
    overflow: hidden;
}

#app {
    height: 100vh;
}

/* ??????? Loading Screen ??????? */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ??????? Auth Pages ??????? */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);
    padding: 20px;
}

.auth-card {
    background: #FFF;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.auth-logo {
    font-size: 56px;
    text-align: center;
    margin-bottom: 10px;
}

.auth-card h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 6px;
}

.auth-sub {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-footer a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    margin-right: 6px;
}

.auth-footer a:hover { text-decoration: underline; }

/* ??????? Forms ??????? */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.15s;
    background: #FAFBFC;

}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: #FFF;
    box-shadow: 0 0 0 4px rgba(124,58,237,0.1);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #FFF;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: #6D28D9;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.alert-error {
    background: #FEE2E2;
    color: #B91C1C;
    border: 1px solid #FCA5A5;
}

/* ??????? App Layout ??????? */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: #FFF;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    border-radius: 12px;
}

.logo-text h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

.logo-text span {
    font-size: 11px;
    color: var(--text-secondary);
}

.nav-menu {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    transition: all 0.15s;
}

.nav-item:hover {
    background: #F8F9FC;
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-item .icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.user-details strong { font-size: 14px; }
.user-details span { color: var(--text-secondary); font-size: 11px; }

.logout-btn {
    width: 100%;
    padding: 10px;
    background: #FEE2E2;
    color: #B91C1C;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.logout-btn:hover { background: #FECACA; }

/* ??????? Main Area ??????? */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    height: 70px;
    background: #FFF;
    border-bottom: 1px solid var(--border);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.top-header h1 {
    font-size: 22px;
    font-weight: 700;
}

.header-info .time {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

/* ??????? Dashboard ??????? */
.dashboard { max-width: 1400px; margin: 0 auto; }

.welcome-card {
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    color: #FFF;
    padding: 32px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.welcome-icon { font-size: 56px; }
.welcome-text h2 { font-size: 26px; margin-bottom: 6px; }
.welcome-text p { opacity: 0.9; }

.tenant-badge {
    display: flex;
    gap: 16px;
    background: #FFF;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--border);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #F8F9FC;
    border-radius: 10px;
}

.badge-icon { font-size: 24px; }
.badge-item small {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
}

.badge-item strong { font-size: 14px; }

.section-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.nav-card {
    background: #FFF;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    display: block;
}

.nav-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(124,58,237,0.12);
}

.nav-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 16px;
}

.nav-card h4 {
    font-size: 17px;
    margin-bottom: 6px;
}

.nav-card p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ??????? Placeholder ??????? */
.placeholder {
    text-align: center;
    padding: 80px 20px;
    background: #FFF;
    border-radius: 16px;
    border: 2px dashed var(--border);
}

.placeholder-icon {
    font-size: 72px;
    margin-bottom: 20px;
}

.placeholder h2 {
    font-size: 26px;
    margin-bottom: 10px;
}

.placeholder p {
    color: var(--text-secondary);
    font-size: 15px;
}

.access-denied {
    text-align: center;
    padding: 60px;
}

/* ??????? Responsive ??????? */
@media (max-width: 900px) {
    .sidebar { width: 80px; }
    .logo-text { display: none; }
    .nav-item span:not(.icon) { display: none; }
    .user-details { display: none; }
    .logout-btn { font-size: 18px; padding: 8px; }
}

#blazor-error-ui {
    background: #FEE2E2;
    color: #B91C1C;
    bottom: 0;
    display: none;
    left: 0;
    padding: 14px 20px;
    position: fixed;
    right: 0;
    z-index: 1000;
    text-align: center;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    left: 20px;
    top: 12px;
    font-size: 20px;
}
/* POS Screen Styles */
.pos-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 130px);
    background: #F5F6FA;
    border-radius: 14px;
    overflow: hidden;
}

.pos-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #FFF;
    border-bottom: 1px solid #E8EAF0;
    gap: 12px;
    flex-shrink: 0;
}

.pos-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
}

.pos-categories::-webkit-scrollbar { height: 4px; }
.pos-categories::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 2px; }

.cat-btn {
    padding: 10px 20px;
    background: #F5F6FA;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #787891;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: inherit;
}

.cat-btn:hover { background: #EEF0F5; }

.cat-btn.active {
    background: #7C3AED;
    color: #FFF;
    border-color: #7C3AED;
}

.pos-topbar-right { flex-shrink: 0; }

.tenant-name {
    font-size: 13px;
    font-weight: 700;
    color: #787891;
    background: #F5F6FA;
    padding: 8px 14px;
    border-radius: 8px;
}

.pos-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 12px;
    padding: 12px;
}

.pos-items-area {
    flex: 1;
    overflow-y: auto;
}

.pos-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.pos-item-card {
    background: #FFF;
    border: 2px solid #E8EAF0;
    border-radius: 12px;
    padding: 14px 12px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 110px;
}

.pos-item-card:hover {
    border-color: #7C3AED;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124,58,237,0.12);
}

.pos-item-card:active { transform: scale(0.98); }

.pos-item-name {
    font-size: 15px;
    font-weight: 700;
    color: #18182B;
    line-height: 1.3;
}

.pos-item-cat { font-size: 11px; color: #787891; font-weight: 600; }

.pos-item-price {
    font-size: 17px;
    font-weight: 800;
    color: #7C3AED;
    margin-top: auto;
}

.pos-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #787891;
    gap: 10px;
}

.empty-icon {
    font-size: 32px;
    font-weight: 900;
    color: #CBD5E1;
}

.pos-cart {
    width: 380px;
    background: #FFF;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    border: 1px solid #E8EAF0;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E8EAF0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    font-size: 15px;
    color: #18182B;
}

.cart-badge {
    background: #7C3AED;
    color: #FFF;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #A0AEC0;
    font-size: 14px;
}

.cart-line {
    background: #F8F9FC;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-line-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-line-name { font-weight: 700; font-size: 14px; color: #18182B; }
.cart-line-total { font-weight: 800; color: #7C3AED; font-size: 14px; }

.cart-line-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-line-price { font-size: 11px; color: #787891; }

.qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #E8EAF0;
    border-radius: 8px;
    background: #FFF;
    color: #18182B;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.qty-btn:hover { background: #EEF0F5; }

.qty-btn.remove {
    background: #FEE2E2;
    color: #B91C1C;
    border-color: #FCA5A5;
}

.qty-btn.remove:hover { background: #FECACA; }

.qty-value {
    min-width: 26px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
}

.cart-totals {
    padding: 14px 20px;
    border-top: 1px solid #E8EAF0;
    background: #FAFBFC;
}

.total-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: #4A5568;
}

.total-line.grand {
    font-size: 18px;
    font-weight: 800;
    color: #7C3AED;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 2px solid #E8EAF0;
}

.cart-actions {
    display: flex;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid #E8EAF0;
}

.btn-clear {
    padding: 14px 20px;
    background: #F5F6FA;
    color: #787891;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.btn-clear:hover:not(:disabled) { background: #FEE2E2; color: #B91C1C; }
.btn-clear:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-pay {
    flex: 1;
    padding: 14px 20px;
    background: #10B981;
    color: #FFF;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.btn-pay:hover:not(:disabled) { background: #059669; }
.btn-pay:disabled { opacity: 0.4; cursor: not-allowed; }

.modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.payment-modal {
    background: #FFF;
    border-radius: 20px;
    padding: 36px 32px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.payment-modal h2 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #18182B;
}

.payment-total {
    font-size: 40px;
    font-weight: 800;
    color: #10B981;
    margin: 12px 0 4px;
}

.payment-sub {
    color: #787891;
    margin-bottom: 26px;
    font-size: 14px;
}

.alert-error {
    background: #FEE2E2;
    color: #B91C1C;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
}

.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.pay-opt {
    padding: 20px 10px;
    border: 2px solid #E8EAF0;
    border-radius: 14px;
    background: #FFF;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    color: #18182B;
    transition: all 0.15s;
    font-family: inherit;
}

.pay-opt:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.pay-opt.cash:hover { border-color: #10B981; color: #10B981; }
.pay-opt.visa:hover { border-color: #3B82F6; color: #3B82F6; }
.pay-opt.wallet:hover { border-color: #7C3AED; color: #7C3AED; }

.pay-icon {
    font-size: 24px;
    font-weight: 900;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F6FA;
    border-radius: 50%;
}

.btn-cancel {
    padding: 12px 30px;
    background: #F5F6FA;
    color: #787891;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.btn-cancel:hover { background: #EEF0F5; }

.success-modal {
    background: #FFF;
    border-radius: 20px;
    padding: 40px 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.success-check {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #DCFCE7;
    color: #16A34A;
    font-size: 24px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-modal h2 {
    color: #18182B;
    font-size: 22px;
    margin-bottom: 8px;
}

.success-invoice {
    color: #787891;
    font-size: 14px;
    margin-bottom: 6px;
}

.success-amount {
    font-size: 32px;
    font-weight: 800;
    color: #10B981;
    margin-bottom: 24px;
}

.btn-ok {
    padding: 14px 40px;
    background: #7C3AED;
    color: #FFF;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
}

.btn-ok:hover { background: #6D28D9; }

@media (max-width: 1000px) {
    .pos-cart { width: 320px; }
}

@media (max-width: 800px) {
    .pos-main { flex-direction: column; }
    .pos-cart { width: 100%; max-height: 50%; }
}
/* ═══════════════════════════════════════════════════════
   Modern Management Pages
   ═══════════════════════════════════════════════════════ */

.mgmt-page {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.mgmt-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.mgmt-page-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 4px;
}

.mgmt-page-header p {
    color: #787891;
    font-size: 14px;
}

.btn-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    color: #FFF;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

.btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124,58,237,0.35);
}

.btn-new span {
    font-size: 18px;
    font-weight: 800;
}

.mgmt-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: #FFF;
    border: 1px solid #E8EAF0;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.stat-box:hover {
    border-color: #7C3AED;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124,58,237,0.08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    flex-shrink: 0;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: #18182B;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #787891;
    font-weight: 600;
    margin-top: 4px;
}

/* ═══════ Filter Bar ═══════ */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 10px 20px;
    background: #FFF;
    border: 2px solid #E8EAF0;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    color: #787891;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.filter-chip:hover {
    border-color: #7C3AED;
    color: #7C3AED;
}

.filter-chip.active {
    background: #7C3AED;
    color: #FFF;
    border-color: #7C3AED;
    box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

/* ═══════ Card Grid ═══════ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* ═══════ Category Card ═══════ */
.cat-card {
    background: #FFF;
    border: 2px solid #E8EAF0;
    border-radius: 18px;
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.cat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #7C3AED, #A78BFA);
}

.cat-card:hover {
    border-color: #7C3AED;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(124,58,237,0.15);
}

.cat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #F3E8FF, #E9D5FF);
    color: #7C3AED;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
}

.cat-card-actions {
    display: flex;
    gap: 6px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.icon-btn.edit {
    background: #F3E8FF;
    color: #7C3AED;
}

.icon-btn.edit:hover {
    background: #7C3AED;
    color: #FFF;
}

.icon-btn.delete {
    background: #FEE2E2;
    color: #DC2626;
}

.icon-btn.delete:hover {
    background: #DC2626;
    color: #FFF;
}

.cat-card-body h3 {
    font-size: 18px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 10px;
    word-break: break-word;
}

.cat-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-chip {
    font-size: 11px;
    padding: 4px 10px;
    background: #F5F6FA;
    color: #787891;
    border-radius: 100px;
    font-weight: 700;
}

.cat-card-footer {
    padding-top: 12px;
    border-top: 1px solid #F0F2F7;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 100px;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-pill.active {
    background: #DCFCE7;
    color: #16A34A;
}

.status-pill.active::before {
    background: #16A34A;
}

.status-pill.inactive {
    background: #F1F5F9;
    color: #64748B;
}

.status-pill.inactive::before {
    background: #64748B;
}

/* ═══════ Item Card ═══════ */
.item-card {
    background: #FFF;
    border: 2px solid #E8EAF0;
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    border-color: #EF4444;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(239,68,68,0.12);
}

.item-card-visual {
    height: 100px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    font-weight: 900;
    color: #D97706;
}

.item-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.item-card-header h4 {
    font-size: 16px;
    font-weight: 800;
    color: #18182B;
    word-break: break-word;
    flex: 1;
}

.dot-active, .dot-inactive {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.dot-active {
    background: #16A34A;
    box-shadow: 0 0 0 3px #DCFCE7;
}

.dot-inactive {
    background: #94A3B8;
    box-shadow: 0 0 0 3px #F1F5F9;
}

.item-card-category {
    font-size: 12px;
    color: #787891;
    font-weight: 600;
    background: #F5F6FA;
    padding: 4px 10px;
    border-radius: 100px;
    display: inline-block;
    align-self: flex-start;
}

.item-card-price {
    font-size: 22px;
    font-weight: 800;
    color: #EF4444;
    margin-top: auto;
    padding-top: 8px;
}

.item-card-price span {
    font-size: 12px;
    color: #787891;
    font-weight: 600;
}

.item-card-actions {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid #F0F2F7;
    margin-top: 8px;
}

.item-card-actions .icon-btn {
    flex: 1;
    height: 32px;
}

/* ═══════ Empty State ═══════ */
.mgmt-empty {
    text-align: center;
    padding: 80px 20px;
    background: #FFF;
    border: 2px dashed #E8EAF0;
    border-radius: 18px;
}

.empty-graphic {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    background: linear-gradient(135deg, #F3E8FF, #E9D5FF);
    color: #7C3AED;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 900;
    margin: 0 auto 20px;
}

.mgmt-empty h3 {
    font-size: 20px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 8px;
}

.mgmt-empty p {
    color: #787891;
    margin-bottom: 20px;
    font-size: 14px;
}

.mgmt-loading {
    text-align: center;
    padding: 60px;
    color: #787891;
    font-size: 14px;
}

/* ═══════ Toast ═══════ */
.toast {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

.toast-success {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #86EFAC;
}

.toast-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════ Modal ═══════ */
.modal-box {
    background: #FFF;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: modalPop 0.2s ease-out;
    overflow: hidden;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #F0F2F7;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: #18182B;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F5F6FA;
    border-radius: 10px;
    color: #787891;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
}

.modal-close:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.modal-body {
    padding: 24px;
}

.modal-error {
    background: #FEE2E2;
    color: #991B1B;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #FCA5A5;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid #F0F2F7;
}

.btn-save {
    flex: 1;
    padding: 14px 24px;
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    color: #FFF;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.btn-save:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(124,58,237,0.35);
}

.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ═══════ Toggle Switch ═══════ */
.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: #18182B;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #E8EAF0;
    transition: 0.3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #FFF;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

input:checked + .slider {
    background-color: #7C3AED;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.form-group small {
    color: #94A3B8;
    font-size: 11px;
    margin-top: 4px;
    display: block;
}

/* ═══════ Responsive ═══════ */
@media (max-width: 768px) {
    .mgmt-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .btn-new {
        justify-content: center;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .mgmt-stats {
        grid-template-columns: 1fr;
    }
}
/* ═══════════════════════════════════════════════════════
   Cash Registers Page
   ═══════════════════════════════════════════════════════ */

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #FFF;
    color: #7C3AED;
    border: 2px solid #7C3AED;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #F3E8FF;
    transform: translateY(-2px);
}

/* ═══════ Cash Card ═══════ */
.cash-card {
    background: #FFF;
    border: 2px solid #E8EAF0;
    border-radius: 18px;
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.cash-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
}

.cash-card.type-cash::before { background: linear-gradient(90deg, #10B981, #34D399); }
.cash-card.type-bank::before { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.cash-card.type-wallet::before { background: linear-gradient(90deg, #7C3AED, #A78BFA); }

.cash-card.type-cash:hover { border-color: #10B981; box-shadow: 0 12px 32px rgba(16,185,129,0.15); }
.cash-card.type-bank:hover { border-color: #3B82F6; box-shadow: 0 12px 32px rgba(59,130,246,0.15); }
.cash-card.type-wallet:hover { border-color: #7C3AED; box-shadow: 0 12px 32px rgba(124,58,237,0.15); }

.cash-card:hover { transform: translateY(-4px); }

.cash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.cash-type-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.type-cash .cash-type-badge { background: #DCFCE7; color: #16A34A; }
.type-bank .cash-type-badge { background: #DBEAFE; color: #2563EB; }
.type-wallet .cash-type-badge { background: #F3E8FF; color: #7C3AED; }

.cash-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.default-badge {
    font-size: 10px;
    font-weight: 800;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #FFF;
    padding: 5px 10px;
    border-radius: 100px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.default-badge::before {
    content: 'Star';
    font-size: 9px;
    opacity: 0.8;
}

.icon-btn.star {
    background: #FEF3C7;
    color: #D97706;
}

.icon-btn.star:hover {
    background: #F59E0B;
    color: #FFF;
}

.cash-card-body h3 {
    font-size: 18px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 4px;
    word-break: break-word;
}

.cash-account {
    font-size: 12px;
    color: #787891;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: #F5F6FA;
    padding: 4px 10px;
    border-radius: 8px;
    display: inline-block;
}

.cash-balance {
    margin-top: 12px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cash-balance-value {
    font-size: 28px;
    font-weight: 800;
    color: #18182B;
    letter-spacing: -0.5px;
}

.type-cash .cash-balance-value { color: #10B981; }
.type-bank .cash-balance-value { color: #3B82F6; }
.type-wallet .cash-balance-value { color: #7C3AED; }

.cash-balance-currency {
    font-size: 13px;
    font-weight: 700;
    color: #94A3B8;
}

.cash-card-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid #F0F2F7;
}

.cash-action-btn {
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.cash-action-btn.deposit { background: #DCFCE7; color: #16A34A; }
.cash-action-btn.deposit:hover { background: #16A34A; color: #FFF; }

.cash-action-btn.withdraw { background: #FEE2E2; color: #DC2626; }
.cash-action-btn.withdraw:hover { background: #DC2626; color: #FFF; }

.cash-action-btn.history {
    grid-column: span 2;
    background: #F5F6FA;
    color: #787891;
}

.cash-action-btn.history:hover { background: #7C3AED; color: #FFF; }

/* ═══════ Manual Info ═══════ */
.manual-info {
    background: #F8F9FC;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    text-align: center;
}

.manual-register {
    font-size: 16px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 4px;
}

.manual-balance {
    font-size: 13px;
    color: #787891;
    font-weight: 600;
}

/* ═══════ Modal Wide ═══════ */
.modal-box.modal-wide {
    max-width: 640px;
}

/* ═══════ Transaction List ═══════ */
.tx-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tx-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #F8F9FC;
    border-radius: 10px;
    transition: all 0.15s;
}

.tx-row:hover {
    background: #EEF0F5;
}

.tx-dir {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}

.tx-in { background: #DCFCE7; color: #16A34A; }
.tx-out { background: #FEE2E2; color: #DC2626; }

.tx-info {
    flex: 1;
    min-width: 0;
}

.tx-desc {
    font-size: 13px;
    font-weight: 700;
    color: #18182B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-meta {
    font-size: 11px;
    color: #94A3B8;
    margin-top: 2px;
}

.tx-amount {
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
}

.amount-in { color: #16A34A; }
.amount-out { color: #DC2626; }
/* ═══════════════════════════════════════════════════════
   Reports Page
   ═══════════════════════════════════════════════════════ */

.report-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFF;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid #E8EAF0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.report-filters label {
    font-size: 13px;
    font-weight: 700;
    color: #787891;
}

.date-input {
    max-width: 180px;
    padding: 10px 14px !important;
    font-size: 14px !important;
}

.report-stats {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.report-stat {
    background: #FFF;
    border: 1px solid #E8EAF0;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s;
}

.report-stat.big {
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    color: #FFF;
    border: none;
    position: relative;
    overflow: hidden;
}

.report-stat.big::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.report-stat.big::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -40px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.report-stat-label {
    font-size: 12px;
    font-weight: 700;
    color: #787891;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.report-stat.big .report-stat-label {
    color: rgba(255,255,255,0.85);
}

.report-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #18182B;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

.report-stat.big .report-stat-value {
    color: #FFF;
    font-size: 42px;
}

.report-stat-value span {
    font-size: 16px;
    color: #94A3B8;
    font-weight: 700;
}

.report-stat.big .report-stat-value span {
    color: rgba(255,255,255,0.85);
}

.report-stat-sub {
    font-size: 12px;
    color: #94A3B8;
    margin-top: 8px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.report-stat.big .report-stat-sub {
    color: rgba(255,255,255,0.75);
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.report-card {
    background: #FFF;
    border: 1px solid #E8EAF0;
    border-radius: 16px;
    overflow: hidden;
}

.report-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #F0F2F7;
}

.report-card-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: #18182B;
}

.report-card-body {
    padding: 16px 24px 24px;
}

.report-empty {
    text-align: center;
    padding: 30px 20px;
    color: #94A3B8;
    font-size: 14px;
}

/* ═══════ Payment Rows ═══════ */
.payment-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #F5F6FA;
}

.payment-row:last-child { border-bottom: none; }

.payment-label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 90px;
    font-size: 13px;
    font-weight: 700;
    color: #4A5568;
    flex-shrink: 0;
}

.payment-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.payment-bar-wrap {
    flex: 1;
    height: 8px;
    background: #F0F2F7;
    border-radius: 100px;
    overflow: hidden;
}

.payment-bar {
    height: 100%;
    border-radius: 100px;
    transition: width 0.4s ease;
}

.payment-amount {
    font-size: 13px;
    font-weight: 800;
    color: #18182B;
    min-width: 80px;
    text-align: left;
}

/* ═══════ Top Items ═══════ */
.top-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #F5F6FA;
}

.top-item-row:last-child { border-bottom: none; }

.top-item-rank {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #F3E8FF;
    color: #7C3AED;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.top-item-info { flex: 1; min-width: 0; }

.top-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #18182B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-item-qty {
    font-size: 11px;
    color: #94A3B8;
    margin-top: 2px;
    font-weight: 600;
}

.top-item-revenue {
    font-size: 14px;
    font-weight: 800;
    color: #10B981;
    flex-shrink: 0;
}

/* ═══════ Invoices List ═══════ */
.invoices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invoice-row {
    display: grid;
    grid-template-columns: 80px 80px 1fr 100px 120px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #F8F9FC;
    border-radius: 10px;
    transition: all 0.15s;
}

.invoice-row:hover {
    background: #EEF0F5;
    transform: translateX(-2px);
}

.invoice-no {
    font-size: 14px;
    font-weight: 800;
    color: #7C3AED;
}

.invoice-time {
    font-size: 12px;
    color: #787891;
    font-weight: 600;
}

.invoice-items {
    font-size: 13px;
    color: #4A5568;
    font-weight: 600;
}

.invoice-payment { text-align: center; }

.pay-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
}

.pay-cash { background: #DCFCE7; color: #16A34A; }
.pay-visa { background: #DBEAFE; color: #2563EB; }
.pay-wallet { background: #F3E8FF; color: #7C3AED; }
.pay-credit { background: #FEF3C7; color: #D97706; }

.invoice-total {
    font-size: 14px;
    font-weight: 800;
    color: #18182B;
    text-align: left;
}

@media (max-width: 1000px) {
    .report-stats { grid-template-columns: 1fr 1fr; }
    .report-stat.big { grid-column: span 2; }
    .report-grid { grid-template-columns: 1fr; }
    .invoice-row { grid-template-columns: 70px 70px 1fr 90px 100px; font-size: 12px; }
}

@media (max-width: 700px) {
    .invoice-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .invoice-row > div:nth-child(3),
    .invoice-row > div:nth-child(4) { text-align: right; }
    .invoice-total { grid-column: span 2; text-align: center; }
}
/* ═══════════════════════════════════════════════════════
   Print Styles
   ═══════════════════════════════════════════════════════ */
@media print {
    /* Hide sidebar + header + buttons */
    .sidebar,
    .top-header,
    .header-actions,
    .report-filters,
    .btn-new,
    .btn-secondary,
    .nav-menu,
    .sidebar-footer {
        display: none !important;
    }

    /* Full width for content */
    .app-container {
        display: block !important;
    }

    .main-area {
        margin: 0 !important;
        padding: 0 !important;
    }

    .content-area {
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Backgrounds for cards */
    .report-stat,
    .report-card {
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .report-stat.big {
        background: #7C3AED !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        background: #FFF !important;
    }

    /* Invoice rows */
    .invoice-row {
        page-break-inside: avoid;
    }

    /* Top items */
    .top-item-row {
        page-break-inside: avoid;
    }
}
/* ═══════════════════════════════════════════════════════
   Receipt Print (POS Success Modal)
   ═══════════════════════════════════════════════════════ */
.btn-print-receipt {
    width: 100%;
    padding: 14px 40px;
    background: #10B981;
    color: #FFF;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 10px;
}

.btn-print-receipt:hover { background: #059669; }

@media print {
    .modal-overlay {
        position: static !important;
        background: none !important;
        display: block !important;
    }

    .success-modal {
        box-shadow: none !important;
        max-width: 100% !important;
    }

    .success-modal .btn-ok,
    .success-modal .btn-print-receipt,
    .success-modal .btn-cancel {
        display: none !important;
    }

    .success-check {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
/* ═══════════════════════════════════════════════════════
   Printable Receipt — Hidden on Screen, Visible on Print
   ═══════════════════════════════════════════════════════ */

.print-receipt {
    display: none;
    font-family: 'Courier New', monospace;
    color: #000;
    background: #FFF;
    width: 80mm;
    padding: 5mm;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.4;
}

.receipt-center { text-align: center; }
.receipt-bold { font-weight: bold; }
.receipt-big { font-size: 15px; }
.receipt-small { font-size: 11px; }

.receipt-divider {
    border-top: 1px solid #000;
    margin: 6px 0;
}

.receipt-divider-dashed {
    border-top: 1px dashed #000;
    margin: 4px 0;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
}

.receipt-item {
    margin: 4px 0;
}

.receipt-item-name {
    font-weight: bold;
    font-size: 12px;
}

.receipt-row .col-item { flex: 1; text-align: left; }
.receipt-row .col-qty { width: 40px; text-align: center; }
.receipt-row .col-price { width: 55px; text-align: right; }
.receipt-row .col-total { width: 55px; text-align: right; font-weight: bold; }

.receipt-thanks { margin-top: 8px; font-weight: bold; }

.receipt-barcode {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 3px;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed #000;
}

/* ═══════════ PRINT ONLY RECEIPT ═══════════ */
@media print {

    /* Hide everything */
    body * {
        visibility: hidden;
    }

    /* Show only receipt */
    #print-receipt,
    #print-receipt * {
        visibility: visible;
    }

    #print-receipt {
        position: absolute;
        left: 0;
        top: 0;
        display: block !important;
        width: 80mm;
        padding: 3mm;
    }

    /* Hide modals on print */
    .modal-overlay,
    .no-print {
        display: none !important;
        visibility: hidden !important;
    }

    /* Paper size */
    @page {
        size: 80mm auto;
        margin: 0;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 80mm;
        background: #FFF !important;
    }

    /* Hide other UI elements */
    .sidebar,
    .top-header,
    .nav-menu,
    .sidebar-footer,
    .pos-wrapper {
        display: none !important;
    }
}
/* ═══════════════════════════════════════════════════════
   Settings Page
   ═══════════════════════════════════════════════════════ */

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.settings-card {
    background: #FFF;
    border: 1px solid #E8EAF0;
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.2s;
}

.settings-card:hover {
    border-color: #7C3AED;
    box-shadow: 0 12px 32px rgba(124,58,237,0.08);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: #FAFBFC;
    border-bottom: 1px solid #F0F2F7;
}

.settings-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    flex-shrink: 0;
}

.settings-card-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 2px;
}

.settings-card-header p {
    font-size: 12px;
    color: #787891;
}

.settings-card-body {
    padding: 20px 24px 24px;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    padding: 16px 0;
    border-top: 1px solid #F0F2F7;
}

.btn-save-settings {
    padding: 14px 40px;
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    color: #FFF;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

.btn-save-settings:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124,58,237,0.35);
}

.btn-save-settings:disabled { opacity: 0.6; cursor: not-allowed; }

/* Fee Group */
.fee-group {
    padding: 16px 0;
    border-bottom: 1px solid #F5F6FA;
}

.fee-group:last-of-type { border-bottom: none; }

.fee-group .switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 0;
}

.fee-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-left: 60px;
}

.fee-input-wrap .form-control {
    max-width: 120px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #7C3AED;
}

.fee-suffix {
    font-size: 18px;
    font-weight: 800;
    color: #94A3B8;
}

.fee-preview {
    background: #F8F9FC;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 16px;
}

.fee-preview-title {
    font-size: 11px;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.fee-preview-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #4A5568;
    font-weight: 600;
    padding: 2px 0;
}

/* Visa Modal */
.visa-info {
    text-align: center;
    margin-bottom: 20px;
}

.visa-icon-big {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #1A1F71, #2A3B9E);
    color: #FFF;
    border-radius: 8px;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.visa-info p {
    font-size: 13px;
    color: #787891;
    font-weight: 600;
}

.visa-digits-input {
    text-align: center !important;
    font-size: 32px !important;
    font-weight: 900 !important;
    letter-spacing: 12px !important;
    font-family: 'Courier New', monospace !important;
    padding: 16px !important;
    color: #7C3AED !important;
}

.visa-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #F8F9FC;
    border-radius: 12px;
    font-size: 14px;
    color: #4A5568;
}

.visa-total strong {
    font-size: 20px;
    color: #10B981;
    font-weight: 800;
}

@media (max-width: 900px) {
    .settings-grid { grid-template-columns: 1fr; }
}
/* ═══════════════════════════════════════════════════════
   Print Styles - Page-Aware
   ═══════════════════════════════════════════════════════ */

.print-receipt {
    display: none;
    font-family: 'Courier New', monospace;
    color: #000;
    background: #FFF;
    width: 80mm;
    padding: 5mm;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.4;
}

.receipt-center { text-align: center; }
.receipt-bold { font-weight: bold; }
.receipt-big { font-size: 15px; }
.receipt-small { font-size: 11px; }

.receipt-divider {
    border-top: 1px solid #000;
    margin: 6px 0;
}

.receipt-divider-dashed {
    border-top: 1px dashed #000;
    margin: 4px 0;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
}

.receipt-item { margin: 4px 0; }

.receipt-item-name {
    font-weight: bold;
    font-size: 12px;
}

.receipt-row .col-item { flex: 1; text-align: left; }
.receipt-row .col-qty { width: 40px; text-align: center; }
.receipt-row .col-price { width: 55px; text-align: right; }
.receipt-row .col-total { width: 55px; text-align: right; font-weight: bold; }

.receipt-thanks { margin-top: 8px; font-weight: bold; }

.receipt-barcode {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 3px;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed #000;
}

/* ═══════════════════════════════════════════════════════
   PRINT — Applies to all pages
   ═══════════════════════════════════════════════════════ */
@media print {

    /* Hide common UI elements */
    .sidebar,
    .top-header,
    .nav-menu,
    .sidebar-footer,
    .header-actions,
    .report-filters,
    .btn-new,
    .btn-secondary,
    .filter-bar,
    .toast,
    .modal-close,
    .btn-cancel,
    .btn-ok,
    .btn-print-receipt,
    .btn-save,
    .no-print {
        display: none !important;
    }

    /* Reset layout for print */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #FFF !important;
        overflow: visible !important;
    }

    .app-container {
        display: block !important;
    }

    .main-area {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .content-area {
        padding: 10mm !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* Reports styling */
    .mgmt-page {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .report-stat,
    .report-card,
    .settings-card {
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-stat.big {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .card-grid {
        display: block !important;
    }

    .cat-card,
    .item-card,
    .cash-card {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 5mm;
        page-break-inside: avoid;
    }

    /* ═══════════════════════════════════════════════
       RECEIPT MODE — Only when #print-receipt exists
       ═══════════════════════════════════════════════ */

    /* When body has a print-receipt, hide everything else */
    body:has(#print-receipt) .sidebar,
    body:has(#print-receipt) .top-header,
    body:has(#print-receipt) .pos-wrapper,
    body:has(#print-receipt) .modal-overlay {
        display: none !important;
    }

    body:has(#print-receipt) * {
        visibility: hidden;
    }

    body:has(#print-receipt) #print-receipt,
    body:has(#print-receipt) #print-receipt * {
        visibility: visible;
    }

    body:has(#print-receipt) #print-receipt {
        position: absolute;
        left: 0;
        top: 0;
        display: block !important;
        width: 80mm !important;
        padding: 3mm !important;
    }

    body:has(#print-receipt) .content-area {
        padding: 0 !important;
    }

    @page {
        margin: 5mm;
    }

    /* Receipt-specific paper size */
    body:has(#print-receipt) {
        width: 80mm;
    }
}
/* ???????????????????????????????????????????????????????
   Reports 80mm Print
   ??????????????????????????????????????????????????????? */

.report-print-80mm {
    display: none;
    font-family: 'Courier New', monospace;
    color: #000;
    background: #FFF;
    width: 80mm;
    padding: 4mm;
    box-sizing: border-box;
    font-size: 11px;
    line-height: 1.35;
}

.rp-center { text-align: center; }
.rp-bold { font-weight: bold; }
.rp-big { font-size: 14px; }
.rp-small { font-size: 10px; }

.rp-divider {
    border-top: 1px solid #000;
    margin: 5px 0;
}

.rp-dash {
    border-top: 1px dashed #000;
    margin: 3px 0;
}

.rp-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
}

.rp-section-title {
    font-size: 11px;
    margin: 6px 0 3px 0;
}

.rp-row .rp-col1 { width: 35px; }
.rp-row .rp-col2 { width: 50px; text-align: center; }
.rp-row .rp-col3 { width: 40px; text-align: center; }
.rp-row .rp-col4 { width: 70px; text-align: right; font-weight: bold; }

.rp-barcode {
    text-align: center;
    font-size: 14px;
    letter-spacing: 3px;
    margin-top: 8px;
    padding-top: 4px;
    border-top: 1px dashed #000;
}

/* ??????? PRINT: Reports 80mm mode ??????? */
@media print {

    body:has(#report-print) * {
        visibility: hidden;
    }

    body:has(#report-print) #report-print,
    body:has(#report-print) #report-print * {
        visibility: visible;
    }

    body:has(#report-print) #report-print {
        position: absolute;
        left: 0;
        top: 0;
        display: block !important;
        width: 80mm !important;
        padding: 3mm !important;
    }

    body:has(#report-print) .sidebar,
    body:has(#report-print) .top-header,
    body:has(#report-print) .mgmt-page {
        display: none !important;
    }

    body:has(#report-print) .content-area {
        padding: 0 !important;
    }

    body:has(#report-print) {
        width: 80mm;
    }

    @page {
        size: 80mm auto;
        margin: 0;
    }
}
/* ???????????????????????????????????????????????????????
   PIN Modal
   ??????????????????????????????????????????????????????? */

.pin-modal-overlay {
    z-index: 10000 !important;
}

.pin-modal-box {
    max-width: 420px !important;
    text-align: center;
    padding: 32px 28px !important;
}

.pin-modal-icon {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    color: #FFF;
    border-radius: 12px;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(124,58,237,0.3);
}

.pin-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 8px;
}

.pin-modal-sub {
    font-size: 13px;
    color: #787891;
    line-height: 1.5;
    margin-bottom: 20px;
}

.pin-modal-sub strong {
    color: #7C3AED;
    font-weight: 800;
}

.pin-input {
    text-align: center !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    letter-spacing: 10px !important;
    font-family: 'Courier New', monospace !important;
    padding: 14px !important;
    color: #7C3AED !important;
}

.pin-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.pin-actions .btn-cancel,
.pin-actions .btn-save {
    flex: 1;
}
/* ???????????????????????????????????????????????????????
   PIN Settings Card
   ??????????????????????????????????????????????????????? */

.settings-loading {
    text-align: center;
    padding: 20px;
    color: #787891;
    font-size: 13px;
}

.pin-status-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 2px solid;
}

.pin-status-badge.active {
    background: #F0FDF4;
    border-color: #86EFAC;
}

.pin-status-badge.inactive {
    background: #FFF7ED;
    border-color: #FED7AA;
}

.pin-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pin-status-badge.active .pin-status-dot {
    background: #16A34A;
    box-shadow: 0 0 0 4px rgba(22,163,74,0.15);
}

.pin-status-badge.inactive .pin-status-dot {
    background: #EA580C;
    box-shadow: 0 0 0 4px rgba(234,88,12,0.15);
}

.pin-status-badge strong {
    display: block;
    font-size: 14px;
    color: #18182B;
    margin-bottom: 2px;
}

.pin-status-badge p {
    font-size: 11px;
    color: #787891;
    margin: 0;
}

.pin-info-list {
    background: #F8F9FC;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.pin-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
    color: #4A5568;
    font-weight: 600;
}

.pin-info-row:not(:last-child) {
    border-bottom: 1px solid #EBEEF5;
}

.pin-info-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #F3E8FF;
    color: #7C3AED;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    flex-shrink: 0;
}

.pin-description {
    font-size: 13px;
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: center;
}

.pin-description strong {
    color: #7C3AED;
    font-weight: 800;
}

.pin-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-pin-action {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    width: 100%;
}

.btn-pin-action.primary {
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

.btn-pin-action.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(124,58,237,0.35);
}

.btn-pin-action.secondary {
    background: #F3E8FF;
    color: #7C3AED;
}

.btn-pin-action.secondary:hover {
    background: #E9D5FF;
}

.btn-pin-action.danger {
    background: #FEE2E2;
    color: #DC2626;
}

.btn-pin-action.danger:hover {
    background: #FECACA;
}
/* ???????????????????????????????????????????????????????
   Tables Page
   ??????????????????????????????????????????????????????? */

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.table-card {
    background: #FFF;
    border: 2px solid #E8EAF0;
    border-radius: 18px;
    padding: 16px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.table-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
}

.table-card.table-free { border-color: #DCFCE7; }
.table-card.table-free::before { background: linear-gradient(90deg, #10B981, #34D399); }
.table-card.table-free:hover { border-color: #10B981; box-shadow: 0 12px 32px rgba(16,185,129,0.15); transform: translateY(-3px); }

.table-card.table-busy { border-color: #FEE2E2; }
.table-card.table-busy::before { background: linear-gradient(90deg, #EF4444, #F87171); }
.table-card.table-busy:hover { border-color: #EF4444; box-shadow: 0 12px 32px rgba(239,68,68,0.15); transform: translateY(-3px); }

.table-card.table-reserved { border-color: #FEF3C7; }
.table-card.table-reserved::before { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.table-card.table-reserved:hover { border-color: #F59E0B; box-shadow: 0 12px 32px rgba(245,158,11,0.15); transform: translateY(-3px); }

.table-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-status-pill {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.table-free .table-status-pill { background: #DCFCE7; color: #16A34A; }
.table-busy .table-status-pill { background: #FEE2E2; color: #DC2626; }
.table-reserved .table-status-pill { background: #FEF3C7; color: #D97706; }

.table-card-actions {
    display: flex;
    gap: 4px;
}

.table-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
    margin: 0 auto;
}

.table-free .table-card-icon { background: #DCFCE7; color: #16A34A; }
.table-busy .table-card-icon { background: #FEE2E2; color: #DC2626; }
.table-reserved .table-card-icon { background: #FEF3C7; color: #D97706; }

.table-card-info {
    text-align: center;
}

.table-card-info h3 {
    font-size: 17px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 4px;
    word-break: break-word;
}

.table-capacity {
    font-size: 12px;
    color: #787891;
    font-weight: 600;
}

.table-card-footer {
    padding-top: 12px;
    border-top: 1px solid #F0F2F7;
}

.table-action-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.table-action-btn.primary {
    background: #F3E8FF;
    color: #7C3AED;
}

.table-action-btn.primary:hover { background: #7C3AED; color: #FFF; }

.table-action-btn.success {
    background: #DCFCE7;
    color: #16A34A;
}

.table-action-btn.success:hover { background: #16A34A; color: #FFF; }
/* ???????????????????????????????????????????????????????
   Info Box
   ??????????????????????????????????????????????????????? */
.info-box {
    background: #F0FDF4;
    color: #166534;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #86EFAC;
    margin-top: 12px;
}

.info-box.warning {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FCD34D;
}

/* ???????????????????????????????????????????????????????
   Invoice Detail Modal
   ??????????????????????????????????????????????????????? */
.invoice-detail-header {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #4A5568;
    padding: 8px 0;
    flex-wrap: wrap;
}

.invoice-detail-header strong {
    color: #18182B;
}

.invoice-detail-totals {
    padding: 12px 0;
}

.invoice-detail-totals > div {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    color: #4A5568;
}

.invoice-detail-totals > div.grand {
    border-top: 2px solid #E8EAF0;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 800;
    color: #7C3AED;
}
/* ═══════════════════════════════════════════════════════
   Fixed Table Layout (better column spacing)
   ═══════════════════════════════════════════════════════ */

.mgmt-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mgmt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
}

.mgmt-table thead th {
    background: #F8F9FC;
    color: #787891;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    text-align: center;
    border-bottom: 2px solid #E8EAF0;
    white-space: nowrap;
}

.mgmt-table tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: #18182B;
    text-align: center;
    border-bottom: 1px solid #F0F2F7;
    vertical-align: middle;
}

.mgmt-table tbody tr:last-child td {
    border-bottom: none;
}

.mgmt-table tbody tr:hover {
    background: #FAFBFC;
}

.mgmt-table tbody tr:hover td {
    background: transparent;
}

/* Column-specific widths */
.mgmt-table .col-date { min-width: 110px; }
.mgmt-table .col-time { min-width: 80px; }
.mgmt-table .col-money { min-width: 100px; text-align: right; padding-right: 20px; }
.mgmt-table .col-desc { min-width: 200px; text-align: right; padding-right: 16px; }
.mgmt-table .col-name { min-width: 140px; text-align: right; padding-right: 16px; }
.mgmt-table .col-badge { min-width: 90px; }
.mgmt-table .col-actions { min-width: 130px; }

/* Description ellipsis */
.mgmt-table .cell-ellipsis {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fix amount column - make it readable */
.mgmt-table td:last-child,
.mgmt-table th:last-child {
    padding-right: 20px;
}

/* Actions cell - keep buttons inline */
.mgmt-table .btn-sm {
    margin: 0 2px;
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.15s;
}

.mgmt-table .btn-sm.btn-edit {
    background: #F3E8FF;
    color: #7C3AED;
}

.mgmt-table .btn-sm.btn-edit:hover {
    background: #7C3AED;
    color: #FFF;
}

.mgmt-table .btn-sm.btn-delete {
    background: #FEE2E2;
    color: #DC2626;
}

.mgmt-table .btn-sm.btn-delete:hover {
    background: #DC2626;
    color: #FFF;
}

/* Pay badges inside table */
.mgmt-table .pay-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

/* RTL adjustments */






/* Responsive table */
@media (max-width: 900px) {
    .mgmt-table {
        min-width: 700px;
    }
    .mgmt-table thead th,
    .mgmt-table tbody td {
        padding: 10px 8px;
        font-size: 12px;
    }
}
/* ???????????????????????????????????????????????????????
   Recipes Page
   ??????????????????????????????????????????????????????? */

.recipes-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    align-items: start;
}

.recipes-items-list {
    background: #FFF;
    border-radius: 16px;
    border: 1px solid #E8EAF0;
    padding: 12px;
    max-height: 75vh;
    overflow-y: auto;
}

.recipes-list-title {
    font-size: 11px;
    font-weight: 800;
    color: #787891;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
}

.recipe-item-row {
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 4px;
}

.recipe-item-row:hover {
    background: #F8F9FC;
}

.recipe-item-row.selected {
    background: #F3E8FF;
    border-left: 4px solid #7C3AED;
}

.recipe-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #18182B;
    margin-bottom: 4px;
}

.recipe-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #787891;
    font-weight: 600;
}

.recipe-cost-chip {
    background: #DCFCE7;
    color: #16A34A;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
}

.recipe-cost-chip.no-recipe {
    background: #FEE2E2;
    color: #DC2626;
}

.recipes-detail {
    background: #FFF;
    border-radius: 16px;
    border: 1px solid #E8EAF0;
    padding: 24px;
    min-height: 400px;
}

.recipe-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.recipe-detail-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 4px;
}

.recipe-detail-meta {
    font-size: 13px;
    color: #787891;
}

.recipe-detail-meta strong {
    color: #7C3AED;
}

.recipe-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.recipe-summary-box {
    background: #F8F9FC;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.recipe-summary-label {
    font-size: 11px;
    font-weight: 800;
    color: #787891;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.recipe-summary-value {
    font-size: 20px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .recipes-layout {
        grid-template-columns: 1fr;
    }
    .recipe-summary-grid {
        grid-template-columns: 1fr;
    }
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    background: #F3E8FF;
    color: #7C3AED;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
}
/* ═══════════════════════════════════════════════════════
   Direction: Respect <html dir="..."> attribute
   ═══════════════════════════════════════════════════════ */
html

html[dir="ltr"],
html[dir="ltr"] body {
    direction: ltr;
}

/* ═══════════════════════════════════════════════════════
   RTL Layout — Only when dir="rtl"
   ═══════════════════════════════════════════════════════ */



[dir="ltr"] .app-container {
    direction: ltr;
}

/* Sidebar position */


[dir="ltr"] .sidebar { border-left: 1px solid var(--border, #E8EAF0); border-right: none; }



[dir="ltr"] .main-area { order: 1 !important; flex: 1; }
/* Direction — Respect html[dir] attribute */
html
html[dir="ltr"], html[dir="ltr"] body { direction: ltr; }


[dir="ltr"] .sidebar { border-left: 1px solid var(--border, #E8EAF0); border-right: none; }

/* ═══════════════════════════════════════════════════════
   Fixed Sidebar — Always on LEFT
   ═══════════════════════════════════════════════════════ */

.app-container {
    display: flex !important;
    flex-direction: row-reverse !important;
    direction: ltr !important;
}

.sidebar { order: 0 !important; direction: rtl; border-left: 1px solid var(--border, #E8EAF0); border-right: none; }

.main-area { order: 1 !important; flex: 1; }

/* Content area — switches direction based on language */
.content-area[dir="rtl"] {
    direction: rtl;
}

.content-area[dir="ltr"] {
    direction: ltr;
}

/* Header — switches direction too */
.top-header[dir="rtl"] {
    direction: rtl;
}

.top-header[dir="ltr"] {
    direction: ltr;
}

/* ═══════════════════════════════════════════════════════
   Beautiful Header Buttons
   ═══════════════════════════════════════════════════════ */

.header-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-soft);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.header-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(124, 58, 237, 0.15);
}

.header-btn:active {
    transform: translateY(0);
}

.header-btn svg {
    flex-shrink: 0;
}

/* Theme button — icon only */
.theme-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #D97706;
}

.theme-btn:hover {
    background: linear-gradient(135deg, #FDE68A, #FCD34D);
    color: #B45309;
}

/* Language button */
.lang-btn {
    background: linear-gradient(135deg, #F3E8FF, #E9D5FF);
    color: #7C3AED;
}

.lang-btn:hover {
    background: linear-gradient(135deg, #E9D5FF, #D8B4FE);
    color: #6D28D9;
}

/* Time chip */
.time-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    background: var(--bg-soft);
    color: var(--text-secondary);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════
   Dark Mode Variables
   ═══════════════════════════════════════════════════════ */

html[data-theme="dark"] {
    --bg-main: #0F172A;
    --bg-card: #1E293B;
    --bg-soft: #334155;
    --border: #334155;
    --border-soft: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --accent: #A78BFA;
    --accent-light: #3730A3;
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #F87171;
}

html[data-theme="dark"] body {
    background: #0F172A !important;
    color: #F1F5F9 !important;
}

html[data-theme="dark"] .sidebar {
    background: #1E293B !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .top-header {
    background: #1E293B !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .nav-item {
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .nav-item:hover {
    background: #334155 !important;
}

html[data-theme="dark"] .nav-item.active {
    background: #3730A3 !important;
    color: #DDD6FE !important;
}

html[data-theme="dark"] .logo-text h3,
html[data-theme="dark"] .top-header h1,
html[data-theme="dark"] .user-details strong {
    color: #F1F5F9 !important;
}

html[data-theme="dark"] .logo-text span,
html[data-theme="dark"] .user-details span {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .mgmt-page,
html[data-theme="dark"] .mgmt-card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .report-card,
html[data-theme="dark"] .stat-box,
html[data-theme="dark"] .cash-card,
html[data-theme="dark"] .cat-card,
html[data-theme="dark"] .item-card,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .pos-wrapper,
html[data-theme="dark"] .pos-cart,
html[data-theme="dark"] .pos-topbar {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

html[data-theme="dark"] .mgmt-table thead th {
    background: #0F172A !important;
    color: #94A3B8 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .mgmt-table tbody td {
    color: #E2E8F0 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .mgmt-table tbody tr:hover {
    background: #334155 !important;
}

html[data-theme="dark"] .mgmt-table-wrap {
    background: #1E293B !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #0F172A !important;
    color: #F1F5F9 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] input:focus {
    border-color: #A78BFA !important;
}

html[data-theme="dark"] .modal-box {
    background: #1E293B !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .modal-header h3,
html[data-theme="dark"] .modal-body label {
    color: #F1F5F9 !important;
}

html[data-theme="dark"] .modal-header {
    border-color: #334155 !important;
}

html[data-theme="dark"] .modal-footer {
    border-color: #334155 !important;
}

html[data-theme="dark"] .mgmt-page-header h1,
html[data-theme="dark"] .mgmt-page-header p,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .recipes-list-title {
    color: #F1F5F9 !important;
}

html[data-theme="dark"] .mgmt-page-header p {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .stat-value {
    color: #F1F5F9 !important;
}

html[data-theme="dark"] .stat-label {
    color: #94A3B8 !important;
}

html[data-theme="dark"] .cart-header,
html[data-theme="dark"] .cart-line,
html[data-theme="dark"] .cart-totals {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

html[data-theme="dark"] .cart-line {
    background: #0F172A !important;
}

html[data-theme="dark"] .pos-item-card {
    background: #1E293B !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .pos-item-name {
    color: #F1F5F9 !important;
}

html[data-theme="dark"] .header-btn {
    background: #334155 !important;
    color: #F1F5F9 !important;
}

html[data-theme="dark"] .theme-btn {
    background: linear-gradient(135deg, #1E293B, #334155) !important;
    color: #FBBF24 !important;
}

html[data-theme="dark"] .lang-btn {
    background: linear-gradient(135deg, #312E81, #3730A3) !important;
    color: #C7D2FE !important;
}

html[data-theme="dark"] .time-chip {
    background: #334155 !important;
    color: #94A3B8 !important;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
/* ═══════════════════════════════════════════════════════
   Payment Error Box — Beautiful design
   ═══════════════════════════════════════════════════════ */

.payment-error-box {
    display: flex;
    gap: 14px;
    background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
    border: 2px solid #FCA5A5;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: right;
    direction: rtl;
    animation: errorShake 0.4s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.payment-error-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #DC2626;
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.payment-error-content {
    flex: 1;
    min-width: 0;
}

.payment-error-content strong {
    display: block;
    font-size: 14px;
    color: #991B1B;
    font-weight: 800;
    margin-bottom: 8px;
}

.payment-error-message {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 13px;
    color: #7F1D1D;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    font-weight: 600;
}

/* Dark mode */
html[data-theme="dark"] .payment-error-box {
    background: linear-gradient(135deg, #450A0A, #7F1D1D);
    border-color: #DC2626;
}

html[data-theme="dark"] .payment-error-content strong {
    color: #FECACA;
}

html[data-theme="dark"] .payment-error-message {
    color: #FCA5A5;
}
/* ???????????????????????????????????????????????????????
   User Cards
   ??????????????????????????????????????????????????????? */

.user-card {
    background: #FFF;
    border: 2px solid #E8EAF0;
    border-top-width: 5px;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.2s;
}

.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.user-avatar-circle {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.user-role-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.user-card-body h3 {
    font-size: 17px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 4px;
}

.user-email {
    font-size: 12px;
    color: #787891;
    font-weight: 600;
    word-break: break-all;
}

.user-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #F0F2F7;
}

.user-last-login {
    font-size: 11px;
    color: #94A3B8;
    font-weight: 600;
}

.user-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #F0F2F7;
}

.user-card-actions .btn-sm {
    flex: 1;
}

/* Dark mode */
html[data-theme="dark"] .user-card {
    background: #1E293B;
    border-color: #334155;
}

html[data-theme="dark"] .user-card-body h3 {
    color: #F1F5F9;
}

html[data-theme="dark"] .user-email {
    color: #94A3B8;
}

html[data-theme="dark"] .user-card-footer {
    border-color: #334155;
}
/* ═══════════════════════════════════════════════════════
   Usage Bar (Team members limit)
   ═══════════════════════════════════════════════════════ */

.usage-bar-wrap {
    background: #FFF;
    border: 1px solid #E8EAF0;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 20px;
}

.usage-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.usage-bar-label {
    font-size: 13px;
    font-weight: 800;
    color: #18182B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-bar-count {
    font-size: 13px;
    color: #787891;
    font-weight: 700;
}

.usage-bar-count strong {
    color: #7C3AED;
    font-size: 16px;
}

.usage-bar-track {
    height: 10px;
    background: #F0F2F7;
    border-radius: 100px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7C3AED, #A78BFA);
    border-radius: 100px;
    transition: width 0.4s ease;
}

.usage-bar-fill.warning {
    background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

.usage-bar-fill.full {
    background: linear-gradient(90deg, #EF4444, #F87171);
}

.usage-bar-hint {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #787891;
}

.usage-bar-hint.warning {
    color: #DC2626;
}

/* Disabled button state */
.btn-new:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #94A3B8 !important;
    box-shadow: none !important;
}

.btn-new:disabled:hover {
    transform: none !important;
}

/* Dark mode */
html[data-theme="dark"] .usage-bar-wrap {
    background: #1E293B;
    border-color: #334155;
}

html[data-theme="dark"] .usage-bar-label {
    color: #F1F5F9;
}

html[data-theme="dark"] .usage-bar-track {
    background: #0F172A;
}
/* ???????????????????????????????????????????????????????
   TOP NAVBAR ï؟½ New Layout
   ??????????????????????????????????????????????????????? */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-main, #F5F6FA);
}

/* ??????? Top Navbar ??????? */
.topnav {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 68px;
    padding: 0 20px;
    background: #FFFFFF;
    border-bottom: 1px solid #E8EAF0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

/* ??????? Logo ??????? */
.topnav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    padding: 6px 12px 6px 6px;
    border-radius: 12px;
    transition: all 0.15s;
    margin-left: 8px;
}

.topnav-logo:hover {
    background: #F5F6FA;
}

.topnav-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

.topnav-logo-text {
    font-weight: 800;
    font-size: 15px;
    color: #18182B;
    letter-spacing: -0.3px;
}

/* ??????? Menu ??????? */
.topnav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.topnav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    color: #4A5568;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    position: relative;
}

.topnav-item:hover {
    background: #F5F6FA;
    color: #7C3AED;
}

.topnav-item.active {
    background: #F3E8FF;
    color: #7C3AED;
}

.topnav-item svg {
    flex-shrink: 0;
}

.topnav-item .caret {
    margin-left: 2px;
    opacity: 0.6;
    transition: transform 0.2s;
}

/* ??????? Groups ??????? */
.topnav-group {
    position: relative;
}

.topnav-group-btn {
    position: relative;
}

.topnav-group:hover .topnav-group-btn {
    background: #F5F6FA;
    color: #7C3AED;
}

.topnav-group.active .topnav-group-btn {
    background: #F3E8FF;
    color: #7C3AED;
}

.topnav-group.active .topnav-group-btn .caret {
    transform: rotate(180deg);
}

/* ??????? Dropdown ??????? */
.topnav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: #FFF;
    border: 1px solid #E8EAF0;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 200;
}

.topnav-group:hover .topnav-dropdown,
.topnav-dropdown.show,
.topnav-user.open .topnav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ??????? Dropdown Items ??????? */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #18182B;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    width: 100%;
    text-align: right;
}

.dropdown-item:hover {
    background: #F5F6FA;
}

.dropdown-item.active {
    background: #F3E8FF;
}

.dropdown-item.danger:hover {
    background: #FEE2E2;
}

.dd-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.dd-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    text-align: right;
}

.dd-content strong {
    font-size: 13px;
    font-weight: 800;
    color: #18182B;
}

.dd-content small {
    font-size: 11px;
    color: #94A3B8;
    font-weight: 600;
}

/* ??????? Right Actions ??????? */
.topnav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.topnav-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #4A5568;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    font-weight: 800;
    font-size: 12px;
    position: relative;
}

.topnav-icon-btn:hover {
    background: #F5F6FA;
    color: #7C3AED;
    transform: translateY(-1px);
}

.theme-btn {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #D97706;
}

.theme-btn:hover {
    background: linear-gradient(135deg, #FDE68A, #FCD34D);
    color: #B45309;
}

.lang-btn {
    background: linear-gradient(135deg, #F3E8FF, #E9D5FF);
    color: #7C3AED;
}

.lang-btn:hover {
    background: linear-gradient(135deg, #E9D5FF, #D8B4FE);
    color: #6D28D9;
}

.lang-code {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

/* ??????? User Button ??????? */
.topnav-user {
    position: relative;
}

.topnav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.topnav-user-btn:hover {
    background: #F5F6FA;
}

.user-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

.user-meta-mini {
    display: flex;
    flex-direction: column;
    text-align: right;
    min-width: 0;
}

.user-meta-mini strong {
    font-size: 13px;
    font-weight: 800;
    color: #18182B;
    white-space: nowrap;
}

.user-meta-mini small {
    font-size: 10px;
    color: #94A3B8;
    font-weight: 700;
    text-transform: uppercase;
}

/* User Dropdown */
.user-dropdown {
    left: auto;
    right: 0;
    min-width: 260px;
}

.user-dd-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #F8F9FC;
    border-radius: 10px;
    margin-bottom: 6px;
}

.user-avatar-big {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}

.user-dd-header > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    text-align: right;
}

.user-dd-header strong {
    font-size: 13px;
    font-weight: 800;
    color: #18182B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dd-header small {
    font-size: 11px;
    color: #94A3B8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dd-divider {
    height: 1px;
    background: #F0F2F7;
    margin: 6px 0;
}

/* ??????? Page Wrapper ??????? */
.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px 12px;
    background: transparent;
    flex-shrink: 0;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: #18182B;
    letter-spacing: -0.5px;
}

.page-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px 30px 30px;
}

/* ??????? RTL Adjustments ??????? */
[dir="rtl"] .topnav {
    direction: rtl;
}

[dir="rtl"] .topnav-logo {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .topnav-actions {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .topnav-dropdown {
    left: auto;
    right: 0;
}

[dir="rtl"] .user-dropdown {
    left: 0;
    right: auto;
}

[dir="rtl"] .dropdown-item,
[dir="rtl"] .dd-content,
[dir="rtl"] .user-meta-mini,
[dir="rtl"] .user-dd-header > div:last-child {
    text-align: right;
}

[dir="rtl"] .page-header h1 {
    text-align: right;
}

/* ??????? Dark Mode ??????? */
html[data-theme="dark"] .app-shell {
    background: #0F172A;
}

html[data-theme="dark"] .topnav {
    background: #1E293B;
    border-bottom-color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .topnav-logo-text,
html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .user-meta-mini strong,
html[data-theme="dark"] .dd-content strong {
    color: #F1F5F9;
}

html[data-theme="dark"] .topnav-item {
    color: #CBD5E1;
}

html[data-theme="dark"] .topnav-item:hover,
html[data-theme="dark"] .topnav-group:hover .topnav-group-btn,
html[data-theme="dark"] .topnav-icon-btn:hover,
html[data-theme="dark"] .topnav-user-btn:hover,
html[data-theme="dark"] .topnav-logo:hover {
    background: #334155;
}

html[data-theme="dark"] .topnav-item.active,
html[data-theme="dark"] .topnav-group.active .topnav-group-btn {
    background: #3730A3;
    color: #DDD6FE;
}

html[data-theme="dark"] .topnav-dropdown {
    background: #1E293B;
    border-color: #334155;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .dropdown-item {
    color: #E2E8F0;
}

html[data-theme="dark"] .dropdown-item:hover {
    background: #334155;
}

html[data-theme="dark"] .dropdown-item.active {
    background: #3730A3;
}

html[data-theme="dark"] .dropdown-item.danger:hover {
    background: #450A0A;
}

html[data-theme="dark"] .dd-content small {
    color: #64748B;
}

html[data-theme="dark"] .user-dd-header {
    background: #0F172A;
}

html[data-theme="dark"] .user-dd-divider {
    background: #334155;
}

html[data-theme="dark"] .topnav-icon-btn {
    color: #CBD5E1;
}

html[data-theme="dark"] .theme-btn {
    background: linear-gradient(135deg, #1E293B, #334155);
    color: #FBBF24;
}

html[data-theme="dark"] .lang-btn {
    background: linear-gradient(135deg, #312E81, #3730A3);
    color: #C7D2FE;
}

html[data-theme="dark"] .time-chip {
    background: #334155;
    color: #94A3B8;
}

/* ??????? Responsive ??????? */
@media (max-width: 1200px) {
    .topnav-item span:not(.lang-code) {
        display: none;
    }
    .topnav-item {
        padding: 10px 12px;
    }
    .topnav-item .caret {
        display: none;
    }
    .user-meta-mini {
        display: none;
    }
}

@media (max-width: 768px) {
    .topnav {
        padding: 0 12px;
    }
    .topnav-logo-text {
        display: none;
    }
    .page-header {
        padding: 16px 20px 10px;
    }
    .content-area {
        padding: 10px 20px 20px;
    }
    .topnav-dropdown {
        min-width: 240px;
    }
}
/* ???????????????????????????????????????????????????????
   Party Cards (Customers / Suppliers)
   ??????????????????????????????????????????????????????? */

.party-card {
    background: #FFF;
    border: 2px solid #E8EAF0;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.party-card:hover {
    border-color: #7C3AED;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(124,58,237,0.1);
}

.party-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.party-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.party-card-actions {
    display: flex;
    gap: 6px;
}

.party-card-body h3 {
    font-size: 17px;
    font-weight: 800;
    color: #18182B;
    margin-bottom: 6px;
}

.party-meta {
    font-size: 12px;
    color: #787891;
    font-weight: 600;
    margin-bottom: 2px;
}

.party-balance {
    background: #F8F9FC;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.party-balance-label {
    font-size: 11px;
    font-weight: 800;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.party-balance-value {
    font-size: 18px;
    font-weight: 800;
    color: #16A34A;
}

.party-balance-value.debt {
    color: #DC2626;
}

.party-balance-value.credit {
    color: #2563EB;
}

.party-card-footer {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #F0F2F7;
}

.party-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.party-btn.pay {
    background: #DCFCE7;
    color: #16A34A;
}

.party-btn.pay:hover:not(:disabled) {
    background: #16A34A;
    color: #FFF;
}

.party-btn.pay:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.party-btn.statement {
    background: #F3E8FF;
    color: #7C3AED;
}

.party-btn.statement:hover {
    background: #7C3AED;
    color: #FFF;
}

/* Balance Preview in Payment Modal */
.party-balance-preview {
    background: linear-gradient(135deg, #7C3AED, #A78BFA);
    color: #FFF;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    text-align: center;
}

.party-balance-preview-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
    margin-bottom: 6px;
}

.party-balance-preview-value {
    font-size: 28px;
    font-weight: 900;
}

/* Statement Summary */
.statement-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.statement-summary-box {
    background: #F8F9FC;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.statement-summary-box.highlight {
    background: linear-gradient(135deg, #F3E8FF, #E9D5FF);
}

.statement-summary-label {
    font-size: 10px;
    font-weight: 800;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.statement-summary-value {
    font-size: 16px;
    font-weight: 800;
    color: #18182B;
}

.statement-summary-value.debit {
    color: #DC2626;
}

.statement-summary-value.credit {
    color: #16A34A;
}

/* Badges */
.badge-sale,
.badge-purchase {
    background: #FEE2E2;
    color: #DC2626;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
}

.badge-payment {
    background: #DCFCE7;
    color: #16A34A;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
}

/* Dropdown separator */
.dropdown-separator {
    height: 1px;
    background: #F0F2F7;
    margin: 6px 4px;
}

@media (max-width: 900px) {
    .statement-summary {
        grid-template-columns: 1fr 1fr;
    }
}

/* Dark mode */
html[data-theme="dark"] .party-card {
    background: #1E293B;
    border-color: #334155;
}

html[data-theme="dark"] .party-card-body h3 {
    color: #F1F5F9;
}

html[data-theme="dark"] .party-balance {
    background: #0F172A;
}

html[data-theme="dark"] .party-card-footer {
    border-color: #334155;
}

html[data-theme="dark"] .statement-summary-box {
    background: #0F172A;
}

html[data-theme="dark"] .statement-summary-value {
    color: #F1F5F9;
}

html[data-theme="dark"] .dropdown-separator {
    background: #334155;
}
/* === POS Credit Sale / Customer Modal === */
.pay-opt.credit { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.customer-select-modal { max-width: 560px; max-height: 85vh; display: flex; flex-direction: column; }
.customer-select-modal .modal-body { overflow-y: auto; flex: 1; }
.customer-total-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; margin-bottom: 12px; color: #9a3412; font-size: 15px; }
.customer-total-bar strong { font-size: 18px; }
.customer-list { max-height: 340px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 8px; }
.customer-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #e5e7eb; cursor: pointer; transition: background 0.15s; }
.customer-row:last-child { border-bottom: none; }
.customer-row:hover { background: #f3f4f6; }
.customer-name { font-weight: 600; font-size: 15px; }
.customer-phone { font-size: 13px; color: #6b7280; margin-top: 2px; }
.customer-row-balance { text-align: right; font-size: 13px; }
.customer-row-balance.has-debt .balance-value { color: #dc2626; font-weight: 700; }
.customer-row-balance .balance-label { color: #6b7280; display: block; }
.customer-row-balance .balance-value { font-weight: 600; }
.customer-empty { text-align: center; padding: 30px 10px; color: #6b7280; }
/* === POS Tables Bar === */
.pos-tables-bar { display: flex; gap: 8px; padding: 8px 16px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; overflow-x: auto; }
.table-pill { padding: 8px 16px; border-radius: 20px; border: 2px solid #d1d5db; background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap; transition: all 0.15s; }
.table-pill:hover { transform: translateY(-1px); }
.table-pill.active { border-color: #2563eb; background: #dbeafe; color: #1e40af; }
.table-pill.free { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.table-pill.busy { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.table-pill.reserved { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.btn-send { background: #f59e0b; color: #fff; padding: 10px 16px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }



/* ═══════════ TABLE OPEN ORDER INFO ═══════════ */
.table-open-order {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    text-align: center;
}
.table-open-items {
    font-size: 12px;
    color: #991b1b;
    font-weight: 600;
}
.table-open-total {
    font-size: 16px;
    color: #b91c1c;
    font-weight: 700;
    margin-top: 2px;
}

/* ═══════════ ORDER DETAIL MODAL ═══════════ */
.order-detail-modal {
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.order-detail-modal .modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 16px 20px;
}
.order-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}
.order-details-wrapper {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.order-details-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.order-details-table th {
    background: #f9fafb;
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}
.order-details-table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
}
.order-details-table tr:last-child td { border-bottom: none; }
.order-details-table .ta-center { text-align: center; }
.order-details-table .ta-right { text-align: right; }

.order-totals {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
}
.order-total-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: #374151;
}
.order-total-line.grand {
    border-top: 2px solid #d1d5db;
    margin-top: 6px;
    padding-top: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.btn-settle {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: transform 0.15s;
}
.btn-settle:hover:not(:disabled) { transform: translateY(-1px); }
.btn-settle:disabled { opacity: 0.5; cursor: not-allowed; }

.settle-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.settle-label {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
    margin: 0;
}
.settle-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.settle-btn {
    padding: 16px 10px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    transition: transform 0.15s;
}
.settle-btn:hover:not(:disabled) { transform: translateY(-1px); }
.settle-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.settle-btn.cash { background: linear-gradient(135deg, #22c55e, #16a34a); }
.settle-btn.visa { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.settle-btn.credit { background: linear-gradient(135deg, #f59e0b, #d97706); }

.settle-cancel {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.settle-cancel:hover:not(:disabled) { background: #f9fafb; }


/* ═══════════ PAYMENT MODAL — CUSTOMER SEARCH ═══════════ */
.pay-customer-section {
    margin: 14px 0;
    text-align: left;
}
.pay-customer-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}
.pay-customer-search {
    position: relative;
}
.pay-customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}
.pay-customer-option {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.pay-customer-option:last-child { border-bottom: none; }
.pay-customer-option:hover { background: #f9fafb; }
.pay-customer-option-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
.pay-customer-option-phone {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
.pay-customer-loading,
.pay-customer-empty {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}
.pay-customer-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
}
.pay-customer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.pay-customer-name {
    font-size: 14px;
    font-weight: 600;
    color: #065f46;
}
.pay-customer-phone {
    font-size: 12px;
    color: #047857;
}
.pay-customer-clear {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    transition: transform 0.15s;
}


/* ═══════════ PURCHASE MODAL ═══════════ */
.purchase-modal {
    max-width: 800px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}
.purchase-modal .modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 18px 22px;
}

.purchase-meta-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 700px) {
    .purchase-meta-grid { grid-template-columns: 1fr 1fr; }
}

.purchase-search-section {
    margin-bottom: 14px;
}
.purchase-search-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.purchase-search-box { position: relative; }
.purchase-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 50;
    margin-top: 4px;
}
.purchase-search-option {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.purchase-search-option:last-child { border-bottom: none; }
.purchase-search-option:hover { background: #f9fafb; }
.purchase-search-option-main {
    display: flex;
    align-items: center;
    gap: 8px;
}
.purchase-search-option-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
.purchase-search-option-type {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
}
.purchase-search-option-type.type-ing { background: #dbeafe; color: #1e40af; }
.purchase-search-option-type.type-item { background: #fef3c7; color: #92400e; }
.purchase-search-option-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
    display: flex;
    gap: 12px;
}
.purchase-search-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

.purchase-lines {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}
.purchase-lines-table {
    width: 100%;
    border-collapse: collapse;
}
.purchase-lines-table th {
    background: #f9fafb;
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    color: #374151;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}
.purchase-lines-table td {
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.purchase-lines-table tr:last-child td { border-bottom: none; }
.line-name { font-weight: 600; color: #111827; font-size: 13px; }
.line-type { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.line-input {
    padding: 5px 8px !important;
    font-size: 13px !important;
    text-align: right;
}
.line-total {
    font-weight: 700;
    color: #111827;
    text-align: right;
}
.line-remove {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0 6px;
}
.line-remove:hover { transform: scale(1.2); }

.purchase-lines-empty {
    padding: 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    margin-bottom: 16px;
}

.purchase-totals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
@media (max-width: 700px) {
    .purchase-totals-grid { grid-template-columns: 1fr 1fr; }
}

.purchase-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 14px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
    color: #374151;
}
.summary-row.grand {
    border-top: 2px solid #d1d5db;
    margin-top: 6px;
    padding-top: 10px;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}
.summary-row.remaining {
    font-size: 14px;
    color: #6b7280;
    padding-top: 4px;
}
.summary-row.remaining.has-remaining {
    color: #dc2626;
    font-weight: 700;
}

.purchase-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.btn-save-draft {
    background: #f3f4f6;
    color: #374151;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}


/* ═══════════ Z-REPORT ═══════════ */
.zreport-page {
    max-width: 900px;
    margin: 0 auto;
}

.zreport-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.zreport-date {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.zreport-print {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
}

.zreport-print-area {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px 40px;
    margin-top: 20px;
}

.zr-header {
    text-align: center;
    border-bottom: 3px double #374151;
    padding-bottom: 14px;
    margin-bottom: 20px;
}
.zr-title {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    letter-spacing: 2px;
}
.zr-date {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.zr-section {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
.zr-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d1d5db;
}
.zr-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    margin: 10px 0 6px;
    letter-spacing: 1px;
}

.zr-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
    color: #374151;
}
.zr-row.highlight {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}
.zr-row.bold {
    font-weight: 700;
    color: #111827;
    border-top: 1px dashed #d1d5db;
    margin-top: 6px;
    padding-top: 8px;
}
.zr-row.grand {
    font-size: 20px;
    font-weight: 800;
    color: #16a34a;
    padding: 12px 0 4px;
}
.zr-row .positive { color: #16a34a; font-weight: 600; }
.zr-row .negative { color: #dc2626; font-weight: 600; }
.zr-row .bold { font-weight: 700; color: #111827; }

.zr-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 10px 0;
}
.zr-divider-strong {
    height: 2px;
    background: #374151;
    margin: 14px 0;
}

.zr-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}
.zr-table th {
    background: #f3f4f6;
    padding: 8px 12px;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid #d1d5db;
}
.zr-table td {
    padding: 8px 12px;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
}
.zr-table tr:last-child td { border-bottom: none; }

.zr-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px dashed #d1d5db;
    font-size: 12px;
    color: #9ca3af;
}

/* ═══════════ PRINT — Z-REPORT ONLY ═══════════ */
@media print {
    /* 1) اخفي كل حاجة في الصفحة */
    body * {
        visibility: hidden;
    }

    /* 2) أظهر بس منطقة التقرير */
    .zreport-print-area,
    .zreport-print-area * {
        visibility: visible;
    }

    /* 3) حط التقرير فوق الصفحة */
    .zreport-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 15mm;
        margin: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: #fff !important;
    }

    /* 4) اخفي كل عناصر الواجهة */
    .topnav,
    .page-header,
    .no-print,
    .zreport-actions {
        display: none !important;
    }

    /* 5) اخلفية بيضاء */
    html, body {
        background: #fff !important;
        overflow: visible !important;
    }

    /* 6) الأقسام ما تتقطعش */
    .zr-section {
        break-inside: avoid;
        page-break-inside: avoid;
        background: #fff !important;
        border: 1px solid #ddd;
    }

    .zr-table {
        break-inside: avoid;
    }

    .zr-header {
        margin-top: 0;
    }

    /* 7) الألوان تطبع صح */
    .zr-section,
    .zr-row,
    .zr-table,
    .zr-title,
    .zr-date,
    .zr-section-title {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 8) الحجم */
    @page {
        margin: 10mm;
        size: A4;
    }
}


/* ═══════════ REFUND & STATUS ═══════════ */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-closed { background: #DCFCE7; color: #15803D; }
.status-refunded { background: #FEE2E2; color: #B91C1C; }
.status-open { background: #FEF3C7; color: #92400E; }

.row-refunded {
    opacity: 0.65;
    background: #FAFAFA;
}

.btn-refund {
    background: #F59E0B !important;
    color: #fff !important;
}
.btn-refund:hover {
    background: #D97706 !important;
}

/* ═══════════ REFUND MODAL ═══════════ */
.refund-modal {
    max-width: 520px;
}
.refund-warning {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: 10px;
    margin-bottom: 16px;
}
.refund-warning-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F59E0B;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}
.refund-warning-text {
    font-size: 13px;
    color: #78350F;
    line-height: 1.5;
}
.refund-warning-text strong { font-weight: 800; }
.refund-warning-text ul {
    margin: 6px 0 0 16px;
    padding: 0;
}
.refund-warning-text li { margin-bottom: 3px; }

.refund-reason-input {
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
}

.btn-refund-confirm {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s;
}
.btn-refund-confirm:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
.btn-refund-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

.refund-banner {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
}
.refund-banner-title {
    font-weight: 800;
    color: #991B1B;
    font-size: 14px;
    margin-bottom: 6px;
}
.refund-banner-reason {
    font-size: 13px;
    color: #7F1D1D;
    margin-bottom: 3px;
}
.refund-banner-date {
    font-size: 12px;
    color: #9CA3AF;
}
.btn-cancel-order {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.btn-cancel-order:hover { background: #b91c1c; }
.btn-cancel-order:disabled { opacity: .5; cursor: not-allowed; }
.btn-save-draft:hover:not(:disabled) { background: #e5e7eb; }
.btn-save-draft:disabled { opacity: 0.5; cursor: not-allowed; }
.pay-customer-clear:hover { transform: scale(1.2); }

.btn-cancel-order {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all .15s;
}
.btn-cancel-order:hover { background: #fef2f2; }
.btn-cancel-order:disabled { opacity: .5; cursor: not-allowed; }

/* Cancel Modal */
.cancel-modal {
    background: var(--bg-card, #fff);
    color: var(--text-primary, #111);
    border-radius: 14px;
    padding: 28px 26px 22px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    text-align: center;
    animation: popIn .18s ease-out;
}
@keyframes popIn {
    from { transform: scale(.95); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.cancel-modal-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
    font-size: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border: 2px solid #fecaca;
}

.cancel-modal h2 {
    font-size: 20px;
    margin: 0 0 8px;
    font-weight: 700;
}

.cancel-modal-desc {
    font-size: 14px;
    color: var(--text-secondary, #666);
    margin: 0 0 18px;
    line-height: 1.5;
}

.cancel-modal-summary {
    background: var(--bg-soft, #f8f9fb);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    text-align: left;
}
.cancel-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}
.cancel-row span { color: var(--text-secondary, #666); }
.cancel-row strong { color: var(--text-primary, #111); font-weight: 600; }
.cancel-row.total {
    border-top: 1px dashed #ddd;
    margin-top: 6px;
    padding-top: 10px;
    font-size: 15px;
}
.cancel-row.total strong { color: #dc2626; }

.cancel-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.cancel-modal-actions button {
    flex: 1;
    padding: 11px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: all .15s;
}
.btn-keep {
    background: #f1f5f9;
    color: #334155;
}
.btn-keep:hover { background: #e2e8f0; }
.btn-confirm-cancel {
    background: #dc2626;
    color: #fff;
}
.btn-confirm-cancel:hover { background: #b91c1c; }
.btn-confirm-cancel:disabled,
.btn-keep:disabled { opacity: .6; cursor: not-allowed; }

.audit-list { display: flex; flex-direction: column; gap: 10px; }
.audit-row {
    display: flex; gap: 14px; padding: 14px 16px;
    background: #fff; border: 1px solid #E5E7EB; border-radius: 10px;
    align-items: flex-start;
}
.audit-badge {
    padding: 6px 12px; border-radius: 6px; font-size: 12px;
    font-weight: 700; color: #fff; min-width: 80px; text-align: center;
}
.audit-refund { background: #EF4444; }
.audit-cancel { background: #F59E0B; }
.audit-pin { background: #7C3AED; }
.audit-default { background: #64748B; }
.audit-info { flex: 1; }
.audit-main { font-size: 14px; margin-bottom: 4px; }
.audit-main span { color: #64748B; }
.audit-details { font-size: 13px; color: #334155; margin-bottom: 4px; }
.audit-meta { font-size: 12px; color: #94A3B8; }

/* RESPONSIVE */

/* Tablet & below (≤ 1024px) */
@media (max-width: 1024px) {
    .pos-main { flex-direction: column; }
    .pos-items-area { width: 100%; }
    .pos-cart {
        width: 100%;
        max-height: 45vh;
        border-top: 2px solid #E5E7EB;
    }
    .pos-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

/* Mobile (≤ 640px) */
@media (max-width: 640px) {
    .pos-topbar { flex-direction: column; gap: 8px; padding: 8px; }
    .pos-categories { overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
    .cat-btn { flex-shrink: 0; font-size: 12px; padding: 6px 10px; }
    .pos-tables-bar { overflow-x: auto; white-space: nowrap; padding: 6px; }
    .table-pill { flex-shrink: 0; font-size: 12px; padding: 6px 10px; }
    .pos-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 6px;
        padding: 6px;
    }
    .pos-item-card { padding: 8px; }
    .pos-item-name { font-size: 12px; }
    .pos-item-price { font-size: 13px; }
    .cart-actions { flex-wrap: wrap; gap: 6px; }
    .cart-actions button { font-size: 12px; padding: 8px; }
    .payment-modal { width: 95%; padding: 16px; }
    .payment-options { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* صفحات الإدارة */
    .mgmt-page { padding: 12px; }
    .mgmt-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .mgmt-page-header h1 { font-size: 20px; }
    .header-actions { width: 100%; flex-wrap: wrap; }

    .mgmt-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-box { padding: 10px; }
    .stat-value { font-size: 16px; }

    /* الكروت */
    .card-grid { grid-template-columns: 1fr; gap: 10px; }

    /* الجداول */
    .zr-table { font-size: 12px; }
    .zr-table th, .zr-table td { padding: 6px 4px; }
    .zr-section { padding: 12px; }
    .zr-row { font-size: 13px; }

    /* الـ Modals */
    .modal-box { width: 95%; max-width: 95%; padding: 16px; }
    .modal-wide { width: 95%; }
}

/* شاشات صغيرة جداً */
@media (max-width: 480px) {
    .mgmt-stats { grid-template-columns: 1fr; }
    .topnav-menu { display: none; }
    .topnav-actions { gap: 6px; }
}

/* ═══════════ MOBILE NAV ═══════════ */

.topnav-hamburger {
    display: none;
    background: transparent;
    border: none;
    color: #1F2937;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}
.topnav-hamburger:hover { background: #F3F4F6; }

@media (max-width: 900px) {
    .topnav {
        flex-wrap: wrap;
        padding: 8px 12px;
    }

    .topnav-hamburger {
        display: flex;
        order: 2;
        margin-inline-start: auto;
    }

    .topnav-logo {
        order: 1;
    }

    .topnav-actions {
        order: 3;
    }

    /* اخفي القوائم على الموبايل */
    .topnav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        order: 10;
        padding: 12px 0 0;
        border-top: 1px solid #E5E7EB;
        margin-top: 8px;
    }

    /* اظهرها لما mobile-open */
    .topnav.mobile-open .topnav-menu {
        display: flex !important;
    }

    /* عناصر القائمة بالطول */
    .topnav-menu .topnav-item {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 14px;
        border-radius: 8px;
        font-size: 15px;
    }

    /* القوائم المنسدلة (dropdowns) */
    .topnav-menu .topnav-dropdown {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        background: #F9FAFB;
        border-radius: 8px;
        margin: 4px 0 8px;
        padding: 6px;
        display: none;
    }

    .topnav-menu .topnav-dropdown.show {
        display: block !important;
    }

    /* dropdown items */
    .topnav-menu .dropdown-item {
        padding: 10px 12px;
    }

    /* topnav-user مايظهرش على الموبايل (بدل ما يلخبط) */
    .topnav-user .user-meta-mini { display: none; }

    /* لما القائمة مفتوحة، اخفي الـ actions الزيادة */
    .topnav.mobile-open .topnav-actions .theme-btn,
    .topnav.mobile-open .topnav-actions .lang-btn {
        display: flex;
    }
}

/* شاشات صغيرة جداً */
@media (max-width: 480px) {
    .topnav-logo-text span { font-size: 16px; }
    .topnav { padding: 6px 8px; gap: 6px; }
    .topnav-actions { gap: 4px; }
    .topnav-icon-btn { padding: 6px; }
}

/* ═══════════ MOBILE NAV ═══════════ */

.topnav-hamburger {
    display: none;
    background: transparent;
    border: none;
    color: #1F2937;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}
.topnav-hamburger:hover { background: #F3F4F6; }

@media (max-width: 900px) {
    .topnav {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
        height: auto;
        min-height: 56px;
    }

    .topnav-logo { flex-shrink: 0; }
    .topnav-hamburger { display: flex; margin-inline-start: auto; }
    .topnav-actions { flex-shrink: 0; margin-inline-start: 0 !important; }

    /* اخفي القوائم في الوضع العادي */
    .topnav-menu {
        display: none;
    }

    /* لما القائمة مفتوحة */
    .topnav.mobile-open .topnav-menu {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        order: 99;
        flex-basis: 100%;
        padding: 8px 0 12px;
        border-top: 1px solid #E5E7EB;
        margin-top: 8px;
        gap: 2px;
        background: #fff;
    }

    /* كل زر أو مجموعة: عرض كامل + محتوى أفقي */
    .topnav.mobile-open .topnav-menu .topnav-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding: 12px 14px;
        border-radius: 8px;
        font-size: 15px;
        text-align: start;
        gap: 10px;
        background: transparent;
        color: #1F2937;
    }

    .topnav.mobile-open .topnav-menu .topnav-item span {
        display: inline !important;
        flex: 1;
    }

    .topnav.mobile-open .topnav-menu .topnav-item svg {
        flex-shrink: 0;
    }

    .topnav.mobile-open .topnav-menu .topnav-group {
        width: 100%;
        position: static;
        display: block;
    }

    .topnav.mobile-open .topnav-menu .topnav-group-btn {
        justify-content: space-between;
    }

    /* dropdown جوه mobile */
    .topnav.mobile-open .topnav-menu .topnav-dropdown {
        position: static !important;
        display: none;
        box-shadow: none !important;
        border: none !important;
        background: #F9FAFB;
        border-radius: 8px;
        margin: 4px 0 6px;
        padding: 6px;
        width: 100%;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .topnav.mobile-open .topnav-menu .topnav-dropdown.show {
        display: block !important;
    }

    .topnav.mobile-open .topnav-menu .dropdown-item {
        display: flex;
        flex-direction: row;
        padding: 10px 12px;
        gap: 10px;
        width: 100%;
    }

    /* الـ user mini ما يظهرش */
    .topnav-user .user-meta-mini { display: none; }
    .topnav-user .user-avatar-mini { padding: 6px; }
}

@media print {
    .no-print,
    .topnav,
    .modal-overlay > .modal-box > .modal-header,
    .modal-footer {
        display: none !important;
    }
    body, .modal-overlay, .modal-box {
        background: #fff !important;
        box-shadow: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    #delivery-report-print {
        display: block !important;
    }
}

@media print {
    /* اخفي كل حاجة */
    body * { visibility: hidden; }

    /* اظهر بس بلوك التقرير */
    #delivery-report-print,
    #delivery-report-print * {
        visibility: visible !important;
    }

    /* خلي التقرير في أول الصفحة */
    #delivery-report-print {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        padding: 10px !important;
        background: #fff !important;
    }

    /* اخفي الأزرار */
    .no-print { display: none !important; }

    /* شيل تأثيرات المودال */
    .modal-overlay {
        position: static !important;
        background: none !important;
        overflow: visible !important;
    }

    .modal-box {
        position: static !important;
        box-shadow: none !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

.delivery-report-modal {
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.delivery-report-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    max-height: calc(90vh - 130px);
}

.delivery-report-modal .modal-header,
.delivery-report-modal .modal-footer {
    flex-shrink: 0;
}

.pos-item-card {
    position: relative;
    overflow: hidden;
}

.pos-item-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 6px;
    display: block;
}

.pos-item-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7C3AED, #A855F7);
    color: #fff;
    font-size: 28px;
    font-weight: 800;
}

.pay-opt.talabat {
    background: #FFF7ED;
    border-color: #FF6B00;
}
.pay-opt.talabat:hover { background: #FFEDD5; }
.pay-opt.talabat span { color: #FF6B00; font-weight: 700; }
.pay-icon-talabat {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.pay-opt.split {
    background: #EEF2FF;
    border-color: #6366F1;
}
.pay-opt.split:hover { background: #E0E7FF; }
.pay-opt.split span { color: #6366F1; font-weight: 700; }