@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --accent-blue: #d4af37;
    --accent-green: #2ecc71;
    --accent-red: #e74c3c;
    --accent-orange: #f59f00;
    --text-primary: #212529;
    --text-secondary: #495057;
    --border-color: #dee2e6;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);

    /* Premium Glass Design System */
    --premium-gold: #D4AF37;
    --premium-gold-light: #E8C65A;
    --premium-silver: #F4F2F7;
    --premium-glass: rgba(255, 255, 255, 0.6);
    --premium-glass-dark: rgba(255, 255, 255, 0.8);
    --premium-glass-border: rgba(255, 255, 255, 0.4);
    --premium-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    --premium-blur: blur(15px);
    
    /* Modern Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(212, 175, 55, 0.12);
    --glass-blur: blur(20px);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
    --shadow-gold: 0 8px 32px rgba(212, 175, 55, 0.15);
    --shadow-gold-lg: 0 16px 48px rgba(212, 175, 55, 0.2);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ── Premium Reveal Animations ── */
.dash-reveal {
    opacity: 0;
    transform: translateY(25px);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-reveal-left {
    opacity: 0;
    transform: translateX(-35px);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-reveal-right {
    opacity: 0;
    transform: translateX(35px);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-reveal-scale {
    opacity: 0;
    transform: scale(0.94);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.revealed {
    opacity: 1 !important;
    transform: translate(0, 0) scale(1) !important;
}

/* Stagger Logic */
.dash-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.dash-stagger > *:nth-child(2) { transition-delay: 0.10s; }
.dash-stagger > *:nth-child(3) { transition-delay: 0.15s; }
.dash-stagger > *:nth-child(4) { transition-delay: 0.20s; }
.dash-stagger > *:nth-child(5) { transition-delay: 0.25s; }
.dash-stagger > *:nth-child(6) { transition-delay: 0.30s; }

/* ── Premium Glass Cards ── */
.premium-glass-card {
    background: var(--premium-glass);
    backdrop-filter: var(--premium-blur);
    -webkit-backdrop-filter: var(--premium-blur);
    border: 1px solid var(--premium-glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--premium-shadow);
    transition: all var(--transition-smooth);
}

.premium-glass-card:hover {
    background: var(--premium-glass-dark);
    transform: translateY(-5px);
    box-shadow: 0 18px 46px rgba(212, 175, 55, 0.18);
    border-color: rgba(212, 175, 55, 0.4);
}

.premium-text-gradient {
    color: var(--premium-gold);
}

/* Image Protection */
img {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: auto;
}

/* ── Compact Status Toggle (Top-Right) ── */
.status-pill {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    transition: all var(--transition-smooth) !important;
    width: auto !important;
    height: auto !important;
}

.status-pill:hover {
    background: var(--premium-glass-dark) !important;
    border-color: rgba(212, 175, 55, 0.4) !important;
    transform: translateY(-2px);
}

.status-pill .status-label {
    display: none !important; /* Hide label as requested */
}

.status-pill .switch {
    width: 60px !important;
    height: 34px !important;
}

.status-pill .slider:before {
    height: 26px !important;
    width: 26px !important;
    left: 4px !important;
    bottom: 4px !important;
}

.status-pill input:checked + .slider:before {
    transform: translateX(26px) !important;
}

/* RTL Global Support */
[dir="rtl"] body {
    font-family: 'Cairo', sans-serif !important;
    text-align: right;
}

[dir="rtl"] .dashboard-layout {
    direction: ltr !important;
}

[dir="rtl"] .sidebar,
[dir="rtl"] .main-content {
    direction: rtl !important;
}

[dir="rtl"] .menu-header {
    padding-left: 0;
    padding-right: 12px;
}

[dir="rtl"] .premium-icon {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .lang-switch {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .header {
    flex-direction: row-reverse;
}

/* Flip margins/paddings for typical utilities if used, or handle in component styles */
[dir="rtl"] .nav-link {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-link i {
    margin-left: 10px;
    margin-right: 0;
}

[dir="rtl"] .sidebar-server-selector {
    flex-direction: row-reverse;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Modern Glassmorphism */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    padding: 0;
    border-right: 1px solid var(--glass-border);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.sidebar-content {
    padding: 20px 16px;
    flex: 1;
}

.logo {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 20px;
    margin-bottom: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.3), transparent);
}

.logo-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo img {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(212,175,55,0.2);
    border: 2px solid rgba(212,175,55,0.2);
}

.logo h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-top: 24px;
    margin-bottom: 8px;
    padding-left: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.menu-header i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.menu-header i.fa-chevron-down {
    transform: rotate(180deg);
}

.menu-header:first-child {
    margin-top: 10px;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(212, 175, 55, 0.08);
    color: var(--accent-blue);
    transform: none;
    border-color: rgba(212, 175, 55, 0.15);
}

.nav-link.active {
    background: rgba(212, 175, 55, 0.12);
    color: var(--accent-blue);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

.nav-link i {
    width: 22px;
    font-size: 1.1rem;
    text-align: center;
    color: var(--text-secondary);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-link:hover i,
.nav-link.active i {
    color: var(--accent-blue);
    transform: scale(1.1);
}

/* Sidebar Server Selector */
.sidebar-server-selector {
    margin-top: 12px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.server-icon-small {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
}

.sidebar-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.sidebar-select:hover {
    border-color: var(--accent-blue);
}

.sidebar-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(176, 141, 59, 0.1);
}

/* Premium Crown Icon Style (Simulation) */
.premium-icon {
    margin-left: auto;
    color: #FEE75C;
    font-size: 0.8rem;
}

/* Dashboard Cards and Layout (Generic) - Modern Glass */
.dash-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(212, 175, 55, 0.16);
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.07), inset 0 1px 0 rgba(255,255,255,0.85);
    transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.6, 1), box-shadow 0.35s ease, border-color 0.3s ease;
}

.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 44px rgba(212, 175, 55, 0.16), inset 0 1px 0 rgba(255,255,255,0.95);
    border-color: rgba(212, 175, 55, 0.38);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dash-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Table Styles */
.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

[dir="rtl"] .dash-table th {
    text-align: right;
}

.dash-table td {
    padding: 12px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.dash-table tr:last-child td {
    border-bottom: none;
}

/* Coin Row (Module Icon) */
.coin-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: fadeIn 0.5s ease-out;
    padding: 30px 40px;
    flex: 1;
    overflow-y: auto;
}

/* Grid Layout */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto;
    gap: 24px;
}

.widget-overview {
    grid-column: span 1;
}

.widget-chart-sm {
    grid-column: span 1;
}

.widget-main-chart {
    grid-column: span 2;
    grid-row: span 2;
}

.widget-list-1 {
    grid-column: span 2;
    grid-row: span 2;
}

.widget-list-2 {
    grid-column: span 4;
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .dashboard-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }

    .widget-overview,
    .widget-chart-sm {
        grid-column: span 1;
    }

    .widget-main-chart {
        grid-column: span 2;
    }

    .widget-list-1 {
        grid-column: span 2;
    }

    .widget-list-2 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        display: none;
        /* Mobile menu needed */
    }

    .main-content {
        padding: 20px;
    }
}

/* =========================================
   Bento Grid Redesign (Home Page - Frieren Theme)
   ========================================= */

.home-body {
    background: #F4F2F7;
    /* Pale silver-purple (Frieren Hair) */
    color: #1E2233;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[dir="rtl"] .home-body {
    font-family: 'Cairo', sans-serif;
}

/* Home Header */
.bento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
    color: #1a1a1a;
}

.logo-area img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.bento-nav {
    display: flex;
    gap: 30px;
}

.bento-nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.bento-nav a:hover {
    color: #D4AF37;
    /* Frieren Gold */
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.lang-toggle {
    text-decoration: none;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.lang-toggle:hover {
    color: #D4AF37;
}

/* Primary Button (Gold) */
.btn-bento-primary {
    background: #D4AF37;
    /* Frieren Bright Gold */
    color: #fff;
    padding: 10px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    border: 1px solid #C8A127;
}

.btn-bento-primary:hover {
    background: #C8A127;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* Dark Button (Dark Slate) */
.btn-bento-black {
    background: #1E2233;
    color: #fff;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-bento-black:hover {
    background: #2A3047;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 34, 51, 0.3);
}

[dir="rtl"] .btn-bento-black i {
    transform: rotate(180deg);
}

/* Bento Container */
.bento-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
    max-width: 1400px;
    margin: 20px auto;
    width: 95%;
    padding-bottom: 40px;
}

.bento-item {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-2xl);
    padding: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid var(--glass-border);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.bento-item:hover {
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-gold-lg), inset 0 1px 0 rgba(255,255,255,0.9);
}

/* Hero Item - Modern Glass */
.hero-card {
    grid-column: span 2;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.8);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.hero-card:hover {
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-gold-lg), inset 0 1px 0 rgba(255,255,255,0.9);
}

.hero-text {
    flex: 1;
    max-width: 500px;
    z-index: 2;
}

.hero-text h1 {
    font-size: 3.2rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #1a1a1a;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-subtext p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.hero-social-proof {
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatars {
    display: flex;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #fff;
    background-size: cover;
    margin-left: -12px;
    background-color: #eee;
}

.avatar:first-child {
    margin-left: 0;
}

[dir="rtl"] .avatar {
    margin-right: -12px;
    margin-left: 0;
}

[dir="rtl"] .avatar:first-child {
    margin-right: 0;
}

/* Phone Visual */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.phone-mockup {
    width: 260px;
    height: 480px;
    background: #2D2D2D;
    border-radius: 40px;
    padding: 8px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
    border: 4px solid #444;
    position: relative;
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.phone-mockup:hover {
    transform: rotate(0deg) scale(1.02);
}

.phone-screen {
    background: #fff;
    width: 100%;
    height: 100%;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.app-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #333;
}

.app-header img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.app-balance-card {
    margin: 10px 20px;
    background: #FAFAFA;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    border: 1px solid #eee;
}

.app-balance-card .label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
}

.app-balance-card .amount {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #D4AF37;
}

/* Gold text */
.status-badge {
    background: #E8F5E9;
    color: #2E7D32;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 10px;
}

.app-menu-grid {
    margin-top: auto;
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.menu-item {
    color: #ddd;
    font-size: 1.2rem;
}

.menu-item.active {
    color: #D4AF37;
}

/* Secondary Cards */
.servers-card {
    grid-column: span 1;
    background: #2D2D2D;
    /* Dark Grey like Frieren's leggings/accent */
    color: #fff;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
}

.servers-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.servers-list::-webkit-scrollbar {
    width: 4px;
}

.servers-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 2px;
}

.server-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #444;
}

.server-row:last-child {
    border-bottom: none;
}

.server-row img,
.server-icon-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.server-info {
    display: flex;
    flex-direction: column;
}

.server-info .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.server-info .count {
    font-size: 0.8rem;
    color: #aaa;
}

/* Feature Cards - Modern Glass */
.feature-card-1 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.feature-card-2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 249, 230, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.icon-circle {
    width: 56px;
    height: 56px;
    background: rgba(255, 240, 240, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #C0392B;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(192, 57, 43, 0.1);
}

/* Feature 2 specifics */
.feature-card-2 .icon-circle {
    background: rgba(255, 255, 255, 0.9);
    color: #C5A059;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.15);
}

.bento-item h3 {
    font-size: 1.3rem;
    margin: 0 0 10px 0;
    font-weight: 700;
    color: #2D2D2D;
}

.bento-item p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

/* CTA Card: Spans 3 columns in the bottom row - Modern Glass */
.cta-card {
    grid-column: span 3;
    background: linear-gradient(135deg, #C5A059 0%, #d4af37 50%, #e8c65a 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 48px 64px;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.cta-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.cta-content p {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.btn-bento-outline {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-bento-outline:hover {
    background: #fff;
    color: #C5A059;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .bento-container {
        grid-template-columns: 1fr 1fr;
    }

    .hero-card {
        grid-column: span 2;
        flex-direction: column;
        text-align: center;
        gap: 40px;
        padding: 40px;
    }

    .hero-text {
        margin: 0 auto;
        max-width: 100%;
    }

    .hero-visual {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .servers-card {
        grid-column: span 1;
    }

    .feature-card-1 {
        grid-column: span 1;
    }

    .feature-card-2 {
        grid-column: span 1;
    }

    .cta-card {
        grid-column: span 2;
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .bento-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .bento-nav {
        display: none;
    }

    .bento-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding-bottom: 20px;
    }

    .hero-card {
        grid-column: span 1;
        padding: 30px 20px;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .phone-mockup {
        width: 220px;
        height: 420px;
    }

    .servers-card,
    .feature-card-1,
    .feature-card-2,
    .cta-card {
        grid-column: span 1;
        padding: 25px;
    }

    .cta-card {
        padding: 30px 20px;
    }

    .cta-content h2 {
        font-size: 1.5rem;
    }
}


[dir="rtl"] .home-body {
    font-family: 'Cairo', sans-serif;
}

/* Home Header */
.bento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
    color: #111;
}

.logo-area img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.bento-nav {
    display: flex;
    gap: 30px;
}

.bento-nav a {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.bento-nav a:hover {
    color: #111;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.lang-toggle {
    text-decoration: none;
    color: #4b5563;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-bento-primary {
    background: #ceff00;
    /* Neon Lime from reference */
    color: #000;
    padding: 10px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #b8e600;
}

.btn-bento-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(206, 255, 0, 0.4);
}

.btn-bento-black {
    background: #000;
    color: #fff;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-bento-black:hover {
    background: #222;
    transform: translateY(-2px);
}

[dir="rtl"] .btn-bento-black i {
    transform: rotate(180deg);
}

/* Bento Container */
.bento-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto;
    /* Two rows implicitly */
    gap: 20px;
    max-width: 1400px;
    margin: 20px auto;
    width: 95%;
    padding-bottom: 40px;
}

.bento-item {
    background: #fff;
    border-radius: 32px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    /* Clean white look */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

/* Hero Item */
.hero-card {
    grid-column: span 2;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px;
}

.hero-text {
    flex: 1;
    max-width: 500px;
    z-index: 2;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #000;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-subtext p {
    color: #6b7280;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.hero-social-proof {
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatars {
    display: flex;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #fff;
    background-size: cover;
    margin-left: -12px;
    background-color: #eee;
}

.avatar:first-child {
    margin-left: 0;
}

[dir="rtl"] .avatar {
    margin-right: -12px;
    margin-left: 0;
}

[dir="rtl"] .avatar:first-child {
    margin-right: 0;
}

/* Phone Visual */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.phone-mockup {
    width: 280px;
    height: 500px;
    background: #000;
    border-radius: 40px;
    padding: 10px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 4px solid #333;
    position: relative;
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.phone-mockup:hover {
    transform: rotate(0deg) scale(1.02);
}

.phone-screen {
    background: #fff;
    width: 100%;
    height: 100%;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.app-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.app-header img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.app-balance-card {
    margin: 10px 20px;
    background: #f3f4f6;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
}

.app-balance-card .label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.app-balance-card .amount {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #111;
}

.status-badge {
    background: #dcfce7;
    color: #166534;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 10px;
}

.app-menu-grid {
    margin-top: auto;
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.menu-item {
    color: #ccc;
    font-size: 1.2rem;
}

.menu-item.active {
    color: #000;
}

/* Secondary Cards */
.servers-card {
    grid-column: span 1;
    background: #000;
    /* Dark contrast card */
    color: #fff;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
}

.servers-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.servers-list::-webkit-scrollbar {
    width: 4px;
}

.servers-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

.server-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

.server-row:last-child {
    border-bottom: none;
}

.server-row img,
.server-icon-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.server-info {
    display: flex;
    flex-direction: column;
}

.server-info .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.server-info .count {
    font-size: 0.8rem;
    color: #888;
}

/* Feature Cards */
.feature-card-1,
.feature-card-2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.icon-circle {
    width: 50px;
    height: 50px;
    background: #fdf2f8;
    color: #db2777;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.bento-item h3 {
    font-size: 1.3rem;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.bento-item p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

/* CTA Card: Spans 3 columns in the bottom row */
.cta-card {
    grid-column: span 3;
    background: #ceff00;
    /* Neon Lime */
    color: #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 40px 60px;
}

.cta-content h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 5px 0;
}

.cta-content p {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

.btn-bento-outline {
    background: transparent;
    border: 2px solid #000;
    color: #000;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-bento-outline:hover {
    background: #000;
    color: #ceff00;
}

/* Responsive */
@media (max-width: 1024px) {
    .bento-container {
        grid-template-columns: 1fr 1fr;
    }

    .hero-card {
        grid-column: span 2;
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .hero-text {
        margin: 0 auto;
    }

    .hero-visual {
        width: 100%;
    }

    .servers-card {
        grid-column: span 1;
    }

    .feature-card-1 {
        grid-column: span 1;
    }

    .feature-card-2 {
        grid-column: span 1;
    }

    /* CTA card breaks to span 2 if needed or stack */
    .cta-card {
        grid-column: span 2;
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .bento-container {
        grid-template-columns: 1fr;
    }

    .hero-card,
    .servers-card,
    .feature-card-1,
    .feature-card-2,
    .cta-card {
        grid-column: span 1;
    }

    .bento-header {
        flex-direction: column;
        gap: 20px;
    }

    .bento-nav {
        display: none;
    }

    /* Simplified nav for mobile */
    .cta-card {
        flex-direction: column;
    }
}

/* Dark Mode Overrides for Home Page only if User Prefers or Logic Dictates 
   For now, we stick to the white/clean look of the reference, but if the dashboard 
   is dark, we might want a dark version. Given 'FinTech' reference, clean white is standard.
*/

\n

/* =========================================
   SAGE THEME - GRAPHIC DESIGNERS VIBE (Reverted)
   ========================================= */
.sage-theme {
    background-color: #ffedc9;
    color: #111;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

.sage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.sage-header-left,
.sage-header-right {
    display: flex;
    align-items: center;
}

.sage-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 30px;
}

.sage-logo i {
    font-size: 1.4rem;
}

.sage-location-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    color: #333;
    font-weight: 500;
}

.sage-header-right {
    gap: 30px;
}

.sage-header-right a {
    text-decoration: none;
    color: #111;
    font-weight: 500;
    font-size: 0.95rem;
}

.sage-btn-black {
    background: #111;
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: 0.3s;
}

.sage-btn-black:hover {
    background: #333;
    transform: translateY(-2px);
}

.sage-btn-outline {
    background: transparent;
    color: #111;
    border: 1px solid #111;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
}

.sage-btn-outline:hover {
    background: #111;
    color: #fff;
}

.sage-hero {
    display: flex;
    max-width: 1500px;
    margin: 40px auto 0;
    padding: 0 40px;
    gap: 40px;
    min-height: calc(100vh - 100px);
}

.sage-hero-content {
    flex: 1;
    padding-top: 40px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
}

.sage-title {
    font-family: 'Playfair Display', serif;
    font-size: 6.5rem;
    line-height: 0.9;
    font-weight: 600;
    margin: 0 0 20px 0;
    letter-spacing: -3px;
    color: #111;
}

.sage-reviews {
    color: #111;
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    gap: 4px;
}

.sage-desc {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 40px;
    color: #222;
    max-width: 500px;
}

.sage-author-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 50px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 24px 0;
}

.author-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-left img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-details strong {
    font-size: 1.05rem;
    color: #111;
}

.author-details span {
    font-size: 0.9rem;
    color: #444;
}

.author-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.author-right strong {
    font-size: 0.95rem;
    color: #111;
}

.rating-line {
    height: 2px;
    background: #111;
    width: 60px;
    margin-top: 6px;
}

.sage-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 60px;
}

.sage-stats {
    display: flex;
    gap: 50px;
    margin-top: auto;
    padding-bottom: 40px;
}

.stat-block {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-block i {
    font-size: 1.8rem;
    color: #111;
}

.icon-group {
    display: flex;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info strong {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111;
}

.stat-info span {
    font-size: 0.85rem;
    color: #444;
}

.sage-hero-visual {
    flex: 1.2;
    position: relative;
    display: flex;
}

.sage-image-wrapper {
    width: 100%;
    position: relative;
}

.sage-main-image {
    width: 100%;
    height: 100%;
    min-height: 700px;
    background-size: cover;
    background-position: center;
}

.sage-glass-card {
    position: absolute;
    left: -100px;
    bottom: 25%;
    width: 260px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.glass-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.glass-head img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.glass-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111;
    display: flex;
    align-items: center;
    gap: 5px;
}

.glass-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.6rem;
    line-height: 1.2;
    font-weight: 500;
    color: #111;
    margin: 0 0 30px 0;
}

.glass-link {
    text-decoration: none;
    color: #111;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 15px;
    transition: 0.3s;
}

.glass-link:hover {
    gap: 10px;
}

@media (max-width: 1024px) {
    .sage-hero {
        flex-direction: column;
    }

    .sage-title {
        font-size: 4rem;
    }

    .sage-hero-visual {
        min-height: 500px;
    }

    .sage-glass-card {
        left: 20px;
    }
}

@media (max-width: 768px) {
    .sage-header {
        flex-direction: column;
        gap: 20px;
    }

    .sage-header-right {
        display: none;
    }

    .sage-glass-card {
        display: none;
    }

    .sage-stats {
        flex-direction: column;
        gap: 20px;
    }
}


/* =========================================
   FRIEREN LIGHT THEME - FORM CONTROLS
   ========================================= */

/* Base Input styling */
.form-control,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="color"],
textarea,
select {
    width: 100%;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    color: var(--text-primary) !important;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-control:focus,
input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2) !important;
    background: #fff !important;
}

/* Base Button Styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3) !important;
}

.btn-primary:hover {
    background: #c5a027 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.4) !important;
}

.btn-secondary {
    background: var(--text-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(33, 37, 41, 0.2) !important;
}

.btn-secondary:hover {
    background: #1a1e22 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(33, 37, 41, 0.3) !important;
}

.btn-danger {
    background: var(--accent-red) !important;
    color: white !important;
}

.btn-danger:hover {
    background: #c0392b !important;
    transform: translateY(-2px);
}

/* Card Overrides */
.setting-card,
.plugin-card,
.dash-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow) !important;
    border-radius: 12px;
    color: var(--text-primary);
}

.setting-card h3,
.plugin-card h3,
.dash-card h3 {
    color: var(--text-primary) !important;
    font-weight: 700;
}

/* Custom Switches/Toggles (Slider) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--accent-green) !important;
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--accent-green);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Checkboxes & Radios */
.checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
}

/* Alert Boxes */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.alert-success {
    background: #E8F5E9 !important;
    color: #2E7D32 !important;
    border-left: 4px solid #2E7D32 !important;
}

.alert-error {
    background: #FFEBEE !important;
    color: #C62828 !important;
    border-left: 4px solid #C62828 !important;
}

.alert-info {
    background: #E3F2FD !important;
    color: #1565C0 !important;
    border-left: 4px solid #1565C0 !important;
}

.form-group {
    position: relative;
    z-index: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}


/* =========================================
   FRIEREN FINTECH DASHBOARD OVERRIDES
   ========================================= */

/* Body & Background */
body {
    background-color: #F8F9FA !important;
    /* Soft clinical grey background */
    font-family: 'Inter', sans-serif;
}

/* Cards (Match the large rounded look) */
.setting-card,
.plugin-card,
.dash-card,
.welcome-preview-container,
.control-group {
    background: #FFFFFF !important;
    border: none !important;
    border-radius: 28px !important;
    padding: 30px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.setting-card:hover,
.control-group:hover,
.dash-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06) !important;
}

.setting-card h3,
.control-group h3,
.dash-card h3 {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #1A1D20 !important;
    margin-bottom: 25px !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Form Controls (Inputs, Selects, Textareas) */
.form-control,
input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 16px !important;
    box-sizing: border-box !important;
    /* Larger touch targets but constrained */
    background: #F8F9FA !important;
    /* Very light grey */
    border: 2px solid transparent !important;
    border-radius: 16px !important;
    /* Pill-like but readable */
    color: #1A1D20 !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.form-control:focus,
input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none !important;
    background: #FFFFFF !important;
    border-color: #D4AF37 !important;
    /* Frieren Gold Focus */
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15) !important;
}

/* Add specific styling for range sliders */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #D4AF37;
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #E9ECEF;
    border-radius: 10px;
}

