:root {
    --background: 220 20% 98%;
    --foreground: 224 71% 4%;
    --card: 0 0% 100%;
    --card-foreground: 224 71% 4%;
    --popover: 0 0% 100%;
    --popover-foreground: 224 71% 4%;
    --primary: 239 84% 67%;
    --primary-foreground: 0 0% 100%;
    --secondary: 220 14% 96%;
    --secondary-foreground: 224 47% 11%;
    --muted: 220 14% 96%;
    --muted-foreground: 220 9% 46%;
    --accent: 220 14% 96%;
    --accent-foreground: 224 47% 11%;
    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;
    --success: 142 76% 36%;
    --success-foreground: 0 0% 100%;
    --border: 220 13% 91%;
    --input: 220 13% 91%;
    --ring: 239 84% 67%;
    --radius: 0.75rem;
    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
    --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.06), 0 2px 4px -2px rgb(15 23 42 / 0.04);
    --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.04);
    --sidebar-width: 16.5rem;
    --header-height: 4rem;
    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
    --background: 224 71% 4%;
    --foreground: 210 40% 98%;
    --card: 224 47% 8%;
    --card-foreground: 210 40% 98%;
    --popover: 224 47% 8%;
    --popover-foreground: 210 40% 98%;
    --primary: 239 84% 67%;
    --primary-foreground: 0 0% 100%;
    --secondary: 215 28% 14%;
    --secondary-foreground: 210 40% 98%;
    --muted: 215 28% 14%;
    --muted-foreground: 217 10% 64%;
    --accent: 215 28% 14%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62% 50%;
    --destructive-foreground: 0 0% 100%;
    --success: 142 70% 45%;
    --border: 215 28% 16%;
    --input: 215 28% 16%;
    --ring: 239 84% 67%;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.2);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.25);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
}

*, *::before, *::after { border-color: hsl(var(--border)); box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: hsl(var(--primary) / 0.2); color: hsl(var(--foreground)); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground) / 0.25);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / 0.4); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    height: 2.5rem;
    padding: 0 1rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition),
        color var(--transition), box-shadow var(--transition), transform var(--transition), opacity var(--transition);
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { pointer-events: none; opacity: 0.55; }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.btn-default {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(239 84% 58%));
    color: hsl(var(--primary-foreground));
    box-shadow: var(--shadow-sm), 0 1px 0 hsl(var(--primary) / 0.15) inset;
}
.btn-default:hover:not(:disabled) {
    filter: brightness(1.05);
    box-shadow: var(--shadow-md), 0 1px 0 hsl(var(--primary) / 0.15) inset;
}

.btn-outline {
    border-color: hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    box-shadow: var(--shadow-sm);
}
.btn-outline:hover:not(:disabled) {
    background: hsl(var(--accent));
    border-color: hsl(var(--border));
}

.btn-ghost {
    background: transparent;
    color: hsl(var(--foreground));
}
.btn-ghost:hover:not(:disabled) { background: hsl(var(--accent)); }

.btn-destructive {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}
.btn-destructive:hover:not(:disabled) { filter: brightness(1.05); }

.btn-sm { height: 2.25rem; padding: 0 0.75rem; font-size: 0.8125rem; }
.btn-lg { height: 2.75rem; padding: 0 1.25rem; font-size: 0.9375rem; }
.btn-icon { height: 2.5rem; width: 2.5rem; padding: 0; }

.btn.is-loading { pointer-events: none; opacity: 0.75; }
.btn.is-loading .btn-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Form controls */
.input, .textarea, .select {
    width: 100%;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--input));
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.input, .select {
    display: flex;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
}
.textarea {
    min-height: 5rem;
    padding: 0.625rem 0.75rem;
    resize: vertical;
}
.input:hover, .textarea:hover, .select:hover { border-color: hsl(var(--muted-foreground) / 0.35); }
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}
.input:disabled, .textarea:disabled, .select:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: hsl(var(--muted));
}

.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-left: 2.5rem; }
.input-icon-wrap .input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: hsl(var(--muted-foreground));
    pointer-events: none;
}

.label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    color: hsl(var(--foreground));
    margin-bottom: 0.375rem;
}

.form-hint { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-top: 0.25rem; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    padding: 0.125rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.badge-default { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); border-color: hsl(var(--primary) / 0.2); }
.badge-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.badge-outline { border-color: hsl(var(--border)); color: hsl(var(--muted-foreground)); background: transparent; }
.badge-success { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.2); }

