/* ============================================
   RAM-YUM STORE — MAIN STYLESHEET
   ============================================ */

/* --- CSS VARIABLES --- */
:root {
    --primary-orange: #FF7A00;
    --primary-orange-dark: #E56C00;
    --primary-orange-light: rgba(255, 122, 0, 0.08);
    --primary-red: #E53935;
    --primary-red-dark: #D32F2F;
    --primary-red-light: rgba(229, 57, 53, 0.08);
    --secondary-orange: #D97706;
    --secondary-orange-light: rgba(217, 119, 6, 0.1);
    
    /* Enhanced Gradients */
    --gradient-primary: linear-gradient(135deg, #FF7A00 0%, #E53935 100%);
    --gradient-orange: linear-gradient(135deg, #FF7A00 0%, #F59E0B 100%);
    --gradient-sunset: linear-gradient(135deg, #FF6B6B 0%, #FFD93D 100%);
    --gradient-ocean: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);

    /* Backgrounds */
    --bg-white: #FFFFFF;
    --bg-gray: #F3F4F6;
    --bg-card: #FFFFFF;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --text-inverse: #FFFFFF;

    /* Borders */
    --border-color: #D1D5DB;
    --border-strong: #9CA3AF;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.10), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);

    /* Status colors */
    --green-bg: #D1FAE5;
    --green-text: #065F46;
    --yellow-bg: #FEF3C7;
    --yellow-text: #78350F;
    --red-bg: #FEE2E2;
    --red-text: #991B1B;
    --blue-bg: #DBEAFE;
    --blue-text: #1D4ED8;

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

    /* Sidebar */
    --sidebar-width: 260px;
}

/* --- DARK MODE --- */
[data-theme="dark"] {
    --bg-white: #1A1D2E;
    --bg-gray: #13151F;
    --bg-card: #1A1D2E;

    --text-primary: #F8FAFC;
    --text-secondary: #E2E8F0;
    --text-muted: #94A3B8;

    --border-color: #2D3748;
    --border-strong: #4A5568;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.4);

    --green-bg: #064E3B;
    --green-text: #6EE7B7;
    --yellow-bg: #451A03;
    --yellow-text: #FCD34D;
    --red-bg: #450A0A;
    --red-text: #FCA5A5;
    --blue-bg: #1E3A5F;
    --blue-text: #93C5FD;
}

[data-theme="dark"] .card {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 12px 32px rgba(255, 122, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .top-navbar {
    background: rgba(26, 29, 46, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .top-navbar::before {
    background: linear-gradient(135deg, rgba(26, 29, 46, 0.98), rgba(26, 29, 46, 0.95));
}

[data-theme="dark"] .search-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] tbody tr:hover {
    background: linear-gradient(90deg, rgba(255, 122, 0, 0.1), transparent);
}

/* --- RESET --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- BASE --- */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-gray);
    background-image: url('../images/bg-pattern.jpg');
    background-repeat: repeat;
    background-size: 480px auto;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Add solid overlay to ensure text is always visible */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-gray);
    opacity: 0.75;
    z-index: -1;
    pointer-events: none;
}

[data-theme="dark"] body {
    background-image: url('../images/bg-pattern.jpg');
    background-blend-mode: overlay;
}

[data-theme="dark"] body::before {
    background: rgba(21, 28, 44, 0.70);
    opacity: 1;
}

/* ============================================
   LAYOUT
   ============================================ */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
    border-right: 1px solid rgba(255, 122, 0, 0.1);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    z-index: 50;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.2), inset -1px 0 0 rgba(255, 122, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Enhanced sidebar with animated gradient */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(circle at top, rgba(255, 122, 0, 0.15), transparent);
    pointer-events: none;
}

/* Ensure sidebar has solid background - no bleed-through */
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
    z-index: -1;
}

/* Slim scrollbar for sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 122, 0, 0.15);
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.1) 0%, rgba(229, 57, 53, 0.05) 100%);
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.sidebar-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
    border: 2px solid rgba(255, 122, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-brand img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 6px 20px rgba(255, 122, 0, 0.4);
}

.sidebar-brand-text h3 {
    color: #FFFFFF;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sidebar-brand-text span {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 122, 0, 0.9);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 12px 12px;
    flex: 1;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 16px 8px 6px;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    user-select: none;
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.1), rgba(229, 57, 53, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.2);
}

.nav-item:hover::after {
    opacity: 1;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.25), rgba(229, 57, 53, 0.25));
    color: #FF7A00;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(255, 122, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateX(6px);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: linear-gradient(180deg, #FF7A00, #E53935);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px rgba(255, 122, 0, 0.6);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg, #1E1E2D 0%, #2A2A3C 100%);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px 24px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ============================================
   TOP NAVBAR
   ============================================ */
