/* ===================================================
   Preventivatore AI — "Teal Light" Design System
   Premium light theme with teal accents, glassmorphism,
   micro-animations and interactive elements
   =================================================== */

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

/* --- CSS Variables --- */
:root {
    color-scheme: light;
    --bg-primary: #f4f6f7;
    --bg-secondary: #edf0f2;
    --bg-tertiary: #e5eaed;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-solid: #ffffff;
    --bg-hover: rgba(0, 0, 0, 0.03);
    --bg-input: rgba(0, 0, 0, 0.03);
    --text: #111118;
    --text-secondary: #3d4556;
    --muted: #667085;
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.04);
    --accent: #22c1a6;
    --accent-rgb: 34, 193, 166;
    --accent-dark: #0f766e;
    --accent-light: rgba(34, 193, 166, 0.10);
    --accent-glow: rgba(34, 193, 166, 0.20);
    --danger: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.08);
    --success: #16a34a;
    --success-light: rgba(22, 163, 74, 0.08);
    --warning: #d97706;
    --warning-light: rgba(217, 119, 6, 0.08);
    --info: #0891b2;
    --info-light: rgba(8, 145, 178, 0.08);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(34, 193, 166, 0.12);
    --glass: saturate(180%) blur(20px);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Animated mesh background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% 20%, rgba(34, 193, 166, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 90% 80%, rgba(15, 118, 110, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(8, 145, 178, 0.02) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

a {
    color: var(--accent-dark);
    text-decoration: none;
    transition: all var(--transition);
}

a:hover {
    color: var(--accent);
    text-decoration: none;
}

h1, h2, h3, h4 {
    line-height: 1.3;
    letter-spacing: -0.02em;
}

h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
h2 { margin: 0 0 16px; font-size: 1.25rem; font-weight: 600; }
h3 { margin: 0 0 12px; font-size: 1.05rem; font-weight: 600; }

.muted {
    color: var(--muted);
    margin: 4px 0 0;
    font-size: 0.88rem;
}

code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--text-secondary);
}

/* --- App Layout --- */
.app {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background: var(--bg-card-solid);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    padding: 24px 16px;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    margin-bottom: 28px;
    padding: 4px 8px;
    overflow: hidden;
}

.sidebar-logo {
    display: block;
    max-width: 170px;
    max-height: 28px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sidebar-logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-rgb), 0.02));
    opacity: 0;
    transition: opacity var(--transition);
    border-radius: inherit;
}

.nav-item:hover {
    color: var(--text);
    text-decoration: none;
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item.active {
    color: var(--accent-dark);
    font-weight: 600;
    text-decoration: none;
}

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

.nav-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
}

.nav-item-danger {
    color: var(--danger) !important;
}

.nav-item-danger:hover {
    color: var(--danger) !important;
}

.nav-item-danger::before {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(220, 38, 38, 0.02)) !important;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    transition: all var(--transition);
    opacity: 0.6;
}

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

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #5fe0c7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.72rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.72rem;
    color: var(--muted);
}

/* --- Content Area --- */
.content {
    flex: 1;
    padding: 32px 30px;
    margin-left: 260px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.content-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0;
    animation: fadeInUp 0.5s ease both;
}

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

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* --- Cards --- */
.card {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
}

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

.card + .card {
    margin-top: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

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

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

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

.stat-card.accent {
    border-left: 3px solid var(--accent);
}
.stat-card.accent:hover { box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.12); }
.stat-card.success {
    border-left: 3px solid var(--success);
}
.stat-card.success:hover { box-shadow: 0 8px 24px rgba(22, 163, 74, 0.1); }
.stat-card.info {
    border-left: 3px solid var(--info);
}
.stat-card.info:hover { box-shadow: 0 8px 24px rgba(8, 145, 178, 0.1); }

.stat-label {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.03em;
}

/* --- Login/Public Card --- */
body > main.card {
    width: 100%;
    max-width: none;
    margin: 32px 0;
    padding: 24px 30px;
}

body > main.card.login-card {
    width: clamp(360px, 28vw, 460px);
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    padding: 40px;
}

