/* ═══════════════════════════════════════════════
   Credbusiness — PRISMA Design System
   Modern Premium Theme · 2026
   Indigo + Emerald · Glassmorphism · Inter Font
   ═══════════════════════════════════════════════ */

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

/* ── Design Tokens ── */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --primary-glow: rgba(99,102,241,.18);

    --accent: #10b981;
    --accent-hover: #059669;
    --accent-light: #ecfdf5;

    --sidebar-bg: #0c0a1d;
    --sidebar-surface: rgba(255,255,255,.04);
    --sidebar-w: 72px;
    --sidebar-text: #7c7c9a;
    --sidebar-hover: rgba(255,255,255,.06);
    --sidebar-active-bg: rgba(99,102,241,.12);
    --sidebar-active-text: #a5b4fc;
    --sidebar-border: rgba(255,255,255,.06);

    --bg: #f4f2ee;
    --bg2: #eae7e1;
    --surface: #ffffff;
    --surface2: #fafaf9;
    --border: #e7e5e4;
    --border-light: #f5f5f4;

    --text: #1c1917;
    --text2: #57534e;
    --text3: #78716c;

    --focus-ring: 0 0 0 3px rgba(99,102,241,.45);
    --focus-ring-offset: 0 0 0 2px var(--surface);

    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-md: 0 8px 16px -4px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
    --shadow-lg: 0 20px 40px -8px rgba(0,0,0,.12);
    --shadow-primary: 0 4px 14px rgba(99,102,241,.25);
    --shadow-accent: 0 4px 14px rgba(16,185,129,.25);

    --transition: .2s cubic-bezier(.4,0,.2,1);
    --transition-fast: .15s ease;
    --transition-spring: .4s cubic-bezier(.34,1.56,.64,1);

    --header-h: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
a { text-decoration: none; color: var(--primary); transition: var(--transition-fast); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
h1,h2,h3,h4,h5,h6 { font-weight: 600; color: var(--text); line-height: 1.3; }

/* ═══════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════ */

/* ── Skip to Content ── */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    font-size: .9rem;
    font-weight: 600;
    border-radius: 0 0 var(--radius) var(--radius);
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: none;
}
.skip-to-content:focus {
    left: 50%;
    transform: translateX(-50%);
    outline: none;
}

/* ── Focus Indicators (WCAG 2.4.7) ── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.btn:focus-visible,
.header-btn:focus-visible,
.menu-toggle:focus-visible,
.nav-link:focus-visible,
.auth-tab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}
.form-control:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}
.modal-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    background: var(--bg);
}

/* ── Screen Reader Only ── */
.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-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: inherit;
}

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-in     { animation: fadeInUp .4s cubic-bezier(.4,0,.2,1) both; }
.animate-fade   { animation: fadeIn .3s ease both; }
.animate-scale  { animation: scaleIn .3s cubic-bezier(.4,0,.2,1) both; }

/* Staggered children animation */
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .15s; }
.stagger > *:nth-child(5) { animation-delay: .2s; }
.stagger > *:nth-child(6) { animation-delay: .25s; }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg2) 25%, var(--bg) 50%, var(--bg2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════ */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow: visible;
    border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 200px;
    background: linear-gradient(180deg, rgba(99,102,241,.08) 0%, transparent 100%);
    pointer-events: none;
}
.sidebar-header { display: none; }
.sidebar-brand { display: none; }
.sidebar-nav {
    flex: 1;
    overflow: visible;
    padding: 16px 0;
    position: relative;
    z-index: 1;
    width: 100%;
}

.nav-section { padding: 0 0; margin-bottom: 2px; }
.nav-section-title { display: none; }
.nav-item { margin-bottom: 1px; position: relative; }
.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    border-radius: 0;
    color: var(--sidebar-text);
    font-size: .85rem;
    font-weight: 450;
    transition: all .15s;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    width: 100%;
}
.nav-link span { display: none; }
.nav-link i {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
    opacity: .55;
    flex-shrink: 0;
}
.nav-link:hover {
    background: var(--sidebar-hover);
    color: #d4d4d8;
    padding-left: 0;
}
.nav-link:hover i { opacity: .85; }
.nav-item.active > .nav-link {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 500;
}
.nav-item.active > .nav-link i {
    opacity: 1;
    color: var(--sidebar-active-text);
}
.nav-item.active > .nav-link::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}
.nav-link .arrow { display: none; }

