/* ==========================================================================
   FATOORA ROYAL DESIGN SYSTEM (LOGO SAPPHIRE/CYAN & LUXURY GOLD HARMONY)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* 1. Official Logo Palette (Sapphire, Electric Cyan & Turquoise) */
    --logo-blue: #0876E9;
    --logo-blue-dark: #0558B5;
    --logo-cyan: #0492D2;
    --logo-teal: #05B1BF;
    --logo-sky: #50D6FB;
    --logo-gradient: linear-gradient(135deg, #50D6FB 0%, #0492D2 45%, #0876E9 100%);
    --logo-gradient-hover: linear-gradient(135deg, #7BE4FD 0%, #05A3EA 45%, #1583F6 100%);
    --logo-glow: 0 8px 24px rgba(8, 118, 233, 0.3);
    --logo-subtle: rgba(4, 146, 210, 0.12);

    /* 2. Luxury Gold & Amber Palette */
    --gold-primary: #D4AF37;
    --gold-light: #F3E5AB;
    --gold-dark: #AA7C11;
    --gold-amber: #DAA520;
    --gold-bright: #FFD700;
    --gold-gradient: linear-gradient(135deg, #FFF0B3 0%, #F3E5AB 30%, #D4AF37 70%, #AA7C11 100%);
    --gold-gradient-hover: linear-gradient(135deg, #FFF9D2 0%, #FFD700 50%, #DAA520 100%);
    --gold-subtle: rgba(212, 175, 55, 0.12);
    --gold-glow: 0 8px 24px rgba(212, 175, 55, 0.28);

    /* 3. Synergy Harmony Gradients (Logo Cyan + Gold) */
    --synergy-gradient: linear-gradient(135deg, #0876E9 0%, #0492D2 45%, #D4AF37 100%);
    --synergy-glow: 0 10px 30px rgba(8, 118, 233, 0.2), 0 0 20px rgba(212, 175, 55, 0.2);

    /* 4. Deep Sapphire Navy & Obsidian Neutral Accents */
    --bg-dark-main: #060D18;
    --bg-sidebar: #091527;
    --bg-sidebar-hover: #11223D;
    --bg-sidebar-active: linear-gradient(90deg, rgba(8, 118, 233, 0.25) 0%, rgba(212, 175, 55, 0.1) 100%);
    --bg-app: #F5F8FC;
    --card-bg: #FFFFFF;

    /* 5. Text Colors */
    --text-main: #0F1E36;
    --text-muted: #64748B;
    --text-gold: #B8860B;
    --text-blue: #0876E9;
    --text-cyan: #0492D2;
    --text-light: #F8FAFC;

    /* 6. Status Colors */
    --status-approved: #10B981;
    --status-pending: #F59E0B;
    --status-draft: #6366F1;
    --status-rejected: #EF4444;

    /* 7. Border Radius & Shadows */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-card: 0 10px 30px -5px rgba(8, 118, 233, 0.06), 0 4px 12px -2px rgba(212, 175, 55, 0.06);
    --shadow-hover: 0 20px 35px -10px rgba(8, 118, 233, 0.22);
    --border-gold: 1px solid rgba(212, 175, 55, 0.3);
    --border-cyan: 1px solid rgba(4, 146, 210, 0.3);
    --border-synergy: 1px solid rgba(4, 146, 210, 0.25);
}

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

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   APP LAYOUT WITH SIDEBAR & TOPBAR
   ========================================================================== */

.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0A1629 0%, #060D19 100%);
    color: #FFFFFF;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1040;
    border-left: 1px solid rgba(4, 146, 210, 0.2);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.25);
}

.sidebar-header {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 118, 233, 0.04);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #FFFFFF;
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #060D18;
    border: 1.5px solid rgba(4, 146, 210, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(8, 118, 233, 0.35);
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFFFFF 0%, #50D6FB 40%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 11px;
    color: #50D6FB;
    opacity: 0.85;
    display: block;
    margin-top: -2px;
    font-weight: 600;
}

/* User profile card inside sidebar */
.sidebar-user {
    margin: 16px 14px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(8, 118, 233, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(4, 146, 210, 0.25);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--logo-gradient);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(8, 118, 233, 0.3);
}

.user-info {
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--gold-light);
}

/* Navigation Links */
.sidebar-menu {
    list-style: none;
    padding: 10px 14px;
    flex-grow: 1;
}

.menu-category {
    font-size: 11px;
    text-transform: uppercase;
    color: #7CA0C7;
    padding: 14px 12px 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: #A3BDDB;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.menu-link i {
    font-size: 18px;
    color: #50D6FB;
    transition: transform 0.2s ease, color 0.2s ease;
}

.menu-link:hover {
    color: #FFFFFF;
    background-color: var(--bg-sidebar-hover);
    border-color: rgba(4, 146, 210, 0.3);
    transform: translateX(-4px);
}

.menu-link:hover i {
    color: #FFF0B3;
}

.menu-link.active {
    color: #FFFFFF;
    background: linear-gradient(90deg, rgba(8, 118, 233, 0.35) 0%, rgba(4, 146, 210, 0.2) 60%, rgba(212, 175, 55, 0.15) 100%);
    font-weight: 700;
    border: 1px solid rgba(4, 146, 210, 0.45);
    border-right: 4px solid var(--gold-primary);
    box-shadow: 0 4px 16px rgba(8, 118, 233, 0.25);
}

.menu-link.active i {
    color: var(--gold-primary);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Main Content Layout */
.app-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.app-topbar {
    height: 70px;
    background-color: #FFFFFF;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.topbar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-main);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

.topbar-toggle:hover {
    background-color: var(--gold-subtle);
    color: var(--gold-dark);
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Page Body Container */
.app-main-content {
    padding: 30px;
    flex-grow: 1;
}

/* ==========================================================================
   GOLDEN CARDS & COMPONENTS
   ========================================================================== */

.gold-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    overflow: hidden;
}

.gold-card:hover {
    box-shadow: var(--shadow-hover);
}

.gold-card-header {
    padding: 20px 24px;
    background: linear-gradient(to left, rgba(243, 229, 171, 0.15), transparent);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gold-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.gold-card-title i {
    color: var(--gold-primary);
}

/* Welcome Hero Banner - Light Theme */
.welcome-hero {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 60%, #FEF3C7 100%);
    border-radius: var(--radius-xl);
    padding: 32px 36px;
    color: #1E293B;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.welcome-hero::after {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-hero h1,
.welcome-hero h2,
.welcome-hero h3,
.welcome-hero h4,
.welcome-hero h5,
.welcome-hero h6 {
    color: #0F172A !important;
}

.welcome-hero p,
.welcome-hero .text-white-50,
.welcome-hero small {
    color: #475569 !important;
}

.welcome-hero .bg-white.bg-opacity-10 {
    background-color: rgba(212, 175, 55, 0.08) !important;
    color: #0F172A !important;
}

.welcome-hero .bg-white.bg-opacity-10 strong,
.welcome-hero .bg-white.bg-opacity-10 small {
    color: #0F172A !important;
}

.welcome-hero .bg-white.bg-opacity-10 small.text-warning {
    color: var(--gold-dark) !important;
}

.hero-gold-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold-primary);
    color: var(--gold-dark);
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 14px;
}

/* Stat Cards */
.stat-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--gold-primary);
}

.stat-icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(8, 118, 233, 0.12) 0%, rgba(4, 146, 210, 0.08) 50%, rgba(212, 175, 55, 0.1) 100%);
    color: var(--logo-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
    border: 1px solid rgba(4, 146, 210, 0.25);
}

