/* ============================================
   BaixaFacil — Minimalist Design System
   Light only · Indigo accent · Balanced density
   ============================================ */

:root {
    /* Brand */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --primary-tint: #f5f7ff;

    /* Status */
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;

    /* Neutrals */
    --bg: #ffffff;
    --bg-soft: #fafbfc;
    --bg-muted: #f5f6f8;
    --border: #e8eaed;
    --border-soft: #f0f1f4;
    --text: #1a1d23;
    --text-soft: #4a5160;
    --text-muted: #8b92a0;
    --text-faint: #b3b9c4;

    /* Type scale */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 0.95rem;
    --fs-md: 1.05rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2rem;
    --fs-3xl: 2.5rem;

    /* Spacing scale */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4rem;

    /* Radius */
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-full: 999px;

    /* Transitions */
    --t-fast: 0.15s ease;
    --t-base: 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-soft);
    color: var(--text);
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--primary-dark); }

/* ─── Navbar (centered simple) ─────────────── */

.navbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    height: 60px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 var(--sp-6);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand a {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}
.nav-brand a:hover { color: var(--text); }
.nav-brand .logo-mark {
    color: var(--primary);
    font-size: var(--fs-lg);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    justify-self: center;
}

.nav-links a {
    color: var(--text-soft);
    font-size: var(--fs-sm);
    font-weight: 500;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm);
    transition: all var(--t-fast);
}
.nav-links a:hover {
    color: var(--text);
    background: var(--bg-muted);
}
.nav-links a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-links .btn-nav {
    background: var(--primary);
    color: white !important;
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--r-sm);
}
.nav-links .btn-nav:hover {
    background: var(--primary-dark);
    color: white !important;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    justify-self: end;
}

.nav-user .user-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1);
    background: var(--bg-muted);
    border-radius: var(--r-full);
    font-size: var(--fs-sm);
    color: var(--text-soft);
    font-weight: 500;
}
.nav-user .user-chip .avatar {
    width: 26px;
    height: 26px;
    border-radius: var(--r-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.btn-logout {
    color: var(--text-muted) !important;
    font-size: var(--fs-sm) !important;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm);
}
.btn-logout:hover {
    color: var(--danger) !important;
    background: var(--danger-light) !important;
}

/* ─── Layout containers ────────────────────── */

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-5);
}

.page-head {
    margin-bottom: var(--sp-5);
}
.page-head h1 {
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
.page-head p {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin-top: var(--sp-1);
}

/* ─── Hero (home) — minimal ────────────────── */

.hero {
    text-align: center;
    padding: var(--sp-8) var(--sp-5) var(--sp-7);
    margin-bottom: var(--sp-7);
}
.hero .badge {
    display: inline-block;
    padding: var(--sp-1) var(--sp-3);
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: var(--sp-4);
    text-transform: uppercase;
}
.hero h1 {
    font-size: var(--fs-3xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: var(--sp-3);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.hero .subtitle {
    font-size: var(--fs-md);
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto var(--sp-5);
    line-height: 1.6;
}
.hero-actions {
    display: flex;
    gap: var(--sp-3);
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Buttons ──────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0.6rem 1.1rem;
    border-radius: var(--r-sm);
    font-weight: 500;
    font-size: var(--fs-sm);
    font-family: inherit;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--t-fast);
    line-height: 1.2;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
}
.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: white;
}

.btn-danger {
    background: var(--bg);
    color: var(--danger);
    border-color: var(--border);
}
.btn-danger:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: var(--fs-xs);
}
.btn-lg {
    padding: 0.85rem 1.6rem;
    font-size: var(--fs-md);
}
.btn-block { width: 100%; }

/* ─── Features grid (home) ─────────────────── */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-7);
}

.feature-card {
    background: var(--bg);
    padding: var(--sp-5);
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
    transition: all var(--t-base);
}
.feature-card:hover {
    border-color: var(--border);
    transform: translateY(-1px);
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-md);
    margin-bottom: var(--sp-3);
}

.feature-card h3 {
    font-size: var(--fs-base);
    font-weight: 600;
    margin-bottom: var(--sp-2);
    color: var(--text);
}
.feature-card p {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    line-height: 1.55;
}

/* ─── Cards ────────────────────────────────── */

.card {
    background: var(--bg);
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}
.card-header {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
}
.card-header h2 {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text);
}
.card-body {
    padding: var(--sp-5);
}

/* ─── Forms ────────────────────────────────── */

