/* PurePixel Pro — shared theme (dark, cyan accent) */
:root {
    /* Softer dark: slate instead of near-black, off-white text (less glare),
       brighter secondary text and visible card edges. */
    --bg: #1A2130;
    --bg-elev: #1F2737;
    --card: #252E40;
    --border: #3A4660;
    --border-strong: #4D5B78;
    --text: #E6EAF1;
    --text-muted: #B4BED0;
    --accent: #06B6D4;
    --accent-hover: #22D3EE;
    --on-accent: #062A33;
    --on-danger: #2B0B0B;
    --on-warning: #2B1D00;
    --accent-glow: rgba(6, 182, 212, 0.22);
    --accent-soft: rgba(6, 182, 212, 0.14);
    --success: #34D399;
    --success-soft: rgba(52, 211, 153, 0.14);
    --warning: #FBBF24;
    --warning-soft: rgba(251, 191, 36, 0.14);
    --danger: #F87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* theme-dependent details */
    --hover-bg: rgba(255, 255, 255, 0.07);
    --hover-text: #FFFFFF;
    --subtle-bg: rgba(255, 255, 255, 0.03);
    --surface-2: #2C3649;
    --surface-img: #252E40;
    --checker-a: #2F3A4F;
    --checker-b: #252E40;
    --hero-a: #252E40;
    --hero-b: #1A2130;
    --body-text: #D5DCE6;
    --code-text: #F9A8D4;
    --success-text: #86EFAC;
    --danger-text: #FCA5A5;
    --warning-text: #FDE68A;
    --info-text: #A5C8FD;
    --shadow: rgba(0, 0, 0, 0.25);
    color-scheme: dark;
}

/* Light theme: chosen with the sun/moon switch (saved per browser). */
:root[data-theme="light"] {
    --bg: #F1F5F9;
    --bg-elev: #F8FAFC;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;
    --text: #0F172A;
    --text-muted: #64748B;
    --accent: #0E7490;
    --accent-hover: #155E75;
    --on-accent: #FFFFFF;
    --on-danger: #FFFFFF;
    --on-warning: #FFFFFF;
    --accent-glow: rgba(14, 116, 144, 0.22);
    --accent-soft: rgba(14, 116, 144, 0.09);
    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.09);
    --warning: #D97706;
    --warning-soft: rgba(217, 119, 6, 0.1);
    --danger: #DC2626;
    --danger-soft: rgba(220, 38, 38, 0.08);
    --hover-bg: rgba(15, 23, 42, 0.05);
    --hover-text: #0F172A;
    --subtle-bg: rgba(15, 23, 42, 0.02);
    --surface-2: #F1F5F9;
    --surface-img: #F8FAFC;
    --checker-a: #E2E8F0;
    --checker-b: #FFFFFF;
    --hero-a: #FFFFFF;
    --hero-b: #ECFEFF;
    --body-text: #334155;
    --code-text: #BE185D;
    --success-text: #047857;
    --danger-text: #B91C1C;
    --warning-text: #B45309;
    --info-text: #1D4ED8;
    --shadow: rgba(15, 23, 42, 0.08);
    color-scheme: light;
}

/* Theme switch button */
.theme-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; margin-bottom: 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition); }
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle i { width: 18px; text-align: center; }
.theme-toggle.icon-only { width: auto; margin: 0; padding: 7px 10px; }
.theme-float { position: fixed; top: 16px; right: 16px; z-index: 50; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
img { max-width: 100%; }

/* ---------- App layout (sidebar + main) ---------- */
body.app-layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; text-decoration: none; color: var(--text); }
.brand-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 18px; letter-spacing: -0.5px; }
.brand-text span { font-size: 11px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.nav-group { margin-bottom: 26px; }
.nav-bottom { margin-top: auto; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 12px; display: block; font-weight: 700; }
.nav-item {
    padding: 11px 14px; border-radius: 10px; text-decoration: none; color: var(--text-muted);
    margin-bottom: 4px; display: flex; align-items: center; gap: 12px; transition: var(--transition);
    font-weight: 500; font-size: 14px;
}
.nav-item i { width: 18px; text-align: center; }
.nav-item:hover { background: var(--hover-bg); color: var(--hover-text); }
.nav-item.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 12px var(--accent-glow); }
.nav-sub { padding: 8px 14px; font-size: 13px; }
.nav-sub.active { background: var(--accent-soft); color: var(--accent); box-shadow: none; font-weight: 700; }

