/*
  SIGO Premium Design System v4.0
  Architecture: Sidebar-First | Multi-View | Themes | Accessibility
*/

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

/* ════════ Design Tokens ════════ */
:root {
    /* Dynamic (overridden by JS/themes) */
    --dyn-font: 'Inter', sans-serif;
    --dyn-size: 14px;
    --dyn-title-font: 'Plus Jakarta Sans', sans-serif;

    /* Accent */
    --accent: #3b82f6;
    --accent-vibrant: #06d6a0;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --accent-hover: #2563eb;

    /* Surfaces — default = glass */
    --bg-app: #060810;
    --bg-sidebar: rgba(8, 10, 18, 0.85);
    --bg-navbar: rgba(8, 10, 18, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shine: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 100%);
    --card-hover: rgba(255, 255, 255, 0.07);

    /* Text */
    --text-high: rgba(255, 255, 255, 0.95);
    --text-mid: rgba(255, 255, 255, 0.55);
    --text-low: rgba(255, 255, 255, 0.3);

    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #60a5fa;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    --radius-3xl: 32px;

    /* Accessibility */
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.5);

    /* Easing */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    /* Layout */
    --sidebar-w: 260px;
    --navbar-h: 64px;
}

/* ════════ Theme: Light ════════ */
.theme-white {
    --bg-app: #f4f5f7;
    --bg-sidebar: rgba(255, 255, 255, 0.92);
    --bg-navbar: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shine: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, transparent 100%);
    --card-hover: rgba(0, 0, 0, 0.04);
    --text-high: #0f172a;
    --text-mid: #475569;
    --text-low: #94a3b8;
    --accent-glow: rgba(59, 130, 246, 0.15);
}

/* ════════ Theme: Pure White (High Contrast) ════════ */
.theme-pure-white {
    --bg-app: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-navbar: #ffffff;
    --glass-bg: #ffffff;
    --glass-border: #d1d5db;
    --glass-shine: none;
    --card-hover: #f3f4f6;
    --text-high: #000000;
    --text-mid: #334155;
    --text-low: #6b7280;
    --accent: #1d4ed8;
    --accent-vibrant: #059669;
    --accent-glow: rgba(29, 78, 216, 0.15);
}
.theme-pure-white .mesh-bg { display: none; }

/* ════════ Theme: Dark ════════ */
.theme-dark {
    --bg-app: #0a0a0f;
    --bg-sidebar: #0f0f16;
    --bg-navbar: rgba(15, 15, 22, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --text-high: #e2e8f0;
    --text-mid: #64748b;
}
.theme-dark .mesh-bg::before { opacity: 0.5; }

/* ════════ Reset & Base ════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: var(--dyn-size);
    scroll-behavior: smooth;
}

body {
    background: var(--bg-app);
    color: var(--text-high);
    font-family: var(--dyn-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.4s var(--ease), color 0.3s var(--ease);
}

a { color: inherit; text-decoration: none; }

/* ════════ Accessibility ════════ */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sr-only:focus {
    position: fixed; top: 12px; left: 12px;
    width: auto; height: auto; padding: 12px 24px;
    clip: auto; white-space: normal;
    background: var(--accent); color: #fff;
    border-radius: var(--radius-md); z-index: 99999;
    font-weight: 700; font-size: 14px;
}
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* Reduce motion */
.reduce-motion, .reduce-motion * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
}

