/* ============================================
   GOLD CLUBE — Design System CSS
   Brand Book: Purple Premium + Gold Accent
   ============================================ */

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

/* === CSS VARIABLES === */
:root {
    /* Paleta Principal (60-30-10) */
    --primary-purple: #6A1B9A;
    --primary-dark: #4A148C;
    --primary-deeper: #4e0078;
    --primary-light: #f4d9ff;
    --primary-subtle: #e4b5ff;
    --accent-gold: #FDD835;
    --accent-gold-dark: #705e00;
    --accent-gold-hover: #e8c41d;
    --neutral-white: #FFFFFF;

    /* Superfícies */
    --bg-page: #F5F5F7;
    --bg-card: #FFFFFF;
    --bg-input: #F5F5F7;
    --bg-sidebar: #4A148C;
    --border-light: #EEEEEE;
    --border-medium: #d0c2d3;
    --border-focus: #6A1B9A;

    /* Texto */
    --text-dark: #1A1A1B;
    --text-muted: #4d4351;
    --text-light: #7f7383;
    --text-on-purple: #FFFFFF;
    --text-on-gold: #705e00;

    /* Status */
    --success: #2E7D32;
    --success-bg: rgba(46, 125, 50, 0.1);
    --warning: #FB8C00;
    --warning-bg: rgba(251, 140, 0, 0.1);
    --error: #ba1a1a;
    --error-bg: rgba(186, 26, 26, 0.1);
    --info: #1976D2;
    --info-bg: rgba(25, 118, 210, 0.1);

    /* Sistema */
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --sidebar-width: 280px;
    --header-height: 80px;

    /* Elevação */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-card: 0px 4px 20px rgba(0,0,0,0.05);
    --shadow-hover: 0px 10px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0px 20px 60px rgba(0,0,0,0.12);

    /* Transições */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
    --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === RESET & BASE === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: var(--primary-purple);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-deeper);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: var(--font-family);
    cursor: pointer;
    border: none;
    outline: none;
}

input, select, textarea {
    font-family: var(--font-family);
}

/* === TYPOGRAPHY === */
.text-display {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.text-headline-lg {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
}

.text-headline-md {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
}

.text-body-lg {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
}

.text-body {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
}

.text-label {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.text-label-sm {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.text-purple { color: var(--primary-purple); }
.text-gold { color: var(--accent-gold-dark); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-white { color: var(--neutral-white); }

/* === LAYOUT SYSTEM === */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
    padding: 32px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header-info h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-purple);
    line-height: 1.3;
}

.page-header-info p {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: 4px;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    z-index: 50;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar-brand {
    padding: 0 32px;
    margin-bottom: 16px;
}

.sidebar-brand img {
    height: 48px;
    width: auto;
}

.sidebar-brand-text {
    margin-top: 4px;
}

.sidebar-brand-text .brand-name {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-gold);
    line-height: 1.1;
}

.sidebar-brand-text .brand-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-radius: var(--radius);
    color: var(--text-on-purple);
    font-size: 14px;
    font-weight: 700;
    transition: var(--transition);
    text-decoration: none;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-on-purple);
}

.sidebar-link.active {
    background: var(--accent-gold);
    color: var(--accent-gold-dark);
}

.sidebar-link .material-symbols-outlined {
    font-size: 22px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 0 16px;
    margin-top: 16px;
}

.sidebar-upgrade-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--accent-gold);
    color: var(--accent-gold-dark);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(253, 216, 53, 0.3);
}

.sidebar-upgrade-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(253, 216, 53, 0.4);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-purple);
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-info .user-name {
    color: var(--neutral-white);
    font-size: 14px;
    font-weight: 700;
}