.nav-user { padding-top: 16px; border-top: 1px solid var(--border); }
.user-chip { display: flex; flex-direction: column; padding: 0 14px 12px; }
.user-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.nav-logout { color: var(--danger); background: var(--danger-soft); border: 1px solid rgba(239, 68, 68, 0.2); margin: 0; }
.nav-logout:hover { background: var(--danger); color: var(--on-danger); }

.main-container { flex: 1; overflow-y: auto; padding: 40px 56px; min-width: 0; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-header h1, .page-header h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin: 0; }
.page-header h1 span, .page-header h2 span { color: var(--accent); }
.page-header p { color: var(--text-muted); margin: 6px 0 0; }

/* ---------- Cards, text ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.card + .card { margin-top: 24px; }
.card h2, .card h3 { margin-top: 0; }
.card.narrow { max-width: 560px; margin: 40px auto; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, 'SF Mono', Monaco, Consolas, monospace; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-weight: 600; font-size: 14px; border: 1px solid; }
.alert-success { background: var(--success-soft); border-color: rgba(16, 185, 129, 0.3); color: var(--success-text); }
.alert-error { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.3); color: var(--danger-text); }
.alert-warning { background: var(--warning-soft); border-color: rgba(245, 158, 11, 0.3); color: var(--warning-text); }
.alert-info { background: var(--accent-soft); border-color: rgba(6, 182, 212, 0.3); color: var(--text); }

/* ---------- Forms ---------- */
label, .label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; display: block; margin-bottom: 7px; letter-spacing: 0.5px; }
.form-control, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="file"], select, textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--border); background: var(--bg);
    color: var(--text); border-radius: 10px; font: inherit; font-size: 14px; transition: var(--transition);
}
.form-control:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-group { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; font: inherit; font-size: 14px; font-weight: 700; border-radius: 10px;
    border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: var(--transition);
    background: var(--card); color: var(--text); white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px var(--accent-glow); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-warning { border-color: rgba(245, 158, 11, 0.4); }
.btn-warning:hover { background: var(--warning); border-color: var(--warning); color: var(--on-warning); }
.btn-danger { border-color: rgba(239, 68, 68, 0.4); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; flex: 1; border-color: var(--border); color: var(--text-muted); background: var(--bg); font-size: 12px; }
.btn-icon:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-icon.danger:hover { background: var(--danger); border-color: var(--danger); }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--text-muted); font: inherit; cursor: pointer; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:hover { background: rgba(6, 182, 212, 0.03); }
.text-strong { font-weight: 700; }
.text-sub { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid; }
.badge-ok { background: var(--success-soft); border-color: rgba(16, 185, 129, 0.3); color: var(--success-text); }
.badge-warn { background: var(--warning-soft); border-color: rgba(245, 158, 11, 0.3); color: var(--warning-text); }
.badge-accent { background: var(--accent-soft); border-color: rgba(6, 182, 212, 0.3); color: var(--accent); }

.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--accent), #3B82F6); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex-shrink: 0; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.avatar-cell { display: flex; align-items: center; gap: 14px; }

/* ---------- Modals ---------- */
.modal { display: none; position: fixed; inset: 0; background: rgba(11, 17, 32, 0.85); backdrop-filter: blur(5px); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal.active { display: flex; }
.modal-content { background: var(--card); padding: 36px; border-radius: 24px; width: 100%; max-width: 1000px; max-height: 92vh; overflow-y: auto; position: relative; border: 1px solid var(--border); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6); }
.modal-close { position: absolute; top: 18px; right: 20px; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--accent); }
hr { border: 0; height: 1px; background: var(--border); margin: 26px 0; }