/* Cards */
.card {
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.card-interactive:hover {
    box-shadow: var(--shadow-md);
    border-color: hsl(var(--primary) / 0.15);
}
.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 1.25rem 1.5rem 0;
}
.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.card-description { font-size: 0.875rem; color: hsl(var(--muted-foreground)); line-height: 1.5; }
.card-content { padding: 1.25rem 1.5rem 1.5rem; }
.card-footer {
    padding: 0 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stat cards */
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
a.stat-card {
    color: inherit;
    text-decoration: none;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, hsl(var(--primary)), hsl(239 84% 58%));
    opacity: 0;
    transition: opacity var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: calc(var(--radius) - 2px);
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
}
.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.stat-card-label { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); font-weight: 500; }

/* Page layout */
.page-shell { animation: pageEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
.page-header { margin-bottom: 1.75rem; }
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.page-subtitle {
    margin-top: 0.375rem;
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
}

.app-main-bg {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, hsl(var(--primary) / 0.06), transparent),
        hsl(var(--background));
}

.dark .app-main-bg {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, hsl(var(--primary) / 0.08), transparent),
        hsl(var(--background));
}

/* Sidebar */
.sidebar {
    background: hsl(var(--card));
    border-right: 1px solid hsl(var(--border));
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.sidebar-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
}
.brand-logo {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    object-fit: contain;
    background: white;
    box-shadow: 0 2px 8px hsl(var(--foreground) / 0.08);
}
.brand-logo-sm {
    width: 2rem;
    height: 2rem;
}
.brand-logo-lg {
    width: 4rem;
    height: 4rem;
    box-shadow: 0 4px 16px hsl(var(--foreground) / 0.12);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    transition: background-color var(--transition), color var(--transition), transform var(--transition);
}
.nav-link:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}
.nav-link-active {
    background: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    font-weight: 600;
}
.nav-link-active:hover {
    background: hsl(var(--primary) / 0.14);
    color: hsl(var(--primary));
}

.app-header {
    height: var(--header-height);
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--card) / 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    border-radius: 9999px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    transition: border-color var(--transition), box-shadow var(--transition);
}
.user-pill:hover { border-color: hsl(var(--primary) / 0.25); box-shadow: var(--shadow-sm); }
.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, hsl(var(--primary) / 0.2), hsl(var(--primary) / 0.05));
    font-size: 0.75rem;
    font-weight: 700;
    color: hsl(var(--primary));
}

/* Alerts & toasts */
.alert {
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}
.alert-success {
    border-color: hsl(142 76% 36% / 0.25);
    background: hsl(142 76% 36% / 0.08);
    color: hsl(142 76% 28%);
}
.alert-error {
    border-color: hsl(var(--destructive) / 0.25);
    background: hsl(var(--destructive) / 0.08);
    color: hsl(var(--destructive));
}
.alert-info {
    border-color: hsl(var(--primary) / 0.25);
    background: hsl(var(--primary) / 0.08);
    color: hsl(var(--primary));
}
.dark .alert-success { color: hsl(142 70% 65%); }
.dark .alert-error { color: hsl(0 90% 75%); }
.dark .alert-info { color: hsl(239 84% 75%); }

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.toast.is-leaving { animation: toastOut 0.25s cubic-bezier(0.4, 0, 1, 1) both; }
.toast-success { border-left: 3px solid hsl(var(--success)); }
.toast-error { border-left: 3px solid hsl(var(--destructive)); }
.toast-info { border-left: 3px solid hsl(var(--primary)); }
.toast-close {
    margin-left: auto;
    flex-shrink: 0;
    padding: 0.125rem;
    border: none;
    background: transparent;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    border-radius: 4px;
    transition: color var(--transition), background-color var(--transition);
}
.toast-close:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: calc(var(--radius) - 2px); }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table thead { background: hsl(var(--muted) / 0.5); }
.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground));
}
.table td { padding: 0.875rem 1rem; border-top: 1px solid hsl(var(--border)); }
.table tbody tr { transition: background-color var(--transition); }
.table tbody tr:hover { background: hsl(var(--muted) / 0.35); }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}
.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius);
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    margin-bottom: 1rem;
}
.empty-state-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.375rem; }
.empty-state-desc { font-size: 0.875rem; color: hsl(var(--muted-foreground)); max-width: 24rem; margin-bottom: 1.25rem; }