.stat-number {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Buttons & Forms */
.btn-brand {
    background: var(--logo-gradient);
    color: #FFFFFF;
    font-weight: 700;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(8, 118, 233, 0.35);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-brand:hover {
    background: var(--logo-gradient-hover);
    color: #FFFFFF;
    box-shadow: 0 6px 22px rgba(8, 118, 233, 0.5);
    transform: translateY(-2px);
}

.btn-brand-outline {
    background: transparent;
    color: var(--logo-blue);
    font-weight: 700;
    border: 2px solid var(--logo-cyan);
    padding: 8px 20px;
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-brand-outline:hover {
    background: var(--logo-gradient);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: var(--logo-glow);
}

.btn-gold {
    background: var(--gold-gradient);
    color: var(--bg-dark-main);
    font-weight: 700;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-gold:hover {
    background: var(--gold-gradient-hover);
    color: var(--bg-dark-main);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
    transform: translateY(-2px);
}

.btn-gold-outline {
    background: transparent;
    color: var(--gold-dark);
    font-weight: 700;
    border: 2px solid var(--gold-primary);
    padding: 8px 20px;
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-gold-outline:hover {
    background: var(--gold-gradient);
    color: var(--bg-dark-main);
    border-color: transparent;
    box-shadow: var(--gold-glow);
}

.btn-dark-gold {
    background: var(--bg-sidebar);
    color: #50D6FB;
    border: 1px solid rgba(4, 146, 210, 0.4);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-dark-gold:hover {
    background: #0E1E36;
    color: #FFF0B3;
    border-color: var(--gold-primary);
    box-shadow: 0 4px 15px rgba(8, 118, 233, 0.25);
}

.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1px solid #E2E8F0;
    padding: 11px 16px;
    font-size: 14px;
    transition: all 0.25s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
    outline: none;
}

.form-label {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-main);
    margin-bottom: 6px;
}

/* 4 Invoice Type Selection Cards Grid */
.invoice-type-card {
    background: #FFFFFF;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.invoice-type-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.15);
}

.invoice-type-card.selected {
    border-color: var(--gold-primary);
    background: linear-gradient(180deg, rgba(243, 229, 171, 0.18) 0%, rgba(255, 255, 255, 1) 100%);
    box-shadow: var(--gold-glow);
}

.type-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--gold-subtle);
    color: var(--gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: all 0.25s ease;
}

.invoice-type-card.selected .type-card-icon {
    background: var(--gold-gradient);
    color: var(--bg-dark-main);
    box-shadow: var(--gold-glow);
    transform: scale(1.08);
}

.type-card-title {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.type-card-code {
    font-size: 11px;
    color: var(--gold-dark);
    font-weight: 700;
    margin-bottom: 6px;
    background: rgba(212, 175, 55, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
}

.type-card-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.3;
}

.type-card-check {
    position: absolute;
    top: 10px;
    left: 10px;
    color: var(--gold-dark);
    font-size: 18px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s ease;
}

.invoice-type-card.selected .type-card-check {
    opacity: 1;
    transform: scale(1);
}

/* Enlarged QR Code Container */
.qr-code-large-box {
    display: inline-block;
    padding: 16px;
    background: #FFFFFF;
    border: 2px solid var(--gold-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
    text-align: center;
}

.qr-code-large-box img {
    width: 175px;
    height: 175px;
    object-fit: contain;
}

/* Tables */
.table-gold {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-gold thead th,
.app-main-content .table-gold thead th {
    background: #F8FAFC !important;
    color: #0F1E36 !important;
    font-weight: 700;
    font-size: 13.5px;
    padding: 14px 16px;
    border-bottom: 2px solid var(--gold-primary);
    text-align: center;
}

.table-gold tbody tr {
    transition: background-color 0.18s ease;
}

.table-gold tbody tr:hover,
.table-gold tbody tr:hover > * {
    background-color: #F4F8FD !important;
    color: #0F1E36 !important;
}

.table-gold tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
    text-align: center;
    font-size: 14px;
    color: #0F1E36;
}

.table-gold tbody td:hover {
    background-color: #EBF3FC !important;
}

/* Badges */
.badge-gold-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    display: inline-block;
}

.badge-approved { background: rgba(16, 185, 129, 0.12); color: #047857; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-sent { background: rgba(99, 102, 241, 0.12); color: #4338CA; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-draft { background: rgba(245, 158, 11, 0.15); color: #B45309; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-rejected { background: rgba(239, 68, 68, 0.12); color: #B91C1C; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Authentication Pages */
.auth-wrapper {
    min-height: 100vh;
    background: radial-gradient(circle at 15% 20%, rgba(8, 118, 233, 0.22) 0%, transparent 45%),
                radial-gradient(circle at 85% 80%, rgba(212, 175, 55, 0.18) 0%, transparent 45%),
                radial-gradient(circle at 50% 50%, #08162B 0%, #040912 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(10, 22, 41, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(4, 146, 210, 0.35);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(8, 118, 233, 0.2), 0 0 20px rgba(212, 175, 55, 0.15);
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #50D6FB 0%, #0876E9 50%, #D4AF37 100%);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-brand-icon {
    width: 72px;
    height: 72px;
    background: #060D18;
    border: 2px solid rgba(4, 146, 210, 0.6);
    border-radius: 22px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(8, 118, 233, 0.35);
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFFFFF 0%, #50D6FB 40%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: 13px;
    color: #94A3B8;
    margin-top: 4px;
}

.auth-card .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(4, 146, 210, 0.3);
    color: #FFFFFF;
    border-radius: 12px;
}

.auth-card .form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #50D6FB;
    box-shadow: 0 0 15px rgba(4, 146, 210, 0.35);
    color: #FFFFFF;
}

.auth-card .form-label {
    color: #E2E8F0;
    font-weight: 600;
}

/* PRINT MODE (FULL A4 PAGE HEIGHT, CLEAN & NO EXTRA TEXT) */
@media print {
    @page {
        size: A4 portrait;
        margin: 5mm 8mm 5mm 8mm;
    }

    *, *::before, *::after {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html, body {
        background: #FFFFFF !important;
        color: #000000 !important;
        font-family: 'Cairo', sans-serif !important;
        font-size: 10.5pt !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    .app-wrapper, .app-content, .app-main-content, .container, .container-fluid {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
    }

    .app-sidebar,
    .app-topbar,
    .no-print,
    .btn,
    .alert,
    .sidebar-footer,
    nav,
    header,
    footer,
    .topbar-actions,
    .border-top.no-print {
        display: none !important;
    }

    .printable-invoice-card {
        border: 2px solid #D4AF37 !important;
        border-radius: 12px !important;
        padding: 22px 26px !important;
        background: #FFFFFF !important;
        margin: 0 auto !important;
        width: 100% !important;
        min-height: 275mm !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        page-break-inside: avoid !important;
    }

    .printable-invoice-card table {
        width: 100% !important;
        font-size: 10.5pt !important;
        border-collapse: collapse !important;
    }

    .printable-invoice-card th {
        background-color: #FAF5E4 !important;
        color: #000000 !important;
        border-bottom: 2px solid #D4AF37 !important;
        padding: 8px 10px !important;
        font-weight: 800 !important;
    }

    .printable-invoice-card td {
        padding: 8px 10px !important;
        border-bottom: 1px solid #E5E7EB !important;
    }

    .qr-code-large-box {
        border: 2px solid #D4AF37 !important;
        padding: 10px !important;
    }

    .qr-code-large-box img {
        width: 165px !important;
        height: 165px !important;
    }
}

/* ==========================================================================
   GLOBAL TABLE DARK & OVERFLOW PROTECTION STYLES
   ========================================================================== */
.table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.table-dark,
.app-main-content .table-dark,
.app-main-content .table-dark th,
.app-main-content .table-dark td,
.app-main-content .table-dark small,
.app-main-content .table-dark strong,
.app-main-content .table-dark span:not(.badge),
.app-main-content .table-dark .text-muted {
    color: #0F1E36 !important;
    background-color: #FFFFFF !important;
}

.table-dark.table-hover > tbody > tr:hover > *,
.app-main-content .table-dark tbody tr:hover > * {
    background-color: #F4F8FD !important;
    color: #0F1E36 !important;
}

.app-main-content .table-dark .text-muted {
    opacity: 0.85 !important;
    color: #64748B !important;
}

.app-main-content .table-dark th {
    background-color: #F8FAFC !important;
    color: #0F1E36 !important;
    border-bottom: 2px solid var(--gold-primary) !important;
}

/* Responsive adjustments & Mobile Overlay */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 25, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 992px) {
    .app-sidebar {
        position: fixed;
        right: -285px;
        top: 0;
        bottom: 0;
        z-index: 1045;
        width: 280px;
    }
    
    .app-sidebar.show {
        right: 0;
    }

    .app-main-content {
        padding: 16px 12px !important;
    }

    .app-topbar {
        padding: 0 14px !important;
    }
}

@media (max-width: 576px) {
    .brand-title {
        font-size: 16px;
    }

    .kpi-value-box {
        font-size: 1.45rem !important;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .gold-card {
        border-radius: 12px;
    }

    .btn-gold, .btn {
        font-size: 0.88rem;
    }
}

/* Custom Scrollbar for tables and containers */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(11, 15, 25, 0.05);
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.7);
}

/* ==========================================================================
   LTR MULTI-LANGUAGE OVERRIDES (English Support)
   ========================================================================== */
html[dir="ltr"] body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    direction: ltr;
}

html[dir="ltr"] .app-sidebar {
    border-left: none;
    border-right: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
}

@media (max-width: 992px) {
    html[dir="ltr"] .app-sidebar {
        right: auto;
        left: -285px;
    }
    
    html[dir="ltr"] .app-sidebar.show {
        left: 0;
    }
}

/* ============================================================
   Premium Form Enhancements (v2.0)
   تحسينات احترافية للحقول والنماذج
   ============================================================ */

/* حقول إدخال محسّنة مع تركيز ذهبي */
.app-main-content .form-control,
.app-main-content .form-select {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    border: 1px solid rgba(212, 175, 55, 0.25);
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    backdrop-filter: blur(8px);
}

.app-main-content .form-control::placeholder {
    color: #94A3B8 !important;
    font-weight: 300;
}

.app-main-content .form-control:hover,
.app-main-content .form-select:hover {
    border-color: rgba(212, 175, 55, 0.5);
    background-color: #FFFFFF !important;
}

.app-main-content .form-control:focus,
.app-main-content .form-select:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25),
                0 0 20px rgba(212, 175, 55, 0.15);
    background-color: #FFFFFF !important;
    color: #0F172A !important;
    outline: 0;
}

.app-main-content .form-control:invalid:not(:placeholder-shown):not(:focus),
.app-main-content .form-select:invalid:not(:focus) {
    border-color: rgba(220, 53, 69, 0.5);
}

/* Labels - تحسين النصوص التوضيحية */
.app-main-content .form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #334155;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.app-main-content .form-label .text-danger {
    color: #DC2626 !important;
    font-weight: 700;
    margin-right: 0.15rem;
}