body > main.card.login-card::before { display: none; }

/* Login page */
body.login-page {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.login-page::before {
    background:
        radial-gradient(ellipse 50% 50% at 20% 30%, rgba(34, 193, 166, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 80% 70%, rgba(15, 118, 110, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 50% 10%, rgba(8, 145, 178, 0.03) 0%, transparent 70%);
    animation: meshMove 15s ease-in-out infinite alternate;
}

@keyframes meshMove {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.login-form-wrapper {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.6s ease both;
}

.login-form-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.brand-logo-img {
    max-height: 32px;
    width: auto;
    display: block;
}

.logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f766e, #22c1a6);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.25);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.25); }
    50% { box-shadow: 0 4px 24px rgba(var(--accent-rgb), 0.4); }
}

.logo::after {
    content: "AI";
    color: #fff;
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: -0.03em;
    font-family: 'Inter', sans-serif;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

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

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: all var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12), 0 0 16px rgba(var(--accent-rgb), 0.06);
}

input::placeholder {
    color: #a0a0b0;
}

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

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:hover::after { opacity: 1; }

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 22px rgba(var(--accent-rgb), 0.4);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--text-secondary);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    color: var(--text);
    border-color: rgba(0, 0, 0, 0.12);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.35);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
}

.btn-block {
    width: 100%;
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

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

thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

tbody tr {
    transition: all var(--transition);
}

tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.03);
}

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

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
    border-color: rgba(22, 163, 74, 0.15);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.15);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
    border-color: rgba(217, 119, 6, 0.15);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
    border-color: rgba(8, 145, 178, 0.15);
}

.badge-accent {
    background: var(--accent-light);
    color: var(--accent-dark);
    border-color: rgba(var(--accent-rgb), 0.15);
}

/* --- Alerts --- */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: alertSlide 0.4s ease both;
}

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

.alert-success {
    background: var(--success-light);
    border-color: rgba(22, 163, 74, 0.2);
    color: var(--success);
}

.alert-danger, .alert-error {
    background: var(--danger-light);
    border-color: rgba(220, 38, 38, 0.2);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    border-color: rgba(217, 119, 6, 0.2);
    color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    border-color: rgba(8, 145, 178, 0.2);
    color: var(--info);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: clamp(320px, 90vw, 440px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0.92) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-title {
    font-size: 1.1rem;
    margin: 0 0 8px;
}

.modal p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    justify-content: center;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid var(--border);
    background: #fff;
}

.pagination a:hover {
    background: var(--bg-primary);
    border-color: rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

.pagination .current {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-weight: 700;
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.25);
}

.pagination .disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* --- Actions Row --- */
.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* --- Form Links --- */
.form-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 0.84rem;
}

.form-links a {
    color: var(--muted);
    font-weight: 500;
    transition: color var(--transition);
}

.form-links a:hover {
    color: var(--accent-dark);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    stroke: var(--muted);
    margin-bottom: 16px;
    opacity: 0.4;
}

/* --- Sidebar Toggle --- */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.35);
    color: #fff;
    padding: 0;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.45);
}

.sidebar-toggle svg {
    width: 22px;
    height: 22px;
}

/* --- Sidebar Overlay --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(3px);
    z-index: 90;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.is-active {
    display: block;
}

/* --- Token Display --- */
.token-display {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 12px 16px;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.78rem;
    word-break: break-all;
    margin: 12px 0;
    color: var(--accent-dark);
}

/* --- Stagger Animation --- */
.stagger-in > * {
    animation: fadeInUp 0.4s ease both;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.1);
        background: var(--bg-card-solid);
    }

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

    .content {
        margin-left: 0;
        padding: 20px 16px;
    }

    .sidebar-toggle {
        display: flex;
    }

    body > main.card.login-card {
        width: 100%;
        padding: 24px;
        min-height: auto;
        margin: 20px auto;
    }

    .login-form-wrapper {
        padding: 28px;
    }

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

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

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

    .modal {
        width: calc(100vw - 32px);
    }
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
