/* ============================================================
   R2 CDN Panel — app.css
   Premium dark SaaS theme · glassmorphism · Inter
   ============================================================ */

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

:root {
    --bg-0: #0a0c14;
    --bg-1: #0f1320;
    --bg-2: #141929;
    --surface: rgba(22, 27, 43, 0.72);
    --surface-solid: #161b2b;
    --surface-hover: rgba(30, 36, 56, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: #e8ecf4;
    --text-muted: #8b93a7;
    --text-dim: #5b6378;

    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-soft: rgba(99, 102, 241, 0.16);
    --accent-glow: rgba(99, 102, 241, 0.45);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.16);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.16);
    --warning: #f59e0b;
    --info: #3b82f6;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 0 1px var(--border), 0 20px 60px -15px var(--accent-glow);

    --sidebar-w: 260px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

/* ---------- Lucide icons ---------- */
.icon,
[data-lucide] {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}
.icon-sm,
.btn-sm [data-lucide],
.row-actions [data-lucide],
.sidebar-user [data-lucide],
.search-box [data-lucide],
.input-wrap [data-lucide] { width: 15px; height: 15px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 26px; height: 26px; }

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg-0);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
        radial-gradient(1000px 500px at -10% 20%, rgba(99, 102, 241, 0.12), transparent 55%),
        var(--bg-0);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, button { font-family: inherit; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-solid);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 24px -8px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-danger { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.28); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-icon {
    width: 34px; height: 34px; padding: 0;
    border-radius: 9px;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.10), transparent 45%);
    pointer-events: none;
}
.login-brand {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 28px;
    position: relative;
}
.brand-mark {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center;
    color: #fff;
    box-shadow: 0 8px 22px -6px var(--accent-glow);
}
.brand-mark [data-lucide] { width: 22px; height: 22px; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.brand-sub { font-size: 12px; color: var(--text-muted); }
.login-title { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 6px; }
.login-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; position: relative; }
.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}
.input-wrap { position: relative; }
.input-wrap .input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-dim); pointer-events: none;
    display: inline-flex; align-items: center;
}
.form-control {
    width: 100%;
    padding: 13px 16px 13px 42px;
    background: rgba(10, 12, 20, 0.55);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14.5px;
    transition: all 0.18s ease;
    outline: none;
}
.form-control::placeholder { color: var(--text-dim); }
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: rgba(10, 12, 20, 0.8);
}
.login-card .btn-primary { width: 100%; padding: 13px; font-size: 15px; margin-top: 6px; }
.login-foot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--text-dim); }