/* Input Groups */
.app-main-content .input-group-text {
    background-color: #F1F5F9 !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    color: #475569 !important;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Cards احترافية محسّنة */
.app-main-content .gold-card,
.app-main-content .card.gold-card {
    background: #FFFFFF !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    border-radius: 1rem !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06),
                0 0 0 1px rgba(212, 175, 55, 0.05) inset;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1E293B !important;
}

.app-main-content .gold-card:hover,
.app-main-content .card.gold-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.18),
                0 0 24px rgba(212, 175, 55, 0.10);
    border-color: rgba(212, 175, 55, 0.4) !important;
}

.app-main-content .gold-card .card-header,
.app-main-content .card.gold-card .card-header {
    background: linear-gradient(90deg,
        rgba(212, 175, 55, 0.10) 0%,
        rgba(212, 175, 55, 0.04) 100%) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2) !important;
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: #0F172A !important;
}

/* Tables احترافية */
table,
.table,
.app-main-content .table {
    --bs-table-bg: #FFFFFF;
    --bs-table-color: #0F1E36;
    --bs-table-hover-bg: #F4F8FD;
    --bs-table-hover-color: #0F1E36;
    --bs-table-border-color: #E2E8F0;
    color: #0F1E36;
    background-color: #FFFFFF;
}

table > thead,
.table > thead,
.app-main-content .table > thead {
    background: #F8FAFC;
}

table > thead th,
.table > thead th,
.app-main-content .table > thead th {
    color: #0F1E36;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    border-bottom: 2px solid rgba(212, 175, 55, 0.4);
    padding: 0.85rem;
    background-color: #F8FAFC !important;
}

table > tbody > tr,
.table > tbody > tr,
.app-main-content .table > tbody > tr {
    transition: background-color 0.18s ease-in-out;
}

table > tbody > tr:hover,
table > tbody > tr:hover > *,
.table > tbody > tr:hover,
.table > tbody > tr:hover > *,
.app-main-content .table > tbody > tr:hover,
.app-main-content .table > tbody > tr:hover > *,
.table-hover > tbody > tr:hover > * {
    background-color: #F4F8FD !important;
    color: #0F1E36 !important;
}

table > tbody > td,
.table > tbody > td,
.app-main-content .table > tbody > td {
    padding: 0.85rem;
    border-color: #E2E8F0;
    vertical-align: middle;
    color: #0F1E36;
}

table > tbody > td:hover,
.table > tbody > td:hover,
.app-main-content .table > tbody > td:hover {
    background-color: #EBF3FC !important;
    color: #0F1E36 !important;
}

/* Buttons Premium */
.btn-gold {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 50%, #d4af37 100%);
    color: #1a1a1a !important;
    border: none;
    font-weight: 700;
    padding: 0.65rem 1.5rem;
    border-radius: 0.6rem;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    transition: left 0.5s;
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.45);
    background: linear-gradient(135deg, #f4d03f 0%, #d4af37 50%, #f4d03f 100%);
    color: #000 !important;
}

.btn-gold:hover::before {
    left: 100%;
}

.btn-gold:active {
    transform: translateY(0);
}

/* Alert Premium */
.alert {
    border: none;
    border-radius: 0.75rem;
    backdrop-filter: blur(8px);
    font-weight: 500;
    padding: 1rem 1.25rem;
}

.alert-success {
    background: linear-gradient(135deg,
        rgba(25, 135, 84, 0.25) 0%,
        rgba(25, 135, 84, 0.15) 100%);
    color: #75e6a0;
    border-left: 4px solid #198754;
}

