/* ============================================================
   KEDA KEDA PRO v4.0 - MODERN GLASS DEFAULT THEME
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 50%, #d1d8e8 100%);
    --surface: rgba(255, 255, 255, 0.72);
    --surface2: rgba(255, 255, 255, 0.55);
    --surface3: rgba(255, 255, 255, 0.40);
    --surface4: rgba(255, 255, 255, 0.25);
    --text: #0f172a;
    --text2: #1e293b;
    --text3: #475569;
    --text4: #94a3b8;
    --border: rgba(255, 255, 255, 0.6);
    --accent: #4f46e5;
    --accent2: #7c3aed;
    --accent-light: rgba(79, 70, 229, 0.12);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.12);
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.12), 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --glass: blur(20px) saturate(1.8);
    --chart-color1: #4f46e5;
    --chart-color2: #7c3aed;
    --chart-color3: #06b6d4;
    --chart-color4: #f59e0b;
}

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

body {
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text4); }

/* ===== AUTH PAGE ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation: float 8s ease-in-out infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.auth-card {
    background: var(--surface);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    z-index: 2;
    animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card .logo {
    font-size: 32px;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: -1px;
}

.auth-card .logo svg {
    width: 40px;
    height: 40px;
    color: var(--accent);
    filter: drop-shadow(0 4px 12px rgba(79, 70, 229, 0.3));
}

.auth-card .sub {
    text-align: center;
    color: var(--text3);
    font-size: 14px;
    margin-bottom: 32px;
    font-weight: 500;
}

.auth-card .form-group { margin-bottom: 18px; }
.auth-card .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text2);
    margin-bottom: 6px;
}

.auth-card .form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--surface4);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--surface2);
    color: var(--text);
    transition: var(--transition);
    font-family: inherit;
}

.auth-card .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light), 0 4px 16px rgba(79, 70, 229, 0.15);
    background: var(--surface);
}

.auth-card .btn {
    width: 100%;
    padding: 16px;
    font-size: 15px;
    font-weight: 800;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.auth-card .btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.auth-card .btn:hover::before { transform: translateX(100%); }

.auth-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.35);
}

.auth-card .switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text3);
}

.auth-card .switch a {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.auth-card .switch a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transition: width 0.3s;
}

.auth-card .switch a:hover::after { width: 100%; }

.auth-card .error-msg {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
    font-weight: 600;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.auth-card .admin-hint {
    font-size: 12px;
    color: var(--text4);
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

/* ===== APP LAYOUT ===== */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 260px;
    background: var(--surface);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
    gap: 4px;
    flex-shrink: 0;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-lg);
}

.sidebar .logo {
    font-size: 22px;
    font-weight: 900;
    padding: 10px 14px 22px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 2px solid var(--surface4);
    margin-bottom: 10px;
}

.sidebar .logo svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
    filter: drop-shadow(0 2px 8px rgba(79, 70, 229, 0.3));
    flex-shrink: 0;
}

.sidebar .logo .shop-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text3);
    transition: var(--transition);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    border-radius: 4px 0 0 4px;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: var(--surface3);
    color: var(--text);
    transform: translateX(-4px);
}

.nav-item:hover::before { height: 60%; }

.nav-item.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
    transform: translateX(-4px);
}

.nav-item.active::before {
    height: 80%;
    background: rgba(255,255,255,0.5);
}

.nav-item.active svg { color: #fff; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text4);
    transition: var(--transition);
}

.nav-item:hover svg { color: var(--accent); }

.nav-item .badge-nav {
    margin-right: auto;
    font-size: 11px;
    background: linear-gradient(135deg, var(--danger), #f97316);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--surface4);
    font-size: 12px;
    color: var(--text4);
    text-align: center;
    padding-bottom: 6px;
    font-weight: 500;
}

.sidebar .user-info {
    padding: 12px 14px;
    border-top: 1px solid var(--surface4);
    margin-top: 6px;
    font-size: 13px;
    color: var(--text2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface2);
    border-radius: var(--radius-sm);
}

.sidebar .user-info .uname { font-weight: 700; }

.sidebar .user-info .logout-btn {
    background: linear-gradient(135deg, var(--danger), #f97316);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    transition: var(--transition);
}

.sidebar .user-info .logout-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.header {
    height: 68px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    background: var(--surface);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    gap: 16px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 5;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.header-title {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text), var(--text2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-title .shop-name-header {
    font-weight: 500;
    font-size: 14px;
    background: linear-gradient(135deg, var(--text3), var(--text4));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 10px;
}

.header-right { display: flex; align-items: center; gap: 14px; }

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid var(--surface4);
    border-radius: 50px;
    background: var(--surface2);
    width: 280px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light), 0 4px 16px rgba(79, 70, 229, 0.1);
    background: var(--surface);
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text);
    width: 100%;
    font-family: inherit;
    font-weight: 500;
}

.search-box input::placeholder { color: var(--text4); }

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--text4);
    flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    background: var(--surface2);
    color: var(--text2);
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
    height: 42px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn:hover::after { transform: translateX(100%); }

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-success:hover { box-shadow: 0 12px 32px rgba(16, 185, 129, 0.4); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f97316);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover { box-shadow: 0 12px 32px rgba(239, 68, 68, 0.4); }