/* Buttons (Pill-shaped, popping colors) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px !important;
    border-radius: 50px !important;
    /* Pill shape */
    font-weight: 600 !important;
    font-size: 1rem !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    border: none !important;
    text-decoration: none;
}

button[type="submit"],
.btn-primary,
.btn-success {
    background: #D4AF37 !important;
    /* Frieren Gold */
    color: #FFFFFF !important;
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3) !important;
}

button[type="submit"]:hover,
.btn-primary:hover,
.btn-success:hover {
    background: #C5A027 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4) !important;
}

.btn-secondary {
    background: #F1F3F5 !important;
    /* Light grey */
    color: #495057 !important;
    /* Dark grey text */
    box-shadow: none !important;
}

.btn-secondary:hover {
    background: #E2E6EA !important;
    color: #1A1D20 !important;
    transform: translateY(-2px);
}

.btn-danger {
    background: #FFF0F0 !important;
    color: #E03131 !important;
    box-shadow: none !important;
}

.btn-danger:hover {
    background: #FFE3E3 !important;
    transform: translateY(-2px);
}

/* Sidebar Specifics to match the floaty/clean look */
.sidebar {
    background: #FFFFFF !important;
    border-right: 1px solid #F1F3F5 !important;
    padding: 20px 10px !important;
}