/* ════════ Mesh Background ════════ */
.mesh-bg {
    position: fixed; inset: 0; z-index: -1;
    background: var(--bg-app);
    overflow: hidden;
}
.mesh-bg::before {
    content: '';
    position: absolute;
    width: 150%; height: 150%; top: -25%; left: -25%;
    background:
        radial-gradient(ellipse at 20% 30%, hsla(224, 80%, 25%, 0.3) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 15%, hsla(280, 80%, 20%, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, hsla(160, 80%, 20%, 0.2) 0%, transparent 50%);
    filter: blur(80px);
    animation: meshDrift 25s infinite alternate ease-in-out;
}
.theme-white .mesh-bg::before {
    background:
        radial-gradient(ellipse at 20% 30%, hsla(224, 80%, 80%, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 15%, hsla(280, 80%, 80%, 0.1) 0%, transparent 50%);
}
@keyframes meshDrift {
    0% { transform: rotate(0deg) scale(1.05); }
    100% { transform: rotate(8deg) scale(1.15); }
}

/* ════════ App Shell ════════ */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ════════ Sidebar ════════ */
.sidebar-pro {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    height: 100vh;
    position: sticky; top: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    backdrop-filter: blur(40px) saturate(150%);
    border-right: 1px solid var(--glass-border);
    z-index: 100;
    transition: transform 0.4s var(--ease), width 0.3s var(--ease), min-width 0.3s var(--ease);
}


.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
}
.sidebar-logo {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-vibrant));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
    box-shadow: 0 4px 16px var(--accent-glow);
    flex-shrink: 0;
}
.sidebar-brand {
    font-family: var(--dyn-title-font);
    font-weight: 800;
    font-size: 20px;
    background: linear-gradient(135deg, var(--text-high) 40%, var(--accent-vibrant));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar-brand small {
    font-weight: 400; font-size: 0.55em;
    -webkit-text-fill-color: var(--text-low);
}
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }

.nav-section-label {
    font-size: 10px; font-weight: 700;
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 20px 14px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-mid);
    font-weight: 500; font-size: 13px;
    transition: all 0.2s var(--ease);
    cursor: pointer;
    border: 1px solid transparent;
}
.nav-item:hover {
    background: var(--glass-bg);
    color: var(--text-high);
    border-color: var(--glass-border);
}
.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.2);
}
.nav-item i {
    width: 20px; text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}
.nav-item.active i { color: var(--accent); }

.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 10px; color: var(--text-low);
    line-height: 1.6;
}

/* ════════ Main Wrapper ════════ */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    height: 100vh;
    transition: all 0.3s var(--ease);
}

/* ════════ Global Navbar ════════ */
.global-navbar {
    position: sticky; top: 0;
    height: var(--navbar-h);
    padding: 0 32px;
    display: flex; align-items: center;
    background: var(--bg-navbar);
    backdrop-filter: blur(30px) saturate(150%);
    border-bottom: 1px solid var(--glass-border);
    z-index: 90;
    gap: 16px;
}
.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-high);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    transition: all 0.2s var(--ease);
}
.sidebar-toggle:hover {
    background: var(--glass-bg);
    color: var(--accent);
}
.navbar-search {
    position: relative;
    width: 280px;
}
.navbar-search i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-low); font-size: 13px; pointer-events: none;
}
.navbar-search input {
    width: 100%; height: 38px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0 14px 0 38px;
    color: var(--text-high);
    font-size: 13px; font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.navbar-search input::placeholder { color: var(--text-low); }
.navbar-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}
.navbar-spacer { flex: 1; }

/* View mode toggles in navbar */
.view-toggles {
    display: flex; gap: 4px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 3px;
}
.view-btn {
    width: 32px; height: 32px;
    border: none; border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-low);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: all 0.2s var(--ease);
}
.view-btn:hover { color: var(--text-mid); background: var(--glass-bg); }
.view-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* User profile trigger */
.profile-trigger {
    display: flex; align-items: center; gap: 12px;
    cursor: pointer;
    padding: 6px 8px 6px 16px;
    border-radius: var(--radius-lg);
    transition: background 0.2s;
    position: relative;
}
.profile-trigger:hover { background: var(--glass-bg); }
.profile-info { text-align: right; }
.profile-name { font-size: 13px; font-weight: 600; color: var(--text-high); }
.profile-role {
    font-size: 10px; font-weight: 700; color: var(--accent-vibrant);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.profile-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--accent-vibrant));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 15px;
    box-shadow: 0 4px 12px var(--accent-glow);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.profile-trigger:hover .profile-avatar { transform: scale(1.05); }

/* ════════ User Dropdown Menu ════════ */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px); right: 0;
    width: 300px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 8px;
    box-shadow: 0 20px 60px -10px rgba(0,0,0,0.6), 0 0 0 1px var(--glass-border);
    opacity: 0; visibility: hidden;
    transform: translateY(8px) scale(0.97);
    transition: all 0.25s var(--ease);
    z-index: 200;
}
.user-dropdown.open {
    opacity: 1; visibility: visible;
    transform: translateY(0) scale(1);
}

