/* =======================================================
   Era Technology ERP — "Glass" Premium Theme
   Dark-first glassmorphism with gradient accents,
   plus a clean Light mode. Same class names as before.
   ======================================================= */

:root {
    /* ---- Light Mode ---- */
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #0369a1;
    --accent-color-2: #0284c7;
    --accent-hover: #0284c7;
    --accent-soft: rgba(3, 105, 161, 0.1);
    --border-color: #cbd5e1;
    --shadow-color: rgba(0, 0, 0, 0.06);
    --shadow-color-strong: rgba(0, 0, 0, 0.12);
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0284c7;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(3, 105, 161, 0.08);
    --glow-1: rgba(3, 105, 161, 0.06);
    --glow-2: rgba(6, 182, 212, 0.05);
}

[data-theme="dark"] {
    /* ---- Dark Mode ---- */
    --bg-primary: #0a1628;
    --bg-secondary: #0f1d35;
    --bg-tertiary: #111d35;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-color-2: #06b6d4;
    --accent-hover: #7dd3fc;
    --accent-soft: rgba(56, 189, 248, 0.15);
    --border-color: #1e3a5f;
    --shadow-color: rgba(0, 0, 0, 0.45);
    --shadow-color-strong: rgba(0, 0, 0, 0.65);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --glass-bg: rgba(17, 29, 53, 0.65);
    --glass-border: rgba(56, 189, 248, 0.12);
    --glow-1: rgba(56, 189, 248, 0.25);
    --glow-2: rgba(6, 182, 212, 0.2);
}

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

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Ambient glow blobs behind everything — the "wow" atmosphere */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 46vw;
    height: 46vw;
    border-radius: 50%;
    filter: blur(90px);
    z-index: 0;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

body::before {
    top: -14vw;
    left: -10vw;
    background: var(--glow-1);
}

body::after {
    bottom: -18vw;
    right: -10vw;
    background: var(--glow-2);
}

[data-theme="light"] body::before,
[data-theme="light"] body::after {
    opacity: 0.5;
}

.container-fluid, .row { position: relative; z-index: 1; }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    letter-spacing: -0.01em;
}

/* Page section titles get a subtle gradient treatment */
.main-content > h2,
.main-content > .d-flex > h2 {
    background: linear-gradient(90deg, var(--accent-color), var(--accent-color-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ---------------------------------------------
   Glass Cards
   --------------------------------------------- */
.win11-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px var(--shadow-color);
    border: 1px solid var(--glass-border);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.win11-card:hover {
    box-shadow: 0 12px 40px var(--shadow-color-strong), 0 0 0 1px var(--glow-1);
    border-color: var(--glow-1);
}

/* ---------------------------------------------
   Buttons
   --------------------------------------------- */
.win11-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-2));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 24px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    min-width: 120px;
    box-shadow: 0 6px 20px var(--glow-1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.win11-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px var(--glow-1);
    color: white;
}

.win11-btn:active {
    transform: translateY(0) scale(0.98);
}

.win11-btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow: none;
}

.win11-btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

/* ---------------------------------------------
   Inputs
   --------------------------------------------- */
.win11-input {
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.15s ease;
    width: 100%;
}

.win11-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.form-select {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1.5px solid var(--border-color) !important;
}

.form-label {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: inline-block;
    text-transform: uppercase;
}

/* ---------------------------------------------
   Sidebar
   --------------------------------------------- */
.win11-sidebar {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--glass-border);
    min-height: 100vh;
    padding: 20px 0;
    position: relative;
    z-index: 2;
}

.win11-sidebar .nav-link {
    color: var(--text-secondary);
    padding: 12px 20px;
    margin: 3px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.18s ease;
    font-size: 14px;
    font-weight: 600;
}

.win11-sidebar .nav-link:hover {
    background: var(--accent-soft);
    color: var(--accent-color);
}

.win11-sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-2));
    color: white;
    font-weight: 700;
    box-shadow: 0 8px 22px var(--glow-1);
}

.win11-sidebar .nav-link i {
    font-size: 17px;
}

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

.win11-table th,
.win11-table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.win11-table th {
    background: transparent;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--glass-border);
}

.win11-table tbody tr {
    transition: background 0.15s ease;
}

.win11-table tbody tr:hover {
    background: var(--accent-soft);
}

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

/* ---------------------------------------------
   Modal
   --------------------------------------------- */