/* ── Tooltip ── */
.nav-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-w) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e1b4b;
    color: #e2e8f0;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s, transform .15s;
    transform: translateY(-50%) translateX(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    z-index: 1001;
    letter-spacing: .2px;
}
.nav-item[data-tooltip]::before {
    content: '';
    position: absolute;
    left: calc(var(--sidebar-w) - 2px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1e1b4b;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 1001;
}
.nav-item[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.nav-item[data-tooltip]:hover::before {
    opacity: 1;
}
/* Hide tooltip on items that have flyout submenu */
.nav-item.has-submenu[data-tooltip]::after,
.nav-item.has-submenu[data-tooltip]::before { display: none; }

/* Submenu — flyout on hover */
.submenu { display: none; }
.nav-item.has-submenu:hover > .submenu {
    display: block;
    position: absolute;
    left: calc(var(--sidebar-w) + 4px);
    top: 0;
    background: #1e1b4b;
    border-radius: 10px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
    z-index: 1001;
}
.nav-item.has-submenu:hover > .submenu .nav-link {
    padding: 8px 20px;
    justify-content: flex-start;
    gap: 8px;
    font-size: .82rem;
    color: #c7d2fe;
}
.nav-item.has-submenu:hover > .submenu .nav-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.nav-item.has-submenu:hover > .submenu .nav-item.active > .nav-link {
    color: var(--sidebar-active-text);
    background: rgba(99,102,241,.15);
}
.nav-item.has-submenu:hover > .submenu .nav-item.active > .nav-link::before { display: none; }
.nav-item.has-submenu > .nav-link .arrow { display: none; }
/* Submenu hover bridge — prevents gap from closing submenu */
.nav-item.has-submenu::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 0;
    width: 12px;
    height: 100%;
    pointer-events: none;
}
.nav-item.has-submenu:hover::after {
    pointer-events: auto;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: center;
}
.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s;
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-user img {
    width: 36px; height: 36px;
    border-radius: 10px;
    object-fit: cover;
}
.sidebar-user-info { display: none; }

/* ── Main Wrapper ── */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin .3s ease;
}

/* ── Header ── */
.top-header {
    height: var(--header-h);
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.15rem;
    color: var(--text2);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.menu-toggle:hover { background: var(--bg2); }
.header-breadcrumb {
    font-size: .85rem;
    color: var(--text3);
}
.header-breadcrumb span { color: var(--text); font-weight: 600; }
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.header-btn {
    width: 40px; height: 40px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    font-size: .95rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}
.header-btn:hover { background: var(--bg2); color: var(--text); }
.header-btn .dot {
    position: absolute;
    top: 6px; right: 6px;
    min-width: 16px; height: 16px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--surface);
    font-size: .6rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* ── Notification Dropdown ── */
.notification-wrapper { position: relative; }
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}
.notification-dropdown.show { display: flex; }
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.notif-list {
    overflow-y: auto;
    max-height: 360px;
    flex: 1;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.notif-item:hover { background: var(--bg2); }
.notif-item.unread { background: var(--primary-light); }
.notif-item i:first-child { font-size: 1rem; margin-top: 3px; flex-shrink: 0; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: .82rem; color: var(--text); margin-bottom: 2px; }
.notif-msg { font-size: .78rem; color: var(--text2); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: .7rem; color: var(--text3); margin-top: 3px; }
.notif-dismiss {
    position: absolute;
    top: 8px; right: 8px;
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    font-size: .7rem;
    padding: 4px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity .15s;
}
.notif-item:hover .notif-dismiss { opacity: 1; }
.notif-dismiss:hover { color: var(--danger); }
.notif-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: .8rem;
}
.notif-footer a { color: var(--primary); text-decoration: none; }
.notif-footer a:hover { text-decoration: underline; }

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--accent) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background .15s;
    margin-left: 4px;
    border: 1px solid transparent;
}
.user-menu:hover { background: var(--bg2); border-color: var(--border); }
.user-menu img {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 2px solid var(--border);
}
.user-menu .name { font-size: .85rem; font-weight: 600; color: var(--text); }
.user-menu .level-tag {
    font-size: .65rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    line-height: 1;
    letter-spacing: .3px;
}