.ud-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 4px;
}
.ud-header-avatar {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--accent-vibrant));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 18px;
}
.ud-header-info h4 { font-size: 14px; font-weight: 700; margin: 0; }
.ud-header-info span { font-size: 11px; color: var(--text-mid); }

.ud-group { padding: 4px 0; }
.ud-group-label {
    font-size: 10px; font-weight: 700;
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 12px 4px;
}
.ud-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    color: var(--text-mid);
    transition: all 0.15s;
}
.ud-link:hover {
    background: var(--card-hover);
    color: var(--text-high);
}
.ud-link i { width: 18px; text-align: center; font-size: 14px; color: var(--accent); }
.ud-link.danger { color: var(--danger); }
.ud-link.danger i { color: var(--danger); }
.ud-link.danger:hover { background: rgba(239, 68, 68, 0.1); }

.ud-divider { height: 1px; background: var(--glass-border); margin: 4px 8px; }

/* Theme selector inside dropdown */
.ud-theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 4px 12px 8px;
}
.theme-btn {
    height: 36px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}
.theme-btn:hover { border-color: var(--text-mid); transform: scale(1.05); }
.theme-btn.active { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

.theme-btn[data-theme="glass"] { background: linear-gradient(135deg, #0a0e1a, #1a1e30); color: #8b9cc6; }
.theme-btn[data-theme="white"] { background: linear-gradient(135deg, #e8ecf1, #f5f7fa); color: #64748b; }
.theme-btn[data-theme="pure-white"] { background: #fff; color: #000; border-color: #ccc; }
.theme-btn[data-theme="dark"] { background: linear-gradient(135deg, #050508, #0f0f18); color: #475569; }

/* ════════ Content Body ════════ */
.content-body {
    padding: 40px 48px 60px;
    max-width: 1400px;
    width: 100%;
}

/* Hero Section */
.hero-section { margin-bottom: 48px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 30px;
    color: var(--accent);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.15em;
    margin-bottom: 20px;
}
.hero-title {
    font-family: var(--dyn-title-font);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 12px;
    line-height: 1.1;
}
.theme-glass .hero-title, .theme-dark .hero-title {
    background: linear-gradient(135deg, #fff 40%, rgba(255,255,255,0.5));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    color: var(--text-mid);
    font-size: clamp(15px, 1.3vw, 18px);
    max-width: 600px;
    line-height: 1.6;
}

/* ════════ KPI Grid ════════ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}
.kpi-card {
    display: flex; align-items: center; gap: 16px;
    padding: 24px;
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px -10px rgba(0,0,0,0.3);
}
.kpi-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    position: relative;
}
.kpi-icon::after {
    content: '';
    position: absolute; inset: 6px;
    background: currentColor; border-radius: inherit;
    opacity: 0.1; filter: blur(8px);
}
.kpi-value {
    font-family: var(--dyn-title-font);
    font-size: 28px; font-weight: 800;
    line-height: 1.1;
}
.kpi-label {
    font-size: 10px; font-weight: 700;
    color: var(--accent-vibrant);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

/* ════════ Portal Grid (Cards) ════════ */
.section-title {
    font-family: var(--dyn-title-font);
    font-size: 20px; font-weight: 700;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.section-title i { color: var(--accent); font-size: 18px; }
.section-title span {
    font-family: var(--dyn-body-font);
    font-size: 12px;
    font-weight: 800;
    color: var(--text-mid);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 3px 8px;
}
.module-section { margin-top: 28px; }
.module-section:first-of-type { margin-top: 0; }

/* VIEW: Grid */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.module-card {
    display: flex; flex-direction: column;
    padding: 20px 24px;
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    transition: all 0.35s var(--ease);
    position: relative;
    overflow: hidden;
    gap: 12px;
}
.module-card::before {
    content: '';
    position: absolute; inset: 0;
    background: var(--glass-shine);
    pointer-events: none;
}
.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -10px rgba(0,0,0,0.15);
    border-color: rgba(59, 130, 246, 0.3);
}
.module-card-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff;
    box-shadow: 0 8px 16px -6px var(--accent-glow);
    flex-shrink: 0;
}
.module-card-title {
    font-family: var(--dyn-title-font);
    font-size: 16px; font-weight: 700;
    color: var(--text-high);
    margin: 0;
}
.module-card-desc {
    color: var(--text-mid);
    font-size: 13px; line-height: 1.4;
    margin: 0;
    flex: 1;
}
.module-card-action {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700;
    color: var(--accent);
    margin-top: 4px;
    transition: gap 0.2s;
}
.module-card:hover .module-card-action { gap: 10px; }

/* === Ribbon "DEV" e badge "NOVO/ADMIN/SAP" — ver painel.php === */
/* Garante posicionamento dos marcadores absolutos. */
.module-card.is-dev,
.module-card.is-badged { position: relative; overflow: hidden; }

/* Ribbon diagonal no canto superior direito sinalizando DEV. */
.module-ribbon-dev {
    position: absolute;
    top: 12px;
    right: -38px;
    transform: rotate(35deg);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 3px 42px;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    text-shadow: 0 1px 1px rgba(0,0,0,.25);
    pointer-events: none;
    z-index: 3;
}

/* Badge texto curto (NOVO, ADMIN, SAP, SNOW...) no canto superior esquerdo. */
.module-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #2563eb;
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 3px 8px;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    z-index: 2;
    text-transform: uppercase;
}
.module-card.is-dev .module-badge { background: #16a34a; }    /* NOVO em DEV → verde */

/* Suaviza opacidade do card DEV pra reforçar status experimental. */
.module-card.is-dev::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(245,158,11,0.04), rgba(245,158,11,0.0) 60%);
    pointer-events: none;
}

.module-card.is-inactive {
    opacity: .58;
    cursor: not-allowed;
    filter: grayscale(.2);
}
.module-card.is-inactive:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--glass-border);
}
.module-card.is-inactive .module-card-icon {
    background: #94a3b8 !important;
}
.module-badge-muted {
    background: #64748b !important;
}

.nav-item-dev small {
    margin-left: auto;
    font-size: 10px;
    font-weight: 800;
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, .35);
    border-radius: 999px;
    padding: 1px 6px;
}

/* VIEW: List */
.view-list .portal-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.view-list .module-card {
    flex-direction: row;
    align-items: center;
    padding: 16px 24px;
    gap: 20px;
    border-radius: var(--radius-lg);
}
.view-list .module-card-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    font-size: 18px;
}
.view-list .module-card-title { font-size: 15px; }
.view-list .module-card-desc { display: none; }
.view-list .module-card-action {
    margin-left: auto;
    margin-top: 0;
}
.view-list .module-card:hover { transform: translateX(4px) translateY(0); }

/* VIEW: Menu (Sidebar-like) */
.view-menu .portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.view-menu .module-card {
    flex-direction: row;
    align-items: center;
    padding: 14px 18px;
    gap: 14px;
    border-radius: var(--radius-md);
    background: transparent;
    border-color: transparent;
    backdrop-filter: none;
}
.view-menu .module-card::before { display: none; }
.view-menu .module-card:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    transform: none;
    box-shadow: none;
}
.view-menu .module-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    font-size: 16px;
}
.view-menu .module-card-title { font-size: 14px; }
.view-menu .module-card-desc { display: none; }
.view-menu .module-card-action { display: none; }