.alert-danger {
    background: linear-gradient(135deg,
        rgba(220, 53, 69, 0.25) 0%,
        rgba(220, 53, 69, 0.15) 100%);
    color: #ff8a95;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: linear-gradient(135deg,
        rgba(255, 193, 7, 0.25) 0%,
        rgba(255, 193, 7, 0.15) 100%);
    color: #ffd966;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: linear-gradient(135deg,
        rgba(13, 202, 240, 0.25) 0%,
        rgba(13, 202, 240, 0.15) 100%);
    color: #6edff6;
    border-left: 4px solid #0dcaf0;
}

/* Badges Premium */
.badge {
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    letter-spacing: 0.02em;
}

.badge.bg-gold {
    background: linear-gradient(135deg, #d4af37, #f4d03f) !important;
    color: #1a1a1a !important;
}

/* Status Colors احترافية */
.status-approved,
.status-cleared,
.status-reported,
.status-paid {
    color: #75e6a0;
    background-color: rgba(25, 135, 84, 0.2);
    border: 1px solid rgba(25, 135, 84, 0.4);
}

.status-rejected,
.status-cancelled {
    color: #ff8a95;
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
}

.status-draft,
.status-pending {
    color: #ffd966;
    background-color: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.status-sent {
    color: #6edff6;
    background-color: rgba(13, 202, 240, 0.2);
    border: 1px solid rgba(13, 202, 240, 0.4);
}

/* Tooltip محسّن */
.tooltip-inner {
    background-color: rgba(33, 37, 41, 0.95);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-weight: 500;
    max-width: 280px;
    text-align: right;
    direction: rtl;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: rgba(212, 175, 55, 0.3);
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: rgba(212, 175, 55, 0.3);
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: rgba(212, 175, 55, 0.3);
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: rgba(212, 175, 55, 0.3);
}

/* Animations ناعمة */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGold {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(212, 175, 55, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pulse-gold {
    animation: pulseGold 2s infinite;
}

/* Animations للنماذج */
form .form-control,
form .form-select {
    animation: fadeInUp 0.3s ease-out;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        font-size: 16px; /* منع zoom iOS */
        padding: 0.6rem 0.8rem;
    }

    .btn-gold {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* Print Styles محسّنة */
@media print {
    .app-sidebar,
    .app-header,
    .btn,
    .alert {
        display: none !important;
    }

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

/* Scrollbar Premium */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(33, 37, 41, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d4af37, #b8860b);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f4d03f, #d4af37);
}

/* Selection */
::selection {
    background-color: rgba(212, 175, 55, 0.4);
    color: #fff;
}

/* ============================================================
   FORM FIELD PRECISION v3.0
   ضبط دقيق لارتفاع ومحاذاة الحقول لتطبيق احترافي
   ============================================================ */

/* 1) ارتفاع موحّد ومريح لكل الحقول */
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea.form-control {
    min-height: 44px !important;
    line-height: 1.5 !important;
    padding: 0.65rem 0.9rem !important;
    font-size: 0.95rem !important;
    vertical-align: middle;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

/* 2) textarea يحتاج ارتفاع مختلف */
textarea.form-control {
    min-height: 90px !important;
    padding-top: 0.75rem !important;
    line-height: 1.6 !important;
}

/* 3) input-group: توحيد الارتفاع بين النص والزر والـ input */
.input-group {
    align-items: stretch;
}

.input-group > .form-control,
.input-group > .form-select {
    min-height: 44px !important;
}

.input-group-text {
    min-height: 44px !important;
    min-width: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0.5rem !important;
}

.input-group > :not(:first-child) {
    margin-right: 0 !important;
    margin-left: -1px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > :not(:last-child) > .form-control,
.input-group > :not(:last-child) > .form-select,
.input-group > :last-child > .form-control,
.input-group > :last-child > .form-select {
    border-top-left-radius: 0.5rem !important;
    border-bottom-left-radius: 0.5rem !important;
}

/* في RTL: العكس */
[dir="rtl"] .input-group > :not(:first-child) {
    margin-right: -1px !important;
    margin-left: 0 !important;
    border-top-left-radius: 0.5rem !important;
    border-bottom-left-radius: 0.5rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

[dir="rtl"] .input-group > :not(:last-child) > .form-control,
[dir="rtl"] .input-group > :not(:last-child) > .form-select,
[dir="rtl"] .input-group > :last-child > .form-control,
[dir="rtl"] .input-group > :last-child > .form-select {
    border-top-right-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* 4) form-control-sm داخل الجداول: ارتفاع مضغوط ولكن واضح */
.table .form-control,
.table .form-select {
    min-height: 38px !important;
    padding: 0.45rem 0.65rem !important;
    font-size: 0.875rem !important;
}

.table td {
    vertical-align: middle !important;
    padding: 0.6rem 0.75rem !important;
}

/* 5) حقل readonly مميّز */
.form-control[readonly],
.form-control:read-only {
    background-color: rgba(212, 175, 55, 0.08) !important;
    color: #d4af37 !important;
    border-color: rgba(212, 175, 55, 0.4) !important;
    cursor: default;
    opacity: 0.95;
}

/* 6) حقل disabled */
.app-main-content .form-control:disabled,
.app-main-content .form-control[disabled],
.app-main-content .form-select:disabled {
    background-color: #F1F5F9 !important;
    color: #94A3B8 !important;
    border-color: #E2E8F0 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 7) تنسيق validation states */
.form-control.is-valid,
.was-validated .form-control:valid {
    border-color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.08) !important;
    padding-right: 2.5rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left calc(0.65em + 0.4rem) center !important;
    background-size: calc(0.8em + 0.6rem) calc(0.8em + 0.6rem) !important;
}

[dir="rtl"] .form-control.is-valid,
[dir="rtl"] .was-validated .form-control:valid {
    padding-left: 2.5rem !important;
    padding-right: 0.9rem !important;
    background-position: right calc(0.65em + 0.4rem) center !important;
}

.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.08) !important;
    padding-right: 2.5rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left calc(0.65em + 0.4rem) center !important;
    background-size: calc(0.8em + 0.6rem) calc(0.8em + 0.6rem) !important;
}

[dir="rtl"] .form-control.is-invalid,
[dir="rtl"] .was-validated .form-control:invalid {
    padding-left: 2.5rem !important;
    padding-right: 0.9rem !important;
    background-position: right calc(0.65em + 0.4rem) center !important;
}

/* 8) Select arrow alignment (RTL fix) */
.form-select {
    background-position: left 0.75rem center !important;
    padding-left: 2.25rem !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

[dir="rtl"] .form-select {
    background-position: right 0.75rem center !important;
    padding-left: 0.9rem !important;
    padding-right: 2.25rem !important;
}

/* 9) form-label alignment مع الـ input */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.form-label .text-danger {
    font-size: 0.95em;
}

/* 10) form-text: تنسيق النص التوضيحي تحت الحقل */
.form-text {
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.55) !important;
}

/* 11) Custom checkbox/radio: تنسيق ذهبي */
.app-main-content .form-check-input {
    background-color: #FFFFFF !important;
    border: 1.5px solid #CBD5E1 !important;
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.2em;
    transition: all 0.2s ease;
}

.app-main-content .form-check-input:checked {
    background-color: #d4af37 !important;
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25) !important;
    border-color: #d4af37 !important;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    color: rgba(255, 255, 255, 0.85);
}

/* 12) form-switch: مفتاح تبديل فاخر */
.form-switch .form-check-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255,255,255,0.8)'/%3e%3c/svg%3e") !important;
    width: 2.5em;
    height: 1.4em;
}

.form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23111827'/%3e%3c/svg%3e") !important;
}

/* 13) Floating Labels (form-floating) */
.form-floating > .form-control,
.form-floating > .form-select {
    height: 58px !important;
    min-height: 58px !important;
    padding: 1.2rem 0.9rem 0.4rem !important;
}

.form-floating > label {
    padding: 0.85rem 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: #d4af37;
    transform: scale(0.85) translateY(-0.5rem) translateX(0);
}

/* 14) File input: تنسيق رفع الملفات */
input[type="file"].form-control {
    padding: 0.5rem !important;
    line-height: 1.4;
}

input[type="file"].form-control::file-selector-button {
    padding: 0.45rem 0.9rem;
    margin: 0 0.75rem 0 0;
    background: var(--gold-gradient);
    color: #111827;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

[dir="rtl"] input[type="file"].form-control::file-selector-button {
    margin: 0 0 0 0.75rem;
}

input[type="file"].form-control::file-selector-button:hover {
    background: var(--gold-gradient-hover);
    transform: translateY(-1px);
}

/* 15) input[type=number]: إخفاء الأسهم الافتراضية لتطبيق أنيق */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* 16) input[type=date] & input[type=time]: تقويم مخصص */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(0deg);
    cursor: pointer;
    opacity: 0.7;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* 17) Placeholder animation */
.form-control::placeholder {
    transition: all 0.25s ease;
}

.form-control:focus::placeholder {
    transform: translateX(4px);
    opacity: 0.6;
}

/* 18) Focus-within: تأثير خاص على الـ field group */
.field-group:focus-within .form-label {
    color: #d4af37 !important;
}

.field-group {
    position: relative;
    transition: all 0.2s ease;
}

.field-group:focus-within {
    transform: translateY(-1px);
}

/* 19) تحسين form-control مع input-group بـ dir="rtl" */
[dir="rtl"] .input-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .input-group > .form-control,
[dir="rtl"] .input-group > .form-select {
    border-radius: 0.5rem !important;
}

[dir="rtl"] .input-group > .input-group-prepend + .form-control,
[dir="rtl"] .input-group > .input-group-prepend + .form-select {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

[dir="rtl"] .input-group > .form-control + .input-group-append,
[dir="rtl"] .input-group > .form-select + .input-group-append {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* 20) Gold highlight underline for required fields */
.form-label.text-warning {
    position: relative;
    padding-bottom: 0.2rem;
}

.form-label.text-warning::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #d4af37, transparent);
    border-radius: 1px;
}

[dir="ltr"] .form-label.text-warning::after {
    right: auto;
    left: 0;
    background: linear-gradient(90deg, transparent, #d4af37);
}

::-moz-selection {
    background-color: rgba(212, 175, 55, 0.4);
    color: #fff;
}

/* ==========================================================================
   LIGHT THEME FOR WORK AREA (.app-main-content)
   تحويل منطقة العمل إلى ألوان فاتحة مع كتابة غامقة
   ========================================================================== */

/* 1) الخلفية العامة لمنطقة العمل */
.app-content,
.app-main-content {
    background-color: #F8FAFC !important;
    color: #1E293B !important;
}

/* 2) تحويل كل النصوص الفاتحة داخل منطقة العمل إلى ألوان غامقة */
.app-main-content .text-white,
.app-main-content .text-light {
    color: #1E293B !important;
}

.app-main-content .text-white-50 {
    color: #64748B !important;
}

.app-main-content .text-white-75 {
    color: #475569 !important;
}

.app-main-content .text-muted {
    color: #64748B !important;
}

/* 3) تحويل الخلفيات الداكنة داخل منطقة العمل إلى خلفيات فاتحة */
.app-main-content .bg-dark {
    background-color: #F1F5F9 !important;
    color: #1E293B !important;
}

.app-main-content .bg-black {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
}

.app-main-content .bg-dark.bg-opacity-50,
.app-main-content .bg-dark.bg-opacity-25,
.app-main-content .bg-dark.bg-opacity-10 {
    background-color: rgba(241, 245, 249, var(--bs-bg-opacity, 1)) !important;
}

/* 4) البطاقات (Cards) في منطقة العمل */
.app-main-content .card,
.app-main-content .gold-card {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: rgba(212, 175, 55, 0.25) !important;
}

.app-main-content .card.bg-dark,
.app-main-content .gold-card.bg-dark {
    background-color: #F8FAFC !important;
    color: #1E293B !important;
}

/* 5) الـ Form Controls في منطقة العمل */
.app-main-content .form-control,
.app-main-content .form-select,
.app-main-content textarea,
.app-main-content input[type="text"],
.app-main-content input[type="email"],
.app-main-content input[type="password"],
.app-main-content input[type="number"],
.app-main-content input[type="tel"],
.app-main-content input[type="search"],
.app-main-content input[type="url"],
.app-main-content input[type="date"],
.app-main-content input[type="time"],
.app-main-content input[type="datetime-local"] {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: #CBD5E1 !important;
}

.app-main-content .form-control::placeholder,
.app-main-content .form-select::placeholder,
.app-main-content textarea::placeholder,
.app-main-content input::placeholder {
    color: #94A3B8 !important;
    opacity: 1 !important;
}

.app-main-content .form-control:focus,
.app-main-content .form-select:focus,
.app-main-content textarea:focus,
.app-main-content input:focus {
    background-color: #FFFFFF !important;
    color: #0F172A !important;
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18) !important;
}

.app-main-content .form-control:disabled,
.app-main-content .form-control[readonly],
.app-main-content input[readonly] {
    background-color: #F1F5F9 !important;
    color: #475569 !important;
    border-color: #E2E8F0 !important;
}

.app-main-content .input-group-text {
    background-color: #F1F5F9 !important;
    color: #475569 !important;
    border-color: #CBD5E1 !important;
}

.app-main-content .form-text {
    color: #64748B !important;
}

.app-main-content .form-label {
    color: #334155 !important;
}

/* 6) الجداول في منطقة العمل */
.app-main-content .table,
.app-main-content .table-gold,
.app-main-content .table-responsive table {
    color: #0F1E36 !important;
    --bs-table-bg: #FFFFFF;
    --bs-table-color: #0F1E36;
    --bs-table-hover-bg: #F4F8FD;
    --bs-table-hover-color: #0F1E36;
    background-color: #FFFFFF !important;
}

.app-main-content .table > :not(caption) > * > * {
    color: #0F1E36 !important;
    background-color: #FFFFFF !important;
    border-bottom-color: #E2E8F0 !important;
    transition: background-color 0.18s ease-in-out;
}

.app-main-content .table thead th,
.app-main-content .table-gold thead th {
    background-color: #F8FAFC !important;
    color: #0F1E36 !important;
    font-weight: 700;
    border-bottom: 2px solid var(--gold-primary) !important;
}

.app-main-content .table tbody tr:hover > *,
.app-main-content .table-gold tbody tr:hover > *,
.app-main-content .table-hover tbody tr:hover > * {
    background-color: #F4F8FD !important;
    color: #0F1E36 !important;
}

.app-main-content .table tbody td:hover,
.app-main-content .table-gold tbody td:hover {
    background-color: #EBF3FC !important;
    color: #0F1E36 !important;
}

.app-main-content .table-dark,
.app-main-content .table-gold.table-dark,
.app-main-content .table > .table-dark {
    --bs-table-bg: #FFFFFF;
    --bs-table-color: #0F1E36;
    background-color: #FFFFFF !important;
    color: #0F1E36 !important;
}

/* 7) القوائم المنسدلة والـ Navs */
.app-main-content .dropdown-menu {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}

.app-main-content .dropdown-item {
    color: #1E293B !important;
}

.app-main-content .dropdown-item:hover,
.app-main-content .dropdown-item:focus {
    background-color: rgba(212, 175, 55, 0.1) !important;
    color: #0F172A !important;
}

.app-main-content .nav-tabs {
    border-bottom-color: rgba(212, 175, 55, 0.2) !important;
}

.app-main-content .nav-tabs .nav-link {
    color: #475569 !important;
    border-color: transparent !important;
}

.app-main-content .nav-tabs .nav-link.active,
.app-main-content .nav-tabs .nav-item.show .nav-link {
    color: var(--gold-dark) !important;
    background-color: #FFFFFF !important;
    border-color: rgba(212, 175, 55, 0.3) rgba(212, 175, 55, 0.3) #FFFFFF !important;
}

.app-main-content .nav-pills .nav-link {
    color: #1E293B !important;
    background-color: #F1F5F9 !important;
}

.app-main-content .nav-pills .nav-link.active {
    color: #FFFFFF !important;
    background-color: var(--gold-primary) !important;
}

/* 8) الـ Modal في منطقة العمل */
.app-main-content .modal-content {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}

.app-main-content .modal-header,
.app-main-content .modal-footer {
    border-color: rgba(212, 175, 55, 0.2) !important;
}

/* 9) الـ Alerts في منطقة العمل */
.app-main-content .alert-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #065F46 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.app-main-content .alert-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #991B1B !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.app-main-content .alert-warning {
    background-color: rgba(245, 158, 11, 0.12) !important;
    color: #92400E !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.app-main-content .alert-info {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #1E40AF !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* 10) الـ Badges في منطقة العمل */
.app-main-content .badge.bg-dark,
.app-main-content .badge.bg-black {
    background-color: #334155 !important;
    color: #F1F5F9 !important;
}

/* 11) الـ List Groups في منطقة العمل */
.app-main-content .list-group-item {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: #E2E8F0 !important;
}

.app-main-content .list-group-item.active {
    background-color: var(--gold-primary) !important;
    color: #0F172A !important;
    border-color: var(--gold-primary) !important;
}

/* 12) الـ Accordion / Collapse في منطقة العمل */
.app-main-content .accordion-item {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: rgba(212, 175, 55, 0.15) !important;
}

.app-main-content .accordion-button {
    background-color: #F8FAFC !important;
    color: #1E293B !important;
}

.app-main-content .accordion-button:not(.collapsed) {
    background-color: rgba(212, 175, 55, 0.1) !important;
    color: #0F172A !important;
}

/* 13) الـ Pagination في منطقة العمل */
.app-main-content .page-link {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: #E2E8F0 !important;
}

.app-main-content .page-item.active .page-link {
    background-color: var(--gold-primary) !important;
    color: #0F172A !important;
    border-color: var(--gold-primary) !important;
}

/* 14) الـ Borders في منطقة العمل */
.app-main-content .border-secondary {
    border-color: #E2E8F0 !important;
}

.app-main-content .border-dark {
    border-color: #CBD5E1 !important;
}

/* 15) الـ Sections والعناوين داخل منطقة العمل */
.app-main-content h1, .app-main-content h2, .app-main-content h3,
.app-main-content h4, .app-main-content h5, .app-main-content h6 {
    color: #0F172A !important;
}

.app-main-content p {
    color: #334155 !important;
}

/* 16) الكود و pre */
.app-main-content code,
.app-main-content pre {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
    border: 1px solid #E2E8F0;
}

/* 17) حالة خاصة: .gold-card-header - تأكد من وضوح النص */
.app-main-content .gold-card-header {
    background: linear-gradient(to left, rgba(212, 175, 55, 0.08), transparent) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2) !important;
}

.app-main-content .gold-card-title {
    color: #0F172A !important;
}

/* 18) النصوص الذهبية (text-warning) تبقى كما هي للتمييز */
.app-main-content .text-warning,
.app-main-content .text-gold {
    color: var(--gold-dark) !important;
}

.app-main-content .text-info {
    color: #0369A1 !important;
}

/* 19) إصلاح placeholders والأيقونات داخل input-group */
.app-main-content .input-group-text i,
.app-main-content .input-group-text .bi {
    color: #64748B !important;
}

/* 20) تحسينات إضافية للـ button outline داخل منطقة العمل */
.app-main-content .btn-outline-light {
    color: #1E293B !important;
    border-color: #CBD5E1 !important;
}

.app-main-content .btn-outline-light:hover {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
}

/* 21) List group flush داخل region العمل */
.app-main-content .text-white-50.bg-dark,
.app-main-content .text-white.bg-dark {
    color: #1E293B !important;
    background-color: #F1F5F9 !important;
}

/* 22) Table responsive wrapper - لا تغييرات */
.app-main-content .table-responsive {
    background-color: #FFFFFF !important;
    border-radius: var(--radius-md);
}

/* 23) صندوق البحث (search box) */
.app-main-content .search-box,
.app-main-content .search-input {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: #CBD5E1 !important;
}

/* 24) Stat Cards - أرقام وإحصائيات */
.app-main-content .stat-card,
.app-main-content .stat-value {
    color: #0F172A !important;
}

.app-main-content .stat-label {
    color: #64748B !important;
}

/* 25) إصلاح جميع العناصر التي لها خلفية داكنة ضمن منطقة العمل */
.app-main-content [class*="bg-dark"],
.app-main-content [class*="bg-black"] {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
}

/* استثناء: شارات الـ ZATCA الجاهزة تبقى ذهبية */
.app-main-content .badge-gold-status {
    color: inherit;
}

/* 26) الصور داخل منطقة العمل تبقى كما هي */
.app-main-content img {
    max-width: 100%;
    height: auto;
}

/* 27) Checkbox/Radio Light Theme */
.app-main-content .form-check-input {
    background-color: #FFFFFF !important;
    border: 1.5px solid #CBD5E1 !important;
}

.app-main-content .form-check-input:checked {
    background-color: #d4af37 !important;
    border-color: #d4af37 !important;
}

.app-main-content .form-check-label {
    color: #334155 !important;
}

/* 28) Floating Labels */
.app-main-content .form-floating > label {
    color: #64748B !important;
    background-color: transparent !important;
}

.app-main-content .form-floating > .form-control:focus ~ label,
.app-main-content .form-floating > .form-control:not(:placeholder-shown) ~ label,
.app-main-content .form-floating > .form-select ~ label {
    color: var(--gold-dark) !important;
    background-color: #FFFFFF !important;
}

/* 29) File Input */
.app-main-content input[type="file"].form-control {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: #CBD5E1 !important;
}

/* 30) Custom Scrollbar لمنطقة العمل (Light) */
.app-main-content ::-webkit-scrollbar-track {
    background: #F1F5F9;
}

.app-main-content ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #D4AF37, #AA7C11);
    border-radius: 8px;
}