.sidebar-user-info .user-role {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* === TOP NAVIGATION === */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    padding: 0 32px;
    background: var(--neutral-white);
    box-shadow: var(--shadow-sm);
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-top-btn {
    display: flex; 
    align-items: center; 
    gap: 4px; 
    color: var(--accent-gold); 
    background: rgba(255, 215, 0, 0.1); 
    padding: 6px 12px; 
    border-radius: 20px; 
    text-decoration: none; 
    font-size: 14px; 
    font-weight: 600; 
    border: 1px solid var(--accent-gold);
    transition: var(--transition);
}

.admin-top-btn:hover {
    background: rgba(255, 215, 0, 0.2);
}

.hamburger-btn {
    display: none;
    background: none;
    color: var(--primary-purple);
    padding: 8px;
    border-radius: var(--radius);
}

.hamburger-btn:hover {
    background: var(--bg-input);
}

.search-box {
    position: relative;
}

.search-box .material-symbols-outlined {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 20px;
}

.search-box input {
    padding: 10px 16px 10px 40px;
    width: 280px;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: 14px;
    color: var(--text-dark);
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-purple);
    background: var(--neutral-white);
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.1);
}

.search-box input::placeholder {
    color: var(--text-light);
}

.gold-balance-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(253, 216, 53, 0.1);
    border: 1px solid rgba(253, 216, 53, 0.2);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-purple);
}

.gold-balance-badge .material-symbols-outlined {
    font-size: 18px;
    color: var(--accent-gold-dark);
}

.notification-btn {
    position: relative;
    background: none;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-muted);
    transition: var(--transition);
}

.notification-btn:hover {
    color: var(--primary-purple);
    background: var(--bg-input);
}

.notification-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid var(--neutral-white);
}

.top-nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 2px solid var(--border-light);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.top-nav-avatar:hover {
    border-color: var(--primary-purple);
}

.top-nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    padding: 24px;
    transition: var(--transition);
}

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

.card-gold {
    background: var(--accent-gold);
    color: var(--accent-gold-dark);
    border: none;
    position: relative;
    overflow: hidden;
}

.card-gold::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transition: var(--transition-slow);
}

.card-gold:hover::after {
    transform: scale(1.2);
}

.card-purple {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-purple));
    color: var(--text-on-purple);
    border: none;
}

.card-bordered-gold {
    border-left: 4px solid var(--accent-gold);
}

.card-bordered-purple {
    border-left: 4px solid var(--primary-purple);
}

/* === STAT CARDS === */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.stat-card-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-purple);
    line-height: 1.2;
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--error); }
.stat-card-trend.neutral { color: var(--warning); }

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-slow);
}

.stat-card-icon.purple {
    background: rgba(106, 27, 154, 0.08);
    color: var(--primary-purple);
}

.stat-card:hover .stat-card-icon.purple {
    background: var(--primary-purple);
    color: var(--neutral-white);
}

.stat-card-icon.gold {
    background: rgba(253, 216, 53, 0.15);
    color: var(--accent-gold-dark);
}