/* ---------- Asset managers (brand & badge) ---------- */
.layout-grid { display: grid; grid-template-columns: 340px 1fr; gap: 36px; align-items: start; }
.sticky { position: sticky; top: 0; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.logo-card { background: var(--card); border-radius: 16px; border: 1px solid var(--border); overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; }
.logo-card:hover { transform: translateY(-3px); box-shadow: 0 12px 20px var(--shadow); border-color: var(--accent); }
.checker {
    background-color: var(--checker-b);
    background-image: linear-gradient(45deg, var(--checker-a) 25%, transparent 25%), linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--checker-a) 75%), linear-gradient(-45deg, transparent 75%, var(--checker-a) 75%);
    background-size: 10px 10px; background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}
.logo-display { height: 140px; display: flex; align-items: center; justify-content: center; padding: 18px; }
.logo-display img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-display.photo-display { padding: 0; }
.logo-display.photo-display img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.preview-box.photo-display { height: 200px; overflow: hidden; }
.logo-info { padding: 14px; border-top: 1px solid var(--border); }
.logo-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 12px; }
.logo-actions { display: flex; gap: 8px; }
.logo-actions form { flex: 1; display: flex; }
.logo-actions .btn-icon { width: 100%; }
.preview-box { border: 1px solid var(--border); border-radius: 10px; height: 110px; margin-bottom: 18px; }
.empty-state { grid-column: 1 / -1; padding: 80px 20px; text-align: center; color: var(--text-muted); border: 2px dashed var(--border); border-radius: 16px; }
.empty-state i { font-size: 40px; opacity: 0.3; margin-bottom: 14px; display: block; }

/* ---------- Toggle switch ---------- */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; flex-shrink: 0; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-strong); transition: .25s; border-radius: 34px; }
.slider::before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; transition: .25s; border-radius: 50%; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--accent-glow); }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }

/* ---------- Auth pages (login, setup) ---------- */
body.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--card); padding: 48px 40px; border-radius: 24px; border: 1px solid var(--border); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); width: 100%; max-width: 440px; text-align: center; }
.auth-card .auth-logo { width: 84px; height: 84px; object-fit: contain; margin: 0 auto 18px; display: block; border-radius: 18px; }
.auth-card h1 { font-size: 28px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.5px; }
.auth-card h1 span { color: var(--accent); }
.auth-card .subtitle { color: var(--text-muted); margin: 0 0 28px; font-size: 15px; }
.auth-card form { text-align: left; }
.auth-card .btn { width: 100%; border-radius: 50px; padding: 14px; font-size: 15px; margin-top: 6px; }
.otp-input { text-align: center; letter-spacing: 0.5em; font-size: 24px !important; font-weight: 800; }
.qr-box { background: #fff; border-radius: 16px; padding: 10px; width: 200px; height: 200px; margin: 0 auto 16px; }
.qr-box img { width: 100%; height: 100%; display: block; }
.manual-code { font-size: 13px; background: var(--accent-soft); border: 1px solid rgba(6, 182, 212, 0.25); padding: 10px; border-radius: 8px; margin-bottom: 22px; word-break: break-all; text-align: center; }
.auth-footer { margin-top: 20px; font-size: 14px; }
.auth-card form.auth-footer { text-align: center; }
.auth-footer a, .auth-footer button { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.auth-footer a:hover, .auth-footer button:hover { color: var(--accent); }

/* ---------- Dashboard ---------- */
.hero { background: linear-gradient(145deg, var(--hero-a), var(--hero-b)); border: 1px solid var(--border); border-radius: 24px; padding: 36px; display: flex; align-items: center; gap: 36px; margin-bottom: 28px; box-shadow: 0 20px 40px var(--shadow); }
.hero img { width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 0 20px var(--accent-glow)); flex-shrink: 0; }
.hero h1 { font-size: 32px; margin: 0 0 8px; font-weight: 800; letter-spacing: -1px; }
.hero p { font-size: 17px; color: var(--text-muted); margin: 0; max-width: 560px; }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.recent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.thumb { aspect-ratio: 1 / 1; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); padding: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb-label { font-size: 12px; margin: 8px 0 0; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.quick-link { background: var(--bg); border: 1px solid var(--border); color: var(--text); font-weight: 600; padding: 12px 14px; text-decoration: none; border-radius: 10px; display: flex; gap: 10px; align-items: center; transition: var(--transition); }
.quick-link:hover { border-color: var(--accent); }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 18px; }
.section-title h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.tip { margin-top: 24px; padding: 16px 22px; background: var(--card); border-radius: 16px; border: 1px solid var(--border); display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--text-muted); }
.tip-icon { background: var(--warning-soft); padding: 8px 10px; border-radius: 8px; color: var(--warning); }

