/* ═══════════════════════════════════════════════════════════
   Tessera Site Management Panel — Modern Dark UI
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Background layers */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-input: rgba(0, 0, 0, 0.3);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accents */
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-indigo: #6366f1;
    --accent-purple: #8b5cf6;
    --accent-green: #22c55e;
    --accent-green-light: #4ade80;
    --accent-red: #ef4444;
    --accent-red-light: #f87171;
    --accent-yellow: #eab308;
    --accent-orange: #f97316;
    --accent-cyan: #06b6d4;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #06b6d4 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    --gradient-warning: linear-gradient(135deg, #eab308 0%, #f97316 100%);
    --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(17, 24, 39, 0.9));

    /* Borders & shadows */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-light: rgba(255, 255, 255, 0.12);
    --border-radius: 1rem;
    --border-radius-sm: 0.625rem;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 30px rgba(59, 130, 246, 0.15);
    --shadow-glow-green: 0 0 30px rgba(34, 197, 94, 0.15);

    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

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

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

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

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-blue-light);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover { color: var(--accent-purple); }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.sidebar-brand {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.sidebar-brand h1 {
    font-size: 1.05rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-brand .logo {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

.sidebar-nav {
    padding: 1.25rem 0;
    flex: 1;
}

.nav-section {
    padding: 0.75rem 1.5rem 0.5rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.5rem;
    margin: 0.125rem 0.75rem;
    color: var(--text-secondary);
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item:hover::before { height: 60%; }

.nav-item.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.12);
    font-weight: 600;
}

.nav-item.active::before { height: 70%; }

.nav-item .icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

/* ── Main Content ─────────────────────────────────────── */
.main {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    padding: 1.25rem 2rem;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.content {
    padding: 2rem;
    flex: 1;
}

/* ── Cards ────────────────────────────────────────────── */
.card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

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

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ── Stats Grid ───────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

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

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    position: relative;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}
.stat-icon.green {
    background: rgba(34, 197, 94, 0.12);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.1);
}
.stat-icon.yellow {
    background: rgba(234, 179, 8, 0.12);
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.1);
}
.stat-icon.red {
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.stat-info h4 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.825rem;
    font-weight: 500;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-glass);
}

td {
    font-size: 0.875rem;
    font-weight: 400;
}

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

tbody tr:hover {
    background: var(--bg-hover);
}

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

/* ── Badges ───────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.725rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge.green {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent-green-light);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.08);
}
.badge.red {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red-light);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.08);
}
.badge.yellow {
    background: rgba(234, 179, 8, 0.12);
    color: var(--accent-yellow);
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.08);
}
.badge.blue {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue-light);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.08);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.825rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

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

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: white;
}

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

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

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.btn-success {
    background: var(--gradient-success);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}
.btn-success:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
}

.btn-danger {
    background: var(--gradient-danger);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.btn-warning {
    background: var(--gradient-warning);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.25);
}

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-color-light);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.775rem;
    border-radius: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    min-width: 36px;
    justify-content: center;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition);
}

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

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), var(--shadow-glow-blue);
    background: var(--bg-tertiary);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    min-height: 120px;
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

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

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

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

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
}

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

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

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ── Alerts ───────────────────────────────────────────── */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    animation: alertSlideIn 0.3s ease;
}

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

.alert.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--accent-green-light);
}
.alert.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--accent-red-light);
}
.alert.warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.25);
    color: var(--accent-yellow);
}
.alert.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--accent-blue-light);
}

/* ── File Manager ─────────────────────────────────────── */
.file-list {
    list-style: none;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
    gap: 0.75rem;
    background: var(--bg-input);
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: var(--bg-hover);
}

.file-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    min-width: 0;
}

.file-name a {
    color: var(--text-primary);
    font-weight: 500;
}

.file-name a:hover {
    color: var(--accent-blue-light);
}

.file-size {
    color: var(--text-muted);
    font-size: 0.775rem;
    min-width: 80px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.file-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.breadcrumb a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

.breadcrumb a:hover {
    color: var(--accent-blue-light);
}

.breadcrumb .separator {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Code Editor ──────────────────────────────────────── */
.code-editor {
    width: 100%;
    min-height: 500px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--accent-green-light);
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    padding: 1.25rem;
    resize: vertical;
    tab-size: 4;
    transition: var(--transition);
}

.code-editor:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: var(--bg-tertiary);
}

/* ── Health Check ─────────────────────────────────────── */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.health-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
}

.health-item:hover {
    border-color: var(--border-color-light);
    transform: translateY(-2px);
}

.health-item .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.health-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.health-item .value {
    font-weight: 600;
    margin-top: 0.35rem;
    font-size: 0.9rem;
}

/* ── Login Page ───────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

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

/* ── Drop Zone ────────────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 1rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    color: var(--text-secondary);
}

/* ── Toast Notifications ──────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Utilities ────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
    .content { padding: 1rem; }
    .topbar { padding: 1rem; flex-direction: column; gap: 1rem; }
    .topbar-actions { width: 100%; justify-content: center; }
    .card { padding: 1.25rem; }
    .file-size { display: none; }
}

/* ── Animations ───────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ── Save button feedback ─────────────────────────────── */
.btn.saving {
    pointer-events: none;
    opacity: 0.7;
}

.btn.saving::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
}