.top-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    padding: 14px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    transition: box-shadow 0.3s ease;
}

.top-navbar:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 3px 10px rgba(0, 0, 0, 0.05);
}

/* Ensure solid background */
.top-navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    border-radius: inherit;
    z-index: -1;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-gray);
    padding: 10px 16px;
    border-radius: 12px;
    flex: 1;
    max-width: 400px;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.search-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-red));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary-orange);
    background: var(--bg-white);
    box-shadow: 0 4px 16px rgba(255, 122, 0, 0.15), 0 0 0 4px rgba(255, 122, 0, 0.08);
    transform: translateY(-1px);
}

.search-box:focus-within::before {
    opacity: 1;
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    padding-left: 8px;
    width: 100%;
    color: var(--text-primary);
    font-size: 0.9rem;
}

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

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-red));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.nav-btn svg {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.nav-btn:hover {
    background: var(--bg-white);
    color: var(--primary-orange);
    border-color: var(--primary-orange);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.2);
    transform: translateY(-2px);
}

.nav-btn:hover::before {
    opacity: 0.1;
}

.nav-btn:hover svg {
    transform: scale(1.1) rotate(5deg);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Ensure cards have solid opaque backgrounds */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-card);
    border-radius: inherit;
    z-index: -1;
}

/* Subtle shine effect on hover */
.card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    border-color: rgba(255, 122, 0, 0.2);
    transform: translateY(-2px);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

/* Animated gradient overlay */
.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 122, 0, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.6s ease;
    pointer-events: none;
}

/* Ensure stat cards have solid opaque backgrounds */
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-card);
    border-radius: inherit;
    z-index: 0;
}

.stat-card > * {
    position: relative;
    z-index: 1;
}