.btn-outline {
    background: transparent;
    border-color: var(--surface4);
    color: var(--text3);
}

.btn-outline:hover {
    background: var(--surface3);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    height: 34px;
    border-radius: 10px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 11px;
    height: 26px;
    border-radius: 8px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(0.5);
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    overflow: auto;
    padding: 24px 28px 40px;
    position: relative;
}

.card {
    background: var(--surface);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--chart-color3));
    opacity: 0;
    transition: opacity 0.3s;
}

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

.card:hover::before { opacity: 1; }

.card-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    letter-spacing: -0.3px;
}

.card-title svg { width: 20px; height: 20px; color: var(--accent); }

/* ===== GRIDS ===== */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* ===== STAT CARDS ===== */
.stat-card {
    padding: 22px;
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

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

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

.stat-card .label {
    font-size: 12px;
    color: var(--text3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--text), var(--text2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
    position: relative;
    z-index: 1;
    letter-spacing: -1px;
}

.stat-card .delta {
    font-size: 13px;
    margin-top: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    position: relative;
    z-index: 1;
}

.stat-card .delta.up {
    background: var(--success-light);
    color: var(--success);
}

.stat-card .delta.down {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-card .sub {
    font-size: 13px;
    color: var(--text4);
    margin-top: 6px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ===== TABLES ===== */
.table-wrap {
    overflow-x: auto;
    margin-top: 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface4);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

th {
    text-align: right;
    padding: 14px 16px;
    color: var(--text3);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--surface4);
    background: var(--surface2);
    white-space: nowrap;
}

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

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

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface4);
    color: var(--text2);
    vertical-align: middle;
    font-weight: 500;
    transition: background 0.2s;
}

tr:hover td { background: var(--surface3); }

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

tr:last-child td:first-child { border-radius: 0 0 var(--radius-sm) 0; }

tr:last-child td:last-child { border-radius: 0 0 0 var(--radius-sm); }

td .bold { font-weight: 800; color: var(--text); }
td .mono { font-family: 'Courier New', monospace; font-size: 12px; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.badge-success {
    background: linear-gradient(135deg, var(--success-light), rgba(16,185,129,0.2));
    color: var(--success);
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-light), rgba(239,68,68,0.2));
    color: var(--danger);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-light), rgba(245,158,11,0.2));
    color: var(--warning);
}

.badge-info {
    background: linear-gradient(135deg, var(--info-light), rgba(59,130,246,0.2));
    color: var(--info);
}

.badge-gray {
    background: var(--surface3);
    color: var(--text3);
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--surface4);
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 4px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    width: fit-content;
}

.tab {
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text3);
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    user-select: none;
    position: relative;
}

.tab:hover {
    color: var(--text);
    background: var(--surface3);
}

.tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

/* ===== FORMS ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

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

.form-group label {
    font-size: 12px;
    color: var(--text3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label .required { color: var(--danger); margin-right: 4px; }

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid var(--surface4);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface2);
    color: var(--text);
    transition: var(--transition);
    font-family: inherit;
    width: 100%;
    font-weight: 500;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light), 0 4px 16px rgba(79, 70, 229, 0.1);
    background: var(--surface);
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: modalFadeIn 0.3s ease;
}

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

.modal {
    background: var(--surface);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    overflow: auto;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(79, 70, 229, 0.1);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--surface4);
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text), var(--text2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: var(--surface3);
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    color: var(--text3);
    font-size: 18px;
    line-height: 1;
    border-radius: 10px;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 2px solid var(--surface4);
}

/* ===== SHAMEL DASHBOARD ===== */
.shamel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.shamel-card {
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.shamel-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-light), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.shamel-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--accent);
}