.stat-card-icon.orange {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-card-icon.red {
    background: var(--error-bg);
    color: var(--error);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn .material-symbols-outlined {
    font-size: 18px;
}

.btn-primary {
    background: var(--primary-purple);
    color: var(--neutral-white);
    box-shadow: 0 2px 8px rgba(106, 27, 154, 0.3);
}

.btn-primary:hover {
    background: var(--primary-deeper);
    color: var(--neutral-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-gold {
    background: var(--accent-gold);
    color: var(--accent-gold-dark);
    box-shadow: 0 2px 8px rgba(253, 216, 53, 0.3);
}

.btn-gold:hover {
    background: var(--accent-gold-hover);
    color: var(--accent-gold-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(253, 216, 53, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-medium);
}

.btn-outline:hover {
    background: var(--bg-input);
    border-color: var(--text-muted);
    color: var(--text-dark);
}

.btn-outline-purple {
    background: transparent;
    color: var(--primary-purple);
    border: 1px solid var(--primary-purple);
}

.btn-outline-purple:hover {
    background: rgba(106, 27, 154, 0.05);
    color: var(--primary-purple);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--bg-input);
    color: var(--text-dark);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius);
    background: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-input);
    color: var(--primary-purple);
}

.btn-icon.success:hover {
    background: var(--success-bg);
    color: var(--success);
}

.btn-icon.danger:hover {
    background: var(--error-bg);
    color: var(--error);
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-purple {
    background: rgba(106, 27, 154, 0.1);
    color: var(--primary-purple);
}

.badge-gold {
    background: rgba(253, 216, 53, 0.2);
    color: var(--accent-gold-dark);
}

.badge-neutral {
    background: var(--bg-input);
    color: var(--text-muted);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-solid-purple {
    background: var(--primary-purple);
    color: var(--neutral-white);
    padding: 3px 8px;
    font-size: 10px;
    border-radius: var(--radius-sm);
}

/* === TABLES === */
.table-gc {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.table-gc thead {
    background: var(--bg-input);
}

.table-gc thead th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border-light);
}

.table-gc tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

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

.table-gc tbody tr:hover {
    background: rgba(245, 245, 247, 0.5);
}

.table-gc tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-dark);
    vertical-align: middle;
}

.table-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-user-cell .user-info {
    display: flex;
    flex-direction: column;
}

.table-user-cell .user-info .name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.table-user-cell .user-info .email {
    font-size: 12px;
    color: var(--text-light);
}

/* === FORMS === */
.form-group {
    margin-bottom: 16px;
}

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-dark);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: var(--neutral-white);
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* === AVATAR === */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.avatar-purple {
    background: rgba(106, 27, 154, 0.1);
    color: var(--primary-purple);
}

.avatar-gold {
    background: rgba(253, 216, 53, 0.2);
    color: var(--accent-gold-dark);
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.avatar-xl {
    width: 72px;
    height: 72px;
    font-size: 24px;
}

/* === PROGRESS BAR === */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gold);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.progress-bar-fill.purple {
    background: var(--primary-purple);
}

.progress-bar-lg {
    height: 10px;
}

/* === COURSE CARDS (Netflix Grid) === */
.course-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.course-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition-slow);
    cursor: pointer;
}

.course-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px) scale(1.01);
}

.course-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-input);
}

.course-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.course-card:hover .course-card-thumb img {
    transform: scale(1.05);
}

.course-card-body {
    padding: 16px;
}

.course-card-category {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-purple);
    margin-bottom: 4px;
}

.course-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.3;
}

.course-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
}

.course-card-progress {
    margin-top: 12px;
}

/* === CHIPS (Category Filters) === */
.chip-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-medium);
    background: var(--neutral-white);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

.chip.active {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--accent-gold-dark);
}

/* === TREE VIEW (Network) === */
.tree-view {
    list-style: none;
    padding-left: 0;
}

.tree-view ul {
    list-style: none;
    padding-left: 32px;
    position: relative;
}

.tree-view ul::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 16px;
    width: 2px;
    background: var(--border-light);
}

.tree-view li {
    position: relative;
    padding: 8px 0;
}

.tree-view ul li::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 24px;
    width: 16px;
    height: 2px;
    background: var(--border-light);
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: var(--transition);
}

.tree-node:hover {
    border-color: var(--primary-purple);
    box-shadow: var(--shadow-sm);
}

.tree-node-info {
    flex: 1;
}

.tree-node-info .name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.tree-node-info .detail {
    font-size: 12px;
    color: var(--text-light);
}

/* === TOGGLE SWITCH === */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--text-light);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--neutral-white);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* === FILTER BAR === */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-bar .form-select {
    width: auto;
    min-width: 160px;
    padding: 8px 12px;
    font-size: 13px;
}

.filter-bar .filter-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-light);
}

/* === PAGINATION === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover {
    background: var(--bg-input);
    color: var(--text-dark);
}

.pagination-btn.active {
    background: var(--primary-purple);
    color: var(--neutral-white);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--text-muted);
}

/* === GRID HELPERS === */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }
.col-span-9 { grid-column: span 9; }
.col-span-10 { grid-column: span 10; }
.col-span-11 { grid-column: span 11; }
.col-span-12 { grid-column: span 12; }