.sidebar .nav-item {
    border-radius: 16px !important;
    margin-bottom: 5px !important;
    transition: all 0.2s ease;
}

.sidebar .nav-item.active {
    background: #F8F9FA !important;
    color: #D4AF37 !important;
}

.sidebar .nav-item.active i {
    color: #D4AF37 !important;
}

/* ==============================================================================
   SMART MASTER TOGGLE GATING
   ============================================================================== */

.module-gating-container {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gated-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: filter, opacity;
}

.system-disabled .gated-content {
    filter: grayscale(0.8) blur(4px);
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}

.system-disabled::after {
    content: 'System Offline';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 800;
    color: #1a1a1a;
    border: 2px solid #D4AF37;
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.25);
    z-index: 100;
    font-size: 1.2rem;
    pointer-events: none;
    animation: fadeInLock 0.4s ease-out;
}

@keyframes fadeInLock {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* =========================================
   Premium Searchable Dropdowns
   ========================================= */

.premium-dropdown-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.dropdown-trigger {
    width: 100%;
    min-height: 54px;
    background: #fff;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 8px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.dropdown-trigger:hover,
.dropdown-trigger.active {
    border-color: #D4AF37;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.dropdown-trigger::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    transition: transform 0.2s;
}

.dropdown-trigger.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.placeholder-text {
    color: #aaa;
    font-weight: 500;
    pointer-events: none;
}

.selected-tag {
    background: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    animation: tagPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tagPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.remove-tag {
    cursor: pointer;
    width: 16px;
    height: 16px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    transition: all 0.2s;
}

.remove-tag:hover {
    background: #D4AF37;
    color: #fff;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    z-index: 2000;
    display: none;
    overflow: hidden;
    animation: slideInDropdown 0.2s ease-out;
}

@keyframes slideInDropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.active {
    display: block;
}

.dropdown-search-container {
    padding: 12px;
    border-bottom: 1px solid #f5f5f5;
    position: sticky;
    top: 0;
    background: #fff;
}

.dropdown-search-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #fbfbfb;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.dropdown-search-input:focus {
    border-color: #D4AF37;
    background: #fff;
}

.dropdown-options-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 6px;
}

.dropdown-option {
    padding: 10px 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-option:hover {
    background: rgba(212, 175, 55, 0.05);
}

.dropdown-option.selected {
    background: rgba(212, 175, 55, 0.08);
}

.option-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.option-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    flex: 1;
}

.check-icon {
    color: #D4AF37;
    opacity: 0;
    transition: opacity 0.2s;
}

.dropdown-option.selected .check-icon {
    opacity: 1;
}

.dropdown-options-list::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options-list::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 10px;
}


