:root {
    --primary: #8b5cf6; /* Purple */
    --primary-hover: #7c3aed;
    --secondary: #ec4899; /* Pink */
    --success: #10b981; /* Emerald */
    --danger: #ef4444; /* Red */
    --warning: #f59e0b; /* Amber */
    --info: #3b82f6; /* Blue */
    --dark: #0f172a; /* Slate 900 */
    --light: #f8fafc; /* Slate 50 */
    --body-bg: #f8fafc; /* Slate 50 */
    --card-bg: #ffffff;
    --text-main: #334155; /* Slate 700 */
    --text-muted: #64748b; /* Slate 500 */
    --border-color: #f1f5f9; /* Slate 200 */
    --sidebar-width: 270px;
    --header-height: 75px;
    
    --sidebar-dark: #000000;
    --sidebar-active: #8b5cf6;
    
    /* Premium Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--body-bg);
    color: var(--text-main);
    overflow-x: hidden;
    font-size: 15px;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    gap: 8px;
    font-size: 0.95rem;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.5);
}
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-block { display: block; width: 100%; }

/* Login Page Specifics */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}
.login-container {
    display: flex;
    width: 1000px;
    max-width: 100%;
    min-height: 600px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}
.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    transform: rotate(30deg);
}
.login-left .brand {
    position: relative;
    z-index: 1;
}
.login-left .brand i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}
.login-left h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.login-left p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
    z-index: 1;
    position: relative;
}
.login-right {
    flex: 1;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}
.login-box h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}
.login-box p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}
.form-group {
    margin-bottom: 1.8rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}
.input-icon {
    position: relative;
}
.input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}
.input-icon input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 45px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}
.input-icon input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Dashboard Layout */
.wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.sidebar {
    width: var(--sidebar-width);
    background: #000000 !important;
    height: 100vh;
    position: fixed;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: none;
}
.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-header i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-right: 12px;
}
.sidebar-header h2 {
    font-size: 1.4rem;
    color: white;
    font-weight: 800;
}
.sidebar-menu {
    padding: 1.5rem 0;
    overflow-y: auto;
    flex: 1;
}
.menu-label {
    padding: 0 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #ffffff; /* Pure white for black background */
    font-weight: 700;
    letter-spacing: 1.2px;
    margin-bottom: 0.8rem;
    margin-top: 1.5rem;
    opacity: 0.7;
}
.menu-item {
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    color: #ffffff !important; /* Pure Bright White */
    transition: all 0.2s;
    font-weight: 600; /* Increased weight for clarity */
    margin: 0.2rem 1rem;
    border-radius: 12px;
    text-decoration: none;
}
.menu-item i {
    width: 22px;
    margin-right: 12px;
    font-size: 1.1rem;
    color: #ffffff !important; /* Pure Bright White icons */
}
.menu-item:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
}
.menu-item.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.4) !important;
}

.upgrade-box {
    margin: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    text-align: center;
    margin-top: auto;
    border: 1px solid rgba(255,255,255,0.1);
}
.upgrade-box i { font-size: 2rem; color: #fbbf24; margin-bottom: 10px; display: block; }
.upgrade-box h4 { color: white; font-size: 0.9rem; margin-bottom: 5px; font-weight: 700; }
.upgrade-box p { color: #cbd5e1; font-size: 0.75rem; margin-bottom: 15px; }
.btn-upgrade { 
    background: #8b5cf6; 
    color: white; 
    border: none; 
    padding: 10px; 
    border-radius: 8px; 
    font-size: 0.8rem; 
    font-weight: 700; 
    cursor: pointer; 
    width: 100%; 
    transition: all 0.3s;
}
.btn-upgrade:hover { background: #7c3aed; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding-bottom: 50px;
}
.topbar {
    height: var(--header-height);
    background: white;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 99;
}
.topbar-left {
    display: flex;
    align-items: center;
}
.toggle-sidebar {
    background: var(--body-bg);
    border: none;
    font-size: 1.2rem;
    color: var(--text-main);
    cursor: pointer;
    margin-right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.toggle-sidebar:hover {
    background: var(--border-color);
}
.search-bar input {
    background: var(--body-bg);
    border: 1px solid transparent;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    width: 300px;
    transition: all 0.3s;
}
.search-bar input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.topbar-icon {
    position: relative;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--body-bg);
    transition: all 0.2s;
}
.topbar-icon:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}
.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 10px;
    font-weight: 700;
    border: 2px solid white;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.user-profile:hover {
    background: var(--body-bg);
}
.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
}
.user-info h4 {
    font-size: 0.95rem;
    margin: 0;
    color: var(--dark);
}
.user-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.page-content {
    padding: 2.5rem;
    flex: 1;
    overflow-y: auto;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}