/* Dropdown */
.dropdown {
    position: absolute;
    top: calc(var(--header-h) - 2px);
    right: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 210px;
    display: none;
    z-index: 200;
    overflow: hidden;
    padding: 6px;
}
.dropdown.show { display: block; }
.dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text2);
    font-size: .85rem;
    font-weight: 450;
    border-radius: var(--radius);
    transition: background .1s;
}
.dropdown a:hover { background: var(--bg); color: var(--text); }
.dropdown a i { width: 18px; text-align: center; font-size: .85rem; }
.dropdown .divider { height: 1px; background: var(--border); margin: 4px 6px; }

/* ── Content ── */
.content { flex: 1; padding: 32px; animation: fadeInUp .35s ease both; }

/* ── Footer ── */
.main-footer {
    padding: 18px 32px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: .78rem;
    color: var(--text3);
    background: var(--surface);
}

/* ═══════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════ */

/* ── Page Header ── */
.page-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -.3px;
}
.page-header p { color: var(--text3); font-size: .875rem; }
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: rgba(99,102,241,.12); }
.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header h3 {
    font-size: .95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h3 i { color: var(--text3); font-size: .85rem; }
.card-body { padding: 22px; }
.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-light);
    background: var(--surface2);
    font-size: .82rem;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all .25s;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity .2s;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: rgba(99,102,241,.1);
}
.stat-card:hover::before { opacity: 1; }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-icon.blue   { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }
.stat-icon.green  { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #16a34a; }
.stat-icon.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #7c3aed; }
.stat-icon.orange { background: linear-gradient(135deg, #ffedd5, #fed7aa); color: #ea580c; }
.stat-icon.cyan   { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #0891b2; }
.stat-icon.red    { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #dc2626; }
.stat-icon.yellow { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }
.stat-icon.indigo { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4f46e5; }
.stat-info { flex: 1; }
.stat-info h3 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -.3px; }
.stat-info p { font-size: .8rem; color: var(--text3); margin-top: 2px; font-weight: 450; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -.3px; color: var(--text); }
.stat-label { display: block; font-size: .8rem; color: var(--text3); margin-top: 2px; font-weight: 450; }
.stat-info .trend { font-size: .75rem; font-weight: 600; margin-top: 4px; }
.stat-info .trend.up { color: var(--success); }
.stat-info .trend.down { color: var(--danger); }

/* ── Grid Layouts ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; } .mt-20 { margin-top: 20px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: -4px; padding: 4px; }
table, .table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
    background: var(--surface2);
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--text3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface2); }
tbody tr:focus-within { background: var(--primary-light); }
tbody tr:last-child td { border-bottom: none; }
.table-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--text3);
}
.table-empty i { font-size: 2.2rem; display: block; margin-bottom: 12px; opacity: .3; }

/* ── Table Loading ── */
.table-loading td {
    height: 18px;
    background: linear-gradient(90deg, var(--bg2) 25%, var(--bg) 50%, var(--bg2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .2px;
}
.badge-green, .badge-success   { background: var(--success-bg); color: var(--success); }
.badge-red, .badge-danger      { background: var(--danger-bg); color: var(--danger); }
.badge-yellow, .badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-blue, .badge-info       { background: var(--info-bg); color: var(--info); }
.badge-cyan                    { background: #ecfeff; color: #0891b2; }
.badge-purple                  { background: #ede9fe; color: #7c3aed; }
.badge-gray, .badge-secondary  { background: #f5f5f4; color: #78716c; }
.badge-orange                  { background: #fff7ed; color: #ea580c; }
.badge-indigo                  { background: #eef2ff; color: #4f46e5; }
.badge-primary                 { background: var(--primary-light); color: var(--primary); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 550;
    font-size: .85rem;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    line-height: 1.4;
    letter-spacing: -.1px;
}
.btn:active { transform: scale(.97); }
.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 6px 20px rgba(99,102,241,.35);
    transform: translateY(-1px);
}
.btn-accent {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: var(--shadow-accent);
}
.btn-accent:hover { background: linear-gradient(135deg, #34d399, #10b981); }
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}
.btn-success:hover { background: linear-gradient(135deg, #34d399, #10b981); }
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #dc2626; }
.btn-warning {
    background: var(--warning);
    color: #fff;
}
.btn-warning:hover { background: #d97706; }
.btn-outline {
    background: var(--surface);
    color: var(--text2);
    border-color: var(--border);
}
.btn-outline:hover { background: var(--bg); border-color: var(--text3); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 6px 14px; font-size: .78rem; border-radius: var(--radius-sm); }
.btn-xs { padding: 4px 8px; font-size: .72rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius); }
.btn-icon.sm { width: 30px; height: 30px; font-size: .8rem; }
.btn-group { display: flex; gap: 4px; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 550;
    color: var(--text2);
    margin-bottom: 7px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .875rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control::placeholder { color: var(--text3); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-hint { font-size: .75rem; color: var(--text3); margin-top: 4px; }
.input-group { position: relative; }
.input-group .form-control { padding-right: 42px; }
.input-group-btn {
    position: absolute;
    right: 2px; top: 2px; bottom: 2px;
    width: 38px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text3);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Tabs ── */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 22px;
    gap: 0;
}
.tab {
    padding: 10px 22px;
    font-size: .875rem;
    font-weight: 550;
    color: var(--text3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
    white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Progress Bar ── */
.progress-bar {
    height: 8px;
    background: var(--bg2);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    transition: width .6s cubic-bezier(.4,0,.2,1);
}
.progress-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-fill.orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill.red { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ── Level Cards ── */
.level-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all .25s;
}
.level-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.level-card.current {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-primary);
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--surface) 60%);
}
.level-card .level-icon { font-size: 2.5rem; margin-bottom: 10px; }
.level-card h4 { font-size: 1rem; margin-bottom: 4px; }
.level-card p { font-size: .78rem; color: var(--text3); }
.level-badge { position: absolute; top: 10px; right: 10px; font-size: .65rem; }

/* ── Plan Cards ── */
.plan-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    transition: all .3s;
    position: relative;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card.featured {
    border-color: var(--primary);
    background: linear-gradient(180deg, var(--primary-light), var(--surface));
}
.plan-card .plan-name { font-size: .82rem; color: var(--text3); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.plan-card .plan-price { font-size: 2.2rem; font-weight: 800; margin: 14px 0; letter-spacing: -1px; }
.plan-card .plan-price small { font-size: .82rem; font-weight: 400; color: var(--text3); }
.plan-card .plan-features { list-style: none; margin: 22px 0; text-align: left; }
.plan-card .plan-features li {
    padding: 8px 0;
    font-size: .85rem;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
}
.plan-card .plan-features li:last-child { border: none; }
.plan-card .plan-features li i { color: var(--accent); font-size: .8rem; }
.plan-recommended {
    position: absolute;
    top: -1px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 0 0 var(--radius) var(--radius);
    letter-spacing: .3px;
}

/* ── Package Cards ── */
.pkg-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all .25s;
}
.pkg-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pkg-card .pkg-name { font-size: 1.05rem; font-weight: 650; margin-bottom: 4px; }
.pkg-card .pkg-desc { font-size: .82rem; color: var(--text3); margin-bottom: 16px; }
.pkg-card .pkg-points { font-size: .85rem; color: var(--primary); font-weight: 600; margin-bottom: 12px; }
.pkg-card .pkg-price { font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; letter-spacing: -.3px; }
.pkg-card .pkg-price small { font-size: .8rem; font-weight: 400; color: var(--text3); }

/* ── Activity List ── */
.activity-list { list-style: none; }
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border: none; }
.activity-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    flex-shrink: 0;
}
.activity-info { flex: 1; }
.activity-info .title { font-size: .85rem; font-weight: 500; }
.activity-info .desc { font-size: .78rem; color: var(--text3); }
.activity-info .time { font-size: .72rem; color: var(--text3); }

/* ── Tree View ── */
.tree-container { overflow-x: auto; }
.tree-view ul { padding-left: 28px; position: relative; }
.tree-view > ul { padding-left: 0; }
.tree-view li { position: relative; padding: 4px 0; }
.tree ul { padding-left: 28px; position: relative; }
.tree > ul { padding-left: 0; }
.tree li { position: relative; padding: 4px 0; }
.tree-node {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .85rem;
    transition: all .15s;
}
.tree-node:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }
.tree-node strong { font-weight: 600; }
.tree-node .node-level { font-size: .65rem; }

/* ── FAQ ── */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color .2s;
}
.faq-item.open { border-color: var(--primary); }
.faq-q {
    padding: 16px 20px;
    font-weight: 550;
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background .15s;
}
.faq-q:hover { background: var(--surface2); }
.faq-q i { transition: transform .25s; color: var(--text3); }
.faq-item.open .faq-q i { transform: rotate(180deg); color: var(--primary); }
.faq-a {
    display: none;
    padding: 0 20px 16px;
    font-size: .85rem;
    color: var(--text2);
    line-height: 1.7;
}
.faq-item.open .faq-a { display: block; }

/* ── News / Info ── */
.news-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}
.news-item:last-child { border: none; }
.news-item .news-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.news-item h4 { font-size: .95rem; margin-bottom: 4px; }
.news-item p { font-size: .85rem; color: var(--text2); line-height: 1.6; }

/* ── Event Cards ── */
.event-card {
    display: flex;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all .2s;
}
.event-card:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }
.event-date {
    width: 60px;
    text-align: center;
    flex-shrink: 0;
    padding-top: 4px;
}
.event-date .day { font-size: 1.6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.event-date .month { font-size: .72rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.event-info h4 { font-size: .95rem; margin-bottom: 4px; }
.event-info p { font-size: .82rem; color: var(--text2); margin-bottom: 6px; }
.event-info .event-meta { font-size: .78rem; color: var(--text3); display: flex; gap: 12px; }
.event-info .event-meta i { margin-right: 4px; }

/* ── Video Grid ── */
.video-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all .25s;
}
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.video-thumb {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    position: relative;
}
.video-thumb .duration {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(0,0,0,.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: .72rem;
    font-weight: 600;
}
.video-card .video-info { padding: 14px; }
.video-card .video-info h4 { font-size: .9rem; margin-bottom: 4px; }
.video-card .video-info p { font-size: .78rem; color: var(--text3); }

/* ── Financial Summary ── */
.fin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all .2s;
}
.fin-card:hover { box-shadow: var(--shadow-sm); }
.fin-card .fin-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.fin-card h4 { font-size: .78rem; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.fin-card .amount { font-size: 1.4rem; font-weight: 700; letter-spacing: -.3px; }

/* ── Consultation Cards ── */
.consult-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: all .25s;
}
.consult-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--primary); }
.consult-card .consult-icon {
    width: 68px; height: 68px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 16px;
}
.consult-card h4 { font-size: 1rem; margin-bottom: 6px; }
.consult-card p { font-size: .82rem; color: var(--text3); margin-bottom: 18px; }

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12,10,29,.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 95%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(24px) scale(.96);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 650; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text3);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.modal-close:hover { color: var(--text); background: var(--bg); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--surface2);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ═══════════════════════════════════════
   TOAST
   ═══════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: .875rem;
    font-weight: 450;
    min-width: 300px;
    animation: toastIn .35s cubic-bezier(.4,0,.2,1);
    transition: opacity .3s;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.success i { color: var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.error i { color: var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.warning i { color: var(--warning); }
.toast.info { border-left: 4px solid var(--info); }
.toast.info i { color: var(--info); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px) scale(.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ═══════════════════════════════════════
   OVERLAY
   ═══════════════════════════════════════ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    z-index: 999;
    display: none;
}
.overlay.show { display: block; }

/* ═══════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--text3);
}
.empty-state i { font-size: 3rem; opacity: .25; margin-bottom: 16px; display: block; }
.empty-state p { font-size: .95rem; font-weight: 450; }
.empty-state small { display: block; margin-top: 6px; font-size: .82rem; }

/* ═══════════════════════════════════════
   LOGIN / AUTH PAGES
   ═══════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('Fundo/Fundo.jpg') center/cover no-repeat fixed;
    padding: 20px;
    position: relative;
}
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .65);
    backdrop-filter: blur(2px);
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 44px 40px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #10b981);
}
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}
.login-brand .brand-icon {
    display: inline-block;
    margin-bottom: 20px;
}
.login-brand .brand-icon img {
    height: 72px;
    width: auto;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(99,102,241,.2);
}
.login-brand h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.3px; margin-top: 4px; }
.login-brand p { color: var(--text3); font-size: .875rem; margin-top: 4px; }
.login-footer { margin-top: 28px; text-align: center; font-size: .82rem; color: var(--text3); }
.login-footer a { color: var(--primary); font-weight: 600; }

/* Legacy login-left/login-right support */
.login-page .login-left { display: none; }
.login-page .login-right {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 44px 40px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.login-page .login-right::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #10b981);
}
.login-right h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -.3px; }
.login-right .subtitle { color: var(--text3); margin-bottom: 32px; font-size: .875rem; }
.login-right .form-group label { font-size: .85rem; }
.login-right .btn { width: 100%; padding: 12px; font-size: .95rem; }

/* Auth tabs (login) */
.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: .85rem;
    font-weight: 550;
    color: var(--text3);
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s;
}
.auth-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

/* ═══════════════════════════════════════
   ADMIN EXTRAS
   ═══════════════════════════════════════ */
.admin-sidebar .sidebar-brand .brand-icon {
    /* admin uses same logo */
}
.admin-sidebar::before {
    background: linear-gradient(180deg, rgba(239,68,68,.06) 0%, transparent 100%);
}
.admin-badge-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(239,68,68,.1);
    color: #fca5a5;
    border-radius: 12px;
    font-size: 1rem;
}
.admin-badge-tag i { color: #fbbf24; }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

/* ── Responsive Helpers ── */
.responsive-grid { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); }
.responsive-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.responsive-filters .form-control,
.responsive-filters select { min-width: 0; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.responsive-btn-group { display: flex; flex-wrap: wrap; gap: 4px; }
.modal-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); width: 260px; align-items: stretch; }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .menu-toggle { display: flex; }
    .grid-2, .form-row { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .responsive-grid { grid-template-columns: 1fr; }

    /* Sidebar mobile: show labels + section titles */
    .sidebar .nav-link { justify-content: flex-start; padding: 11px 20px; gap: 12px; }
    .sidebar .nav-link span { display: inline; }
    .sidebar .nav-link i { opacity: .7; font-size: 1rem; width: 22px; }
    .sidebar .nav-section-title { display: block; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.3); padding: 16px 20px 6px; }
    .sidebar .sidebar-user { justify-content: flex-start; padding: 12px 20px; gap: 10px; }
    .sidebar .sidebar-user-info { display: block; color: var(--sidebar-text); font-size: .8rem; }

    /* Submenus: toggle by click (class .submenu-open), not hover */
    .nav-item.has-submenu:hover > .submenu { display: none; }
    .nav-item.has-submenu.submenu-open > .submenu {
        display: block;
        position: static;
        background: rgba(0,0,0,.15);
        border-radius: 0;
        box-shadow: none;
        padding: 2px 0;
        min-width: 0;
    }
    .nav-item.has-submenu.submenu-open > .submenu .nav-link {
        padding: 9px 20px 9px 54px;
        justify-content: flex-start;
        color: rgba(255,255,255,.7);
        font-size: .82rem;
    }
    .nav-item.has-submenu.submenu-open > .submenu .nav-link:hover,
    .nav-item.has-submenu.submenu-open > .submenu .nav-item.active > .nav-link {
        background: rgba(255,255,255,.08);
        color: #fff;
    }
    .nav-item.has-submenu > .nav-link::after {
        content: '\f054';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: .6rem;
        margin-left: auto;
        opacity: .5;
        transition: transform .2s;
    }
    .nav-item.has-submenu.submenu-open > .nav-link::after {
        transform: rotate(90deg);
    }
    /* Hide flyout bridge on mobile */
    .nav-item.has-submenu::after { display: none !important; }
    /* Hide tooltips on mobile */
    .nav-item[data-tooltip]::after,
    .nav-item[data-tooltip]::before { display: none !important; }
}
@media (max-width: 768px) {
    .content { padding: 20px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-header h2 { font-size: 1.25rem; }
    .top-header { padding: 0 16px; }
    .form-row-3 { grid-template-columns: 1fr; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .event-card { flex-direction: column; }
    .card-body { padding: 16px; }
    .modal { width: 95vw; max-width: 95vw; }
    .modal-content { width: 95vw; max-width: 95vw; margin: 10px; }
    .modal-body { padding: 16px; }
    .modal-form-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 0; }
    table.wide-table { min-width: 600px; }
    .notification-dropdown { right: -60px; width: calc(100vw - 32px); max-width: 360px; }
    .user-menu .level-tag { display: none; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header .btn { width: 100%; justify-content: center; }
    .dropdown { right: 16px; left: 16px; min-width: 0; }
    .toast-container { top: calc(var(--header-h) + 8px); right: 12px; left: 12px; }
    .toast { max-width: 100%; min-width: 0; }
    .responsive-filters .form-control,
    .responsive-filters select { max-width: 100% !important; width: 100%; flex: 1 1 100%; }
    .responsive-filters input[type="date"] { flex: 1 1 calc(50% - 4px); }
    .admin-nav { gap: 6px; }
    .admin-nav .btn { flex: 1 1 calc(50% - 6px); font-size: .78rem; padding: 8px 10px; }
    .responsive-btn-group .btn { font-size: .72rem; padding: 4px 6px; }
    .fin-card { flex-direction: column; text-align: center; }
    .level-card { padding: 18px; }
    .plan-card { padding: 24px 18px; }
    .consult-card { padding: 24px 16px; }
    .pkg-card { padding: 18px; }
}
@media (max-width: 480px) {
    .content { padding: 16px 12px; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 16px; }
    .user-menu .name { display: none; }
    .login-card { padding: 32px 24px; }
    .login-page .login-right { padding: 32px 24px; }
    .top-header h1 { font-size: .95rem; }
    .card-header { padding: 14px 16px; flex-wrap: wrap; }
    .card-header h3 { font-size: .95rem; }
    table { font-size: .8rem; }
    .btn { font-size: .82rem; padding: 8px 14px; }
    .btn-sm { padding: 5px 10px; font-size: .75rem; }
    .notification-dropdown { right: -40px; width: calc(100vw - 16px); }
    .admin-nav .btn { flex: 1 1 100%; }
    .page-header-row { flex-direction: column; align-items: stretch; }
    .page-header-row .btn { width: 100%; }
    .header-breadcrumb { display: none; }
    .top-header { gap: 8px; }
}

/* ── Mobile-only menu items ── */
.mobile-only-item { display: none; }
@media (max-width: 992px) {
    .mobile-only-item { display: block; }
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text3) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-accent { color: var(--accent) !important; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.d-flex { display: flex; } .align-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.flex-1 { flex: 1; } .w-full { width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d6d3d1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a29e; }

/* ── Selection ── */
::selection { background: var(--primary-light); color: var(--primary-dark); }

/* ═══════════════════════════════════════
   REDUCED MOTION (WCAG 2.3.3)
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    html { scroll-behavior: auto; }
    .sidebar { transition: none; }
    .modal { transition: none; }
    .toast { animation: none; }
    .card:hover { transform: none; }
    .stat-card:hover { transform: none; }
    .btn-primary:hover { transform: none; }
    .video-card:hover { transform: none; }
    .consult-card:hover { transform: none; }
    .level-card:hover { transform: none; }
    .plan-card:hover { transform: none; }
    .pkg-card:hover { transform: none; }
}

/* ═══════════════════════════════════════
   HIGH CONTRAST (WCAG 1.4.11)
   ═══════════════════════════════════════ */
@media (prefers-contrast: more) {
    :root {
        --border: #a8a29e;
        --border-light: #d6d3d1;
        --text3: #57534e;
        --shadow-sm: none;
        --shadow: none;
        --shadow-md: none;
        --shadow-lg: none;
    }
    .card, .stat-card, .event-card, .faq-item, .tree-node,
    .consult-card, .fin-card, .pkg-card, .plan-card, .level-card {
        border-width: 2px;
    }
    .btn { border-width: 2px; }
    .btn-primary, .btn-accent, .btn-success, .btn-danger, .btn-warning {
        border-color: currentColor;
    }
    .form-control { border-width: 2px; }
    .form-control:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.5); }
    .badge { border: 1px solid currentColor; }
    :focus-visible { outline-width: 3px; }
    .sidebar { border-right-width: 2px; border-color: #444; }
    .top-header { border-bottom-width: 2px; }
    .nav-link:hover { text-decoration: underline; }
}

/* ═══════════════════════════════════════
   DARK MODE SUPPORT (prefers-color-scheme)
   ═══════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    /* Placeholder for future dark mode */
}

/* ═══════════════════════════════════════════════════
   PWA — SPLASH SCREEN, INSTALL BANNER, MOBILE APP
   Estilos específicos para experiência PWA / APK
   ═══════════════════════════════════════════════════ */

/* ── Tela de carregamento inicial PWA ── */
#pwa-splash {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: opacity .5s ease, visibility .5s ease;
}
#pwa-splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-logo {
    width: 96px;
    height: 96px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 16px 48px rgba(99,102,241,.4);
    animation: splashBounce .8s cubic-bezier(.34,1.56,.64,1) both;
    letter-spacing: -2px;
    position: relative;
}
.splash-logo::after {
    content: '';
    position: absolute;
    top: -4px; right: -4px;
    width: 20px; height: 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    border: 3px solid #0f172a;
}
@keyframes splashBounce {
    0%   { opacity: 0; transform: scale(.5) translateY(20px); }
    60%  { opacity: 1; transform: scale(1.08) translateY(-4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.splash-name {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.3px;
    animation: fadeInUp .5s .3s ease both;
}
.splash-tagline {
    font-family: 'Inter', sans-serif;
    font-size: .8rem;
    color: #7c7c9a;
    animation: fadeInUp .5s .4s ease both;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.splash-loader {
    display: flex;
    gap: 6px;
    animation: fadeInUp .5s .5s ease both;
}
.splash-loader-dot {
    width: 8px; height: 8px;
    background: #6366f1;
    border-radius: 50%;
    animation: dotPulse 1.2s ease-in-out infinite;
}
.splash-loader-dot:nth-child(2) { animation-delay: .2s; }
.splash-loader-dot:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(.6); opacity: .4; }
    40%           { transform: scale(1); opacity: 1; }
}



/* ── Bottom navigation bar (mobile PWA) ── */
.pwa-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    z-index: 500;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.pwa-bottom-nav-inner {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: space-around;
    max-width: 480px;
    margin: 0 auto;
}
.pwa-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text3);
    font-size: .65rem;
    font-weight: 600;
    font-family: var(--font);
    transition: all .2s;
    min-width: 52px;
    flex: 1;
}
.pwa-nav-item i { font-size: 1.1rem; }
.pwa-nav-item:hover { color: var(--primary); }
.pwa-nav-item.active { color: var(--primary); }
.pwa-nav-item.active i {
    background: var(--primary-light);
    width: 40px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: .95rem;
}

@media (max-width: 768px) {
    @media (display-mode: standalone), (max-width: 480px) {
        .pwa-bottom-nav { display: block; }
        /* Empurrar conteúdo acima da bottom nav */
        .main-wrapper { padding-bottom: 72px; }
        /* Esconder sidebar no mobile em modo standalone */
        @media (display-mode: standalone) {
            .sidebar { display: none; }
            .main-wrapper { margin-left: 0; }
        }
    }
}

/* Espaço para bottom nav em dispositivos com notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .pwa-bottom-nav {
        padding-bottom: calc(env(safe-area-inset-bottom) + 4px);
        height: calc(64px + env(safe-area-inset-bottom));
    }
}

/* ── Safe area insets para iPhone X+ ── */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    .top-header {
        padding-top: env(safe-area-inset-top);
    }
}