/* ---------- Gallery ---------- */
.gallery-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 40px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 10; }
.gallery-body { padding: 36px 40px; }
.search-form { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0 6px 0 12px; }
.search-form input { border: none; background: transparent; width: 220px; padding: 9px 4px; box-shadow: none !important; }
.search-form button { background: none; border: none; color: var(--accent); cursor: pointer; padding: 8px; }
.recent-hero { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 26px; margin-bottom: 40px; display: flex; align-items: center; gap: 32px; }
.recent-hero .thumb { width: 170px; height: 170px; cursor: zoom-in; flex-shrink: 0; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; list-style: none; padding: 0; margin: 0; }
.asset-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 12px var(--shadow); }
.asset-card .asset-image { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 6%; cursor: zoom-in; position: relative; background: var(--surface-img); }
.asset-card .asset-image img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.asset-meta { padding: 14px 16px; }
.asset-folder { font-size: 12px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.asset-title { font-size: 15px; font-weight: 600; margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-operator { font-size: 12px; color: var(--success); }
.asset-actions { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px dashed var(--border); }
.asset-actions .icons { display: flex; gap: 14px; }
.icon-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 15px; padding: 2px; text-decoration: none; }
.icon-btn.danger { color: var(--danger); }
.lightbox { display: none; position: fixed; z-index: 2000; inset: 0; background: rgba(11, 17, 32, 0.95); justify-content: center; align-items: center; cursor: zoom-out; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 12px; background: var(--card); }

/* ---------- Profile (personnel) ---------- */
.profile-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
.profile-section { background: var(--bg); padding: 22px; border-radius: 16px; border: 1px solid var(--border); }
.profile-section h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.data-row { margin-bottom: 14px; }
.data-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.data-value { font-size: 15px; font-weight: 600; }
.accordion { margin-bottom: 10px; }
.accordion summary { background: var(--bg); padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; font-weight: 600; cursor: pointer; list-style: none; font-size: 14px; display: flex; justify-content: space-between; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; color: var(--text-muted); }
.accordion[open] summary::after { content: '−'; }
.accordion[open] summary { border-radius: 12px 12px 0 0; }
.accordion summary:hover { border-color: var(--accent); }
.accordion-body { padding: 18px; border: 1px solid var(--border); border-top: none; border-radius: 0 0 12px 12px; background: var(--subtle-bg); }
.row-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.toast-container { position: fixed; bottom: 28px; right: 28px; z-index: 9999; }
.toast { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 14px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); min-width: 300px; transform: translateX(130%); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.toast.show { transform: translateX(0); }
.toast.failed { border-left-color: var(--danger); }
.toast strong { display: block; }

/* ---------- Guide (tutorial) ---------- */
.guide-section { background: var(--card); padding: 40px; border-radius: 20px; border: 1px solid var(--border); margin-bottom: 32px; }
.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.guide-section h3 { font-size: 22px; font-weight: 800; margin: 0 0 16px; display: flex; align-items: center; gap: 12px; }
.guide-section h3 i { color: var(--accent); width: 28px; }
.guide-section h4 { margin: 24px 0 10px; }
.guide-section p, .guide-section li { color: var(--body-text); line-height: 1.7; }
.golden-rule { background: linear-gradient(135deg, var(--bg-elev), var(--surface-2)); padding: 26px; border-radius: 16px; margin: 24px 0; border-left: 6px solid var(--accent); }
.highlight-box { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 20px 24px; border-radius: 8px; margin: 20px 0; }
.success-box { background: var(--success-soft); border-left: 4px solid var(--success); padding: 20px 24px; border-radius: 8px; margin: 20px 0; }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { margin-bottom: 16px; display: flex; gap: 14px; }
.feature-list li > i { margin-top: 6px; color: var(--success); font-size: 13px; }
.kb-key { background: var(--bg); border: 1px solid var(--border-strong); padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; box-shadow: 0 2px 0 var(--border-strong); margin: 0 2px; white-space: nowrap; color: var(--text); }
.guide-section code { background: var(--bg); padding: 2px 6px; border-radius: 4px; color: var(--code-text); font-size: 0.9em; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin: 24px 0; }
.shortcut-card { background: var(--bg); padding: 20px; border-radius: 12px; border: 1px solid var(--border); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .layout-grid, .dash-grid, .profile-layout, .intro-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .main-container { padding: 28px; }
}
@media (max-width: 760px) {
    body.app-layout { flex-direction: column; height: auto; overflow: visible; }
    .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
    .nav-bottom { margin-top: 0; }
    .main-container { padding: 20px 16px; overflow: visible; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .hero { flex-direction: column; text-align: center; padding: 24px; }
    .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-header, .gallery-body { padding-left: 16px; padding-right: 16px; }
    .recent-hero { flex-direction: column; }
    .search-form input { width: 140px; }
}

/* Sign-in: choose authenticator app or email codes */
.method-choice { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.method-option { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; transition: var(--transition); }
.method-option:hover:not(:disabled), .method-option:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.method-option:disabled { opacity: .55; cursor: not-allowed; }
.method-option > i { font-size: 22px; color: var(--accent); margin-top: 2px; width: 24px; text-align: center; }
.method-option small { color: var(--text-muted); line-height: 1.45; display: inline-block; margin-top: 4px; }
.method-option em.badge { font-style: normal; margin-left: 6px; vertical-align: 1px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* Roster: switch two-step method */
.mfa-switch { margin-top: 16px; }
.mfa-switch label { display: block; margin-bottom: 6px; }
.mfa-switch-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mfa-switch-row select { width: auto; min-width: 200px; }

/* Gallery: counts, storage, selection */
.nav-sub { display: flex; align-items: center; gap: 10px; }
.nav-sub .nav-sub-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--subtle-bg); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.storage-box { margin: 6px 0 22px; padding: 0 2px; }
.storage-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 14px; }
.storage-line strong { color: var(--text); }
.storage-bar { height: 6px; margin: 8px 14px 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.storage-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.gallery-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 16px; }
.gallery-toolbar .check { margin: 0 !important; }
.dl-format { display: inline-flex; align-items: center; gap: 8px; margin: 0 !important; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.dl-format select { width: auto; padding: 7px 28px 7px 10px; font-size: 13px; }
.asset-card { position: relative; }
.asset-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.asset-select { position: absolute; top: 10px; left: 10px; z-index: 2; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    background: rgba(17, 24, 39, 0.75); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; margin: 0 !important; opacity: .75; transition: var(--transition); }
.asset-card:hover .asset-select, .asset-card.selected .asset-select, .asset-select:focus-within { opacity: 1; }
.asset-select input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.asset-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.asset-size { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.bulk-bar { position: sticky; bottom: 16px; z-index: 50; margin: 0 40px 16px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 12px 18px; background: var(--card); border: 1px solid var(--accent); border-radius: 14px; box-shadow: 0 12px 30px var(--shadow); font-weight: 700; }
.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) { .bulk-bar { margin: 0 16px 16px; } }
.recent-hero .thumb img { width: 100%; height: 100%; object-fit: contain; }

/* Gallery: consistency check */
.toolbar-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn-xs { padding: 5px 10px; font-size: 11px; border-radius: 6px; }
.cc-banner { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; padding: 14px 18px;
    border-radius: 14px; border: 1px solid var(--warning); background: var(--warning-soft); }
.cc-banner.all-good { border-color: var(--success); background: var(--success-soft); }
.cc-banner-text { display: flex; flex-direction: column; gap: 3px; }
.cc-banner-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-banner-actions .check { margin: 0 !important; }
.asset-card.cc-flagged { border-color: var(--warning); box-shadow: 0 0 0 2px var(--warning-soft); }
.asset-card.cc-ok .asset-image::after { content: "\2713"; position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--success); color: #fff; font-size: 14px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.cc-result { margin-top: 10px; font-size: 12px; }
.cc-result ul { margin: 0 0 8px; padding-left: 16px; color: var(--warning-text); line-height: 1.45; }
.cc-result li { margin-bottom: 3px; }
.cc-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cc-note { color: var(--success-text); }

/* About page */
.about-hero { display: flex; align-items: center; gap: 32px; margin-bottom: 28px; flex-wrap: wrap; }
.about-video { width: min(360px, 100%); aspect-ratio: 16 / 9; border-radius: 18px; object-fit: cover; background: #05070a; box-shadow: 0 12px 30px var(--shadow); flex-shrink: 0; }
.about-hero h1 { margin: 0 0 4px; font-size: 38px; font-weight: 900; letter-spacing: -1px; }
.about-hero h1 span { color: var(--accent); }
.about-tagline { margin: 0 0 12px; font-size: 17px; color: var(--body-text); }
.about-meta { margin: 0 0 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.about-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.about-features .card { padding: 20px; margin: 0; }
.about-grid .card, .about-side .card { margin: 0; }
.about-features i { font-size: 22px; color: var(--accent); }
.about-features h3 { margin: 10px 0 6px; font-size: 16px; }
.about-features p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.about-side { display: flex; flex-direction: column; gap: 20px; }
.about-h2 { font-size: 18px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.about-h2 i { color: var(--accent); }
.release { padding: 12px 0; border-top: 1px solid var(--border); }
.release:first-of-type { border-top: 0; padding-top: 0; }
.release-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.release ul { margin: 0; padding-left: 18px; color: var(--body-text); line-height: 1.55; font-size: 14px; }
.release li { margin-bottom: 4px; }
.sysinfo { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.sysinfo dt { color: var(--text-muted); font-weight: 600; }
.sysinfo dd { margin: 0; overflow-wrap: anywhere; }
.sysinfo dd.warn { color: var(--warning-text); font-weight: 700; }
.credits { list-style: none; margin: 0; padding: 0; }
.credits li { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.credits li:first-child { border-top: 0; }
.credits a { font-weight: 700; text-decoration: none; }
.about-foot { margin: 26px 0 0; text-align: center; }
@media (max-width: 1000px) { .about-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .sysinfo { grid-template-columns: 1fr; } .sysinfo dd { margin-bottom: 6px; } }

/* Gallery: drop zone */
.drop-zone { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; padding: 16px 18px;
    border: 2px dashed var(--border); border-radius: 14px; background: var(--card); transition: border-color .15s, background .15s; }
.drop-zone .drop-icon { font-size: 26px; color: var(--accent); }
.drop-zone .drop-text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 4px; line-height: 1.45; }
.drop-zone .drop-status:empty { display: none; }
.drop-zone .drop-status { color: var(--accent); font-weight: 700; }
.drop-zone .drop-status.bad { color: var(--danger, #e5484d); }
body.dragging-files .drop-zone { border-color: var(--accent); }
.drop-zone.drop-hover { border-color: var(--accent); border-style: solid; background: var(--accent-soft, rgba(6, 182, 212, .08)); }
body.dragging-files .nav-sub[data-drop-folder] { outline: 1px dashed var(--accent); outline-offset: -3px; }
.nav-sub.drop-hover { background: var(--accent-soft, rgba(6, 182, 212, .15)) !important; outline-style: solid !important; }