.page-title h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}
.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Premium Cards */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -12px;
}
.col-3 { width: 25%; padding: 12px; }
.col-4 { width: 33.333%; padding: 12px; }
.col-6 { width: 50%; padding: 12px; }
.col-8 { width: 66.666%; padding: 12px; }
.col-12 { width: 100%; padding: 12px; }

.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 1.8rem;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.02);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.card h3 {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
    color: var(--dark);
    font-weight: 800;
}
.stat-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}
.stat-icon {
    width: 65px;
    height: 65px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}
.icon-primary { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); color: var(--primary); }
.icon-success { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: var(--success); }
.icon-warning { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: var(--warning); }
.icon-danger { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: var(--danger); }

/* Table */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table th, .table td {
    padding: 1.2rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--body-bg);
}
.table th:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.table th:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.table td {
    font-weight: 500;
    color: var(--text-main);
}
.badge-status {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}
.status-available, .status-paid, .status-confirmed { background: #d1fae5; color: #059669; }
.status-occupied, .status-pending { background: #fee2e2; color: #dc2626; }
.status-reserved, .status-ready { background: #fef3c7; color: #d97706; }

/* POS System Styles Enhancements */
.pos-wrapper {
    display: flex;
    height: calc(100vh - var(--header-height));
    background: var(--body-bg);
}
.pos-products {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pos-cart {
    width: 420px;
    background: white;
    box-shadow: -10px 0 30px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}
.product-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.product-card:hover {
    border-color: transparent;
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -8px rgba(79, 70, 229, 0.3);
}
.product-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.02) 100%);
    pointer-events: none;
}
/* --- Responsive Media Queries --- */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
    .col-3 { width: 50%; }
    .col-4 { width: 50%; }
    .login-container { width: 95%; }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 270px; /* Width when drawer is open */
        --header-height: 65px;
    }

    body {
        font-size: 14px;
    }

    /* Sidebar Drawer Logic */
    .sidebar {
        left: -100%; /* Hidden by default */
        width: var(--sidebar-width);
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    }
    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    .topbar {
        padding: 0 1rem;
    }

    /* Login Page Stacking */
    .login-container {
        flex-direction: column;
        min-height: auto;
        height: auto;
    }
    .login-left {
        padding: 2.5rem 2rem;
        text-align: center;
    }
    .login-left h1 { font-size: 2rem; }
    .login-left .brand i { font-size: 2.5rem; }
    
    .login-right {
        padding: 2.5rem 2rem;
    }
    .login-box h2 { font-size: 1.8rem; }

    /* Grid System for Mobile */
    .col-3, .col-4, .col-6, .col-8 {
        width: 100%;
    }

    .page-content {
        padding: 1.2rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 1.5rem;
    }

    /* Stat Cards */
    .stat-card {
        padding: 1.2rem;
    }
    .stat-info h3 { font-size: 1.5rem; }
    .stat-icon { width: 50px; height: 50px; font-size: 1.5rem; }

    /* Tables Mobile View */
    .table-responsive {
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
    }
    .table th, .table td {
        padding: 0.8rem;
    }
    .table thead {
        /* Optional: hide headers if you use data-label, 
           but for simplicity, we'll keep horizontal scroll */
    }

    /* POS System Mobile */
    .pos-wrapper {
        flex-direction: column;
        height: auto;
    }
    .pos-cart {
        width: 100%;
        height: 500px;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .search-bar input {
        width: 180px;
    }

    .user-info {
        display: none; /* Hide name on small mobile to save space */
    }
}

@media (max-width: 480px) {
    .search-bar {
        display: none; /* Hide search entirely on very small screens */
    }
    .topbar-right {
        gap: 0.8rem;
    }
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Sidebar Toggle Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
    display: block;
}

/* Transitions */
.sidebar, .main-content, .sidebar-overlay {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dashboard Specific Padding Fix */
.main-content {
    min-height: 100vh;
    background: var(--body-bg);
}

/* Dashboard Component Responsiveness */
@media (max-width: 1200px) {
    .summary-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 768px) {
    .summary-grid { 
        grid-template-columns: 1fr !important; 
        gap: 15px;
    }
    .gradient-card {
        height: auto !important;
        min-height: 140px;
    }
    
    .tenant-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 20px;
    }
    
    .superadmin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .modal-content {
        width: 95% !important;
        padding: 20px !important;
        margin: 10px;
    }
}

/* POS Specific Responsiveness */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}