/* =========================================
   Status Toggle Switches
   ========================================= */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #eee;
    transition: .4s;
    border-radius: 34px;
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider-round {
    background-color: #2ecc71;
}

input:checked+.slider-round:before {
    transform: translateX(24px);
}

/* =========================================
   COMPREHENSIVE RESPONSIVE DESIGN
   ALL DEVICES: Mobile, Tablet, Desktop, TV, PlayStation
   ========================================= */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: max(15px, env(safe-area-inset-top, 15px));
    right: max(15px, env(safe-area-inset-right, 15px));
    left: auto;
    z-index: 3000;
    background: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
    padding: 0;
}

.mobile-menu-toggle:hover {
    background: #f8f9fa;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* =========================================
   LARGE TV & ULTRA-WIDE DISPLAYS (2K, 4K, 8K)
   PlayStation Browser, Smart TVs
   ========================================= */
@media (min-width: 1920px) {
    .main-content {
        max-width: 1800px;
        margin: 0 auto;
        padding: 40px 60px;
    }

    .dashboard-wrapper {
        gap: 30px;
    }

    .dash-card,
    .setting-card,
    .control-group {
        padding: 40px !important;
    }

    .dashboard-title {
        font-size: 2.8rem !important;
    }

    .btn {
        padding: 16px 32px !important;
        font-size: 1.1rem !important;
        min-height: 56px;
        /* Better touch targets for TV remotes */
    }

    /* Larger text for TV viewing distance */
    body {
        font-size: 18px;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 14px 16px;
        min-height: 50px;
        /* Easier D-pad navigation */
    }

    /* Focus states for D-pad/Remote navigation */
    .btn:focus,
    .nav-link:focus,
    select:focus,
    input:focus,
    a:focus {
        outline: 3px solid #D4AF37 !important;
        outline-offset: 3px;
    }
}

/* =========================================
   STANDARD DESKTOP (1440px - 1920px)
   ========================================= */
@media (min-width: 1440px) and (max-width: 1919px) {
    .main-content {
        padding: 35px 50px;
    }

    .dashboard-wrapper {
        gap: 25px;
    }
}

/* =========================================
   LAPTOP & SMALL DESKTOP (1024px - 1440px)
   ========================================= */
@media (min-width: 1024px) and (max-width: 1439px) {
    .main-content {
        padding: 30px 40px;
    }

    .sidebar {
        width: 260px;
        min-width: 260px;
    }

    .dashboard-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .widget-main-chart,
    .widget-list-1,
    .widget-list-2 {
        grid-column: span 2;
    }
}

/* =========================================
   TABLET LANDSCAPE (768px - 1023px)
   iPad Pro, Surface, Galaxy Tab
   ========================================= */
@media (max-width: 1023px) and (min-width: 768px) {
    .sidebar {
        width: 240px;
        min-width: 240px;
    }

    .main-content {
        padding: 25px 30px;
    }

    .dashboard-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dashboard-title {
        font-size: 1.8rem !important;
    }

    .dash-card,
    .setting-card,
    .control-group {
        padding: 25px !important;
    }

    /* Stack cards vertically */
    .widget-overview,
    .widget-chart-sm,
    .widget-main-chart,
    .widget-list-1,
    .widget-list-2 {
        grid-column: span 1;
    }

    /* Better touch targets for tablets */
    .btn {
        min-height: 48px;
        padding: 14px 26px !important;
    }

    .nav-link {
        padding: 12px 14px;
        min-height: 48px;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Prevents zoom on iOS */
    }
}

/* =========================================
   TABLET PORTRAIT & LARGE MOBILE (481px - 767px)
   iPad Mini, Small Tablets
   ========================================= */
@media (max-width: 767px) {

    /* Hide sidebar, show mobile menu */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        min-width: 280px;
        z-index: 2700;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.mobile-open {
        left: 0;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.25);
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .mobile-overlay {
        display: block;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .main-content {
        padding: max(75px, calc(20px + env(safe-area-inset-top, 0px))) max(15px, env(safe-area-inset-right, 15px)) max(20px, env(safe-area-inset-bottom, 20px)) max(15px, env(safe-area-inset-left, 15px));
        width: 100%;
        min-height: 100vh;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px !important;
    }

    .dashboard-title {
        font-size: 1.6rem !important;
    }

    .reveal-right {
        width: 100%;
    }

    .profile-pill {
        width: 100%;
        justify-content: center;
    }

    /* Stack all cards */
    .dashboard-wrapper {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .dash-card,
    .setting-card,
    .control-group {
        padding: 20px !important;
        border-radius: 20px !important;
    }

    .dash-card h3,
    .setting-card h3 {
        font-size: 1.2rem !important;
    }

    /* Responsive buttons */
    .btn {
        width: 100%;
        padding: 14px 20px !important;
        font-size: 0.95rem !important;
        justify-content: center;
    }

    /* Form elements */
    .form-group {
        margin-bottom: 20px;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Prevents iOS zoom */
        padding: 14px !important;
        min-height: 50px;
        width: 100%;
    }

    /* Bento Grid Home Page */
    .bento-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .bento-nav {
        display: none;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .bento-container {
        grid-template-columns: 1fr;
        padding: 0 15px;
        gap: 15px;
    }

    .hero-card {
        grid-column: span 1;
        padding: 30px 20px !important;
        flex-direction: column;
        text-align: center;
    }

    /* Tables responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    /* Dropdown menus full width on mobile */
    .dropdown-menu {
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
    }

    /* Stat cards stack better */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* =========================================
   MOBILE DEVICES (320px - 480px)
   iPhone 8, SE, Small Android Phones
   ========================================= */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        top: max(12px, env(safe-area-inset-top, 12px));
        right: max(12px, env(safe-area-inset-right, 12px));
        left: auto;
        width: 46px;
        height: 46px;
        display: flex !important;
    }

    .main-content {
        padding: max(65px, calc(15px + env(safe-area-inset-top, 0px))) max(12px, env(safe-area-inset-right, 12px)) max(15px, env(safe-area-inset-bottom, 15px)) max(12px, env(safe-area-inset-left, 12px));
    }

    .dashboard-title {
        font-size: 1.4rem !important;
        margin-bottom: 8px;
    }

    /* Welcome message smaller */
    .header p {
        font-size: 0.9rem !important;
    }

    /* Card spacing */
    .dash-card,
    .setting-card,
    .control-group {
        padding: 18px !important;
        border-radius: 18px !important;
        margin-bottom: 12px;
    }

    .dash-card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 15px !important;
    }

    /* Buttons */
    .btn {
        padding: 12px 18px !important;
        font-size: 0.9rem !important;
        min-height: 46px;
        width: 100%;
    }

    /* Form elements */
    input,
    select,
    textarea,
    .form-control {
        font-size: 16px !important;
        padding: 12px !important;
        border-radius: 14px !important;
    }

    /* Sidebar adjustments */
    .sidebar {
        width: 260px;
        padding: 15px 8px !important;
    }

    .frieren-logo-area {
        padding: 15px 12px !important;
    }

    .frieren-logo-name {
        font-size: 0.95rem !important;
    }

    .fri-item {
        padding: 10px !important;
        font-size: 0.85rem !important;
    }

    /* Home page hero */
    .hero-text h1 {
        font-size: 1.8rem !important;
        line-height: 1.2;
    }

    .hero-text p {
        font-size: 0.95rem !important;
    }

    .btn-bento-primary,
    .btn-bento-outline {
        padding: 14px 24px !important;
        font-size: 0.9rem !important;
    }

    .phone-mockup {
        width: 180px !important;
        height: 340px !important;
    }

    /* Feature cards */
    .feature-card-1,
    .feature-card-2,
    .servers-card {
        padding: 20px 15px !important;
    }

    .feature-card-1 h2,
    .feature-card-2 h2 {
        font-size: 1.3rem !important;
    }

    /* CTA Section */
    .cta-content h2 {
        font-size: 1.4rem !important;
    }

    /* Stats display */
    .stat-box {
        padding: 15px !important;
    }

    .stat-value {
        font-size: 1.8rem !important;
    }

    .stat-label {
        font-size: 0.85rem !important;
    }
}

/* =========================================
   ULTRA SMALL DEVICES (< 320px)
   ========================================= */
@media (max-width: 319px) {
    .main-content {
        padding: 60px 10px 10px;
    }

    .dashboard-title {
        font-size: 1.2rem !important;
    }

    .dash-card,
    .setting-card,
    .control-group {
        padding: 15px !important;
        border-radius: 15px !important;
    }

    .btn {
        padding: 10px 15px !important;
        font-size: 0.85rem !important;
    }
}

/* =========================================
   LANDSCAPE MOBILE (HORIZONTAL)
   Better for gaming handhelds like Steam Deck
   ========================================= */
/* =========================================
   LANDSCAPE PHONE MODE
   Phone landscape: width 568-932px, height 360-430px
   Hamburger must show here too (width > 767px breakpoint)
   ========================================= */
@media (max-height: 500px) and (orientation: landscape) {

    /* Force show hamburger button for landscape phones */
    .mobile-menu-toggle {
        display: flex !important;
        position: fixed !important;
        top: max(10px, env(safe-area-inset-top, 10px)) !important;
        left: max(12px, env(safe-area-inset-left, 12px)) !important;
        z-index: 9999 !important;
        width: 42px !important;
        height: 42px !important;
    }

    /* Sidebar must be off-canvas in landscape phone mode */
    .sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        height: 100vh !important;
        width: 260px !important;
        max-width: 70vw !important;
        overflow-y: auto !important;
        z-index: 9998 !important;
        transition: left 0.3s ease !important;
    }

    .sidebar.mobile-open {
        left: 0 !important;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.25) !important;
    }

    /* Main content for landscape */
    .main-content {
        padding-top: 60px !important;
        padding-left: max(12px, env(safe-area-inset-left, 12px)) !important;
        padding-right: max(12px, env(safe-area-inset-right, 12px)) !important;
        padding-bottom: 20px !important;
    }

    .header {
        margin-bottom: 15px !important;
    }

    .dashboard-title {
        font-size: 1.3rem !important;
    }

    .dash-card,
    .setting-card {
        padding: 15px !important;
    }

    /* Reduce vertical spacing */
    .form-group {
        margin-bottom: 12px;
    }

    /* RTL support */
    [dir="rtl"] .mobile-menu-toggle {
        right: auto !important;
        left: max(12px, env(safe-area-inset-left, 12px)) !important;
    }

    [dir="rtl"] .sidebar {
        left: auto !important;
        right: -100% !important;
    }

    [dir="rtl"] .sidebar.mobile-open {
        left: auto !important;
        right: 0 !important;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.25) !important;
    }
}