/* === FLEX HELPERS === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }
.flex-1 { flex: 1; }

/* === SPACING === */
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }
.p-md { padding: 16px; }
.p-lg { padding: 24px; }
.p-xl { padding: 32px; }

/* === UPLOAD AREA === */
.upload-area {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-input);
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-purple);
    background: rgba(106, 27, 154, 0.03);
}

.upload-area .material-symbols-outlined {
    font-size: 48px;
    color: var(--text-light);
    transition: var(--transition);
}

.upload-area:hover .material-symbols-outlined {
    color: var(--primary-purple);
}

.upload-area-text {
    text-align: center;
}

.upload-area-text strong {
    display: block;
    font-size: 14px;
    color: var(--text-dark);
}

.upload-area-text span {
    font-size: 12px;
    color: var(--text-light);
}

/* === HERO BANNER === */
.hero-banner {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: flex-end;
    margin-bottom: 32px;
}

.hero-banner-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: var(--transition-slow);
}

.hero-banner:hover .hero-banner-bg {
    transform: scale(1.03);
}

.hero-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--primary-dark), rgba(74, 20, 140, 0.8), transparent);
}

.hero-banner-content {
    position: relative;
    z-index: 2;
    padding: 32px;
    max-width: 560px;
}

.hero-banner-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-gold);
    color: var(--accent-gold-dark);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.hero-banner-content h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--neutral-white);
    line-height: 1.2;
    margin-bottom: 12px;
}

.hero-banner-content p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    line-height: 1.5;
}

.hero-banner-actions {
    display: flex;
    gap: 12px;
}

/* === PROMO BANNER (Full Width) === */
.promo-banner {
    position: relative;
    height: 240px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-top: 32px;
}

.promo-banner-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.7s ease;
}

.promo-banner:hover .promo-banner-bg {
    transform: scale(0.98);
}

.promo-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--primary-dark), rgba(74, 20, 140, 0.8), transparent);
}

.promo-banner-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
    max-width: 520px;
}

.promo-banner-content .tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
}

.promo-banner-content h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--neutral-white);
    line-height: 1.1;
    margin-bottom: 12px;
}

.promo-banner-content p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

/* === QUICK ACTIONS GRID === */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: var(--bg-input);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-btn:hover {
    background: var(--primary-light);
}

.quick-action-btn .icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--neutral-white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-slow);
    color: var(--text-muted);
}

.quick-action-btn:hover .icon-circle {
    background: var(--primary-purple);
    color: var(--neutral-white);
}

.quick-action-btn span:last-child {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* === FOOTER === */
.main-footer {
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    font-size: 12px;
    opacity: 0.6;
}

.main-footer a {
    color: var(--text-light);
}

.main-footer a:hover {
    color: var(--primary-purple);
}

.footer-links {
    display: flex;
    gap: 16px;
}

/* === SIDEBAR OVERLAY (Mobile) === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* === LOGIN PAGE === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-purple) 50%, #8E24AA 100%);
    padding: 20px;
}

.login-card {
    background: var(--neutral-white);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    margin: 0 auto 32px;
    height: 64px;
    width: auto;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.login-form .form-group {
    text-align: left;
}

.login-form .btn {
    width: 100%;
    margin-top: 8px;
}

.login-links {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.login-links a {
    color: var(--primary-purple);
    font-weight: 600;
}

/* === PLACEHOLDER PAGE (index) === */
.placeholder-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    text-align: center;
    padding: 40px;
}

.placeholder-page img {
    height: 80px;
    margin-bottom: 24px;
}

.placeholder-page h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-purple);
    margin-bottom: 8px;
}

.placeholder-page p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* === LOT CARDS (Admin) === */
.lot-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-light);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
    position: relative;
}

.lot-card.active {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 4px rgba(253, 216, 53, 0.2);
}

.lot-card.active::before {
    content: 'LOTE ATIVO';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    background: var(--accent-gold);
    color: var(--accent-gold-dark);
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.1em;
}

.lot-card-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.lot-card-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-purple);
    margin-bottom: 4px;
}