/* ════════ Customization Modal ════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal-panel {
    width: 100%; max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-sidebar);
    backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.7);
    padding: 0;
}
.modal-panel::-webkit-scrollbar { width: 6px; }
.modal-panel::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 6px; }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--glass-border);
    position: sticky; top: 0;
    background: inherit;
    z-index: 1;
}
.modal-header h2 {
    font-family: var(--dyn-title-font);
    font-size: 18px; font-weight: 700;
    margin: 0;
}
.modal-close {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-mid);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.modal-close:hover { color: var(--text-high); border-color: var(--text-low); }

.modal-body { padding: 24px 28px 32px; }

.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 12px; font-weight: 700;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.form-label i { color: var(--accent); margin-right: 6px; }

.form-select, .form-input {
    width: 100%; height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    color: var(--text-high);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: auto;
    -webkit-appearance: auto;
}
.form-select:focus, .form-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-color-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-color-group { display: flex; flex-direction: column; gap: 6px; }
.form-color-label {
    font-size: 11px; font-weight: 600;
    color: var(--text-low);
}
.form-color-input {
    width: 100%; height: 38px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    cursor: pointer;
    padding: 3px;
}

.form-range-row {
    display: flex; align-items: center; gap: 12px;
}
.form-range {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--glass-border);
    outline: none;
}
.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.form-range-val {
    font-size: 12px; font-weight: 700;
    color: var(--text-mid);
    min-width: 36px; text-align: right;
}

.form-switch-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}
.form-switch-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent); font-size: 16px;
    flex-shrink: 0;
}
.form-switch-text { flex: 1; }
.form-switch-title { font-size: 13px; font-weight: 600; }
.form-switch-desc { font-size: 11px; color: var(--text-mid); margin-top: 2px; }

.toggle-switch {
    position: relative;
    width: 44px; height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    border-radius: 12px;
    background: var(--glass-border);
    cursor: pointer;
    transition: background 0.3s;
}
.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px; left: 3px;
    transition: transform 0.3s var(--ease);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.modal-section-title {
    font-size: 11px; font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 16px 0 10px;
    border-top: 1px solid var(--glass-border);
    margin-top: 8px;
    display: flex; align-items: center; gap: 8px;
}
.modal-section-title i { font-size: 12px; }

.btn-reset {
    width: 100%;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-mid);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.2s;
    margin-top: 24px;
    font-family: inherit;
}
.btn-reset:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

/* ════════ Animations ════════ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.ani-fade { animation: fadeUp 0.6s var(--ease) both; }
.ani-d1 { animation-delay: 0.05s; }
.ani-d2 { animation-delay: 0.1s; }
.ani-d3 { animation-delay: 0.15s; }
.ani-d4 { animation-delay: 0.2s; }

/* ════════ Responsive ════════ */
@media (max-width: 1024px) {
    .content-body { padding: 32px 24px 48px; }
    .portal-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 768px) {
    .sidebar-pro { display: none; }
    .content-body { padding: 24px 16px 40px; }
    .global-navbar { padding: 0 16px; }
    .navbar-search { width: 180px; }
    .profile-info { display: none; }
    .kpi-grid { grid-template-columns: 1fr; }
    .portal-grid { grid-template-columns: 1fr; }
    .view-menu .portal-grid { grid-template-columns: 1fr; }
}

