/* ========================================================================
   DropZone — Premium Dark UI
   Design: Glassmorphism + Gradient Accents + Micro-animations
   ======================================================================== */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --brand-from:      #6366f1;
    --brand-to:        #8b5cf6;
    --brand-gradient:  linear-gradient(135deg, var(--brand-from), var(--brand-to));
    --brand-mid:       #7c3aed;
    --brand-glow:      rgba(99, 102, 241, 0.35);

    /* Background */
    --bg-base:         #0a0a14;
    --bg-surface:      #111128;
    --bg-elevated:     #181833;

    /* Glass */
    --glass-bg:        rgba(255, 255, 255, 0.04);
    --glass-border:    rgba(255, 255, 255, 0.08);
    --glass-shadow:    0 8px 32px rgba(0, 0, 0, 0.4);

    /* Text */
    --text-primary:    #f1f1f8;
    --text-secondary:  #9999bb;
    --text-muted:      #55557a;

    /* Status */
    --success:         #22d3a0;
    --success-dim:     rgba(34, 211, 160, 0.15);
    --error:           #f87171;
    --error-dim:       rgba(248, 113, 113, 0.15);
    --warning:         #fbbf24;

    /* Border */
    --border:          rgba(255, 255, 255, 0.06);
    --border-hover:    rgba(99, 102, 241, 0.5);

    /* Sizing */
    --radius-sm:       8px;
    --radius-md:       12px;
    --radius-lg:       20px;
    --radius-xl:       28px;

    /* Transitions */
    --ease-out:        cubic-bezier(0.22, 1, 0.36, 1);
    --transition-base: 220ms var(--ease-out);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-base);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.6); }

/* ── Glass Utility ──────────────────────────────────────────────────────── */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* ── Background Animated Orbs ───────────────────────────────────────────── */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 12s ease-in-out infinite alternate;
}
.bg-orb-1 {
    width: 560px; height: 560px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -120px; left: -160px;
    animation-duration: 14s;
}
.bg-orb-2 {
    width: 480px; height: 480px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -100px; right: -120px;
    animation-duration: 18s;
    animation-delay: -6s;
}
.bg-orb-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #4f46e5, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 22s;
    animation-delay: -3s;
}
@keyframes orbFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, 20px) scale(1.08); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(99,102,241,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 80% 80%, rgba(139,92,246,0.15) 0%, transparent 60%),
        var(--bg-base);
    overflow: hidden;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 24px;
    display: flex;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    animation: fadeSlideUp 0.5s var(--ease-out) both;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Brand */
.login-brand {
    text-align: center;
    margin-bottom: 36px;
}
.brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    filter: drop-shadow(0 0 20px var(--brand-glow));
    animation: iconBob 3s ease-in-out infinite;
}
@keyframes iconBob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-5px); }
}
.brand-name {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a5b4fc, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand-tagline {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    animation: fadeSlideUp 0.3s var(--ease-out) both;
}
.alert-icon { width: 18px; height: 18px; flex-shrink: 0; }
.alert-error {
    background: var(--error-dim);
    border: 1px solid rgba(248,113,113,0.25);
    color: var(--error);
}

/* Form */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.input-wrapper { position: relative; }
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-base);
}
.form-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
    outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
    border-color: var(--brand-from);
    background: rgba(99,102,241,0.06);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon { color: var(--brand-from); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.45);
    filter: brightness(1.08);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary.loading { opacity: 0.7; pointer-events: none; }

.btn-ghost {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border-color: var(--glass-border);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.09);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.14);
}

