/* =====================================================================
   TROVO PLATFORM — Design System
   Dark Theme | Cyan + Purple Accent | Glassmorphism
   ===================================================================== */

/* ─── CSS Variables ─────────────────────────────────────────────────── */
:root {
    /* Core Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a26;
    --bg-card-hover: #22222f;
    --bg-elevated: #1e1e2d;
    --bg-input: #16161f;
    --bg-sidebar: #0e0e16;
    
    /* Accent Colors */
    --cyan: #00f0d4;
    --cyan-glow: rgba(0, 240, 212, 0.15);
    --cyan-muted: #00c4ad;
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.15);
    --purple-muted: #7c3aed;
    --purple-light: #a78bfa;
    
    /* Gradients */
    --gradient-accent: linear-gradient(135deg, #00f0d4, #8b5cf6);
    --gradient-card: linear-gradient(145deg, rgba(26,26,38,0.8), rgba(18,18,26,0.9));
    --gradient-glow: linear-gradient(135deg, rgba(0,240,212,0.1), rgba(139,92,246,0.1));
    --gradient-button: linear-gradient(135deg, #00f0d4 0%, #00c4ad 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    
    /* Text */
    --text-primary: #f0f0f5;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;
    --text-inverse: #0a0a0f;
    
    /* Borders */
    --border-default: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --border-accent: rgba(0,240,212,0.3);
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Glass */
    --glass-bg: rgba(26, 26, 38, 0.6);
    --glass-border: rgba(255,255,255,0.08);
    --glass-blur: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow-cyan: 0 0 20px rgba(0,240,212,0.15);
    --shadow-glow-purple: 0 0 20px rgba(139,92,246,0.15);
    
    /* Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 50px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--cyan-muted); }

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

::selection { background: var(--purple); color: #fff; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ─── Typography ────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted { color: var(--text-secondary); }
.text-cyan { color: var(--cyan); }
.text-purple { color: var(--purple); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ─── Auth Layout ───────────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(0,240,212,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(0,240,212,0.03) 0%, transparent 40%);
    animation: aurora 20s ease-in-out infinite alternate;
}

@keyframes aurora {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, 1%) rotate(1deg); }
    100% { transform: translate(1%, -1%) rotate(-1deg); }
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    animation: fadeUp 0.6s var(--transition-slow);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 2.2rem;
    letter-spacing: -0.5px;
}

.auth-logo .logo-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--cyan);
    border-radius: 50%;
    margin-left: 2px;
    vertical-align: super;
    box-shadow: 0 0 10px var(--cyan);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* ─── Forms ─────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-glow);
    background: var(--bg-elevated);
}

.form-input:hover:not(:focus) {
    border-color: var(--border-hover);
}

.form-input-icon {
    position: relative;
}

.form-input-icon .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.form-input-icon .form-input {
    padding-left: 2.75rem;
}

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

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b8b9e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

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

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--cyan);
    cursor: pointer;
}

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-button);
    color: var(--text-inverse);
    box-shadow: var(--shadow-glow-cyan);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(0,240,212,0.25);
    color: var(--text-inverse);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-glow);
}

.btn-purple {
    background: var(--gradient-purple);
    color: #fff;
    box-shadow: var(--shadow-glow-purple);
}

.btn-purple:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(139,92,246,0.3);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn:disabled, .btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── App Layout ────────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-slow);
    overflow: hidden;
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-default);
    flex-shrink: 0;
}

.sidebar-brand h2 {
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.sidebar-brand .logo-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--cyan);
    border-radius: 50%;
    margin-left: 1px;
    vertical-align: super;
    box-shadow: 0 0 8px var(--cyan);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 2px;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.nav-item.active {
    color: var(--cyan);
    background: var(--cyan-glow);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    width: 3px;
    height: 24px;
    background: var(--cyan);
    border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--purple);
    color: #fff;
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border-default);
    flex-shrink: 0;
}

/* ─── Top Bar ───────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    background: rgba(10,10,15,0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 90;
    transition: left var(--transition-slow);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-search {
    position: relative;
    width: 320px;
}

.topbar-search .form-input {
    background: rgba(255,255,255,0.04);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding: 0.55rem 1rem 0.55rem 2.5rem;
    font-size: 0.85rem;
}

.topbar-search .form-input:focus {
    background: var(--bg-input);
    border-color: var(--border-hover);
}

.topbar-search .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
    cursor: pointer;
    background: transparent;
    border: none;
}

.topbar-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.topbar-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-inverse);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.topbar-avatar:hover {
    transform: scale(1.05);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem;
    padding-right: 0.75rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.topbar-user:hover {
    background: rgba(255,255,255,0.04);
}

.topbar-user-info {
    text-align: right;
}

.topbar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.topbar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Main Content ──────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 1.5rem;
    transition: margin-left var(--transition-slow);
    min-height: calc(100vh - var(--topbar-height));
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.page-breadcrumb a {
    color: var(--text-secondary);
}

.page-breadcrumb .separator {
    color: var(--text-muted);
}

/* ─── Cards ─────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-default);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* ─── Stat Cards ────────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.stat-icon.cyan { background: var(--cyan-glow); color: var(--cyan); }
.stat-icon.purple { background: var(--purple-glow); color: var(--purple); }
.stat-icon.success { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-icon.danger { background: rgba(239,68,68,0.15); color: var(--danger); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.stat-change.up { color: var(--success); background: rgba(16,185,129,0.1); }
.stat-change.down { color: var(--danger); background: rgba(239,68,68,0.1); }

/* ─── Tables ────────────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

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

.table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-primary);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

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

/* ─── Badges ────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active, .badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-pending, .badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-blocked, .badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-purple { background: var(--purple-glow); color: var(--purple-light); }
.badge-cyan { background: var(--cyan-glow); color: var(--cyan); }

/* ─── Alerts / Flash Messages ───────────────────────────────────────── */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: var(--success); }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--danger); }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: var(--warning); }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2); color: var(--info); }

