:root {
    --fs-primary: #4f46e5;
    --fs-primary-2: #6d5dfc;
    --fs-bg: #f5f7fb;
    --fs-card: #ffffff;
    --fs-text: #111827;
    --fs-muted: #6b7280;
    --fs-border: #e5e7eb;
    --fs-sidebar: #0f172a;
    --fs-sidebar-2: #111c33;
    --fs-success: #16a34a;
    --fs-warning: #f59e0b;
    --fs-danger: #ef4444;
    --fs-shadow: 0 12px 35px rgba(15, 23, 42, .07);
    --fs-radius: 18px;
}
[data-bs-theme="dark"] {
    --fs-bg: #0b1120;
    --fs-card: #111827;
    --fs-text: #eef2ff;
    --fs-muted: #94a3b8;
    --fs-border: #243047;
    --fs-sidebar: #070d19;
    --fs-sidebar-2: #0f172a;
    --fs-shadow: 0 12px 35px rgba(0,0,0,.22);
}
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: var(--fs-bg); color: var(--fs-text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { text-decoration: none; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; background: linear-gradient(180deg, var(--fs-sidebar), var(--fs-sidebar-2)); color: #dbe4f0; padding: 20px 16px; display: flex; flex-direction: column; z-index: 1040; box-shadow: 10px 0 35px rgba(2,6,23,.13); }
.sidebar-brand { display:flex; align-items:center; justify-content:space-between; padding: 2px 6px 24px; }
.brand-link { display:flex; align-items:center; gap:12px; color:#fff; }
.brand-mark { width:42px; height:42px; border-radius:13px; display:grid; place-items:center; background:linear-gradient(135deg,#3b82f6,#6d5dfc); box-shadow:0 8px 20px rgba(79,70,229,.35); font-size:20px; }
.brand-copy { display:flex; flex-direction:column; line-height:1.1; }
.brand-copy strong { font-size:18px; letter-spacing:.1px; }
.brand-copy small { font-size:11px; color:#8fa2bc; margin-top:5px; }
.sidebar-close { border:0; background:transparent; color:#cbd5e1; font-size:20px; }
.sidebar-label { text-transform:uppercase; letter-spacing:.12em; font-size:10px; color:#687995; padding:8px 12px 9px; font-weight:700; }
.sidebar-nav { display:flex; flex-direction:column; gap:6px; }
.sidebar-link { width:100%; border:0; background:transparent; color:#cbd5e1; display:flex; align-items:center; gap:12px; min-height:46px; padding:10px 13px; border-radius:12px; font-size:14px; font-weight:600; transition:.18s ease; }
.sidebar-link i { font-size:17px; width:21px; text-align:center; }
.sidebar-link:hover { color:#fff; background:rgba(255,255,255,.07); transform:translateX(2px); }
.sidebar-link.active { color:#fff; background:linear-gradient(135deg,#3b82f6,#6257f6); box-shadow:0 10px 22px rgba(79,70,229,.28); }
.sidebar-spacer { flex:1; }
.sidebar-security { border:1px solid rgba(255,255,255,.09); background:rgba(255,255,255,.04); border-radius:14px; padding:13px; display:flex; gap:11px; margin:12px 0; align-items:center; }
.security-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; color:#86efac; background:rgba(34,197,94,.12); }
.sidebar-security strong, .sidebar-security small { display:block; }
.sidebar-security strong { font-size:12px; color:#e2e8f0; }
.sidebar-security small { font-size:10px; color:#8494aa; margin-top:3px; }
.theme-toggle { cursor:pointer; }
.theme-switch { width:34px; height:19px; border-radius:50px; background:#435067; padding:2px; display:flex; align-items:center; transition:.2s; }
.theme-switch span { width:15px; height:15px; border-radius:50%; background:#fff; transition:.2s; box-shadow:0 2px 5px rgba(0,0,0,.2); }
.theme-toggle.is-dark .theme-switch { background:#665cf4; }
.theme-toggle.is-dark .theme-switch span { transform:translateX(15px); }
.sidebar-profile { margin-top:12px; padding:12px; border-top:1px solid rgba(255,255,255,.08); display:flex; align-items:center; gap:10px; }
.avatar { width:38px; height:38px; border-radius:50%; display:grid; place-items:center; flex:0 0 auto; background:linear-gradient(135deg,#315f92,#5166c8); color:#fff; font-weight:800; font-size:12px; }
.profile-copy { min-width:0; display:flex; flex-direction:column; flex:1; }
.profile-copy strong { font-size:13px; color:#f8fafc; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.profile-copy small { font-size:10px; color:#8392a8; margin-top:3px; }
.profile-logout { color:#94a3b8; width:32px; height:32px; border-radius:9px; display:grid; place-items:center; }
.profile-logout:hover { background:rgba(239,68,68,.12); color:#fca5a5; }
.main-area { margin-left:270px; min-height:100vh; }
.topbar { height:78px; position:sticky; top:0; z-index:1020; display:flex; justify-content:space-between; align-items:center; padding:0 28px; background:color-mix(in srgb, var(--fs-card) 91%, transparent); backdrop-filter:blur(14px); border-bottom:1px solid var(--fs-border); }
.topbar-title { font-size:18px; font-weight:800; color:var(--fs-text); }
.topbar-subtitle { font-size:11px; color:var(--fs-muted); margin-top:2px; }
.topbar-actions { display:flex; align-items:center; gap:10px; }
.topbar-icon { border:1px solid var(--fs-border); background:var(--fs-card); color:var(--fs-text); border-radius:10px; width:38px; height:38px; }
.role-badge { display:inline-flex; align-items:center; gap:6px; padding:7px 10px; border-radius:999px; font-size:11px; font-weight:700; }
.role-admin { color:#6d28d9; background:#ede9fe; }
.role-user { color:#0369a1; background:#e0f2fe; }
[data-bs-theme="dark"] .role-admin { color:#c4b5fd; background:#2e255d; }
[data-bs-theme="dark"] .role-user { color:#7dd3fc; background:#13354a; }
.btn-primary { --bs-btn-bg:var(--fs-primary); --bs-btn-border-color:var(--fs-primary); --bs-btn-hover-bg:#4338ca; --bs-btn-hover-border-color:#4338ca; border-radius:10px; font-weight:700; box-shadow:0 6px 14px rgba(79,70,229,.18); }
.top-upload-btn { padding:.54rem .85rem; }
.content-area { padding:26px 28px 40px; }
.container, .container-fluid { max-width:1600px; }
.card { background:var(--fs-card); color:var(--fs-text); border:1px solid var(--fs-border)!important; border-radius:var(--fs-radius); box-shadow:var(--fs-shadow)!important; }
.card-body { padding:22px; }
.page-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:22px; }
.page-heading h1 { font-size:26px; margin:0; font-weight:800; letter-spacing:-.02em; }
.page-heading p { margin:5px 0 0; color:var(--fs-muted); font-size:13px; }
.metric-card { position:relative; overflow:hidden; min-height:138px; }
.metric-card .card-body { display:flex; align-items:flex-start; gap:14px; }
.metric-icon { width:46px; height:46px; border-radius:14px; display:grid; place-items:center; font-size:20px; flex:0 0 auto; }
.metric-icon.blue { color:#2563eb; background:#dbeafe; }
.metric-icon.green { color:#16a34a; background:#dcfce7; }
.metric-icon.orange { color:#ea580c; background:#ffedd5; }
.metric-icon.purple { color:#7c3aed; background:#ede9fe; }
.metric-icon.cyan { color:#0891b2; background:#cffafe; }
[data-bs-theme="dark"] .metric-icon.blue { background:#172f58; color:#93c5fd; }
[data-bs-theme="dark"] .metric-icon.green { background:#143925; color:#86efac; }
[data-bs-theme="dark"] .metric-icon.orange { background:#472619; color:#fdba74; }
[data-bs-theme="dark"] .metric-icon.purple { background:#32245a; color:#c4b5fd; }
.metric-label { color:var(--fs-muted); font-size:12px; font-weight:600; margin-bottom:5px; }
.metric-value { font-size:29px; font-weight:800; letter-spacing:-.03em; line-height:1; }
.metric-foot { font-size:11px; color:var(--fs-muted); margin-top:10px; }
.section-title { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; }
.section-title h2 { font-size:16px; font-weight:800; margin:0; }
.section-title p { margin:4px 0 0; color:var(--fs-muted); font-size:11px; }
.storage-panel .storage-top { display:flex; justify-content:space-between; align-items:center; }
.storage-big { font-size:27px; font-weight:800; }
.storage-muted { color:var(--fs-muted); font-size:12px; }
.progress { background:color-mix(in srgb,var(--fs-border) 68%,transparent); border-radius:99px; overflow:hidden; }
.progress-bar { background:linear-gradient(90deg,#3b82f6,#5b55ed); }
.quota-ring { --p:0; width:130px; height:130px; border-radius:50%; display:grid; place-items:center; margin:18px auto; background:conic-gradient(var(--fs-primary) calc(var(--p)*1%), #e7edf5 0); position:relative; }
.quota-ring::after { content:""; width:95px; height:95px; border-radius:50%; background:var(--fs-card); position:absolute; }
.quota-ring strong { position:relative; z-index:1; font-size:24px; }
.table-responsive { border-radius:13px; }
.table { color:var(--fs-text); margin-bottom:0; --bs-table-bg:transparent; --bs-table-hover-bg:rgba(79,70,229,.035); --bs-table-color:var(--fs-text); }
.table thead th { color:var(--fs-muted); text-transform:uppercase; letter-spacing:.045em; font-size:10px; font-weight:800; border-bottom:1px solid var(--fs-border); padding:12px 12px; white-space:nowrap; }
.table tbody td { font-size:12px; padding:14px 12px; border-color:var(--fs-border); }
.file-name-cell { display:flex; align-items:center; gap:10px; min-width:190px; }
.file-type-icon { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; background:#eef2ff; color:#4f46e5; flex:0 0 auto; }
[data-bs-theme="dark"] .file-type-icon { background:#24294a; color:#a5b4fc; }
.file-name-cell strong { display:block; font-size:12px; max-width:250px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-name-cell small { display:block; color:var(--fs-muted); margin-top:2px; }
.badge-soft { border-radius:999px; padding:5px 8px; font-size:10px; font-weight:700; }
.badge-active { color:#15803d; background:#dcfce7; }
.badge-expired { color:#b91c1c; background:#fee2e2; }
.badge-protected { color:#b45309; background:#fef3c7; }
.badge-open { color:#475569; background:#eef2f7; }
.form-control, .form-select { background-color:var(--fs-card); border:1px solid var(--fs-border); color:var(--fs-text); border-radius:11px; min-height:43px; font-size:13px; }
.form-control:focus, .form-select:focus { background-color:var(--fs-card); color:var(--fs-text); border-color:#818cf8; box-shadow:0 0 0 3px rgba(99,102,241,.13); }
.form-label { font-size:12px; font-weight:700; }
.form-text { color:var(--fs-muted); font-size:10px; }
.btn { border-radius:10px; font-weight:700; font-size:12px; }
.btn-outline-secondary { border-color:var(--fs-border); color:var(--fs-text); }
.btn-outline-secondary:hover { background:var(--fs-bg); color:var(--fs-text); border-color:#cbd5e1; }
.btn-outline-danger { border-color:#fecaca; color:#dc2626; }
.alert { border:0; border-radius:13px; font-size:12px; }
.upload-hero { border:1.5px dashed #9aa7ff; border-radius:16px; background:linear-gradient(180deg,rgba(79,70,229,.035),rgba(59,130,246,.018)); padding:28px; text-align:center; transition:.2s; position:relative; }
.upload-hero:hover, .upload-hero.dragover { border-color:var(--fs-primary); background:rgba(79,70,229,.065); transform:translateY(-1px); }
.upload-cloud { width:62px; height:62px; border-radius:18px; display:grid; place-items:center; margin:0 auto 12px; background:#eef2ff; color:#4f46e5; font-size:29px; }
[data-bs-theme="dark"] .upload-cloud { background:#252a4b; color:#a5b4fc; }
.upload-hero h3 { font-size:15px; font-weight:800; margin-bottom:4px; }
.upload-hero p { color:var(--fs-muted); font-size:11px; margin-bottom:13px; }
.upload-hero input[type=file] { max-width:430px; margin:0 auto; }
.upload-options { margin-top:18px; padding-top:18px; border-top:1px solid var(--fs-border); }
.code-font { font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-size:11px!important; }
.auth-layout, .download-layout { min-height:100vh; display:grid; grid-template-columns:minmax(0,1.08fr) minmax(420px,.92fr); background:var(--fs-bg); }
.auth-visual, .download-visual { position:relative; overflow:hidden; display:flex; align-items:flex-end; padding:54px; background:radial-gradient(circle at 15% 20%,#3949ab 0,transparent 28%),radial-gradient(circle at 78% 30%,#2563eb 0,transparent 26%),linear-gradient(145deg,#0f172a,#18254a 58%,#111827); color:#fff; }
.auth-visual::after, .download-visual::after { content:""; position:absolute; inset:0; background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px); background-size:35px 35px; mask-image:linear-gradient(to bottom,black,transparent); }
.auth-visual-copy, .download-visual-copy { position:relative; z-index:1; max-width:540px; }
.auth-visual-copy .brand-mark, .download-visual-copy .brand-mark { margin-bottom:24px; }
.auth-visual h2, .download-visual h2 { font-size:38px; font-weight:800; letter-spacing:-.035em; }
.auth-visual p, .download-visual p { color:#c7d2fe; max-width:470px; }
.auth-pane, .download-pane { display:flex; align-items:center; justify-content:center; padding:35px; background:var(--fs-card); }
.auth-card { width:min(430px,100%); }
.auth-card h1 { font-size:25px; font-weight:800; }
.auth-card .lead-mini { color:var(--fs-muted); font-size:12px; margin-bottom:24px; }
.public-file-card { width:min(520px,100%); }
.public-file-icon { width:70px; height:70px; border-radius:20px; display:grid; place-items:center; background:#eef2ff; color:#4f46e5; font-size:30px; margin-bottom:18px; }
[data-bs-theme="dark"] .public-file-icon { background:#24294a; color:#a5b4fc; }
.public-meta { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:20px 0; }
.public-meta > div { border:1px solid var(--fs-border); background:var(--fs-bg); border-radius:12px; padding:12px; }
.public-meta span, .public-meta strong { display:block; }
.public-meta span { color:var(--fs-muted); font-size:10px; margin-bottom:3px; }
.public-meta strong { font-size:12px; }
.empty-state { text-align:center; padding:42px 20px!important; color:var(--fs-muted)!important; }
.empty-state i { font-size:32px; display:block; margin-bottom:8px; opacity:.55; }
.sidebar-overlay { display:none; }
@media (max-width: 991.98px) {
    .sidebar { transform:translateX(-100%); transition:.22s ease; }
    .sidebar.show { transform:translateX(0); }
    .sidebar-overlay { display:block; position:fixed; inset:0; background:rgba(2,6,23,.55); z-index:1030; opacity:0; visibility:hidden; transition:.2s; }
    .sidebar-overlay.show { opacity:1; visibility:visible; }
    .main-area { margin-left:0; }
    .topbar { padding:0 18px; }
    .content-area { padding:20px 16px 32px; }
}
@media (max-width: 767.98px) {
    .content-area { padding:16px 12px 28px; }
    .topbar { height:68px; }
    .topbar-subtitle { display:none; }
    .role-badge { display:none; }
    .page-heading { align-items:flex-start; flex-direction:column; }
    .card-body { padding:17px; }
    .auth-layout, .download-layout { display:block; min-height:100vh; }
    .auth-visual, .download-visual { min-height:230px; padding:30px 24px; align-items:center; }
    .auth-visual h2, .download-visual h2 { font-size:27px; }
    .auth-pane, .download-pane { min-height:calc(100vh - 230px); padding:28px 20px; }
    .public-meta { grid-template-columns:1fr; }
}