/* =========================================
   PRINT STYLES (Bonus)
   ========================================= */
@media print {

    .sidebar,
    .mobile-menu-toggle,
    .mobile-overlay,
    .fri-bottom,
    .btn-bento-primary,
    .header-actions {
        display: none !important;
    }

    .main-content {
        padding: 0;
        width: 100%;
    }

    .dash-card,
    .setting-card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}

/* =========================================
   ACCESSIBILITY & TOUCH IMPROVEMENTS
   ========================================= */

/* Better touch targets for all interactive elements */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .nav-link,
    .fri-item,
    input,
    select,
    textarea {
        min-height: 48px;
        /* Apple & Google accessibility guidelines */
    }

    /* Increase tap area */
    a,
    button {
        position: relative;
    }

    a::after,
    button::after {
        content: '';
        position: absolute;
        top: -4px;
        left: -4px;
        right: -4px;
        bottom: -4px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    .dash-card,
    .setting-card,
    .sidebar {
        border: 2px solid #000 !important;
    }

    .btn-primary {
        border: 2px solid #000;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (system preference) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-tertiary: #3a3a3a;
        --text-primary: #f8f9fa;
        --text-secondary: #adb5bd;
        --border-color: #3a3a3a;
    }
}

/* =========================================
   ADDITIONAL RESPONSIVE UTILITIES
   ========================================= */