.alert-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
}

/* ─── Dropdown ──────────────────────────────────────────────────────── */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 0.4rem;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-default);
    margin: 0.3rem 0;
}

/* ─── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-base);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-default);
}

.modal-body { padding: 1.5rem; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-default);
}

/* ─── Pagination ────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    transition: all var(--transition-fast);
}

.page-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.page-btn.active { background: var(--cyan); color: var(--text-inverse); border-color: var(--cyan); }

/* ─── Tabs ──────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 1.5rem;
}

.tab-item {
    padding: 0.75rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-item:hover { color: var(--text-primary); }
.tab-item.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

/* ─── Tooltip ───────────────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-default);
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ─── Utility Classes ───────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .topbar { left: 0; }
    .main-content { margin-left: 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .stat-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .topbar-search { display: none; }
    .auth-card { padding: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   TROVO PLATFORM - Module Component Styles (Append to trovo.css)
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Page Title in Topbar ──────────────────────────────────────────── */
.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
}

/* ─── Stats Grid ────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stats-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid-5 { grid-template-columns: repeat(5, 1fr); }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-fast);
}
.stat-card:hover {
    border-color: rgba(0,240,212,0.15);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.stat-card-sm { padding: 1rem 1.25rem; }
.stat-card-link {
    text-decoration: none;
    cursor: pointer;
    justify-content: space-between;
}
.stat-card-link:hover { border-color: var(--cyan); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-content { flex: 1; }
.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}
.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.2;
}
.stat-mini { text-align: center; padding: 0.5rem; }
.stat-mini-value { display: block; font-size: 1.25rem; font-weight: 700; color: var(--text-primary); font-family: 'Space Grotesk', sans-serif; }
.stat-mini-label { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* ─── Dashboard Grid ────────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ─── Card Enhancements ─────────────────────────────────────────────── */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-default);
}
.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.card-body { padding: 1.5rem; }
.card-actions { display: flex; gap: 0.5rem; }

/* ─── Profile Tabs / Module Tabs ────────────────────────────────────── */
.profile-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    flex-wrap: nowrap;
}
.tab-link {
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}
.tab-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.tab-link.active {
    color: var(--cyan);
    background: var(--cyan-glow);
}

/* ─── List Group ────────────────────────────────────────────────────── */
.list-group { display: flex; flex-direction: column; }
.list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.list-item:last-child { border-bottom: none; }
.list-item-link { text-decoration: none; padding: 0.75rem; border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition-fast); }
.list-item-link:hover { background: rgba(255,255,255,0.03); }
.list-item-unread { background: rgba(0,240,212,0.03); }
.list-item-icon { font-size: 1.2rem; width: 32px; text-align: center; flex-shrink: 0; }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { display: block; font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }
.list-item-meta { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.15rem; }
.list-item-amount { font-weight: 600; font-family: 'Space Grotesk', sans-serif; white-space: nowrap; }

/* ─── Avatar ────────────────────────────────────────────────────────── */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-xs { width: 24px; height: 24px; font-size: 0.55rem; }