.lot-card-range {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.lot-card-progress {
    margin-top: 12px;
}

.lot-card-slots {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

/* === TICKET STATUS === */
.ticket-list { display: flex; flex-direction: column; gap: 12px; }

.ticket-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
}

.ticket-item:hover {
    border-color: var(--primary-purple);
    box-shadow: var(--shadow-sm);
}

.ticket-id {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    min-width: 60px;
}

.ticket-subject {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.ticket-date {
    font-size: 12px;
    color: var(--text-light);
}

/* === MATERIAL DOWNLOAD CARD === */
.material-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition);
}

.material-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.material-card-thumb {
    height: 140px;
    background: linear-gradient(135deg, var(--primary-light), var(--bg-input));
    display: flex;
    align-items: center;
    justify-content: center;
}

.material-card-thumb .material-symbols-outlined {
    font-size: 48px;
    color: var(--primary-purple);
    opacity: 0.5;
}

.material-card-body {
    padding: 16px;
}

.material-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.material-card-size {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* === FAB (Floating Action Button) === */
.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-purple);
    color: var(--neutral-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(106, 27, 154, 0.4);
    z-index: 30;
    transition: var(--transition-bounce);
    border: none;
    cursor: pointer;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(106, 27, 154, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

.fab .material-symbols-outlined {
    font-size: 28px;
    transition: transform 0.3s ease;
}

.fab:hover .material-symbols-outlined {
    transform: rotate(90deg);
}

/* === PRO TIP BOX === */
.pro-tip {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(74, 20, 140, 0.05);
    border: 1px solid rgba(74, 20, 140, 0.1);
    border-radius: var(--radius-lg);
    margin-top: 24px;
}

.pro-tip-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pro-tip-icon .material-symbols-outlined {
    color: var(--accent-gold-dark);
    font-size: 20px;
}

.pro-tip-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-purple);
}

.pro-tip-text span {
    font-size: 12px;
    color: var(--text-muted);
}

/* === COPY LINK BOX === */
.copy-link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 4px 4px 4px 12px;
}

.copy-link-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-dark);
    outline: none;
}

.copy-link-box .btn {
    flex-shrink: 0;
}