/* ── Modo standalone: remover scrollbar browser ── */
@media (display-mode: standalone) {
    html {
        overscroll-behavior: none;
    }
    /* Ocultar elementos só relevantes fora do app */
    .app-download-section,
    .install-app-cta { display: none !important; }
}

/* ── Cards mobile otimizados ── */
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-icon { width: 40px; height: 40px; font-size: 1rem; }
    .stat-info h3 { font-size: 1.2rem; }

    .card-body { padding: 16px; }
    .card-header { padding: 14px 16px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    /* Toast mobile */
    .toast-container {
        left: 12px; right: 12px;
        top: auto;
        bottom: 80px; /* acima da bottom nav */
    }
    .toast { min-width: 0; }

    .page-header h2 { font-size: 1.2rem; }
    .content { padding: 16px; }
    .top-header { padding: 0 16px; }
}

/* ── Touch targets mínimos 44px (WCAG) ── */
@media (pointer: coarse) {
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .form-control { min-height: 44px; }
    .nav-link { min-height: 48px; }
    .pwa-nav-item { min-height: 48px; }
    .tab { min-height: 44px; }
    .header-btn { width: 44px; height: 44px; }
}

/* ── Pull-to-refresh indicator ── */
.pull-to-refresh-indicator {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    padding: 8px;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform .25s ease;
}
.pull-to-refresh-indicator.visible {
    transform: translateY(0);
}