.btn-danger {
    background: rgba(248,113,113,0.15);
    color: var(--error);
    border-color: rgba(248,113,113,0.3);
}
.btn-danger:hover {
    background: rgba(248,113,113,0.25);
    border-color: rgba(248,113,113,0.5);
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}
.btn-icon svg { width: 16px; height: 16px; }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-arrow { width: 16px; height: 16px; transition: transform var(--transition-base); }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.app-body {
    background:
        radial-gradient(ellipse 70% 50% at 10% 10%, rgba(99,102,241,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 90% 90%, rgba(139,92,246,0.10) 0%, transparent 60%),
        var(--bg-base);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-logo { width: 32px; height: 32px; }
.nav-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #a5b4fc, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.user-icon { width: 18px; height: 18px; }
.settings-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--glass-border);
}
.settings-tab {
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
}
.settings-tab.is-active {
    border-bottom-color: var(--brand-from);
    color: var(--text-primary);
}
.settings-tab-panel[hidden] { display: none; }
.totp-setup { display: grid; gap: 16px; max-width: 360px; }
.totp-qr { width: 220px; height: 220px; background: #fff; padding: 10px; border-radius: 8px; }
.totp-form { display: grid; gap: 10px; }
.totp-form .form-label { margin-bottom: 0; }
.totp-code-input {
    padding: 12px 14px;
    text-align: center;
    letter-spacing: 0.25em;
    font-variant-numeric: tabular-nums;
}
.totp-form .btn { justify-self: start; }
.totp-enabled-state {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(74, 222, 128, 0.28);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.12), rgba(34, 197, 94, 0.04));
}
.totp-enabled-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.16);
}
.totp-enabled-icon svg { width: 24px; height: 24px; }
.totp-enabled-title { color: var(--text-primary); font-weight: 600; }
.totp-enabled-desc { margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; }
.totp-disable-form {
    margin: 0 0 0 auto;
}
.totp-disable-confirm { display: grid; gap: 8px; min-width: 170px; }
.totp-disable-confirm .form-label { margin-bottom: 0; }
.totp-disable-confirm .totp-code-input { width: 170px; padding: 8px; }
.totp-disable-form .btn { color: var(--error); }
.logout-username {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-right: 4px;
    border-right: 1px solid var(--glass-border);
}
.language-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}
.language-picker select {
    padding: 7px 9px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font: inherit;
}

/* Main */
.app-main {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* Section */
.section {}
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}
.section-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--text-primary);
}
.section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Drop Zone ──────────────────────────────────────────────────────────── */
.dropzone {
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    border: 2px dashed var(--glass-border);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dropzone:hover,
.dropzone:focus-visible {
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.05);
    box-shadow: 0 0 0 1px rgba(99,102,241,0.2), var(--glass-shadow);
    outline: none;
}
.dropzone.is-over {
    border-color: var(--brand-from);
    border-style: solid;
    background: rgba(99,102,241,0.12);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.35), 0 0 60px rgba(99,102,241,0.25);
    transform: scale(1.01);
}