.shamel-card:hover::before { opacity: 1; }

.shamel-card .icon {
    font-size: 52px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(79, 70, 229, 0.2));
    position: relative;
    z-index: 1;
}

.shamel-card .s-label {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    position: relative;
    z-index: 1;
}

.shamel-card .s-desc {
    font-size: 12px;
    color: var(--text3);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.shamel-card .s-badge {
    font-size: 11px;
    background: linear-gradient(135deg, var(--accent-light), rgba(79,70,229,0.15));
    color: var(--accent);
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

/* ===== POS PRODUCT CARDS ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.product-card {
    padding: 18px 14px;
    border: 2px solid var(--surface4);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface2);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    transition: height 0.3s;
}

.product-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px) scale(1.03);
    box-shadow: var(--shadow-lg);
}

.product-card:hover::before { height: 4px; }

.product-card .thumb {
    width: 90px;
    height: 90px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--surface3), var(--surface4));
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--surface4);
    font-size: 36px;
    color: var(--text4);
    transition: var(--transition);
}

.product-card:hover .thumb {
    transform: scale(1.05);
    border-color: var(--accent-light);
}

.product-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .pname {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

.product-card .pprice {
    font-size: 18px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 6px;
}

.product-card .pstock {
    font-size: 12px;
    color: var(--text3);
    margin-top: 4px;
    font-weight: 600;
}

.product-card .pstock.low {
    color: var(--danger);
    font-weight: 700;
    animation: pulseText 2s infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.product-card .pcode {
    font-size: 11px;
    color: var(--text4);
    margin-top: 3px;
    font-weight: 500;
}

/* ===== INVENTORY IMAGE THUMB ===== */
.inv-thumb {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--surface3), var(--surface4));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--surface4);
    font-size: 20px;
    color: var(--text4);
    flex-shrink: 0;
    transition: var(--transition);
}

.inv-thumb:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.inv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== INVOICE MODERN ===== */
.invoice-modern {
    background: var(--surface);
    backdrop-filter: var(--glass);
    border-radius: var(--radius);
    border: 2px solid var(--surface4);
    padding: 32px;
    max-width: 540px;
    margin: 0 auto;
    font-family: 'Cairo', system-ui, sans-serif;
    position: relative;
    overflow: hidden;
}

.invoice-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--chart-color3));
}

.invoice-modern .inv-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--surface4);
}

.invoice-modern .inv-header .shop {
    font-size: 26px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--text), var(--text2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.invoice-modern .inv-header .shop small {
    font-size: 13px;
    font-weight: 500;
    color: var(--text3);
    display: block;
    background: none;
    -webkit-text-fill-color: var(--text3);
}

.invoice-modern .inv-header .inv-number {
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: var(--text2);
    background: var(--surface2);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.invoice-modern .inv-header .inv-number span {
    font-weight: 500;
    color: var(--text3);
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.invoice-modern .inv-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    background: var(--surface2);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid var(--surface4);
}

.invoice-modern .inv-details .item {
    font-size: 13px;
    color: var(--text3);
    font-weight: 500;
}

.invoice-modern .inv-details .item strong {
    color: var(--text);
    font-weight: 700;
}

.invoice-modern .inv-items { margin: 16px 0; }

.invoice-modern .inv-items .row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--surface4);
    font-size: 14px;
    font-weight: 600;
}

.invoice-modern .inv-items .row .qty {
    color: var(--text3);
    font-size: 12px;
    font-weight: 500;
}