/* Responsive Tables - Card View on Mobile */
@media (max-width: 767px) {
    .dash-table {
        display: block;
    }

    .dash-table tbody {
        display: block;
    }

    .dash-table tr {
        display: block;
        margin-bottom: 15px;
        background: #f8f9fa;
        border-radius: 16px !important;
        padding: 15px;
    }

    .dash-table td {
        display: block;
        padding: 8px 0 !important;
        border: none !important;
        text-align: left !important;
    }

    .dash-table td:before {
        content: attr(data-label);
        font-weight: 700;
        display: block;
        margin-bottom: 5px;
        color: var(--text-secondary);
        font-size: 0.8rem;
        text-transform: uppercase;
    }

    /* Module table specific */
    .dash-table tr>td:first-child {
        padding-bottom: 12px;
        margin-bottom: 10px;
        border-bottom: 1px solid #e9ecef !important;
    }

    .dash-table tr>td:last-child {
        text-align: right !important;
        padding-top: 12px;
        border-top: 1px solid #e9ecef !important;
    }

    /* Hide action column label on mobile */
    .dash-table tr>td:last-child:before {
        display: none;
    }
}

/* Responsive Grid Layouts */
@media (max-width: 767px) {

    .stats-grid,
    .feature-grid,
    .module-grid {
        grid-template-columns: 1fr !important;
    }

    /* Stack action buttons vertically */
    .action-buttons,
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons .btn,
    .btn-group .btn {
        width: 100%;
    }

    /* Module icon boxes smaller on mobile */
    .module-icon-box,
    .coin-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 1rem !important;
    }

    /* Status badges */
    .module-status-badge {
        font-size: 0.75rem !important;
        padding: 5px 10px !important;
    }
}

/* Charts responsive */
@media (max-width: 767px) {
    canvas {
        max-height: 200px !important;
    }

    .chart-container {
        height: 200px !important;
    }
}

/* Form layouts */
@media (max-width: 767px) {
    .form-row {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .form-col {
        width: 100% !important;
        flex: none !important;
    }

    /* Color pickers and number inputs */
    input[type="color"] {
        width: 100%;
        height: 60px;
        padding: 5px !important;
    }

    .color-input-group {
        display: flex;
        gap: 10px;
        align-items: stretch;
    }

    .color-input-group input[type="color"] {
        flex: 1;
        min-width: 80px;
    }

    .color-input-group input[type="text"] {
        flex: 2;
    }
}

/* Modal/Dialog responsive */
@media (max-width: 767px) {

    .modal,
    .dialog {
        width: 95% !important;
        max-width: none !important;
        margin: 20px auto !important;
    }

    .modal-content {
        padding: 20px !important;
    }

    .modal-header h2,
    .dialog-header h2 {
        font-size: 1.2rem !important;
    }
}

/* Home page specific */
@media (max-width: 767px) {
    .bento-body {
        padding: 0;
    }

    .btn-group-home {
        flex-direction: column;
        width: 100%;
    }

    .btn-group-home .btn {
        width: 100%;
    }

    /* Server count display */
    .server-count {
        font-size: 2.5rem !important;
    }

    .server-label {
        font-size: 0.9rem !important;
    }
}

/* Keyboard navigation focus for TV/Console */
@media (min-width: 1920px) {

    *:focus,
    button:focus,
    a:focus,
    input:focus,
    select:focus {
        outline: 3px solid #D4AF37 !important;
        outline-offset: 4px;
        box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.2) !important;
    }

    /* Larger scrollbars for D-pad control */
    ::-webkit-scrollbar {
        width: 14px;
        height: 14px;
    }

    ::-webkit-scrollbar-thumb {
        background: #D4AF37;
        border-radius: 7px;
    }

    ::-webkit-scrollbar-track {
        background: #e9ecef;
    }
}

/* Notification/Toast responsive */
@media (max-width: 767px) {

    .toast,
    .notification,
    .alert {
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
        bottom: 70px !important;
        /* Above mobile menu button */
    }
}