.dropzone-idle { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone-hover { display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
[hidden] { display: none !important; }

.dz-icon-wrap {
    margin-bottom: 8px;
    animation: iconBob 4s ease-in-out infinite;
}
.dz-icon { width: 72px; height: 72px; }

.dz-primary-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.dz-secondary-text {
    font-size: 14px;
    color: var(--text-secondary);
}
.dz-browse-btn {
    background: none;
    border: none;
    color: #a5b4fc;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(165,180,252,0.4);
    text-underline-offset: 3px;
    transition: color var(--transition-base);
}
.dz-browse-btn:hover { color: #c4b5fd; }
.dz-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Hover state */
.dz-pulse-ring {
    position: absolute;
    width: 120px; height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(165,180,252,0.4);
    animation: pulse 1.5s ease-out infinite;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
@keyframes pulse {
    0%   { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2);   opacity: 0; }
}
.dz-hover-icon { width: 56px; height: 56px; }
.dz-hover-text { font-size: 18px; font-weight: 600; color: #a5b4fc; }

/* ── Upload Queue ───────────────────────────────────────────────────────── */
.upload-queue {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    animation: fadeSlideUp 0.3s var(--ease-out) both;
}
.upload-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.upload-item-status {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.status-uploading { color: #a5b4fc; }
.status-done      { color: var(--success); }
.status-error     { color: var(--error); }

.progress-bar-wrap {
    grid-column: 1 / -1;
    height: 4px;
    background: rgba(255,255,255,0.07);
    border-radius: 2px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 2px;
    transition: width 0.15s linear;
    width: 0%;
}

/* ── File Table ─────────────────────────────────────────────────────────── */
.table-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.files-table thead {
    background: rgba(255,255,255,0.03);
}
.files-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.files-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}
.files-table tbody tr {
    transition: background var(--transition-base);
    cursor: copy;
}
.files-table tbody tr:last-child td { border-bottom: none; }
.files-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.td-name {
    color: var(--text-primary) !important;
    font-weight: 500;
    max-width: 420px;
}
.td-name-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}
.file-icon {
    width: 32px; height: 32px;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.file-icon svg { width: 16px; height: 16px; color: #a5b4fc; }
.td-filename {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}
.td-filesize {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Countdown Badges */
.td-countdown {
    white-space: nowrap;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums;
}
.badge-timer {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
}
.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
    animation: pulseWarning 2s infinite ease-in-out;
}
@keyframes pulseWarning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.badge-expired {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.3);
}
.badge-muted {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.td-actions {
    white-space: nowrap;
}
.action-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-download {
    background: rgba(99,102,241,0.12);
    color: #a5b4fc;
    border-color: rgba(99,102,241,0.25);
}
.btn-download:hover {
    background: rgba(99,102,241,0.22);
    border-color: rgba(99,102,241,0.5);
    color: #c4b5fd;
}

.btn-delete {
    background: rgba(248,113,113,0.08);
    color: var(--error);
    border-color: rgba(248,113,113,0.2);
}
.btn-delete:hover {
    background: rgba(248,113,113,0.18);
    border-color: rgba(248,113,113,0.4);
}

/* Empty & Loading states */
.table-loading,
.table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 24px;
    color: var(--text-muted);
    font-size: 14px;
}
.table-empty svg { width: 48px; height: 48px; opacity: 0.3; }
.lockouts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 220px;
    padding: 32px 24px;
    text-align: center;
}
.lockouts-empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 8px;
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 50%;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
}
.lockouts-empty-icon svg { width: 30px; height: 30px; }
.lockouts-empty h2 { margin: 0; color: var(--text-primary); font-size: 18px; }
.lockouts-empty p { margin: 0; color: var(--text-secondary); font-size: 13px; }

.spinner {
    width: 28px; height: 28px;
    border: 3px solid rgba(99,102,241,0.15);
    border-top-color: var(--brand-from);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    text-align: center;
    animation: fadeSlideUp 0.25s var(--ease-out) both;
}
.modal-icon {
    width: 56px; height: 56px;
    background: var(--error-dim);
    border: 1px solid rgba(248,113,113,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.modal-icon svg { width: 26px; height: 26px; color: var(--error); }
.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.modal-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}
.modal-body strong { color: var(--text-primary); }
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.modal-actions .btn { flex: 1; }

/* ── Toast Notifications ────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    animation: toastIn 0.3s var(--ease-out) both;
    pointer-events: all;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(24px) scale(0.95); }
}
.toast-success {
    background: rgba(22,211,160,0.12);
    border: 1px solid rgba(34,211,160,0.3);
}
.toast-error {
    background: rgba(248,113,113,0.12);
    border: 1px solid rgba(248,113,113,0.3);
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success svg { color: var(--success); }
.toast-error svg   { color: var(--error); }

/* ── Settings Page ───────────────────────────────────────────────────────── */
.nav-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.settings-card {
    border-radius: var(--radius-xl);
    padding: 32px;
}
.settings-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.settings-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 24px;
}
.settings-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

/* Preset Cards Grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}
.theme-preset-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}
.theme-preset-card:hover {
    border-color: var(--brand-from);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.preset-swatch {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}
.swatch-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.preset-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Custom Color Pickers */
.color-pickers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
.color-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    gap: 20px;
}
.color-picker-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.color-picker-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.color-picker-desc {
    font-size: 12px;
    color: var(--text-muted);
}
.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.color-picker-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: none;
}
.color-picker-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-input::-webkit-color-swatch {
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.color-hex-text {
    font-size: 13px;
    font-family: monospace;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 64px;
}

/* Live Preview Stage */
.preview-stage {
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.preview-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}
.preview-dropzone {
    border: 2px dashed var(--brand-from);
    background: rgba(99,102,241,0.06);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.preview-table-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .navbar { padding: 0 16px; }
    .app-main { padding: 24px 16px 60px; }
    .dropzone { padding: 40px 20px; }
    .login-card { padding: 36px 24px; }
    .files-table th:nth-child(1),
    .files-table td:nth-child(1) { display: none; }
    .modal { padding: 28px 20px; }
    .logout-username { display: none; }
    .color-picker-item { flex-direction: column; align-items: flex-start; }
    .totp-enabled-state { flex-wrap: wrap; }
    .totp-disable-form { flex-basis: 100%; margin-left: 56px; }
    .totp-disable-confirm .totp-code-input { width: 100%; }
}