.app-main-content ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FFD700, #B8860B);
}

/* 31) ضمان عدم تأثر Sidebar (يجب أن تبقى داكنة) */
.app-content > aside.app-sidebar,
.app-content > .app-sidebar {
    background: linear-gradient(180deg, #111827 0%, #0B0F19 100%) !important;
    color: #FFFFFF !important;
}

/* 32) ضمان عدم تأثر Topbar (أبيض نظيف) */
.app-content > .app-topbar {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.app-content > .app-topbar .btn-dark {
    background-color: #F1F5F9 !important;
    color: #1E293B !important;
    border-color: #CBD5E1 !important;
}

.app-content > .app-topbar .btn-dark.dropdown-toggle {
    color: var(--gold-dark) !important;
    border-color: var(--gold-primary) !important;
    background-color: rgba(212, 175, 55, 0.08) !important;
}

/* 33) إصلاح dropdown-menu داخل الـ topbar */
.app-content > .app-topbar .dropdown-menu {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    border-color: rgba(212, 175, 55, 0.2) !important;
}

.app-content > .app-topbar .dropdown-menu .dropdown-item {
    color: #1E293B !important;
}

/* 34) Print: عند الطباعة، استخدم ألوان فاتحة */
@media print {
    .app-content,
    .app-main-content {
        background-color: #FFFFFF !important;
        color: #000000 !important;
    }

    .app-main-content .form-control,
    .app-main-content .form-select {
        background-color: #FFFFFF !important;
        color: #000000 !important;
        border-color: #000000 !important;
    }
}

/* 35) Responsive - تأكيد الثبات على كل الأحجام */
@media (max-width: 991.98px) {
    .app-main-content {
        background-color: #F8FAFC !important;
    }
}

@media (max-width: 575.98px) {
    .app-main-content {
        background-color: #F8FAFC !important;
        padding: 20px 15px !important;
    }
}

/* ==========================================================================
   36) LUXURY PWA INSTALL TOAST & OFFLINE STYLING (ROYAL NAVY & GOLD)
   ========================================================================== */

.pwa-install-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 480px;
    margin: 0 auto;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.pwa-install-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.pwa-toast-card {
    background: rgba(13, 27, 46, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(212, 175, 55, 0.25);
    position: relative;
    color: #F8FAFC;
}

.pwa-toast-close {
    position: absolute;
    top: 12px;
    left: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94A3B8;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.pwa-toast-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.pwa-toast-body {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding-left: 20px;
}

.pwa-toast-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    background: #070c14;
    border: 1.5px solid var(--gold-primary);
    border-radius: 14px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.pwa-toast-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.pwa-toast-info {
    flex-grow: 1;
}

.pwa-toast-title {
    font-size: 15px;
    font-weight: 800;
    color: #FFF;
    margin-bottom: 3px;
    background: linear-gradient(135deg, #FFF0B3 0%, #F3E5AB 40%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pwa-toast-desc {
    font-size: 12px;
    color: #94A3B8;
    margin: 0;
    line-height: 1.4;
}

.pwa-toast-actions {
    display: flex;
    gap: 10px;
}

.pwa-btn-install {
    width: 100%;
    background: linear-gradient(135deg, #FFF0B3 0%, #F3E5AB 30%, #D4AF37 70%, #AA7C11 100%);
    color: #070c14;
    border: none;
    padding: 11px 18px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

.pwa-btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(212, 175, 55, 0.45);
    background: linear-gradient(135deg, #FFF9D2 0%, #FFD700 50%, #DAA520 100%);
}

.pwa-ios-guide {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    font-size: 12px;
    color: #E2E8F0;
    line-height: 1.6;
}

.pwa-ios-step {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

/* Network Real-time Pill Toast */
.pwa-network-pill {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    opacity: 0;
    z-index: 99999;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.pwa-network-pill.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-network-pill.online {
    background: rgba(16, 185, 129, 0.95);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pwa-network-pill.offline {
    background: rgba(239, 68, 68, 0.95);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Update Notification Toast */
.pwa-update-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.pwa-update-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.pwa-update-card {
    background: #0d1b2e;
    border: 1px solid var(--gold-primary);
    border-radius: 14px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #FFF;
}

.btn-update-now {
    background: var(--gold-gradient);
    color: #070c14;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

/* ==========================================================================
   COMPLETE 10/10 RESPONSIVE BREAKPOINT SYSTEM (GLOBAL SAAS & POS STANDARDS)
   ========================================================================== */

/* Safe Area Insets for Modern Smartphones (iOS Notch & Dynamic Island) */
:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* Dynamic Mobile Backdrop with Glassmorphic Blur */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 18, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Close Button in Mobile Drawer */
.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #A3BDDB;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.sidebar-close-btn:hover,
.sidebar-close-btn:active {
    background: rgba(239, 68, 68, 0.25);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.5);
    transform: rotate(90deg) scale(1.05);
}

/* Topbar Sandwich Toggle Button */
.topbar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(8, 118, 233, 0.1) 0%, rgba(212, 175, 55, 0.08) 100%);
    border: 1px solid rgba(8, 118, 233, 0.25);
    color: var(--logo-blue);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 10px rgba(8, 118, 233, 0.12);
}

.topbar-toggle:hover,
.topbar-toggle:active {
    background: var(--logo-gradient);
    color: #FFFFFF;
    transform: scale(1.06);
    box-shadow: var(--logo-glow);
    border-color: transparent;
}

/* Mobile Bottom Navigation Bar with iOS Safe Area */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: rgba(8, 17, 32, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(212, 175, 55, 0.22);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    padding-left: 10px;
    padding-right: 10px;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.4);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #8FA4BF;
    font-size: 11px;
    font-weight: 600;
    flex: 1;
    padding: 6px 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.mobile-nav-item i {
    font-size: 20px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-nav-item.active,
.mobile-nav-item:hover,
.mobile-nav-item:active {
    color: var(--gold-bright);
}

.mobile-nav-item.active i {
    color: var(--gold-bright);
    transform: translateY(-2px);
}

.mobile-nav-action {
    position: relative;
}

.mobile-nav-action .action-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gold-gradient);
    color: #060D18;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    margin-top: -22px;
    box-shadow: 0 4px 18px rgba(212, 175, 55, 0.45);
    border: 3px solid #081120;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.mobile-nav-action:hover .action-circle,
.mobile-nav-action:active .action-circle {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.65);
}

/* ==========================================================================
   BREAKPOINTS SPECTRUM (320px -> 4K)
   ========================================================================== */

/* 1. Ultra-Wide Screens (>= 1600px) */
@media (min-width: 1600px) {
    .app-main-content {
        max-width: 1750px;
        margin: 0 auto;
        width: 100%;
    }
}

/* 2. Desktop Mode (>= 992px) */
@media (min-width: 992px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    .sidebar-close-btn {
        display: none !important;
    }

    .mobile-bottom-nav {
        display: none !important;
    }
}

/* 3. Tablet & Mobile Drawer (< 992px) */
@media (max-width: 991.98px) {
    body.sidebar-open {
        overflow: hidden !important;
        touch-action: none;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        width: 310px;
        max-width: 86vw;
        height: 100vh;
        height: 100dvh;
        z-index: 1050;
        transform: translateX(100%);
        transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.34s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: none;
    }

    /* LTR Support */
    html[dir="ltr"] .app-sidebar {
        right: auto;
        left: 0;
        transform: translateX(-100%);
    }

    /* Open Drawer State */
    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: -10px 0 45px rgba(0, 0, 0, 0.7);
    }

    html[dir="ltr"] .app-sidebar.show {
        box-shadow: 10px 0 45px rgba(0, 0, 0, 0.7);
    }

    /* Main Content Spacing on Mobile (Clearing Bottom Bar) */
    .app-main-content {
        padding: 20px 16px calc(80px + var(--safe-area-bottom)) 16px;
    }

    .app-topbar {
        padding: 0 16px;
        height: 64px;
    }

    .topbar-title {
        font-size: 16px;
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Welcome Hero Responsive */
    .welcome-hero {
        padding: 20px 18px;
    }

    .welcome-hero h1 {
        font-size: 20px;
    }

    /* POS Mobile Stack */
    .pos-cart-panel {
        min-height: auto !important;
        border-left: none !important;
        border-top: 2px solid #d4af37;
        margin-top: 1rem;
    }
}

/* 4. Medium Mobile Phones (< 768px) */
@media (max-width: 767.98px) {
    /* Responsive Filter & Search Bars */
    .filter-bar,
    .search-filter-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .filter-bar .form-control,
    .filter-bar .form-select,
    .filter-bar .btn {
        width: 100% !important;
    }

    /* Invoice Creation Table Column Touch Constraints */
    #itemsTable th,
    #itemsTable td {
        white-space: nowrap;
    }

    #itemsTable input.form-control {
        min-width: 90px;
    }

    #itemsTable td:first-child input.form-control {
        min-width: 140px;
    }
}

/* 5. Small Mobile Phones (< 576px - iPhone, Android) */
@media (max-width: 575.98px) {
    .app-main-content {
        padding: 14px 12px calc(80px + var(--safe-area-bottom)) 12px;
    }

    .app-topbar {
        padding: 0 12px;
        height: 60px;
    }

    .topbar-title {
        font-size: 15px;
        max-width: 135px;
    }

    .gold-card-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .gold-card-title {
        font-size: 15px;
    }

    .card-body {
        padding: 14px;
    }

    /* Form Fields & Touch Ergonomics (Apple HIG 44px) */
    .form-control,
    .form-select,
    .btn {
        min-height: 44px;
        font-size: 14px;
    }

    /* Mobile Bottom Sheet Modals */
    .modal-dialog {
        margin: 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        max-width: 100% !important;
    }

    .modal-content {
        border-radius: 20px 20px 0 0 !important;
        border: 1px solid rgba(212, 175, 55, 0.3) !important;
        max-height: 85vh;
        overflow-y: auto;
    }

    /* Quick Action Button Group Stacking */
    .btn-group-responsive {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .btn-group-responsive .btn {
        width: 100%;
    }

    /* Pagination Mobile Ergonomics */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
}

/* 6. Extra-Small Devices / Foldables (< 380px) */
@media (max-width: 379.98px) {
    .topbar-title {
        font-size: 14px;
        max-width: 105px;
    }

    .mobile-nav-item span {
        font-size: 10px;
    }

    .brand-title {
        font-size: 16px;
    }

    .invoice-type-card {
        padding: 12px 10px;
    }
}

/* Smooth Momentum Touch Scrolling for Data Tables */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: rgba(212, 175, 55, 0.3);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

/* Print Stylesheet Isolation */
@media print {
    .app-sidebar,
    .app-topbar,
    .mobile-bottom-nav,
    .sidebar-backdrop,
    .btn-gold,
    .btn,
    .no-print {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

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

/* ==========================================================================
   WCAG 2.1 & 2.2 LEVEL AA/AAA ACCESSIBILITY SYSTEM
   ========================================================================== */

/* 1. Skip to Main Content Link */
.skip-to-content {
    position: fixed;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: #060D18;
    color: #FFD700;
    border: 2px solid #D4AF37;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 15px;
    z-index: 999999;
    text-decoration: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.5);
    transition: top 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.skip-to-content:focus {
    top: 16px;
    outline: 3px solid #50D6FB;
    outline-offset: 3px;
}

/* 2. Keyboard Navigation Focus Visible Rings (WCAG 2.4.7 & 2.4.11) */
:focus-visible {
    outline: 2.5px solid #FFD700 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(8, 118, 233, 0.45) !important;
}

/* 3. Screen Reader Only Utility */
.visually-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 4. Motion Sensitivity & Vestibular Accessibility (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 5. Windows High Contrast Mode & Forced Colors (WCAG 1.4.1 & 1.4.11) */
@media (forced-colors: active) {
    .menu-link.active,
    .btn-gold,
    .topbar-toggle,
    .mobile-nav-action .action-circle,
    .badge {
        border: 2px solid ButtonText !important;
    }

    .topbar-toggle:focus-visible,
    .btn:focus-visible {
        outline: 3px solid Highlight !important;
    }
}

/* 6. Custom High-Contrast Accessibility Mode */
body.high-contrast {
    background-color: #000000 !important;
    color: #FFFFFF !important;
}

body.high-contrast .gold-card,
body.high-contrast .app-topbar,
body.high-contrast .app-sidebar,
body.high-contrast .modal-content {
    background-color: #000000 !important;
    border: 2px solid #FFD700 !important;
    color: #FFFFFF !important;
}

body.high-contrast .table {
    color: #FFFFFF !important;
}

body.high-contrast .table td,
body.high-contrast .table th {
    border-color: #FFD700 !important;
    color: #FFFFFF !important;
    background-color: #000000 !important;
}

body.high-contrast .text-muted {
    color: #E2E8F0 !important;
}

body.high-contrast .form-control,
body.high-contrast .form-select {
    background-color: #000000 !important;
    border: 2px solid #FFD700 !important;
    color: #FFFFFF !important;
}

/* 7. Accessible Dynamic Font Sizing */
body.text-size-lg {
    font-size: 110% !important;
}

body.text-size-lg .fs-7 {
    font-size: 0.95rem !important;
}

body.text-size-lg .fs-8 {
    font-size: 0.88rem !important;
}

body.text-size-xl {
    font-size: 125% !important;
}

body.text-size-xl .fs-7 {
    font-size: 1.05rem !important;
}

body.text-size-xl .fs-8 {
    font-size: 0.98rem !important;
}

/* 8. Royal Golden Shimmer Animation (CTA Polish) */
.btn-gold, .btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-gold::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    transition: all 0.75s ease-in-out;
}

.btn-gold:hover::after {
    left: 130%;
}

/* 9. Real-time PWA Network Toast Pill */
.pwa-network-pill {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0A1629;
    color: #FFFFFF;
    border: 1.5px solid #D4AF37;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    z-index: 9999999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.pwa-network-pill.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pwa-network-pill.online i {
    color: #10B981;
}

.pwa-network-pill.offline {
    border-color: #EF4444;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(239, 68, 68, 0.3);
}

.pwa-network-pill.offline i {
    color: #EF4444;
}

/* 10. Floating Luxury PWA Installation Toast */
.pwa-install-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    max-width: 380px;
    width: calc(100% - 40px);
    z-index: 999999;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.pwa-install-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.pwa-toast-card {
    background: linear-gradient(135deg, #0A1629 0%, #060D18 100%);
    border: 1.5px solid #D4AF37;
    border-radius: 20px;
    padding: 18px;
    color: #FFFFFF;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(212, 175, 55, 0.25);
    position: relative;
}

.pwa-toast-close {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #CBD5E1;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.pwa-toast-close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.pwa-toast-body {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.pwa-toast-icon img {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.pwa-toast-title {
    font-size: 15px;
    font-weight: 800;
    color: #FFD700;
    margin-bottom: 2px;
}

.pwa-toast-desc {
    font-size: 12px;
    color: #94A3B8;
    line-height: 1.4;
    margin: 0;
}

.pwa-btn-install {
    width: 100%;
    background: linear-gradient(135deg, #FFD700 0%, #D4AF37 100%);
    color: #060D18;
    font-weight: 800;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pwa-btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* 11. PWA Update Notification Toast */
.pwa-update-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 999999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-update-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pwa-update-card {
    background: #0A1629;
    border: 1.5px solid #D4AF37;
    border-radius: 50px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #FFFFFF;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.pwa-update-card .btn-update-now {
    background: #FFD700;
    color: #060D18;
    border: none;
    font-weight: 800;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
}