/* Hide scrollbars on mobile for cleaner look (optional) */
@media (max-width: 767px) {

    .sidebar::-webkit-scrollbar,
    .main-content::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    /* But keep scroll functionality */
    .sidebar,
    .main-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* RTL Support in responsive */
@media (max-width: 767px) {
    [dir="rtl"] .mobile-menu-toggle {
        right: auto;
        left: max(12px, env(safe-area-inset-left, 12px));
    }

    [dir="rtl"] .sidebar {
        left: auto;
        right: -280px;
    }

    [dir="rtl"] .sidebar.mobile-open {
        right: 0;
        left: auto;
    }

    [dir="rtl"] .dash-table td:before {
        text-align: right;
    }
}

/* =========================================
   DEVICE-SPECIFIC BREAKPOINTS
   Comprehensive coverage for all phones
   ========================================= */

/* iPhone Specific (320px - 480px) */
@media (max-width: 480px) {
    :root {
        --touch-target-min: 48px;
    }
}

/* iPhone 12 mini, 13 mini (360px) */
@media (min-width: 360px) and (max-width: 430px) {
    .sidebar {
        width: 260px;
        min-width: 260px;
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
    }
}

/* iPhone SE, 8, 9 (375px) */
@media (min-width: 375px) and (max-width: 667px) {
    .main-content {
        padding-top: max(70px, calc(15px + env(safe-area-inset-top, 0px)));
    }

    .dashboard-title {
        font-size: 1.5rem !important;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* iPhone X, 11, 12, 13 standard (375px-390px) with notch */
@media (min-width: 375px) and (max-width: 667px) and (orientation: portrait) {
    .mobile-menu-toggle {
        top: max(12px, env(safe-area-inset-top, 12px));
        right: max(12px, env(safe-area-inset-right, 12px));
        left: auto;
    }

    .main-content {
        padding-top: max(70px, calc(15px + env(safe-area-inset-top, 0px)));
        padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    }
}

/* iPhone 8 Plus, XS Max, 11 Pro Max, 12 Pro Max, 14 Pro Max, etc. (414px) */
@media (min-width: 414px) and (max-width: 667px) {
    .dashboard-title {
        font-size: 1.6rem !important;
    }

    .dash-card,
    .setting-card {
        padding: 22px !important;
    }
}

/* iPhone 14, 15 Pro (390px-430px) */
@media (min-width: 390px) and (max-width: 430px) {
    .main-content {
        padding: max(70px, calc(15px + env(safe-area-inset-top, 0px))) max(15px, env(safe-area-inset-right, 15px)) max(20px, env(safe-area-inset-bottom, 20px)) max(15px, env(safe-area-inset-left, 15px));
    }
}

/* iPhone 14 Pro Max, 15 Pro Max, 16 Pro Max, 17 Pro Max (430px+) */
@media (min-width: 430px) and (max-width: 667px) {
    .main-content {
        padding: max(75px, calc(15px + env(safe-area-inset-top, 0px))) max(20px, env(safe-area-inset-right, 20px)) max(20px, env(safe-area-inset-bottom, 20px)) max(20px, env(safe-area-inset-left, 20px));
    }

    .dashboard-title {
        font-size: 1.7rem !important;
    }

    .dash-card,
    .setting-card {
        padding: 24px !important;
    }
}

/* Samsung Galaxy S (360px-365px) */
@media (min-width: 360px) and (max-width: 365px) {
    .dashboard-title {
        font-size: 1.4rem !important;
    }

    input,
    select,
    textarea {
        min-height: 44px;
    }
}

/* Samsung Galaxy S21, S22 (360px) */
@media (width: 360px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* Samsung Galaxy S10, S20, S21+ (360px-412px) */
@media (min-width: 360px) and (max-width: 412px) {
    .sidebar {
        width: 270px;
        min-width: 270px;
    }

    .main-content {
        padding: max(70px, calc(15px + env(safe-area-inset-top, 0px))) max(12px, env(safe-area-inset-right, 12px)) max(15px, env(safe-area-inset-bottom, 15px)) max(12px, env(safe-area-inset-left, 12px));
    }
}

/* Samsung Galaxy S10+, S20+, S21 Ultra (412px+) */
@media (min-width: 412px) and (max-width: 667px) {
    .main-content {
        padding: max(75px, calc(15px + env(safe-area-inset-top, 0px))) max(15px, env(safe-area-inset-right, 15px)) max(20px, env(safe-area-inset-bottom, 20px)) max(15px, env(safe-area-inset-left, 15px));
    }

    .dashboard-title {
        font-size: 1.7rem !important;
    }
}

/* Google Pixel 5a, 6 (392px) */
@media (width: 392px) {

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Google Pixel 6 Pro, 7 Pro (412px) */
@media (min-width: 412px) and (max-width: 670px) and (orientation: portrait) {
    .dashboard-title {
        font-size: 1.6rem !important;
    }
}

/* Landscape Mode (All phones) */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-menu-toggle {
        top: max(8px, env(safe-area-inset-top, 8px));
        left: max(8px, env(safe-area-inset-left, 8px));
        width: 40px;
        height: 40px;
    }

    .main-content {
        padding-top: max(50px, calc(8px + env(safe-area-inset-top, 0px)));
    }

    .dashboard-title {
        font-size: 1.3rem !important;
    }
}

/* Loading states responsive */
.skeleton,
.loading-placeholder {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@media (max-width: 767px) {
    .skeleton {
        height: 40px;
        border-radius: 12px;
    }
}

/* Utility Classes */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-hide {
        display: none !important;
    }
}

/* Safe area for notched devices (iPhone X+) */
@supports (padding: max(0px)) {
    .main-content {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    @media (max-width: 767px) {
        .main-content {
            padding-left: max(15px, env(safe-area-inset-left));
            padding-right: max(15px, env(safe-area-inset-right));
            padding-bottom: max(15px, env(safe-area-inset-bottom));
        }

        .sidebar.mobile-open {
            padding-left: max(10px, env(safe-area-inset-left));
        }
    }
}

/* ── Global Status Toggle ── */
.status-pill {
    background: #fff;
    padding: 10px 24px;
    border-radius: 50px;
    border: 1.5px solid #eee;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.3s;
}

.status-pill:has(input:checked) {
    border-color: rgba(255, 179, 57, 0.3);
    box-shadow: 0 2px 12px rgba(255, 179, 57, 0.08);
}

.status-label {
    font-weight: 700;
    color: #555;
    font-size: 0.85rem;
}

/* The switch - the box around the slider */
.switch,
.toggle-switch {
    font-size: 17px;
    position: relative;
    display: inline-block;
    width: 3.5em;
    height: 2em;
}

/* Hide default HTML checkbox */
.switch input,
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider,
.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.slider:before,
.slider-round:before {
    position: absolute;
    content: "";
    height: 1.4em;
    width: 1.4em;
    border-radius: 20px;
    left: 0.3em;
    bottom: 0.3em;
    background-color: white;
    transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* كلمة OFF في الوضع المغلق */
.slider:after,
.slider-round:after {
    content: "OFF";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11px;
    font-weight: bold;
    transition: 0.4s;
}

input:checked+.slider,
input:checked+.slider-round {
    background-color: #ffb339;
    box-shadow: 0 0 15px rgba(255, 179, 57, 0.6);
}

input:focus+.slider,
input:focus+.slider-round {
    box-shadow: 0 0 15px rgba(255, 179, 57, 0.8);
}

input:checked+.slider:before,
input:checked+.slider-round:before {
    transform: translateX(1.5em);
}

/* كلمة ON في الوضع المفتوح */
input:checked+.slider:after,
input:checked+.slider-round:after {
    content: "ON";
    right: auto;
    left: 8px;
}

/* ═══════════════════════════════════════════════
   Custom Global Notifications & Confirmations
   ═══════════════════════════════════════════════ */

/* Alert Toast Container */
#alertContainer {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom Alert Toast */
.custom-alert {
    min-width: 320px;
    background: #fff;
    padding: 16px 24px;
    border-radius: 18px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: alertSlideIn 0.4s cubic-bezier(0.17, 0.88, 0.32, 1.28);
    transition: all 0.3s ease;
}

.custom-alert.alert-success {
    border-left: 5px solid #ffb339;
}

.custom-alert.alert-error {
    border-left: 5px solid #ff4e4e;
}

.custom-alert i {
    font-size: 1.3rem;
}

.custom-alert.alert-success i {
    color: #ffb339;
}

.custom-alert.alert-error i {
    color: #ff4e4e;
}

.custom-alert .alert-msg {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.95rem;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Confirmation Modal Backdrop */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Confirmation Card */
.confirm-card {
    background: #fff;
    width: 90%;
    max-width: 400px;
    padding: 35px;
    border-radius: 32px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: modalPop 0.4s cubic-bezier(0.17, 0.88, 0.32, 1.15);
}

.confirm-card i {
    font-size: 3rem;
    color: #ffb339;
    margin-bottom: 20px;
    display: block;
}

.confirm-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.confirm-card p {
    color: #666;
    font-weight: 500;
    margin-bottom: 30px;
    line-height: 1.5;
}

.confirm-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.confirm-btn {
    padding: 14px;
    border-radius: 16px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn-cancel {
    background: #f1f3f5;
    color: #666;
}

.confirm-btn-cancel:hover {
    background: #e9ecef;
}

.confirm-btn-yes {
    background: #ffb339;
    color: #fff;
}

.confirm-btn-yes:hover {
    background: #ffa000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 179, 57, 0.3);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* =========================================
   DARK THEME — COMPREHENSIVE OVERRIDES
   ========================================= */

/* ── Body & Layout ── */
[data-theme="dark"] body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .main-content,
[data-theme="dark"] .dashboard-layout {
    background: var(--bg-primary) !important;
}

/* ── Sidebar & Server List ── */
[data-theme="dark"] .sidebar {
    background: var(--sidebar-main-bg) !important;
    border-color: var(--sidebar-border) !important;
}

[data-theme="dark"] .server-list-sidebar {
    background: var(--sidebar-bg) !important;
    border-color: var(--sidebar-border) !important;
}

[data-theme="dark"] .server-icon-wrapper {
    background: var(--bg-tertiary) !important;
    border-color: var(--sidebar-border) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .server-item-home {
    background: var(--bg-secondary) !important;
    border-color: var(--sidebar-border) !important;
}

[data-theme="dark"] .server-item-add {
    background: transparent !important;
    border-color: var(--sidebar-border) !important;
    color: #23a55a !important;
}

[data-theme="dark"] .server-separator,
[data-theme="dark"] .fri-divider,
[data-theme="dark"] .dropdown-divider {
    background-color: var(--sidebar-border) !important;
}

/* ── Logo Area ── */
[data-theme="dark"] .frieren-logo-area {
    border-color: var(--sidebar-border) !important;
}

[data-theme="dark"] .frieren-logo-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .frieren-switch-btn {
    background: var(--bg-tertiary) !important;
    border-color: var(--sidebar-border) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .frieren-switch-btn:hover {
    border-color: var(--premium-gold) !important;
    color: var(--premium-gold) !important;
    background: rgba(212, 175, 55, 0.05) !important;
}

/* ── Nav Items ── */
[data-theme="dark"] .fri-item {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .fri-item:hover {
    background: var(--sidebar-item-hover) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .fri-item.active {
    background: rgba(212, 175, 55, 0.08) !important;
    color: #b8920a !important;
}

[data-theme="dark"] .fri-icon {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .fri-section-label {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .fri-home-btn {
    color: var(--text-secondary) !important;
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .fri-home-btn:hover {
    background: var(--sidebar-border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .fri-logout-btn {
    background: rgba(224, 49, 49, 0.08) !important;
}

[data-theme="dark"] .fri-bottom {
    border-color: var(--sidebar-border) !important;
}

/* ── Cards & Panels ── */
[data-theme="dark"] .dash-card,
[data-theme="dark"] .setting-card,
[data-theme="dark"] .fri-card,
[data-theme="dark"] .log-card,
[data-theme="dark"] .module-card,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .master-toggle-card,
[data-theme="dark"] .widget,
[data-theme="dark"] .category-item,
[data-theme="dark"] .premium-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .leaderboard-card,
[data-theme="dark"] .stat-mini {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* ── Log Cards ── */
[data-theme="dark"] .log-card.is-enabled {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, rgba(212, 175, 55, 0.05) 100%) !important;
    border-color: rgba(212, 175, 55, 0.3) !important;
}

[data-theme="dark"] .log-card-label {
    color: var(--text-primary) !important;
}

/* ── Dropdowns & Menus ── */
[data-theme="dark"] .log-dropdown-menu,
[data-theme="dark"] .nav-dropdown,
[data-theme="dark"] .user-dropdown,
[data-theme="dark"] .lang-dropdown,
[data-theme="dark"] .mobile-overlay-menu,
[data-theme="dark"] .premium-dropdown {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;
}

[data-theme="dark"] .log-dropdown-trigger {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .log-dropdown-option {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .log-dropdown-option:hover {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .log-dropdown-search input {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* ── Header & Nav ── */
[data-theme="dark"] .main-header {
    background: rgba(26, 27, 30, 0.95) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .nav-link {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .user-btn {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .username-text {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .lang-toggle-btn,
[data-theme="dark"] .lang-dropdown-btn {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .lang-item:hover {
    background: var(--bg-tertiary) !important;
}

/* ── Typography ── */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span:not([class*="badge"]):not([class*="pill"]):not([class*="tag"]) {
    color: var(--text-secondary);
}

[data-theme="dark"] .logo-text,
[data-theme="dark"] .dashboard-title {
    color: var(--text-primary) !important;
}

/* ── Inputs & Forms ── */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .form-control,
[data-theme="dark"] .modern-input {
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
    border-color: var(--input-border) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted) !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--premium-gold) !important;
}

[data-theme="dark"] .section-header {
    border-color: var(--border-color) !important;
}

/* ── Buttons ── */
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .prof-btn-outline,
[data-theme="dark"] .setup-btn {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .confirm-btn-cancel {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] #unsaved-cancel-btn {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

/* ── Tables ── */
[data-theme="dark"] th {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] td {
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] tbody tr:hover {
    background: rgba(212, 175, 55, 0.04) !important;
}

/* ── Tabs ── */
[data-theme="dark"] .tab-btn,
[data-theme="dark"] .cmdmgr-tab {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .tab-btn.active,
[data-theme="dark"] .cmdmgr-tab.active {
    color: var(--premium-gold) !important;
}

/* ── Modals & Alerts ── */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .confirm-card,
[data-theme="dark"] .custom-alert {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* نص التنبيه كان داكناً ثابتاً — غير مقروء على الخلفية الداكنة */
[data-theme="dark"] .custom-alert .alert-msg {
    color: var(--text-primary) !important;
}

/* ── Premium Dropdown (نسخة dashboard.css) — Dark Theme ── */
[data-theme="dark"] .dropdown-trigger {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-trigger:hover,
[data-theme="dark"] .dropdown-trigger.active {
    background: var(--bg-secondary) !important;
    border-color: var(--premium-gold, #D4AF37) !important;
}

[data-theme="dark"] .dropdown-trigger::after {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .placeholder-text {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .dropdown-menu {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .dropdown-search-container {
    background: var(--bg-secondary) !important;
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .dropdown-search-input {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-search-input:focus {
    background: var(--bg-secondary) !important;
    border-color: var(--premium-gold, #D4AF37) !important;
}

[data-theme="dark"] .dropdown-options-list {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .option-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-options-list::-webkit-scrollbar-thumb {
    background: #444 !important;
}

[data-theme="dark"] #unsaved-changes-bar {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3) !important;
}

/* ── Category Grid Headers ── */
[data-theme="dark"] .category-header {
    border-color: var(--premium-gold) !important;
}

[data-theme="dark"] .category-header h3 {
    color: var(--premium-gold) !important;
}

/* ── Stats & Widgets ── */
[data-theme="dark"] .stat-value,
[data-theme="dark"] .dash-stat-number {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .stat-label {
    color: var(--text-muted) !important;
}

/* ── Scrollbars ── */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border-color) !important;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted) !important;
}

/* ── Dark Mode Toggle Button ── */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color, #eaecf0);
    outline: none !important;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-toggle-color, #555);
    background: var(--theme-toggle-bg, #f0f0f0);
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: none !important;
}

.theme-toggle-btn:hover {
    background: var(--theme-toggle-hover-bg, #e4e4e4);
    color: var(--premium-gold);
}

.theme-toggle-btn .theme-icon {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--premium-gold);
    flex-shrink: 0;
}

.theme-toggle-btn .theme-label {
    flex: 1;
    line-height: 1;
}

.theme-toggle-pill {
    width: 32px;
    height: 18px;
    background: #eaecf0;
    border-radius: 9px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.theme-toggle-pill::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                background 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle-pill {
    background: var(--premium-gold) !important;
}

[data-theme="dark"] .theme-toggle-pill::after {
    transform: translateX(14px);
    background: #1a1b1e;
}

/* =========================================
   FRIEREN LUXURY CONFIRMATION MODAL
   ========================================= */
.frieren-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.frieren-confirm-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.frieren-confirm-modal {
    background: #14151f;
    border: 1.5px solid rgba(212, 175, 55, 0.35);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(212, 175, 55, 0.15);
    transform: scale(0.92) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    color: #f8fafc;
    font-family: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] .frieren-confirm-modal {
    background: #ffffff;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18), 0 0 30px rgba(212, 175, 55, 0.12);
    color: #0f172a;
}

.frieren-confirm-backdrop.active .frieren-confirm-modal {
    transform: scale(1) translateY(0);
}

.frieren-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    position: relative;
}

.frieren-confirm-modal.danger .frieren-confirm-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
}

.frieren-confirm-modal.warning .frieren-confirm-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1.5px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}

.frieren-confirm-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 10px 0;
}

[data-theme="light"] .frieren-confirm-title {
    color: #0f172a;
}

.frieren-confirm-msg {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.55;
    margin: 0 0 24px 0;
    word-break: break-word;
}

[data-theme="light"] .frieren-confirm-msg {
    color: #64748b;
}

.frieren-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-confirm-cancel, .btn-confirm-accept {
    flex: 1;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-confirm-cancel {
    background: #181926;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

[data-theme="light"] .btn-confirm-cancel {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    color: #475569;
}

.btn-confirm-cancel:hover {
    background: #232538;
    color: #ffffff;
    transform: translateY(-1px);
}

[data-theme="light"] .btn-confirm-cancel:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-confirm-accept.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.35);
}

.btn-confirm-accept.danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.45);
    transform: translateY(-2px);
}

.btn-confirm-accept.gold {
    background: linear-gradient(135deg, #D4AF37 0%, #AA7C11 100%);
    color: #0c0d12;
    box-shadow: 0 4px 18px rgba(212, 175, 55, 0.35);
}

.btn-confirm-accept.gold:hover {
    background: linear-gradient(135deg, #dfbc45 0%, #b8891b 100%);
    box-shadow: 0 6px 22px rgba(212, 175, 55, 0.45);
    transform: translateY(-2px);
}