.win11-modal {
    background: var(--bg-secondary);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 70px var(--shadow-color-strong), 0 0 0 1px var(--glow-1);
    border: 1px solid var(--glass-border);
    pointer-events: auto; /* .modal-dialog sets pointer-events:none by default in
                              Bootstrap; only .modal-content restores it. This class
                              stands in for .modal-content in the markup, so it must
                              restore pointer-events itself or every click passes
                              through to the backdrop and closes the modal. */
}

[data-theme="dark"] .win11-modal { background: #14152f; }

.win11-modal-header {
    padding: 22px 26px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.win11-modal-header .modal-title {
    font-weight: 800;
    font-size: 17px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-color-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.win11-modal-body { padding: 26px; }

.win11-modal-footer {
    padding: 18px 26px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ---------------------------------------------
   Theme Toggle
   --------------------------------------------- */
.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px var(--shadow-color);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.12) rotate(15deg);
    border-color: var(--accent-color);
}

.theme-toggle i {
    font-size: 20px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------------------------------------------
   Footer
   --------------------------------------------- */
.win11-footer {
    background: transparent;
    border-top: 1px solid var(--glass-border);
    padding: 18px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------
   WhatsApp Button
   --------------------------------------------- */
.whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #25d366;
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(37, 211, 102, 0.4);
    transition: all 0.25s ease;
    text-decoration: none;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn i { font-size: 28px; }

/* ---------------------------------------------
   Status Badges — pill + glowing live dot
   --------------------------------------------- */
.badge {
    padding: 5px 14px 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    display: inline-block;
}

.bg-success { background: rgba(18, 183, 106, 0.14); color: var(--success-color); }
.bg-warning { background: rgba(247, 144, 9, 0.14); color: var(--warning-color); }
.bg-danger  { background: rgba(240, 68, 56, 0.14); color: var(--danger-color); }
.bg-info    { background: rgba(78, 161, 255, 0.14); color: var(--info-color); }
.bg-secondary { background: var(--bg-tertiary); color: var(--text-secondary); }

/* ---------------------------------------------
   Alert Messages
   --------------------------------------------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(18, 183, 106, 0.1);
    border-color: rgba(18, 183, 106, 0.3);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(240, 68, 56, 0.1);
    border-color: rgba(240, 68, 56, 0.3);
    color: var(--danger-color);
}

/* ---------------------------------------------
   Stat cards (Reports / Dashboard summary tiles)
   --------------------------------------------- */
.win11-stat {
    border-radius: var(--radius-lg);
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px var(--shadow-color-strong);
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-2)) !important;
}

.win11-stat h5 { font-size: 12px; font-weight: 700; opacity: 0.85; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.4px; }
.win11-stat h3 { font-size: 27px; font-weight: 800; }

/* ---------------------------------------------
   Responsive & Mobile Sidebar
   --------------------------------------------- */
@media (max-width: 768px) {
    .container-fluid, .row {
        z-index: auto;
    }

    .win11-sidebar {
        position: fixed;
        right: -300px; /* Hidden off-screen to the right in RTL */
        left: auto;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 999;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
        border-left: 1px solid var(--glass-border);
        border-right: none;
        overflow-y: auto;
    }

    .win11-sidebar.active {
        right: 0;
    }

    .theme-toggle {
        top: 70px;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 10, 20, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Close Button */
.sidebar-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 50%;
    padding: 8px !important;
    font-size: 12px;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: all 0.2s ease;
    color: var(--text-primary) !important;
}

.sidebar-close-btn:hover {
    transform: scale(1.1);
}

/* Sidebar Toggle Button styling on mobile */
.sidebar-toggle-btn {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 4px 12px var(--shadow-color) !important;
    color: var(--text-primary) !important;
}

.sidebar-toggle-btn:hover {
    background: var(--accent-soft) !important;
    color: var(--accent-color) !important;
}

/* ---------------------------------------------
   Sidebar Quick Actions Capsule Menu
   --------------------------------------------- */
.sidebar-quick-actions {
    padding: 15px 14px 5px 14px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 10px;
}
.sidebar-quick-actions h6 {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-action-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.01);
    color: var(--text-primary);
}
.sidebar-action-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-1px);
}
.sidebar-action-btn.active-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-2));
    border: none;
    color: #0a1628 !important;
    box-shadow: 0 4px 15px var(--glow-1);
}
.sidebar-action-btn.active-btn i {
    color: #0a1628 !important;
}
.sidebar-action-btn i {
    font-size: 15px;
    color: var(--text-secondary);
}