.invoice-modern .inv-items .row .total {
    font-weight: 800;
    background: linear-gradient(135deg, var(--text), var(--text2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.invoice-modern .inv-totals {
    border-top: 2px solid var(--surface4);
    padding-top: 14px;
    margin-top: 8px;
}

.invoice-modern .inv-totals .line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.invoice-modern .inv-totals .line .lbl { color: var(--text3); font-weight: 500; }
.invoice-modern .inv-totals .line .val { font-weight: 700; }

.invoice-modern .inv-totals .grand {
    font-size: 22px;
    font-weight: 900;
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 3px solid var(--text);
    margin-top: 8px;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.invoice-modern .inv-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text4);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--surface4);
    font-weight: 600;
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: 100%;
}

.toast {
    padding: 16px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
    border: 1px solid transparent;
    backdrop-filter: var(--glass);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast-success {
    background: var(--success-light);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

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

.toast-error {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

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

.toast-info {
    background: var(--info-light);
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.2);
}

.toast-info::before { background: var(--info); }

@keyframes toastSlideIn {
    from { transform: translateX(-100%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ===== PROGRESS ===== */
.progress-track {
    width: 100%;
    height: 8px;
    background: var(--surface3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== UTILITIES ===== */
.empty {
    text-align: center;
    padding: 50px 24px;
    color: var(--text3);
    font-size: 14px;
    font-weight: 500;
}

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 20px; }
.text-muted { color: var(--text3); }
.fw-700 { font-weight: 800; }
.fs-12 { font-size: 12px; }
.fs-11 { font-size: 11px; }

.theme-selector {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.theme-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--surface4);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow);
}

.theme-dot::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    opacity: 0;
    transform: scale(0);
    transition: var(--transition);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.theme-dot:hover { transform: scale(1.15); box-shadow: var(--shadow-lg); }

.theme-dot.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light), 0 8px 24px rgba(79, 70, 229, 0.3);
    transform: scale(1.1);
}

.theme-dot.active::after { opacity: 1; transform: scale(1); }

.theme-dot.default { background: linear-gradient(135deg, #f5f7fa, #4f46e5); }
.theme-dot.forest { background: linear-gradient(135deg, #0d1f0d, #2d5a27); }
.theme-dot.glass { background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(100,149,237,0.5)); border-color: rgba(255,255,255,0.5); }
.theme-dot.ocean { background: linear-gradient(135deg, #001e3c, #00b4d8); }
.theme-dot.royal { background: linear-gradient(135deg, #0f0c1a, #d4af37); }
.theme-dot.sunset { background: linear-gradient(135deg, #fff3e6, #d45a2a); }

/* ===== CART ITEMS ===== */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--surface4);
    transition: var(--transition);
}

.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: var(--surface3); margin: 0 -8px; padding: 10px 8px; border-radius: 10px; }

.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cart-item .ci-detail { font-size: 12px; color: var(--text3); font-weight: 500; }

.cart-item .ci-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface3);
    padding: 4px;
    border-radius: 10px;
}

.cart-item .ci-qty input {
    width: 48px;
    padding: 4px 6px;
    text-align: center;
    border: 2px solid var(--surface4);
    border-radius: 8px;
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    font-family: inherit;
}

.cart-item .ci-qty input:focus { outline: none; border-color: var(--accent); }

.cart-item .ci-price {
    font-weight: 800;
    font-size: 14px;
    min-width: 70px;
    text-align: left;
    color: var(--text);
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cart-item .ci-remove {
    background: var(--danger-light);
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 14px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item .ci-remove:hover {
    background: var(--danger);
    color: #fff;
    transform: rotate(90deg);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    padding: 14px 0 8px;
    border-top: 3px solid var(--surface4);
    margin-top: 6px;
    font-size: 18px;
    font-weight: 900;
    color: var(--text);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .sidebar { width: 72px; padding: 12px 6px; }
    .sidebar .logo span, .sidebar .nav-item span { display: none; }
    .sidebar .logo { padding: 8px 4px 14px 4px; justify-content: center; }
    .sidebar .logo .shop-name { display: none; }
    .sidebar .nav-item { justify-content: center; padding: 12px 4px; }
    .sidebar-footer { display: none; }
    .sidebar .user-info { flex-direction: column; gap: 6px; font-size: 10px; padding: 6px 2px; }
    .sidebar .user-info .uname { font-size: 10px; }
    .header-title { font-size: 16px; }
    .header-title .shop-name-header { font-size: 12px; }
    .search-box { width: 180px; }
    .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .content { padding: 16px 18px 24px; }
    .modal { padding: 20px; margin: 12px; }
    .stat-card .value { font-size: 26px; }
    .header-right .btn span { display: none; }
    .header-right .btn { padding: 10px 12px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .shamel-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .shamel-card .icon { font-size: 40px; }
    .shamel-card .s-label { font-size: 13px; }
    .product-card .thumb { width: 70px; height: 70px; font-size: 28px; }
    .invoice-modern { padding: 20px; }
}

@media (max-width: 480px) {
    .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card .value { font-size: 20px; }
    .header { padding: 0 14px; flex-wrap: wrap; height: auto; min-height: 60px; gap: 8px; }
    .search-box { width: 100%; order: 3; }
    .header-right { flex-wrap: wrap; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .shamel-grid { grid-template-columns: repeat(2, 1fr); }
}

.hidden { display: none !important; }