/* ============ FTP CCTV Backup — Glassmorphic, two-tone (navy dark / airy light) ============ */

:root, :root[data-theme="dark"] {
  --bg-grad: linear-gradient(160deg, #060b1d 0%, #0a1430 55%, #0d1a42 100%);
  --orb-a: radial-gradient(circle, #2c56c0, transparent 65%);
  --orb-b: radial-gradient(circle, #4231a8, transparent 65%);
  --orb-c: radial-gradient(circle, #14539c, transparent 65%);
  --orb-opacity: .28;

  --card-grad: linear-gradient(150deg, rgba(168, 196, 255, .08), rgba(120, 150, 230, .03) 45%, rgba(148, 178, 255, .05));
  --glass: rgba(148, 178, 255, .06);
  --glass-2: rgba(148, 178, 255, .10);
  --stroke: rgba(160, 190, 255, .14);
  --stroke-soft: rgba(160, 190, 255, .07);
  --shadow: 0 18px 40px rgba(3, 8, 25, .45), inset 0 1px 0 rgba(210, 226, 255, .10);
  --shadow-pop: 0 22px 48px rgba(3, 8, 25, .55), inset 0 1px 0 rgba(210, 226, 255, .10);

  --ink: #edf2ff;
  --ink-2: #a8b6dd;
  --ink-3: #64749c;
  --accent: #6c9fff;
  --series: #5b8def;            /* chart marks — validated vs #101A35 */

  --good: #34d399; --warn: #fbbf24; --serious: #fb923c; --crit: #f87171;
  --danger-ink: #ff9b9b;

  --input-bg: rgba(8, 16, 40, .55);
  --inset-bg: rgba(8, 16, 40, .40);
  --track-bg: rgba(8, 16, 40, .65);
  --thumb-bg: rgba(5, 10, 28, .60);
  --hover-bg: rgba(148, 178, 255, .05);
  --tip-bg: rgba(10, 18, 44, .96);
  --backdrop: rgba(3, 7, 20, .66);
  --avatar-grad: linear-gradient(140deg, #35538f, #22345e);
  --avatar-ink: #cfe0ff;
  --focus-ring: rgba(108, 159, 255, .45);
}

:root[data-theme="light"] {
  --bg-grad: linear-gradient(160deg, #e9eef9 0%, #f4f7fd 55%, #e8effc 100%);
  --orb-a: radial-gradient(circle, #9ab8f5, transparent 65%);
  --orb-b: radial-gradient(circle, #b8a9f2, transparent 65%);
  --orb-c: radial-gradient(circle, #8fc0ef, transparent 65%);
  --orb-opacity: .30;

  --card-grad: linear-gradient(150deg, rgba(255, 255, 255, .84), rgba(255, 255, 255, .58));
  --glass: rgba(59, 102, 214, .05);
  --glass-2: rgba(59, 102, 214, .09);
  --stroke: rgba(30, 60, 140, .13);
  --stroke-soft: rgba(30, 60, 140, .07);
  --shadow: 0 14px 34px rgba(30, 50, 120, .10), inset 0 1px 0 rgba(255, 255, 255, .85);
  --shadow-pop: 0 20px 44px rgba(30, 50, 120, .16), inset 0 1px 0 rgba(255, 255, 255, .85);

  --ink: #16224a;
  --ink-2: #47578a;
  --ink-3: #8592b8;
  --accent: #3b66d6;
  --series: #3b66d6;            /* chart marks — validated vs #F5F8FE */

  --good: #0e9f6e; --warn: #b45309; --serious: #c2410c; --crit: #dc2626;
  --danger-ink: #dc2626;

  --input-bg: rgba(255, 255, 255, .78);
  --inset-bg: rgba(240, 245, 255, .65);
  --track-bg: rgba(215, 225, 248, .90);
  --thumb-bg: rgba(228, 235, 250, .90);
  --hover-bg: rgba(59, 102, 214, .045);
  --tip-bg: rgba(255, 255, 255, .97);
  --backdrop: rgba(35, 50, 95, .35);
  --avatar-grad: linear-gradient(140deg, #d7e2fa, #b9ccf3);
  --avatar-ink: #2c4694;
  --focus-ring: rgba(59, 102, 214, .35);
}

:root {
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Kanit', 'Segoe UI', system-ui, sans-serif;
  font-weight: 300;
  color: var(--ink);
  background: var(--bg-grad) fixed;
  min-height: 100vh;
  letter-spacing: .01em;
  transition: background .25s ease, color .25s ease;
}
b, strong, h1, h2, h3 { font-weight: 500; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--focus-ring); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- ambient orbs ---------- */
.bg-orbs { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--orb-opacity); transition: opacity .25s ease; }
.orb-a { width: 480px; height: 480px; left: -120px; top: -140px; background: var(--orb-a); }
.orb-b { width: 560px; height: 560px; right: -160px; top: 30%; background: var(--orb-b); }
.orb-c { width: 420px; height: 420px; left: 32%; bottom: -200px; background: var(--orb-c); }

/* ---------- glass primitive ---------- */
.glass {
  background: var(--card-grad);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- layout ---------- */
.sidebar {
  position: fixed; inset: 16px auto 16px 16px; width: var(--sidebar-w);
  display: flex; flex-direction: column; padding: 22px 16px; z-index: 40;
}
.main { margin-left: calc(var(--sidebar-w) + 48px); padding: 34px 34px 60px 0; max-width: 1460px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); padding: 2px 8px 18px; }
.brand-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #4d7cfe, #6c3ee8);
  box-shadow: 0 8px 20px rgba(77, 124, 254, .30);
}
.brand-icon svg { width: 22px; height: 22px; }
.brand-icon.lg { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto; }
.brand-icon.lg svg { width: 30px; height: 30px; }
.brand-text { font-size: 1.16rem; font-weight: 300; letter-spacing: .02em; }
.brand-text b { font-weight: 600; color: var(--accent); }

.nav { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: .95rem; transition: all .18s ease; border: 1px solid transparent;
}
.nav-link svg { width: 19px; height: 19px; opacity: .8; }
.nav-link:hover { background: var(--glass); color: var(--ink); }
.nav-link.active {
  background: linear-gradient(120deg, #4d7cfe, #5f45e6);
  border-color: rgba(130, 168, 255, .45); color: #fff; font-weight: 400;
  box-shadow: 0 6px 18px rgba(60, 100, 230, .30);
}
.nav-link.active svg { opacity: 1; }

.sidebar-foot { border-top: 1px solid var(--stroke-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.admin-chip { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--avatar-grad); font-weight: 500; color: var(--avatar-ink);
  border: 1px solid var(--stroke);
}
.admin-meta { display: flex; flex-direction: column; line-height: 1.25; }
.admin-name { font-size: .92rem; font-weight: 400; }
.admin-role { font-size: .74rem; color: var(--ink-3); }
.foot-actions { display: flex; flex-direction: column; gap: 6px; }

/* ---------- theme switch ---------- */
.theme-switch {
  display: flex; gap: 4px; padding: 4px;
  background: var(--glass); border: 1px solid var(--stroke-soft); border-radius: 99px;
}
.theme-opt {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; background: transparent; color: var(--ink-3); cursor: pointer; white-space: nowrap;
  font-size: .8rem; padding: 7px 12px; border-radius: 99px; transition: all .18s ease;
}
.theme-opt svg { width: 14px; height: 14px; }
.theme-opt:hover { color: var(--ink); }
.theme-opt.active { background: var(--card-grad); color: var(--ink); border: 1px solid var(--stroke); box-shadow: var(--shadow); font-weight: 400; }
.theme-switch.floating { position: fixed; top: 20px; right: 20px; z-index: 50; backdrop-filter: blur(14px); }

/* ---------- typography / page ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.65rem; font-weight: 500; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sub { color: var(--ink-2); font-size: .92rem; margin-top: 4px; }
.crumbs { font-size: .84rem; color: var(--ink-3); margin-bottom: 4px; }
.crumbs span { margin: 0 6px; }
.chip {
  font-family: ui-monospace, 'Cascadia Mono', monospace; font-size: .72em; font-weight: 400;
  background: var(--glass-2); border: 1px solid var(--stroke); border-radius: 8px; padding: 3px 10px; color: var(--accent);
}
.live-dot { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: .85rem; padding-top: 8px; }
.live-dot i { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--stroke);
  padding: 10px 20px; font-size: .93rem; font-weight: 400; cursor: pointer;
  color: var(--ink); background: var(--glass); transition: all .18s ease; white-space: nowrap;
}
.btn:hover { background: var(--glass-2); }
.btn-primary {
  background: linear-gradient(130deg, #4d7cfe, #5f45e6); border-color: rgba(130, 168, 255, .5);
  box-shadow: 0 8px 22px rgba(70, 110, 240, .30); color: #fff;
}
.btn-primary:hover { background: linear-gradient(130deg, #5d89ff, #6f55f2); box-shadow: 0 10px 26px rgba(70, 110, 240, .40); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--glass); }
.btn-danger { background: linear-gradient(130deg, #e05252, #b03060); border-color: rgba(255, 140, 140, .45); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn.danger { color: var(--danger-ink); }
.btn.danger:hover { background: rgba(248, 113, 113, .10); border-color: rgba(248, 113, 113, .35); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: .88rem; color: var(--ink-2); }
.field input, .field select, .input-sm {
  font-family: inherit; font-size: .95rem; font-weight: 300; color: var(--ink);
  background: var(--input-bg); border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  padding: 11px 14px; outline: none; transition: border .18s ease, box-shadow .18s ease;
}
.field input:focus, .field select:focus, .input-sm:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring);
}
.input-sm { padding: 8px 12px; font-size: .87rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.check { display: flex; gap: 9px; align-items: center; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.alert { border-radius: var(--radius-sm); padding: 11px 14px; font-size: .88rem; }
.alert-error { background: rgba(248, 113, 113, .10); border: 1px solid rgba(248, 113, 113, .35); color: var(--danger-ink); }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.tile { padding: 22px 24px; display: flex; flex-direction: column; gap: 5px; position: relative; overflow: hidden; }
.tile-label { font-size: .8rem; color: var(--ink-3); letter-spacing: .02em; }
.tile-value { font-size: 2.15rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-hint { font-size: .76rem; color: var(--ink-3); }
.tile-icon {
  position: absolute; right: 18px; top: 18px; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; color: var(--accent);
  background: var(--glass-2); border: 1px solid var(--stroke-soft);
}
.tile-icon svg { width: 19px; height: 19px; }

/* ---------- cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.card { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2 { font-size: 1rem; font-weight: 500; color: var(--ink); }

/* ---------- disk meter ---------- */
.status-badge { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; padding: 4px 12px; border-radius: 99px; border: 1px solid; }
.status-good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: color-mix(in srgb, var(--good) 9%, transparent); }
.status-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.status-serious { color: var(--serious); border-color: color-mix(in srgb, var(--serious) 40%, transparent); background: color-mix(in srgb, var(--serious) 9%, transparent); }
.status-crit { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 40%, transparent); background: color-mix(in srgb, var(--crit) 9%, transparent); }

.disk-meter { margin: 8px 0 20px; }
.meter-track { height: 12px; border-radius: 99px; background: var(--track-bg); border: 1px solid var(--stroke-soft); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--series); transition: width .6s cubic-bezier(.2, .8, .2, 1), background .25s ease; min-width: 4px; }
.meter-fill.warn { background: var(--warn); }
.meter-fill.serious { background: var(--serious); }
.meter-fill.crit { background: var(--crit); }
.meter-legend { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-3); margin-top: 7px; }
.disk-figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.disk-figures > div { background: var(--inset-bg); border: 1px solid var(--stroke-soft); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.fig-label { font-size: .76rem; color: var(--ink-3); }
.fig-value { font-size: 1.12rem; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- chart ---------- */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-bar { fill: var(--series); transition: opacity .15s ease; }
.chart-bar.dim { opacity: .40; }
.chart-grid { stroke: var(--stroke-soft); stroke-width: 1; }
.chart-axis-text { fill: var(--ink-3); font-size: 10.5px; font-family: 'Kanit', sans-serif; font-weight: 300; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 30; min-width: 130px;
  background: var(--tip-bg); border: 1px solid var(--stroke); border-radius: 10px;
  padding: 8px 12px; font-size: .8rem; box-shadow: var(--shadow); color: var(--ink);
  transform: translate(-50%, calc(-100% - 10px)); transition: opacity .1s ease; line-height: 1.5;
}
.chart-tip .tip-title { color: var(--ink-2); font-size: .74rem; }
.chart-tip .tip-value { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left; font-weight: 400; color: var(--ink-3); font-size: .76rem; letter-spacing: .03em;
  padding: 8px 12px; border-bottom: 1px solid var(--stroke); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--stroke-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: var(--hover-bg); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-family: ui-monospace, monospace; font-size: .82rem; }
.table .muted { color: var(--ink-3); }
.empty { color: var(--ink-3); text-align: center; padding: 28px 10px; font-size: .9rem; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; padding: 3px 11px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-online { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: color-mix(in srgb, var(--good) 8%, transparent); }
.badge-online i { box-shadow: 0 0 8px var(--good); }
.badge-offline { color: var(--ink-3); border-color: var(--stroke-soft); background: transparent; }
.badge-disabled { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 35%, transparent); background: color-mix(in srgb, var(--crit) 7%, transparent); }

.row-actions { display: inline-flex; gap: 6px; }
.icon-btn {
  border: 1px solid var(--stroke-soft); background: transparent; color: var(--ink-2);
  border-radius: 9px; padding: 5px 10px; font-size: .78rem; cursor: pointer; transition: all .15s ease;
}
.icon-btn:hover { background: var(--glass-2); color: var(--ink); border-color: var(--stroke); }
.icon-btn.danger:hover { background: rgba(248, 113, 113, .10); color: var(--danger-ink); border-color: rgba(248, 113, 113, .40); }

/* ---------- sites grid ---------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.site-card { padding: 24px; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; display: block; color: var(--ink); }
.site-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-pop); }
.site-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.site-card h3 { font-size: 1.08rem; font-weight: 500; }
.site-desc { color: var(--ink-3); font-size: .84rem; min-height: 1.3em; margin-bottom: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--stroke-soft); padding-top: 14px; }
.site-stats > div { display: flex; flex-direction: column; gap: 1px; }
.ss-value { font-weight: 500; font-size: 1rem; font-variant-numeric: tabular-nums; }
.ss-label { font-size: .72rem; color: var(--ink-3); }
.site-card-foot { margin-top: 12px; font-size: .76rem; color: var(--ink-3); }

.empty-state { padding: 60px 30px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; color: var(--ink-2); margin-top: 8px; }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 4px; background: var(--glass); border: 1px solid var(--stroke-soft); padding: 4px; border-radius: 14px; margin-bottom: 20px; }
.tab {
  border: none; background: transparent; color: var(--ink-2); font-size: .92rem;
  padding: 9px 22px; border-radius: 10px; cursor: pointer; transition: all .18s ease;
}
.tab.active { background: linear-gradient(120deg, #4d7cfe, #5f45e6); color: #fff; box-shadow: 0 4px 14px rgba(60, 100, 230, .28); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: flex-end; gap: 14px; padding: 14px 18px; margin-bottom: 18px; flex-wrap: wrap; border-radius: var(--radius); }
.toolbar-group { display: flex; flex-direction: column; gap: 4px; }
.mini-label { font-size: .72rem; color: var(--ink-3); }
.toolbar-spacer { flex: 1; }
.toolbar-info { font-size: .82rem; color: var(--ink-2); padding-bottom: 8px; }

/* ---------- file grid ---------- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.file-card { border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; border: 1px solid var(--stroke-soft); background: var(--inset-bg); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.file-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.file-thumb { aspect-ratio: 16/10; width: 100%; display: grid; place-items: center; background: var(--thumb-bg); overflow: hidden; position: relative; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb .file-glyph { font-size: 2rem; opacity: .8; }
.file-thumb .play-badge {
  position: absolute; width: 44px; height: 44px; border-radius: 50%;
  background: var(--tip-bg); border: 1px solid var(--stroke); display: grid; place-items: center;
  color: var(--ink); font-size: .95rem; padding-left: 3px;
}
.file-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.file-name { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { font-size: .72rem; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; color: var(--ink-2); font-size: .86rem; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(6px);
  display: grid; place-items: center; z-index: 100; padding: 20px; animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(480px, 100%); padding: 26px; animation: rise .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { width: min(860px, 100%); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.modal-head h3 { font-size: 1.08rem; font-weight: 500; }
.modal-x { background: none; border: none; color: var(--ink-3); font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 4px; }
.modal-x:hover { color: var(--ink); }

/* credentials reveal */
.cred-box { display: flex; flex-direction: column; gap: 10px; }
.cred-row { display: flex; align-items: center; gap: 10px; background: var(--input-bg); border: 1px solid var(--stroke-soft); border-radius: var(--radius-sm); padding: 11px 14px; }
.cred-label { font-size: .78rem; color: var(--ink-3); width: 96px; flex-shrink: 0; }
.cred-value { font-family: ui-monospace, monospace; font-size: .95rem; flex: 1; word-break: break-all; }
.cred-note { font-size: .8rem; color: var(--warn); display: flex; gap: 8px; align-items: center; }

/* lightbox */
.lightbox { width: min(1080px, 96vw); padding: 18px; }
.lightbox-media { display: grid; place-items: center; background: var(--thumb-bg); border-radius: var(--radius-sm); overflow: hidden; min-height: 200px; max-height: 72vh; }
.lightbox-media img, .lightbox-media video { max-width: 100%; max-height: 72vh; display: block; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.lightbox-name { font-size: .9rem; word-break: break-all; }
.lightbox-sub { font-size: .78rem; color: var(--ink-3); }
.lightbox-nofile { color: var(--ink-2); padding: 40px; text-align: center; font-size: .9rem; }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--tip-bg); border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  padding: 12px 18px; font-size: .88rem; box-shadow: var(--shadow); color: var(--ink);
  animation: rise .25s ease; max-width: 380px;
}
.toast.ok { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.toast.err { border-color: color-mix(in srgb, var(--crit) 50%, transparent); }

/* ---------- hint card ---------- */
.hint-card { margin-top: 18px; }
.hint-list { padding-left: 22px; display: flex; flex-direction: column; gap: 9px; font-size: .9rem; color: var(--ink-2); }
.hint-list code { background: var(--glass-2); border: 1px solid var(--stroke-soft); border-radius: 6px; padding: 2px 8px; font-size: .84em; color: var(--accent); }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-wrap { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-card { padding: 38px 34px; display: flex; flex-direction: column; gap: 22px; }
.login-brand { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.login-brand h1 { font-size: 1.5rem; font-weight: 300; }
.login-brand h1 b { font-weight: 600; color: var(--accent); }
.login-brand p { font-size: .86rem; color: var(--ink-2); }
.login-foot { text-align: center; font-size: .78rem; color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: static; width: auto; margin: 12px; inset: auto; flex-direction: row; align-items: center; padding: 12px 16px; gap: 14px; flex-wrap: wrap; }
  .nav { flex-direction: row; flex: 1; margin: 0; }
  .sidebar-foot { border: none; padding: 0; flex-direction: row; align-items: center; gap: 8px; }
  .admin-chip .admin-meta { display: none; }
  .main { margin: 0; padding: 10px 14px 50px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
  .page-head h1 { font-size: 1.3rem; }
  .theme-switch.floating { top: auto; bottom: 16px; right: 16px; }
}