/* Upload zone */
.upload-zone {
    border: 2px dashed hsl(var(--border));
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    background: hsl(var(--muted) / 0.25);
    transition: border-color var(--transition), background-color var(--transition);
}
.upload-zone:hover, .upload-zone.is-dragover {
    border-color: hsl(var(--primary) / 0.5);
    background: hsl(var(--primary) / 0.04);
}
.file-list-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    font-size: 0.875rem;
    animation: fadeSlideIn 0.25s ease both;
}
.file-list-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.file-list-item-meta {
    display: grid;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border));
}
@media (min-width: 640px) {
    .file-list-item-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.file-list-item-meta .label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}
.file-list-item-meta .select,
.file-list-item-meta .input {
    font-size: 0.8125rem;
    padding: 0.375rem 0.625rem;
    min-height: 2rem;
}
.file-list-item-meta-other {
    grid-column: 1 / -1;
}

/* Kit upload progress overlay */
.upload-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: hsl(var(--background) / 0.72);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease both;
}
.upload-progress-overlay.hidden { display: none; }
.upload-progress-card {
    width: 100%;
    max-width: 22rem;
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    box-shadow: 0 20px 50px hsl(var(--foreground) / 0.12);
    text-align: center;
    animation: fadeSlideIn 0.3s ease both;
}
.upload-progress-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
}
.upload-progress-spinner {
    display: block;
    width: 3rem;
    height: 3rem;
    border: 3px solid hsl(var(--primary) / 0.2);
    border-top-color: hsl(var(--primary));
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
.upload-progress-overlay.is-success .upload-progress-spinner,
.upload-progress-overlay.is-error .upload-progress-spinner { display: none; }
.upload-progress-overlay.is-success .upload-progress-check,
.upload-progress-overlay.is-error .upload-progress-error { display: block !important; }
.upload-progress-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}
.upload-progress-status {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1rem;
}
.upload-progress-track {
    height: 0.5rem;
    border-radius: 9999px;
    background: hsl(var(--muted));
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.upload-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 9999px;
    background: linear-gradient(90deg, hsl(var(--primary)), hsl(262 83% 58%));
    transition: width 0.15s ease-out;
}
.upload-progress-overlay.is-indeterminate .upload-progress-bar {
    width: 40% !important;
    animation: uploadIndeterminate 1.2s ease-in-out infinite;
}
.upload-progress-percent {
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: hsl(var(--primary));
    margin-bottom: 0.25rem;
}
.upload-progress-detail {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    min-height: 1rem;
}
.upload-progress-overlay.is-success .upload-progress-bar {
    width: 100% !important;
    background: hsl(142 76% 36%);
}
.upload-progress-overlay.is-error .upload-progress-bar {
    background: hsl(var(--destructive));
}
#upload-form.is-uploading {
    pointer-events: none;
    opacity: 0.55;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes uploadIndeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

/* File picker */
.file-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    background: hsl(var(--card));
    cursor: pointer;
    transition: all var(--transition);
}
.file-tab:hover { border-color: hsl(var(--primary) / 0.3); background: hsl(var(--accent)); }
.file-tab.is-active {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.08);
    color: hsl(var(--primary));
    box-shadow: 0 0 0 1px hsl(var(--primary) / 0.1);
}
.viewer-frame {
    width: 100%;
    min-height: 500px;
    height: 100%;
    border: none;
    background: hsl(var(--muted) / 0.3);
}