/* ─── Quick Actions ─────────────────────────────────────────────────── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.quick-action-btn:hover {
    color: var(--cyan);
    border-color: rgba(0,240,212,0.3);
    background: var(--cyan-glow);
}

/* ─── Empty State ───────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
.empty-state-sm {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ─── User Cell (Table) ─────────────────────────────────────────────── */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ─── Search Bar ────────────────────────────────────────────────────── */
.search-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ─── Progress Bar ──────────────────────────────────────────────────── */
.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ─── Pipeline (CRM) ───────────────────────────────────────────────── */
.pipeline {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
}
.pipeline-stage {
    text-align: center;
    padding: 1rem 0.5rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
    display: block;
}
.pipeline-stage:hover { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); }
.pipeline-count { font-size: 1.75rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; line-height: 1; }
.pipeline-label { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.35rem; text-transform: capitalize; }
.pipeline-bar { height: 3px; border-radius: 2px; margin-top: 0.5rem; transition: width 0.3s ease; }

/* ─── Course Grid ───────────────────────────────────────────────────── */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.course-card { transition: all var(--transition-fast); }
.course-card:hover { border-color: rgba(0,240,212,0.2); transform: translateY(-2px); }

/* ─── Address Grid ──────────────────────────────────────────────────── */
.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.address-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.address-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ─── KYC Status ────────────────────────────────────────────────────── */
.kyc-status {
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ─── Genealogy Tree ────────────────────────────────────────────────── */
.genealogy-tree {
    overflow-x: auto;
    padding: 1rem 0;
}
.tree-root {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.tree-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    min-width: 140px;
    text-align: center;
}
.tree-node:hover { border-color: var(--cyan); background: var(--cyan-glow); }
.tree-node-root { background: rgba(0,240,212,0.05); border-color: rgba(0,240,212,0.2); }
.tree-node-sm { padding: 0.6rem 1rem; min-width: 100px; font-size: 0.85rem; flex-direction: row; gap: 0.5rem; }
.tree-meta { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.25rem; }

.tree-children {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}
.tree-children::before {
    content: '';
    position: absolute;
    top: -0.75rem;
    left: 50%;
    width: 1px;
    height: 0.75rem;
    background: var(--border-default);
}
.tree-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.tree-sub-children {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ─── Ticket Thread ─────────────────────────────────────────────────── */
.ticket-thread { margin-top: 0.5rem; }
.ticket-reply { border-left: 3px solid var(--border-default); }
.ticket-reply:hover { border-left-color: var(--cyan); }
.ticket-internal { border-left-color: var(--purple); background: rgba(139,92,246,0.03); }
.ticket-message { line-height: 1.7; color: var(--text-secondary); font-size: 0.92rem; }

/* ─── FAQ Accordion ─────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 0.5rem; }
.faq-item {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: background var(--transition-fast);
    list-style: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::before { content: '+ '; color: var(--cyan); font-weight: 700; margin-right: 0.5rem; }
.faq-item[open] .faq-question::before { content: '− '; }
.faq-item[open] .faq-question { background: rgba(255,255,255,0.02); }
.faq-answer {
    padding: 0 1.25rem 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
}

/* ─── Form Input Copy ───────────────────────────────────────────────── */
.form-input-copy {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.form-input-copy .form-input { flex: 1; }

/* ─── Text Color Helpers ────────────────────────────────────────────── */
.text-success { color: #22c55e !important; }
.text-danger { color: #ef4444 !important; }
.text-warning { color: #f59e0b !important; }
.text-muted { color: var(--text-secondary) !important; }

/* ─── Badge Variants ────────────────────────────────────────────────── */
.badge-success { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-info { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-primary { background: var(--cyan-glow); color: var(--cyan); }
.badge-accent { background: rgba(139,92,246,0.15); color: var(--purple); }
.badge-secondary { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* ─── Button Enhancements ───────────────────────────────────────────── */
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-danger { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.btn-success:hover { background: rgba(34,197,94,0.25); }

/* ─── Notification Dot ──────────────────────────────────────────────── */
.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
}

/* ─── Responsive Overrides ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-5 { grid-template-columns: repeat(3, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .pipeline { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .stats-grid, .stats-grid-2, .stats-grid-3, .stats-grid-5 { grid-template-columns: 1fr; }
    .pipeline { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: 1fr; }
    .profile-tabs { flex-wrap: wrap; }
    .tree-children { flex-direction: column; align-items: center; }
    .course-grid { grid-template-columns: 1fr; }
    .address-grid { grid-template-columns: 1fr; }
}