/* ════════ Print ════════ */
@media print {
    .mesh-bg, .sidebar-pro, .global-navbar { display: none !important; }
    .main-wrapper { height: auto; overflow: visible; }
    body { background: #fff; color: #000; }
}

/* ════════ Sidebar: Collapsed State (FORCE OVERRIDE) ════════ */
body.sidebar-collapsed {
    --sidebar-w: 80px;
}

body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .sidebar-footer {
    display: none !important;
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center !important;
    padding: 24px 0 !important;
}

body.sidebar-collapsed .sidebar-logo {
    margin: 0 !important;
}

body.sidebar-collapsed .sidebar-nav {
    padding: 12px 10px !important;
    align-items: center !important;
}

body.sidebar-collapsed .nav-item {
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    margin-bottom: 8px !important;
}

body.sidebar-collapsed .nav-item i {
    font-size: 24px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
}

/* Mobile Toggle: Force Show Drawer */
@media (max-width: 768px) {
    body.sidebar-collapsed {
        --sidebar-w: 260px; /* Keep full width in mobile drawer */
    }
    body.sidebar-collapsed .sidebar-pro {
        display: flex !important;
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: var(--sidebar-w) !important;
        height: 100vh !important;
        z-index: 9999 !important;
        box-shadow: 20px 0 60px rgba(0,0,0,0.8) !important;
        background: var(--bg-sidebar) !important;
        backdrop-filter: blur(40px) !important;
        transform: translateX(0) !important;
    }
    body.sidebar-collapsed .sidebar-brand,
    body.sidebar-collapsed .nav-section-label,
    body.sidebar-collapsed .nav-item span,
    body.sidebar-collapsed .sidebar-footer {
        display: block !important;
    }
    body.sidebar-collapsed .main-wrapper {
        filter: blur(4px);
        pointer-events: none;
    }
}