/* ---------- Alerts ---------- */
.alert {
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 10px;
}
.alert-error { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-success { background: var(--success-soft); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }

/* ============================================================
   DASHBOARD LAYOUT (sidebar)
   ============================================================ */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 11px;
    padding: 6px 8px 22px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
.sidebar-brand .brand-mark [data-lucide] { width: 19px; height: 19px; }
.sidebar-brand .brand-name { font-size: 16px; }
.sidebar-brand .brand-sub { font-size: 11px; }
.nav-section-label {
    font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-dim);
    padding: 0 10px; margin: 14px 0 8px;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 14px; font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
    z-index: 2;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active {
    background: var(--accent-soft);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.28);
}
.nav-item .nav-ico { width: 18px; display: inline-flex; align-items: center; justify-content: center; pointer-events: none; }
.nav-item .nav-ico * { pointer-events: none; }
.nav-item svg { pointer-events: none; }
.sidebar-spacer { flex: 1; }
.sidebar-user {
    display: flex; align-items: center; gap: 11px;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
}
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center;
    font-weight: 700; color: #fff; font-size: 14px;
    flex-shrink: 0;
}
.sidebar-user .su-name { font-size: 13.5px; font-weight: 600; }
.sidebar-user .su-role { font-size: 11.5px; color: var(--text-muted); }
.sidebar-user .su-logout {
    margin-left: auto; color: var(--text-dim);
    width: 30px; height: 30px; display: grid; place-items: center;
    border-radius: 8px; transition: all 0.15s ease;
}
.sidebar-user .su-logout:hover { background: var(--danger-soft); color: #fca5a5; }

/* ---------- Main ---------- */
.main {
    padding: 28px 34px 48px;
    min-width: 0;
}
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 26px;
}
.topbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.topbar .crumb { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Stats header ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 26px;
}
.stat-card {
    background: var(--surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.stat-card::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 12px 32px -16px rgba(99, 102, 241, 0.35);
}
.stat-card:hover::after { opacity: 1; }
.stat-value.stat-host { font-size: 15px; word-break: break-all; line-height: 1.35; }
.stat-card .stat-ico {
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center;
    margin-bottom: 14px;
}
.stat-card .stat-ico [data-lucide] { width: 19px; height: 19px; }
.stat-ico.purple { background: var(--accent-soft); color: #a5b4fc; }
.stat-ico.green  { background: var(--success-soft); color: #6ee7b7; }
.stat-ico.blue   { background: rgba(59,130,246,0.16); color: #93c5fd; }
.stat-ico.amber  { background: rgba(245,158,11,0.16); color: #fcd34d; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Panels ---------- */
.panel {
    background: var(--surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 22px;
    overflow: hidden;
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 15.5px; font-weight: 600; }
.panel-head .panel-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.panel-body { padding: 22px; overflow: visible; }

#upload { scroll-margin-top: 24px; }
#upload.nav-flash {
    animation: uploadFlash 1.1s ease;
}
@keyframes uploadFlash {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.55); }
    40% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.35); }
    100% { box-shadow: none; }
}

/* ---------- Drag-drop upload ---------- */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 190px;
    box-sizing: border-box;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 38px 24px;
    text-align: center;
    background: rgba(10, 12, 20, 0.35);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
}
.dropzone:hover { border-color: var(--accent); background: rgba(99,102,241,0.05); }
.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.dropzone .dz-ico {
    width: 56px; height: 56px; border-radius: 16px;
    margin: 0 0 16px;
    background: var(--accent-soft); color: #a5b4fc;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.dropzone .dz-ico [data-lucide],
.dropzone .dz-ico svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
}
.dropzone .dz-title { font-size: 15px; font-weight: 600; margin-bottom: 5px; width: 100%; }
.dropzone .dz-sub { font-size: 13px; color: var(--text-muted); width: 100%; }
.dropzone .dz-browse { color: #a5b4fc; font-weight: 600; text-decoration: underline; }
.dropzone input[type="file"] { display: none; }
.dz-file-name {
    margin-top: 14px; font-size: 13px; color: var(--text);
    padding: 8px 12px; background: var(--bg-2); border-radius: 8px;
    border: 1px solid var(--border); display: none;
    word-break: break-all; align-items: flex-start; gap: 6px;
    line-height: 1.45; text-align: left;
}
.dz-file-name [data-lucide] { width: 15px; height: 15px; color: #a5b4fc; }
.dz-file-name.show { display: flex; }
.upload-row { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.upload-row .btn-primary { flex-shrink: 0; }
.dz-progress {
    flex: 1; height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden;
    display: none;
}
.dz-progress.show { display: block; }
.dz-progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.2s ease; }

/* ---------- File table ---------- */
.file-toolbar {
    display: flex; gap: 12px; align-items: center;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
}
.search-box {
    position: relative; flex: 1; max-width: 320px;
}
.search-box .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); display: inline-flex; align-items: center; }
.search-box input {
    width: 100%; padding: 9px 12px 9px 36px;
    background: rgba(10,12,20,0.55); border: 1px solid var(--border);
    border-radius: 9px; color: var(--text); font-size: 13px; outline: none;
    transition: all 0.15s ease;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.file-count { font-size: 13px; color: var(--text-muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.6px;
    text-transform: uppercase; color: var(--text-dim);
    padding: 12px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(10,12,20,0.25);
}
tbody td { padding: 14px 22px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
tbody tr { transition: background 0.13s ease; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

.file-cell { display: flex; align-items: center; gap: 12px; }
.file-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.file-icon [data-lucide] { width: 17px; height: 17px; }
.file-icon.img  { background: rgba(59,130,246,0.16); color: #93c5fd; }
.file-icon.vid  { background: rgba(239,68,68,0.16); color: #fca5a5; }
.file-icon.aud  { background: rgba(168,85,247,0.16); color: #d8b4fe; }
.file-icon.doc  { background: rgba(16,185,129,0.16); color: #6ee7b7; }
.file-icon.arc  { background: rgba(245,158,11,0.16); color: #fcd34d; }
.file-icon.code { background: rgba(99,102,241,0.16); color: #a5b4fc; }
.file-icon.gen  { background: rgba(139,152,175,0.16); color: #cbd5e1; }
.file-name { font-weight: 500; word-break: break-all; }
.file-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

.size-cell { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.date-cell { min-width: 150px; }
.date-main { font-size: 13px; color: var(--text); font-weight: 500; }
.date-relative { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }

.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    border: 1px solid transparent;
}
.type-badge.img  { background: rgba(59,130,246,0.14); color: #93c5fd; border-color: rgba(59,130,246,0.25); }
.type-badge.vid  { background: rgba(239,68,68,0.14); color: #fca5a5; border-color: rgba(239,68,68,0.25); }
.type-badge.aud  { background: rgba(168,85,247,0.14); color: #d8b4fe; border-color: rgba(168,85,247,0.25); }
.type-badge.doc  { background: rgba(16,185,129,0.14); color: #6ee7b7; border-color: rgba(16,185,129,0.25); }
.type-badge.arc  { background: rgba(245,158,11,0.14); color: #fcd34d; border-color: rgba(245,158,11,0.25); }
.type-badge.code { background: rgba(99,102,241,0.14); color: #a5b4fc; border-color: rgba(99,102,241,0.25); }
.type-badge.gen  { background: rgba(139,152,175,0.14); color: #cbd5e1; border-color: rgba(139,152,175,0.25); }

.link-cell a { color: #a5b4fc; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link-cell a [data-lucide] { width: 14px; height: 14px; }
.link-cell a:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions form { display: inline; }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center; padding: 56px 24px; color: var(--text-muted);
}
.empty-state .es-ico {
    width: 64px; height: 64px; border-radius: 18px;
    margin: 0 auto 18px;
    background: var(--bg-2); border: 1px solid var(--border);
    display: grid; place-items: center; color: var(--text-dim);
}
.empty-state .es-ico [data-lucide] { width: 28px; height: 28px; }
.empty-state h3 { font-size: 16px; color: var(--text); font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; }

/* ============================================================
   TOAST notifications
   ============================================================ */
.toast-stack {
    position: fixed; top: 22px; right: 22px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 9999; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 12px;
    min-width: 280px; max-width: 380px;
    padding: 14px 16px;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-size: 13.5px; font-weight: 500;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
    border-left: 3px solid var(--accent);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast .t-ico { flex-shrink: 0; display: inline-flex; align-items: center; }
.toast .t-ico [data-lucide] { width: 17px; height: 17px; }
.toast.success { border-left-color: var(--success); }
.toast.success .t-ico { color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error .t-ico { color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast.info .t-ico { color: var(--info); }

/* ---------- Mobile sidebar toggle ---------- */
.menu-toggle { display: none; }

@media (max-width: 980px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 200;
        width: var(--sidebar-w); transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle {
        display: inline-flex; width: 38px; height: 38px;
        align-items: center; justify-content: center;
        background: var(--surface-solid); border: 1px solid var(--border);
        border-radius: 10px; color: var(--text);
    }
    .menu-toggle [data-lucide] { width: 18px; height: 18px; }
    .main { padding: 20px 18px 40px; }
    .topbar h1 { font-size: 19px; }
}
@media (max-width: 560px) {
    .stats { grid-template-columns: 1fr; }
    .panel-head, .panel-body, thead th, tbody td { padding-left: 16px; padding-right: 16px; }
    .upload-row { flex-direction: column; align-items: stretch; }
    .date-cell { min-width: 0; }
}

/* ---------- Animations & polish ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fade-up, .row-fade {
    animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--delay, 0ms);
}
.fade-in { animation: fadeIn 0.45s ease both; }

.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.55s ease;
}
.btn-primary:hover::after { transform: translateX(120%); }

.table-wrapper { overflow-x: auto; }
tbody tr.row-fade:hover { transform: translateX(2px); }

.login-card { animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ---------- Nav badge ---------- */
.nav-item { position: relative; z-index: 2; }
.nav-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #a5b4fc;
}

/* ---------- Quota ---------- */
.quota-panel .quota-pct { font-size: 22px; font-weight: 700; color: var(--success); }
.quota-pct.warn { color: var(--warning); }
.quota-pct.danger { color: var(--danger); }
.quota-bar {
    height: 10px; border-radius: 999px;
    background: var(--bg-2); overflow: hidden; margin-bottom: 12px;
}
.quota-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.6s ease;
}
.quota-meta {
    display: flex; flex-wrap: wrap; gap: 16px;
    font-size: 13px; color: var(--text-muted);
}
.quota-meta strong { color: var(--text); }
.quota-warn {
    margin-top: 14px; padding: 10px 14px; border-radius: 10px;
    background: rgba(245,158,11,0.12); color: #fcd34d;
    font-size: 13px; display: flex; align-items: center; gap: 8px;
}

/* ---------- Category grid ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.cat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all 0.18s ease;
}
.cat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px -14px var(--accent-glow);
}
.cat-ico {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--accent-soft); color: #a5b4fc;
    display: grid; place-items: center; margin-bottom: 10px;
}
.cat-ico [data-lucide] { width: 18px; height: 18px; }
.cat-name { font-weight: 600; font-size: 14px; }
.cat-count { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Upload options & form fields ---------- */
.upload-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 16px;
}
.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}
.form-select, .form-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(10, 12, 20, 0.65);
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.form-select:hover, .form-input:hover {
    border-color: var(--border-strong);
    background: rgba(14, 17, 28, 0.75);
}
.form-select:focus, .form-input:focus {
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: rgba(14, 17, 28, 0.85);
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.form-select option {
    background: #161b2b;
    color: var(--text);
    padding: 8px;
}

.field-select {
    position: relative;
    display: flex;
    align-items: center;
}
.field-select .form-select {
    appearance: none;
    -webkit-appearance: none;
    padding-left: 44px;
    padding-right: 40px;
    cursor: pointer;
}
.field-select-ico {
    position: absolute;
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: #a5b4fc;
    pointer-events: none;
    z-index: 1;
}
.field-select-ico [data-lucide] { width: 15px; height: 15px; }
.field-select-ico.cat-image  { background: rgba(59,130,246,0.16); color: #93c5fd; }
.field-select-ico.cat-video  { background: rgba(239,68,68,0.16); color: #fca5a5; }
.field-select-ico.cat-audio  { background: rgba(168,85,247,0.16); color: #d8b4fe; }
.field-select-ico.cat-document { background: rgba(16,185,129,0.16); color: #6ee7b7; }
.field-select-ico.cat-archive { background: rgba(245,158,11,0.16); color: #fcd34d; }
.field-select-ico.cat-code   { background: rgba(99,102,241,0.16); color: #a5b4fc; }
.field-select-ico.cat-other  { background: rgba(139,152,175,0.16); color: #cbd5e1; }
.field-select-arrow {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    pointer-events: none;
    display: inline-flex;
}
.field-select-arrow [data-lucide] { width: 16px; height: 16px; }

.field-input {
    position: relative;
    display: flex;
    align-items: center;
}
.field-input .form-input {
    padding-left: 42px;
}
.field-input-ico {
    position: absolute;
    left: 13px;
    color: var(--text-dim);
    display: inline-flex;
    pointer-events: none;
}
.field-input-ico [data-lucide] { width: 15px; height: 15px; }

.check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; margin-bottom: 8px; }
.check-label input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- Settings limits ---------- */
.limits-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 14px; margin-bottom: 22px;
}
.limit-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
}
.limit-ico {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center; margin-bottom: 12px;
}
.limit-ico.purple { background: var(--accent-soft); color: #a5b4fc; }
.limit-ico.blue { background: rgba(59,130,246,0.16); color: #93c5fd; }
.limit-ico.green { background: var(--success-soft); color: #6ee7b7; }
.limit-ico.amber { background: rgba(245,158,11,0.16); color: #fcd34d; }
.limit-ico [data-lucide] { width: 18px; height: 18px; }
.limit-card h3 { font-size: 14px; margin-bottom: 4px; }
.limit-val { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.limit-desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-row { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-text { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.info-text code { background: var(--bg-2); padding: 2px 6px; border-radius: 6px; font-size: 12px; color: #a5b4fc; }

@media (max-width: 980px) {
    .limits-grid { grid-template-columns: repeat(2, 1fr); }
    .upload-options { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .limits-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .fade-up, .row-fade, .fade-in, .login-card { animation: none; }
    .stat-card:hover { transform: none; }
}
