/* Karakeeb Premium Glassmorphic Dark-Mode Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-glass: rgba(17, 24, 39, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(6, 182, 212, 0.4);
    
    --primary: #06b6d4;      /* Neon Cyan */
    --primary-glow: rgba(6, 182, 212, 0.15);
    --secondary: #8b5cf6;    /* Neon Purple */
    --accent: #f43f5e;       /* Rose Red */
    --success: #10b981;      /* Emerald Green */
    --warning: #f59e0b;      /* Amber Yellow */
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-en: 'Outfit', sans-serif;
    --font-ar: 'Cairo', sans-serif;
}

/* ── Light Theme Overrides ────────────────────────────────────── */
[data-theme="light"] {
    --bg-main: #f0f4f8;
    --bg-glass: rgba(255, 255, 255, 0.82);
    --border-glass: rgba(0, 0, 0, 0.09);
    --border-glass-focus: rgba(6, 182, 212, 0.45);

    --primary: #0891b2;      /* Deeper Cyan for legibility on white */
    --primary-glow: rgba(8, 145, 178, 0.12);
    --secondary: #7c3aed;
    --accent: #e11d48;
    --success: #059669;
    --warning: #d97706;

    --text-main: #0f172a;
    --text-muted: #64748b;
}

[data-theme="light"] body {
    background-image:
        radial-gradient(at 0% 0%, rgba(8, 145, 178, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(124, 58, 237, 0.08) 0px, transparent 50%);
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 2px 0 20px rgba(0,0,0,0.06);
}

[data-theme="light"] .sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .brand-name {
    background: linear-gradient(to right, #0f172a, #0891b2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .glass-card:not(.modal-overlay):hover {
    border-color: rgba(8, 145, 178, 0.25);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.12);
}

[data-theme="light"] .form-control {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-main);
}

[data-theme="light"] .form-control:focus {
    background: rgba(8, 145, 178, 0.04);
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-main);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .custom-table th {
    background: rgba(0,0,0,0.03);
}

[data-theme="light"] .cart-row {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .modal-overlay {
    box-shadow: 0 25px 60px rgba(0,0,0,0.18);
}

[data-theme="light"] .modal-backdrop {
    background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .fc {
    background: rgba(255,255,255,0.6);
}

[data-theme="light"] .fc .fc-button-primary {
    background-color: rgba(0,0,0,0.06) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: var(--text-main) !important;
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #e2e8f0;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
}

[data-theme="light"] .stopwatch-face {
    background: rgba(0,0,0,0.06);
    text-shadow: 0 0 20px rgba(8, 145, 178, 0.4);
}

/* ── Theme Toggle Button ──────────────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    margin-top: 0.75rem;
    background: var(--primary-glow);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-ar), var(--font-en);
}
.theme-toggle:hover {
    background: var(--primary-glow);
    color: var(--primary);
    border-color: var(--primary);
    transform: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-ar), var(--font-en);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* App Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-glass);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

/* Custom premium scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    text-decoration: none;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #a5f3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item.active a, .nav-item a:hover {
    color: var(--text-main);
    background: var(--primary-glow);
    border-color: rgba(6, 182, 212, 0.2);
    box-shadow: inset 0 0 8px rgba(6, 182, 212, 0.05);
}

.nav-item a i {
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.nav-item a:hover i {
    transform: scale(1.1);
    color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-glass);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--border-glass);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--primary);
}

/* Main Content Area */
.main-content {
    padding: 2.5rem;
    overflow-y: auto;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Glass Cards & Widgets */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.75rem;
    transition: var(--transition-smooth);
}

.glass-card:not(.modal-overlay):hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    transform: translateY(-2px);
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-details h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-details .value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--primary); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--secondary); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.rose { background: rgba(244, 63, 94, 0.15); color: var(--accent); }

/* Dashboard Columns */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.chart-container {
    min-height: 350px;
}

/* Tables & Lists */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.85rem;
}

.custom-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.95rem;
}

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

/* Badge Status Styles */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge.success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge.danger { background: rgba(244, 63, 94, 0.15); color: var(--accent); }
.badge.info { background: rgba(6, 182, 212, 0.15); color: var(--primary); }

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Alert Notification Banner */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.2);
    color: #fb7185;
}

/* Right to Left (Arabic Support helper) */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--border-glass);
}

[dir="rtl"] .nav-item a i {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .custom-table {
    text-align: right;
}

/* FullCalendar customizations */
.fc {
    font-family: var(--font-ar), var(--font-en);
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 1rem;
}
.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--border-glass) !important;
}
.fc .fc-toolbar-title {
    font-size: 1.25rem !important;
    font-weight: 700;
}
.fc .fc-button-primary {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--border-glass) !important;
    color: var(--text-main) !important;
}
.fc .fc-button-primary:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* POS Cashier Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
}
.pos-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}
.pos-item-card {
    cursor: pointer;
    text-align: center;
    padding: 1.25rem;
}
.pos-item-card:active {
    transform: scale(0.97);
}
.pos-item-qty {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.pos-item-price {
    font-weight: 700;
    color: var(--success);
    margin-top: 0.5rem;
}
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 1rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 1rem;
}
.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    border: 1px solid var(--border-glass);
}

/* Active Stopwatch (Timer) page */
.stopwatch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
}
.stopwatch-face {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: monospace;
    letter-spacing: 2px;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
    background: rgba(0,0,0,0.25);
    padding: 1rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-glass-focus);
    margin: 1.5rem 0;
}
.pulse-glow {
    animation: neon-pulse 1.8s infinite alternate;
}
@keyframes neon-pulse {
    0% {
        box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
        border-color: rgba(6, 182, 212, 0.2);
    }
    100% {
        box-shadow: 0 0 25px rgba(6, 182, 212, 0.7);
        border-color: rgba(6, 182, 212, 0.6);
    }
}
.notification-badge-header {
    position: relative;
}
.notification-badge-header::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

/* Generic Pop-up Modals styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    border: 1px solid var(--border-glass-focus);
    max-height: 90vh;
    overflow-y: auto;
    transition: none !important;
}

.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.75rem;
}

/* Sub-menu styling for nested links */
.nav-submenu {
    list-style: none;
    padding-right: 1.25rem; /* Indent in RTL */
    margin-top: 0.2rem;
    margin-bottom: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.nav-submenu .nav-subitem a {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}
.nav-submenu .nav-subitem.active a,
.nav-submenu .nav-subitem a:hover {
    color: var(--text-main);
    background: var(--primary-glow);
    border-color: rgba(6, 182, 212, 0.15);
}
[dir="ltr"] .nav-submenu {
    padding-right: 0;
    padding-left: 1.25rem;
}

/* Premium iOS-style Toggle Switches */
.switch-container {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    vertical-align: middle;
}

.switch-container input[type="checkbox"] {
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    cursor: pointer;
    z-index: 10;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.12) !important;
    transition: 0.3s;
    border-radius: 34px;
    border: 1px solid var(--border-glass);
    z-index: 1;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

input[type="checkbox"]:checked + .slider {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
}

input[type="checkbox"]:checked + .slider:before {
    transform: translateX(22px);
}