.stat-card:hover {
    box-shadow: 0 12px 32px rgba(255, 122, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(255, 122, 0, 0.4);
}

.stat-card:hover::after {
    opacity: 1;
    transform: rotate(45deg);
}

.stat-card .stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-card .stat-icon {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

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

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .page-title {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .page-subtitle {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ============================================
   FORMS
   ============================================ */
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: var(--bg-white);
    color: var(--text-primary);
    box-sizing: border-box;
    line-height: 1.5;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.10);
}

.form-input:disabled {
    background: var(--bg-gray);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.error {
    border-color: #EF4444;
}

.form-group {
    margin-bottom: 18px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-red) 100%);
    color: #FFFFFF;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.02em;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 122, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--text-primary);
    padding: 10px 20px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

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

.btn-danger {
    background-color: #EF4444;
    color: #FFFFFF;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
}

.btn-danger:hover {
    background-color: #DC2626;
}

/* ============================================
   BADGES / STATUS CHIPS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.badge-green  { 
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0); 
    color: #065F46;
    border: 1px solid #6EE7B7;
}
.badge-yellow { 
    background: linear-gradient(135deg, #FEF3C7, #FDE68A); 
    color: #78350F;
    border: 1px solid #FCD34D;
}
.badge-red    { 
    background: linear-gradient(135deg, #FEE2E2, #FECACA); 
    color: #991B1B;
    border: 1px solid #FCA5A5;
}
.badge-blue   { 
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE); 
    color: #1D4ED8;
    border: 1px solid #93C5FD;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    color: var(--text-primary);
}

thead {
    background: linear-gradient(135deg, var(--bg-gray), rgba(243, 244, 246, 0.5));
    border-bottom: 2px solid var(--border-color);
}

thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    position: relative;
}

thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-orange), var(--primary-red));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

thead th:hover::after {
    transform: scaleX(1);
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

tbody tr:hover {
    background: linear-gradient(90deg, rgba(255, 122, 0, 0.03), transparent);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

tbody td {
    padding: 14px 16px;
    color: var(--text-primary);
    vertical-align: middle;
    transition: color 0.3s ease;
}

tbody tr:hover td {
    color: var(--primary-orange);
}

/* ============================================
   MODAL OVERRIDES
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-box {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================
   UTILITY
   ============================================ */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-red       { color: var(--primary-red) !important; }
.text-orange    { color: var(--primary-orange) !important; }
.text-green     { color: var(--green-text) !important; }
.text-yellow    { color: var(--yellow-text) !important; }

.font-bold   { font-weight: 700 !important; }
.font-medium { font-weight: 500 !important; }

.mb-0  { margin-bottom: 0 !important; }
.mb-4  { margin-bottom: 4px !important; }
.mb-8  { margin-bottom: 8px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-24 { margin-bottom: 24px !important; }

.mt-0  { margin-top: 0 !important; }
.mt-8  { margin-top: 8px !important; }
.mt-16 { margin-top: 16px !important; }

.p-0  { padding: 0 !important; }
.p-8  { padding: 8px !important; }
.p-16 { padding: 16px !important; }

.flex              { display: flex; }
.flex-center       { display: flex; align-items: center; }
.flex-between      { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap         { flex-wrap: wrap; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: 9999px !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.gradient-orange {
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-red)) !important;
}

.gradient-glow {
    background: linear-gradient(135deg, #FF7A00, #E53935);
    box-shadow: 0 4px 20px rgba(255, 122, 0, 0.4);
}

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 122, 0, 0.5), 0 0 40px rgba(229, 57, 53, 0.3);
}

/* Glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Neon glow effect */
.neon-orange {
    box-shadow: 0 0 10px rgba(255, 122, 0, 0.5),
                0 0 20px rgba(255, 122, 0, 0.3),
                0 0 30px rgba(255, 122, 0, 0.2);
}

.neon-red {
    box-shadow: 0 0 10px rgba(229, 57, 53, 0.5),
                0 0 20px rgba(229, 57, 53, 0.3),
                0 0 30px rgba(229, 57, 53, 0.2);
}

/* ============================================
   DIVIDERS & SEPARATORS
   ============================================ */
.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    animation: fadeIn 0.5s ease-out;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

.empty-state p {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-gray) 0%, rgba(243, 244, 246, 0.5) 50%, var(--bg-gray) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
    border-radius: 6px;
}

.skeleton-card {
    height: 120px;
    border-radius: 12px;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-gray);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

/* ============================================
   LOGOUT BUTTON
   ============================================ */
.logout-btn {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.logout-btn:hover {
    background: rgba(229, 57, 53, 0.15);
    border-color: var(--primary-red);
    color: #FF6B6B;
    transform: translateY(-1px);
}

/* ============================================
   SCROLLBAR (global)
   ============================================ */
::-webkit-scrollbar { 
    width: 8px; 
    height: 8px; 
}
::-webkit-scrollbar-track { 
    background: transparent; 
}
::-webkit-scrollbar-thumb { 
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-red));
    border-radius: 10px;
    transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover { 
    background: linear-gradient(135deg, var(--primary-red), var(--primary-orange));
    box-shadow: 0 0 10px rgba(255, 122, 0, 0.5);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scroll snap for sections */
.scroll-snap {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
}

.scroll-snap > * {
    scroll-snap-align: start;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

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

    .top-navbar {
        border-radius: var(--radius-md);
        padding: 10px 16px;
    }
    
    .search-box {
        max-width: 200px;
    }
    
    .dashboard-hero h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-hero p {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .kpi-card-value {
        font-size: 2rem;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-border {
    0%   { opacity: 1; }
    50%  { opacity: 0.55; transform: scale(0.96); }
    100% { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 122, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 122, 0, 0.6), 0 0 30px rgba(229, 57, 53, 0.4); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out both;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out both;
}

.slide-in-up {
    animation: slideInUp 0.5s ease-out both;
}

.scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Staggered animation delay for lists */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body { background: white !important; color: black !important; }

    .sidebar, .top-navbar, .navbar-actions, .sidebar-nav,
    .sidebar-brand, .sidebar-footer, [id="menuToggle"] {
        display: none !important;
    }

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

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: white !important;
    }

    table { border: 1px solid #ccc !important; width: 100% !important; }
    th { background-color: #f0f0f0 !important; color: black !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    td, th { border: 1px solid #ccc !important; padding: 8px !important; }
}