/* === RESPONSIVE (Mobile & Tablet) === */
@media (max-width: 1024px) {
    .course-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-12 { grid-template-columns: 1fr; }
    .col-span-1, .col-span-2, .col-span-3, .col-span-4, .col-span-5, .col-span-6, 
    .col-span-7, .col-span-8, .col-span-9, .col-span-10, .col-span-11, .col-span-12 {
        grid-column: span 1;
    }
    
    .top-nav-right {
        gap: 8px;
    }
    .search-box {
        display: none !important;
    }
    .admin-btn-text {
        display: none !important;
    }
    .admin-top-btn, .gold-balance-badge {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        flex-shrink: 0;
    }
    .gold-balance-badge span:not(.material-symbols-outlined) {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    .top-nav {
        padding: 0 16px;
    }

    .content-area {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .course-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .main-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .hero-banner {
        min-height: 200px;
    }

    .hero-banner-content h2 {
        font-size: 22px;
    }

    .promo-banner {
        height: 200px;
    }

    .promo-banner-content h2 {
        font-size: 24px;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .filter-count {
        margin-left: 0;
    }

    .pagination {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .page-header-info h1 {
        font-size: 24px;
    }

    .text-display {
        font-size: 32px;
    }

    .login-card {
        padding: 32px 24px;
    }
}

/* ============================================
   MODERN LOGIN LAYOUT
   ============================================ */
.modern-login-layout {
    background: #12141D !important; /* Dark background similar to Energia Compartilhada */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.modern-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-modern {
    max-height: 48px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 24px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.modern-login-header .login-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--neutral-white);
    margin-bottom: 8px;
}

.modern-login-header .login-subtitle {
    font-size: 15px;
    color: var(--text-light);
    margin: 0;
}

.modern-login-card {
    background: #1C1F2B; /* Slightly lighter dark card */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modern-login-card .form-label {
    color: var(--text-light);
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 8px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 20px;
    pointer-events: none;
}

.input-with-icon .form-input {
    padding-left: 48px;
    background: #12141D;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--neutral-white);
}

.input-with-icon .form-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(253, 216, 53, 0.15);
}

.btn-toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-toggle-password:hover {
    color: var(--neutral-white);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-gold);
    width: 16px;
    height: 16px;
}

.forgot-password {
    color: var(--accent-gold);
    font-weight: 600;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

.modern-login-footer {
    margin-top: 48px;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* === SIDEBAR SUBMENU === */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 var(--radius) var(--radius);
    margin-top: -4px;
}
.sidebar-submenu.show {
    max-height: 300px;
    margin-bottom: 4px;
}
.sidebar-sublink {
    display: flex;
    align-items: center;
    padding: 10px 16px 10px 48px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.sidebar-sublink:hover {
    color: var(--neutral-white);
    background: rgba(255, 255, 255, 0.05);
}
.sidebar-sublink.active {
    color: var(--accent-gold);
}
.sidebar-link .caret {
    margin-left: auto;
    transition: transform 0.3s ease;
}
.sidebar-link.open .caret {
    transform: rotate(180deg);
}

/* === CSS ORG TREE === */
.org-tree {
    display: flex;
    justify-content: center;
    padding: 20px 20px 60px 20px;
    overflow-x: auto;
}
.org-tree ul {
    padding-top: 20px; 
    position: relative;
    display: flex;
    justify-content: center;
    transition: all 0.5s;
    list-style-type: none;
    margin: 0;
    padding-left: 0;
}
.org-tree li {
    float: left; 
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 10px 0 10px;
    transition: all 0.5s;
}
.org-tree li::before, .org-tree li::after {
    content: '';
    position: absolute; 
    top: 0; right: 50%;
    border-top: 2px solid var(--primary-purple);
    width: 50%; height: 20px;
}
.org-tree li::after {
    right: auto; left: 50%;
    border-left: 2px solid var(--primary-purple);
}
.org-tree li:only-child::after, .org-tree li:only-child::before {
    display: none;
}
.org-tree li:only-child {
    padding-top: 0;
}
.org-tree li:first-child::before, .org-tree li:last-child::after {
    border: 0 none;
}
.org-tree li:last-child::before {
    border-right: 2px solid var(--primary-purple);
    border-radius: 0 5px 0 0;
}
.org-tree li:first-child::after {
    border-radius: 5px 0 0 0;
}
.org-tree ul::before {
    content: '';
    position: absolute; top: 0; left: 50%;
    border-left: 2px solid var(--primary-purple);
    width: 0; height: 20px;
}
.org-tree li:only-child ul::before {
    display: none;
}
.org-tree li .org-node {
    border: 2px solid var(--border-medium);
    padding: 16px;
    text-decoration: none;
    color: var(--text-dark);
    font-family: var(--font-family);
    font-size: 13px;
    display: inline-block;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    position: relative;
    min-width: 180px;
}
.org-tree li .org-node:hover {
    background: var(--primary-light);
    border-color: var(--primary-purple);
    box-shadow: var(--shadow-card);
}
.org-tree li .org-node.expanded {
    border-color: var(--primary-purple);
}
.org-tree .org-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px auto;
    font-weight: 800; color: var(--primary-purple);
    border: 2px solid var(--primary-subtle);
    font-size: 16px;
}
.org-tree .org-node-title {
    font-weight: 800;
    color: var(--primary-purple);
    margin-bottom: 2px;
    font-size: 14px;
}
.org-tree .org-node-desc {
    font-size: 11px;
    color: var(--text-muted);
}
.org-tree .org-node-stats {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    font-size: 11px;
    font-weight: 700;
}
.org-tree .expand-btn {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-purple);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 3px solid var(--bg-page);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}
.org-tree .expand-btn:hover {
    background: var(--accent-gold);
    color: var(--accent-gold-dark);
}
.org-tree .expand-btn.loading {
    background: var(--warning);
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
    100% { transform: translateX(-50%) scale(1); }
}