.form-group {
    margin-bottom: var(--sp-4);
}
.form-group label {
    display: block;
    margin-bottom: var(--sp-2);
    font-weight: 500;
    color: var(--text);
    font-size: var(--fs-sm);
}
.form-group .hint {
    color: var(--text-muted);
    font-size: var(--fs-xs);
    margin-top: var(--sp-1);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: all var(--t-fast);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-control::placeholder { color: var(--text-faint); }

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

/* ─── Auth pages ───────────────────────────── */

.auth-container {
    max-width: 380px;
    margin: var(--sp-7) auto;
}

.auth-card {
    background: var(--bg);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-soft);
    padding: var(--sp-6);
}
.auth-card h2 {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--sp-1);
    letter-spacing: -0.02em;
}
.auth-card .auth-subtitle {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-5);
}
.auth-footer {
    text-align: center;
    margin-top: var(--sp-4);
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

/* ─── Alerts ───────────────────────────────── */

.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--r-sm);
    margin-bottom: var(--sp-4);
    font-size: var(--fs-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}
.alert-success {
    background: var(--success-light);
    color: #065f46;
}
.alert-error {
    background: var(--danger-light);
    color: #991b1b;
}
.alert-info {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ─── Upload zone ──────────────────────────── */

.upload-zone {
    border: 1.5px dashed var(--border);
    border-radius: var(--r-md);
    padding: var(--sp-7) var(--sp-5);
    text-align: center;
    background: var(--bg);
    transition: all var(--t-base);
    cursor: pointer;
}
.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-tint);
}
.upload-zone .upload-icon {
    font-size: 2.5rem;
    margin-bottom: var(--sp-3);
    display: block;
}
.upload-zone p {
    color: var(--text);
    font-size: var(--fs-base);
    font-weight: 500;
    margin-bottom: var(--sp-1);
}
.upload-zone .upload-hint {
    color: var(--text-muted);
    font-size: var(--fs-xs);
}

/* ─── File grid (dashboard) ────────────────── */

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--sp-3);
}

.file-card {
    background: var(--bg);
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
    overflow: hidden;
    transition: all var(--t-base);
    display: flex;
    flex-direction: column;
}
.file-card:hover {
    border-color: var(--border);
}

.file-preview {
    height: 110px;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    position: relative;
    overflow: hidden;
}
.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info {
    padding: var(--sp-3) var(--sp-4);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-info h4 {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--sp-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    color: var(--text-muted);
    font-size: var(--fs-xs);
    margin-bottom: var(--sp-2);
    display: flex;
    gap: var(--sp-2);
    align-items: center;
}

.file-visibility {
    margin-bottom: var(--sp-3);
}
.badge-public,
.badge-private {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--r-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-public {
    background: var(--success-light);
    color: #065f46;
}
.badge-private {
    background: var(--bg-muted);
    color: var(--text-soft);
}

.file-actions {
    display: flex;
    gap: var(--sp-1);
    margin-top: auto;
}
.file-actions .btn {
    flex: 1;
}

/* ─── Stats ────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}

.stat-card {
    background: var(--bg);
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
}
.stat-label {
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--sp-2);
}
.stat-value {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
}

/* ─── Table ────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

thead {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border-soft);
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}
tbody tr:last-child td { border-bottom: none; }

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
tbody tr:hover {
    background: var(--bg-soft);
}

/* ─── Empty state ──────────────────────────── */

.empty-state {
    text-align: center;
    padding: var(--sp-8) var(--sp-5);
    color: var(--text-muted);
}
.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: var(--sp-3);
    opacity: 0.4;
}
.empty-state h3 {
    color: var(--text);
    font-size: var(--fs-md);
    font-weight: 600;
    margin-bottom: var(--sp-1);
}
.empty-state p {
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-4);
}

/* ─── Footer ───────────────────────────────── */

.site-footer {
    text-align: center;
    padding: var(--sp-5);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    border-top: 1px solid var(--border-soft);
    margin-top: auto;
}

/* ─── Share page ───────────────────────────── */

.share-container {
    max-width: 560px;
    margin: var(--sp-6) auto;
}