/* Auth */
.auth-gradient {
    background:
        radial-gradient(ellipse 75% 55% at 12% 18%, hsl(var(--primary) / 0.16), transparent 55%),
        radial-gradient(ellipse 65% 50% at 88% 82%, hsl(262 70% 58% / 0.1), transparent 55%),
        linear-gradient(165deg, hsl(230 35% 97%) 0%, hsl(235 28% 95%) 45%, hsl(228 22% 93%) 100%);
}
.dark .auth-gradient {
    background:
        radial-gradient(ellipse 80% 60% at 18% 8%, hsl(var(--primary) / 0.28), transparent 52%),
        radial-gradient(ellipse 70% 55% at 82% 92%, hsl(280 55% 42% / 0.18), transparent 52%),
        radial-gradient(ellipse 90% 70% at 50% 110%, hsl(239 45% 28% / 0.12), transparent 60%),
        linear-gradient(155deg, hsl(232 42% 8%) 0%, hsl(238 38% 11%) 48%, hsl(224 48% 5%) 100%);
}
.auth-orb {
    border-radius: 9999px;
    filter: blur(80px);
    pointer-events: none;
}
.auth-orb-1 {
    top: -8rem;
    left: -6rem;
    width: 22rem;
    height: 22rem;
    background: hsl(var(--primary) / 0.25);
}
.auth-orb-2 {
    right: -5rem;
    bottom: -6rem;
    width: 20rem;
    height: 20rem;
    background: hsl(262 70% 55% / 0.15);
}
.dark .auth-orb-1 { background: hsl(var(--primary) / 0.35); }
.dark .auth-orb-2 { background: hsl(280 60% 45% / 0.22); }
.auth-grid {
    background-image: radial-gradient(hsl(var(--foreground) / 0.035) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 10%, transparent 72%);
}
.dark .auth-grid {
    background-image: radial-gradient(hsl(210 40% 98% / 0.04) 1px, transparent 1px);
}
.auth-card {
    overflow: hidden;
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid hsl(var(--border) / 0.45);
    background: hsl(var(--card) / 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-lg), 0 0 0 1px hsl(var(--border) / 0.35), 0 25px 50px -12px hsl(var(--primary) / 0.08);
}
.dark .auth-card {
    background: hsl(var(--card) / 0.75);
    box-shadow: var(--shadow-lg), 0 0 0 1px hsl(var(--border) / 0.4), 0 25px 60px -15px rgb(0 0 0 / 0.45);
}
.auth-card-accent {
    height: 3px;
    background: linear-gradient(90deg, transparent, hsl(var(--primary)), hsl(262 70% 58%), transparent);
}

/* Pagination */
.pagination-wrap nav[role="navigation"] { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: center; }
.pagination-wrap nav[role="navigation"] span,
.pagination-wrap nav[role="navigation"] a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background-color var(--transition), color var(--transition);
}
.pagination-wrap nav[role="navigation"] a {
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}
.pagination-wrap nav[role="navigation"] a:hover { background: hsl(var(--accent)); }
.pagination-wrap nav[role="navigation"] span[aria-current="page"] span {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: calc(var(--radius) - 4px);
    min-width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-spin { animation: spin 0.8s linear infinite; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

.chart-container { position: relative; height: 260px; width: 100%; }
.chart-container-sm { height: 220px; }
.chart-container-lg { height: 300px; }
.analytics-section-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 1rem; }

/* Public share page */
.share-page { min-height: 100vh; display: flex; flex-direction: column; }
.share-protected {
    -webkit-user-select: none;
    user-select: none;
}
.share-protected .btn,
.share-protected .file-tab,
.share-protected input,
.share-protected textarea {
    -webkit-user-select: auto;
    user-select: auto;
}
.share-protected canvas,
.share-protected [data-pdf-canvas] {
    -webkit-user-drag: none;
    user-drag: none;
}
.share-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--card) / 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.share-main { flex: 1; }
.share-viewer-wrap { display: flex; flex-direction: column; }
.share-details-list { display: flex; flex-direction: column; gap: 0.75rem; }
.share-details-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.5rem;
    font-size: 0.875rem;
    align-items: start;
}
.share-details-row dt { color: hsl(var(--muted-foreground)); font-weight: 500; }
.share-details-row dd { font-weight: 500; min-width: 0; word-break: break-word; }
.share-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    transition: border-color var(--transition), background-color var(--transition);
}
.share-file-row:hover { border-color: hsl(var(--primary) / 0.25); background: hsl(var(--muted) / 0.35); }
.share-file-row.is-active {
    border-color: hsl(var(--primary) / 0.45);
    background: hsl(var(--primary) / 0.08);
}
[data-kit-file-switch].is-active {
    border-color: hsl(var(--primary) / 0.45);
}
.file-picker { min-height: 480px; }
.file-picker-toolbar { min-height: 3.25rem; }

.pdf-viewer { min-height: 0; }
.pdf-viewer-controls { backdrop-filter: blur(8px); }
.pdf-viewer-canvas-wrap {
    min-height: 360px;
    background:
        linear-gradient(to right, hsl(var(--border) / 0.4) 1px, transparent 1px),
        linear-gradient(to bottom, hsl(var(--border) / 0.4) 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: hsl(var(--muted) / 0.25);
}
.pdf-viewer-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
    background: white;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