.share-card {
    background: var(--bg);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

.share-header {
    padding: var(--sp-5) var(--sp-5) var(--sp-4);
    text-align: center;
}
.share-header .share-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    margin-bottom: var(--sp-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.share-header h2 {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--sp-1);
}
.share-header p {
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.share-preview {
    background: var(--bg-soft);
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}
.share-preview img {
    max-width: 100%;
    max-height: 460px;
    object-fit: contain;
}
.file-preview-large .preview-icon {
    font-size: 5rem;
    opacity: 0.55;
}

.share-info {
    padding: var(--sp-4) var(--sp-5);
    text-align: center;
}
.share-info h3 {
    font-size: var(--fs-md);
    color: var(--text);
    margin-bottom: var(--sp-2);
    word-break: break-all;
    font-weight: 600;
}
.share-meta {
    display: flex;
    justify-content: center;
    gap: var(--sp-4);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    flex-wrap: wrap;
}
.share-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
}

.share-actions {
    padding: var(--sp-4) var(--sp-5) var(--sp-5);
    text-align: center;
}

/* ─── Lightbox ─────────────────────────────── */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--sp-5);
    animation: fadeIn 0.2s ease-out;
}
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--r-sm);
    animation: zoomIn 0.2s ease-out;
}
.lightbox-close {
    position: absolute;
    top: var(--sp-4);
    right: var(--sp-4);
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    font-size: var(--fs-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast);
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

/* ─── Files list (upload multiple) ─────────── */

.files-list {
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    padding: var(--sp-3);
    margin-bottom: var(--sp-4);
    max-height: 260px;
    overflow-y: auto;
}
.file-list-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: var(--fs-sm);
}
.file-list-item:last-child { border-bottom: none; }
.file-list-icon {
    font-size: var(--fs-md);
    flex-shrink: 0;
}
.file-list-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}
.file-list-size {
    color: var(--text-muted);
    font-size: var(--fs-xs);
    flex-shrink: 0;
}

/* ─── Toolbar ──────────────────────────────── */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
}
.search-bar {
    display: flex;
    gap: var(--sp-2);
    flex: 1;
    max-width: 360px;
}
.search-input {
    flex: 1;
    position: relative;
}
.search-input input {
    padding-left: 2.2rem;
}
.search-input::before {
    content: '🔍';
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--fs-sm);
    opacity: 0.6;
    pointer-events: none;
}
.sort-bar {
    display: flex;
    align-items: center;
}
.sort-select {
    min-width: 160px;
    cursor: pointer;
    padding-right: 2rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b92a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
}

/* ─── Pagination ───────────────────────────── */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--sp-3);
    margin-top: var(--sp-5);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border-soft);
}
.pagination .btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.page-info {
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

/* ─── API hint ─────────────────────────────── */

.api-hint {
    background: var(--bg-soft);
    border-radius: var(--r-sm);
    padding: var(--sp-3) var(--sp-4);
    margin-top: var(--sp-5);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
}
.api-hint code {
    background: var(--bg);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Courier New', monospace;
    color: var(--primary-dark);
    font-size: var(--fs-xs);
}

/* ─── Admin tabs ───────────────────────────── */

.admin-tabs {
    display: flex;
    gap: var(--sp-1);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--sp-5);
    overflow-x: auto;
}
.admin-tabs a {
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all var(--t-fast);
    white-space: nowrap;
    text-decoration: none;
}
.admin-tabs a:hover {
    color: var(--text);
}
.admin-tabs a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ─── Badges for roles ─────────────────────── */

.badge-role {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--r-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-role-admin {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.badge-role-user {
    background: var(--bg-muted);
    color: var(--text-soft);
}

/* ─── Action icons in tables ───────────────── */

.row-actions {
    display: flex;
    gap: var(--sp-1);
    justify-content: flex-end;
    flex-wrap: wrap;
}
.row-actions .btn {
    padding: 0.25rem 0.55rem;
    font-size: var(--fs-xs);
}

/* ─── Inline form (modal-less edit) ────────── */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
}
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-actions {
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
    margin-top: var(--sp-4);
    flex-wrap: wrap;
}

/* ─── Danger zone card ─────────────────────── */

.danger-zone {
    border: 1px solid #fecaca !important;
    background: #fef9f9;
}
.danger-zone .card-header {
    border-bottom-color: #fecaca;
}
.danger-zone h2 {
    color: var(--danger);
}

/* ─── Animations ───────────────────────────── */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.card, .feature-card, .file-card, .stat-card, .alert {
    animation: fadeIn 0.3s ease-out;
}

/* ─── Responsive ───────────────────────────── */

@media (max-width: 768px) {
    .navbar {
        grid-template-columns: auto auto;
        padding: 0 var(--sp-4);
        height: auto;
        min-height: 56px;
        gap: var(--sp-3);
    }
    .nav-brand { grid-row: 1; }
    .nav-user { grid-row: 1; }
    .nav-links {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: var(--sp-2);
        gap: var(--sp-1);
    }
    .nav-user .user-chip { font-size: var(--fs-xs); padding: 0.2rem 0.6rem 0.2rem 0.2rem; }

    .main-content {
        padding: var(--sp-4) var(--sp-3);
    }

    .hero { padding: var(--sp-7) var(--sp-3) var(--sp-6); }
    .hero h1 { font-size: var(--fs-2xl); }
    .hero .subtitle { font-size: var(--fs-base); }

    .features-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .file-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
    .auth-card { padding: var(--sp-5); }

    .toolbar { flex-direction: column; align-items: stretch; }
    .search-bar { max-width: none; }
    .sort-select { width: 100%; min-width: 0; }

    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }
}

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