/* ============================================================
   Joel Capillaire — Client Gallery prototype
   Shared styles for landing, OTP, albums, gallery and back office
   ============================================================ */

:root {
  --bg: #ffffff;
  --fg: #141414;
  --fg-soft: #4a4a4a;
  --muted: #8a8a8a;
  --line: #e9e9e9;
  --panel: #f6f6f5;
  --accent: #c9a24a;
  --gold: #d8b558;
  --danger: #d2463b;
  --ok: #2f9e63;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .12);
  --font-ui: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: .01em; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Logo ---------- */
/* Brand: gold emblem (assets/logo.png, or a drawn placeholder until the file exists) + wordmark */
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; }
.brand--stack { flex-direction: column; gap: 14px; }
.logo { height: 36px; width: auto; display: block; }
.logo--drawn { aspect-ratio: 1 / 1; }
.wordmark { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; font-weight: 600; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid var(--fg);
  background: var(--fg); color: #fff; font-weight: 500; letter-spacing: .04em;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); opacity: .92; }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--fg); }
.btn--light { background: #fff; color: var(--fg); border-color: #fff; }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn--outline-light:hover { background: rgba(255,255,255,.1); }
.btn--sm { padding: 8px 14px; font-size: 12px; }
.btn--danger { background: var(--danger); border-color: var(--danger); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: inherit; transition: background .15s ease;
}
.iconbtn:hover { background: rgba(0,0,0,.06); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.is-on { color: var(--danger); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--fg-soft); }
.input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--fg); outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { border-color: var(--fg); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.input--dark { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.input--dark::placeholder { color: rgba(255,255,255,.45); }
.input--dark:focus { border-color: rgba(255,255,255,.7); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.help { font-size: 12px; color: var(--muted); }

/* ---------- Dark auth screens (landing + OTP) ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  color: #fff; background: #0b0b0b; position: relative; overflow: hidden;
}
.auth__bg {
  position: absolute; inset: -6%; background-size: cover; background-position: center;
  filter: saturate(.85) brightness(.55); transform: scale(1.02);
}
.auth__bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 60% at 50% 40%, rgba(0,0,0,.1), rgba(0,0,0,.72));
}
.auth__card {
  position: relative; z-index: 1; width: 100%; max-width: 440px; text-align: center;
  padding: 44px 36px 32px; border-radius: 22px;
  background: rgba(14,14,14,.72); border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.auth__card .brand { margin: 0 auto 26px; }
.auth__card .logo { height: 96px; }
.auth__card .wordmark { color: rgba(255,255,255,.8); }
.auth__card .eyebrow { color: var(--gold); }
.auth__title { font-size: 44px; line-height: 1.05; margin: 10px 0 6px; }
.auth__sub { color: rgba(255,255,255,.65); margin-bottom: 28px; }
.auth__card .field label { color: rgba(255,255,255,.7); text-align: left; }
.auth__foot { position: relative; z-index: 1; margin-top: 18px; text-align: center; font-size: 12px; color: rgba(255,255,255,.5); }
.auth__foot a { text-decoration: underline; text-underline-offset: 3px; }
.lock { display: inline-flex; align-items: center; gap: 6px; }
.lock svg { width: 13px; height: 13px; }
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* OTP boxes */
.otp { display: flex; gap: 10px; justify-content: center; margin: 22px 0 18px; }
.otp input {
  width: 48px; height: 58px; text-align: center; font-size: 24px; font-weight: 500;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); color: #fff; outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.otp input:focus { border-color: #fff; background: rgba(255,255,255,.12); }
.otp input.filled { border-color: rgba(255,255,255,.55); }
@media (max-width: 420px) { .otp { gap: 6px; } .otp input { width: 42px; height: 52px; font-size: 20px; } }

/* ---------- App header (light pages) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 12px; padding: 14px 24px; background: rgba(14,14,14,.94); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar .muted { color: rgba(255,255,255,.55); }
.topbar__left { display: flex; align-items: center; gap: 12px; }
.topbar__center { text-align: center; font-size: 13px; }
.topbar__center strong { display: block; font-weight: 600; }
.topbar__right { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.topbar .logo { height: 34px; }
@media (max-width: 640px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: 12px 14px; }
  .topbar__center { text-align: left; }
  .hide-sm { display: none !important; }
}

.container { width: min(1240px, 100% - 32px); margin: 0 auto; }

/* ---------- Albums home ---------- */
.hero-strip { padding: 56px 0 28px; }
.hero-strip h1 { font-size: 46px; line-height: 1.05; }
.hero-strip p { margin: 10px 0 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { font-size: 12px; padding: 6px 12px; border-radius: 999px; background: var(--panel); color: var(--fg-soft); display: inline-flex; gap: 6px; align-items: center; }
.chip svg { width: 14px; height: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; padding-bottom: 72px; }
.card {
  display: block; border-radius: var(--radius); overflow: hidden; background: var(--panel);
  transition: transform .25s ease, box-shadow .25s ease; position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: #ddd; position: relative; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__badge {
  position: absolute; top: 12px; left: 12px; padding: 5px 10px; border-radius: 999px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px); display: inline-flex; gap: 6px; align-items: center;
}
.card__badge svg { width: 12px; height: 12px; }
.card__body { padding: 16px 18px 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.card__title { font-size: 26px; line-height: 1.1; }
.card__sub { color: var(--fg-soft); margin-top: 2px; }
.card__meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.card__cta { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.card__cta svg { width: 14px; height: 14px; }

.footer { border-top: 1px solid var(--line); padding: 26px 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Gallery cover ---------- */
.cover {
  position: relative; height: 100vh; min-height: 540px; display: grid; place-items: center; color: #fff; text-align: center; overflow: hidden;
  background: #111;
}
.cover__bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(.6); transform: scale(1.03); animation: kenburns 18s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.03); } to { transform: scale(1.1); } }
.cover__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.15) 40%, rgba(0,0,0,.65)); }
.cover__top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; }
.cover__top .logo { height: 38px; }
.cover__content { position: relative; z-index: 2; padding: 0 16px; }
.cover__content .eyebrow { color: var(--gold); }
.cover__title { font-size: clamp(48px, 9vw, 112px); line-height: .95; margin: 10px 0 8px; }
.cover__sub { color: rgba(255,255,255,.8); font-size: 15px; letter-spacing: .06em; }
.cover__cta { margin-top: 34px; }
.cover__scroll { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 2; color: rgba(255,255,255,.7); animation: bob 1.8s ease-in-out infinite; }
.cover__scroll svg { width: 22px; height: 22px; }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* ---------- Gallery toolbar + grid ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.toolbar__title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.toolbar__title h2 { font-size: 22px; white-space: nowrap; }
.toolbar__title span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.toolbar__actions { display: flex; align-items: center; gap: 4px; }
.toolbar__back { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-soft); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-right: 10px; }
.toolbar__back svg { width: 16px; height: 16px; }
.toolbar .count { font-variant-numeric: tabular-nums; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; background: var(--fg); color: #fff; }
.iconbtn .badge { position: absolute; top: 2px; right: 0; }
.iconbtn { position: relative; }

.filterbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 0 10px; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 12px; color: var(--fg-soft); }
.seg button.is-active { background: var(--fg); color: #fff; }

.masonry { columns: 3; column-gap: 8px; padding-bottom: 60px; }
@media (max-width: 980px) { .masonry { columns: 2; } }
@media (max-width: 520px) { .masonry { columns: 1; } }
.tile {
  position: relative; break-inside: avoid; margin-bottom: 8px; overflow: hidden; background: #ececec; border-radius: 4px; cursor: zoom-in;
}
.tile img { width: 100%; height: auto; display: block; transition: transform .6s ease, opacity .4s ease; opacity: 0; }
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.025); }
.tile__overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.55)); opacity: 0; transition: opacity .2s ease;
}
.tile:hover .tile__overlay, .tile.is-selected .tile__overlay { opacity: 1; }
@media (hover: none) { .tile__overlay { opacity: 1; background: linear-gradient(180deg, rgba(0,0,0,0) 70%, rgba(0,0,0,.5)); } }
.tile__name { color: rgba(255,255,255,.85); font-size: 11px; letter-spacing: .04em; }
.tile__actions { display: flex; gap: 2px; }
.tile__actions .iconbtn { color: #fff; width: 34px; height: 34px; }
.tile__actions .iconbtn:hover { background: rgba(255,255,255,.18); }
.tile__actions .iconbtn.is-on { color: #ff5a6a; }
.tile__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 999px;
  background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; backdrop-filter: blur(4px); pointer-events: none;
}
.tile__play svg { width: 22px; height: 22px; margin-left: 3px; }
.tile__dur { position: absolute; top: 10px; right: 10px; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; padding: 3px 8px; border-radius: 999px; }
.tile__check {
  position: absolute; top: 10px; left: 10px; width: 24px; height: 24px; border-radius: 999px; border: 2px solid #fff; background: rgba(0,0,0,.35);
  display: none; place-items: center; color: #fff;
}
.tile__check svg { width: 14px; height: 14px; }
.select-mode .tile__check { display: grid; }
.select-mode .tile { cursor: pointer; }
.tile.is-selected .tile__check { background: var(--fg); border-color: var(--fg); }
.tile.is-selected::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--fg); pointer-events: none; }
.tile.removing { animation: shrink .3s ease forwards; }
@keyframes shrink { to { opacity: 0; transform: scale(.9); } }

.empty { text-align: center; padding: 80px 16px; color: var(--muted); }
.empty .display { font-size: 32px; color: var(--fg); margin-bottom: 6px; }

/* Selection bar */
.selbar {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, calc(100% + 40px)); z-index: 60; display: flex; gap: 8px; align-items: center;
  padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--fg); color: #fff; box-shadow: var(--shadow); transition: transform .25s ease;
}
.selbar.is-open { transform: translate(-50%, 0); }
.selbar .btn { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; }
.selbar .btn--danger { background: var(--danger); border-color: var(--danger); }
.selbar__quick { display: flex; gap: 2px; padding-right: 10px; margin-right: 4px; border-right: 1px solid rgba(255,255,255,.2); }
.selbar__quick button { border: 0; background: transparent; color: rgba(255,255,255,.75); font-size: 12px; padding: 6px 9px; border-radius: 999px; }
.selbar__quick button:hover { background: rgba(255,255,255,.12); color: #fff; }
.selbar__count { font-size: 12px; white-space: nowrap; }
.btn.is-active { background: var(--fg); color: #fff; }
@media (max-width: 640px) {
  .selbar { left: 12px; right: 12px; transform: translate(0, calc(100% + 40px)); padding: 8px 8px 8px 12px; gap: 6px; flex-wrap: wrap; justify-content: center; border-radius: 18px; }
  .selbar.is-open { transform: none; }
  .selbar__quick { border: 0; padding: 0; margin: 0; width: 100%; justify-content: center; }
}

/* Progress bar (ZIP preparation) */
.progress { height: 6px; border-radius: 999px; background: #ececec; overflow: hidden; margin: 4px 0 14px; }
.progress span { display: block; height: 100%; width: 0; background: var(--fg); transition: width .2s ease; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,8,8,.97); display: none; color: #fff; }
.lightbox.is-open { display: block; }
.lightbox__stage { position: absolute; inset: 64px 0 56px; display: grid; place-items: center; padding: 0 64px; }
.lightbox__stage img, .lightbox__stage video { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox__stage video { width: min(100%, 1200px); background: #000; }
.lightbox__top { position: absolute; top: 0; left: 0; right: 0; height: 64px; display: flex; justify-content: space-between; align-items: center; padding: 0 16px; }
.lightbox__top .iconbtn { color: #fff; }
.lightbox__top .iconbtn:hover { background: rgba(255,255,255,.12); }
.lightbox__top .iconbtn.is-on { color: #ff5a6a; }
.lightbox__meta { font-size: 12px; color: rgba(255,255,255,.7); display: flex; gap: 14px; align-items: center; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 999px; border: 0; color: #fff;
  background: rgba(255,255,255,.08); display: grid; place-items: center; transition: background .15s ease;
}
.lightbox__nav:hover { background: rgba(255,255,255,.18); }
.lightbox__nav svg { width: 24px; height: 24px; }
.lightbox__nav--prev { left: 14px; } .lightbox__nav--next { right: 14px; }
.lightbox__bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; display: flex; justify-content: center; align-items: center; gap: 18px; font-size: 12px; color: rgba(255,255,255,.65); }
.lightbox__dl { display: inline-flex; gap: 8px; align-items: center; padding: 8px 16px; border-radius: 999px; background: #fff; color: #111; font-weight: 600; font-size: 12px; }
.lightbox__dl svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .lightbox__stage { inset: 56px 0 56px; padding: 0 8px; }
  .lightbox__nav { width: 42px; height: 42px; bottom: 60px; top: auto; transform: none; background: rgba(255,255,255,.14); }
  .lightbox__meta .hide-sm { display: none; }
}

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 16px; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }
.modal.is-open { display: grid; }
.modal__box { width: 100%; max-width: 460px; background: #fff; color: var(--fg); border-radius: 18px; padding: 26px 26px 22px; box-shadow: var(--shadow); animation: fadeIn .2s ease both; }
.modal__box h3 { font-size: 20px; margin-bottom: 6px; }
.modal__box p { margin: 0 0 18px; color: var(--fg-soft); }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal__box--wide { max-width: 720px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, calc(100% + 40px)); z-index: 130; display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-radius: 12px; background: #1b1b1b; color: #fff; font-size: 13px; box-shadow: var(--shadow); transition: transform .3s ease; max-width: min(92vw, 520px);
}
.toast.is-open { transform: translate(-50%, 0); }
.toast button { border: 0; background: transparent; color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.toast svg { width: 18px; height: 18px; flex: none; }

/* ---------- Back office ---------- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: #f4f4f2; }
.sidebar { background: #111; color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { margin: 4px 8px 26px; }
.sidebar .logo { height: 34px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.7); font-size: 13px; }
.sidebar a svg { width: 18px; height: 18px; }
.sidebar a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a.is-active { background: rgba(255,255,255,.12); color: #fff; }
.sidebar__foot { margin-top: auto; font-size: 11px; color: rgba(255,255,255,.4); padding: 0 12px; }
.sidebar__status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); font-size: 12px; margin-bottom: 10px; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 0 3px rgba(47,158,99,.2); }
.main { padding: 28px 32px 60px; min-width: 0; }
.main__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.main__head h1 { font-size: 26px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat b { display: block; font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat span { font-size: 12px; color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap; }
.panel__head h2 { font-size: 15px; font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .12s ease; }
.table tbody tr:hover { background: #fafaf8; }
.table .name { font-weight: 600; }
.table .sub { color: var(--muted); font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 4px 10px; border-radius: 999px; background: var(--panel); color: var(--fg-soft); }
.pill--ok { background: #e7f6ee; color: #1f7a4a; }
.pill--warn { background: #fdf3e2; color: #9a6b12; }
.pill--off { background: #f0f0f0; color: #777; }
.link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--fg-soft); }
.table-wrap { overflow-x: auto; }

/* Drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff; z-index: 110; transform: translateX(100%); transition: transform .3s ease; box-shadow: -20px 0 60px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.drawer.is-open { transform: none; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 18px; font-weight: 600; }
.drawer__body { padding: 22px 24px; overflow: auto; flex: 1; }
.drawer__foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fff; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 105; display: none; }
.scrim.is-open { display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.section-title { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; font-weight: 600; }
.section-title:first-child { margin-top: 0; }

/* Toggle */
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle:last-child { border-bottom: 0; }
.toggle b { font-weight: 600; font-size: 13px; display: block; }
.toggle small { color: var(--muted); display: block; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d9d9d9; transition: background .2s ease; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 999px; background: #fff; transition: transform .2s ease; }
.switch input:checked + span { background: var(--fg); }
.switch input:checked + span::before { transform: translateX(18px); }

/* Dropbox folder picker */
.tree { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fafaf8; max-height: 260px; overflow: auto; }
.tree__row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.tree__row:hover { background: #f0f0ec; }
.tree__row.is-selected { background: var(--fg); color: #fff; }
.tree__row svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.tree__row .sub { margin-left: auto; font-size: 11px; opacity: .6; }
.tree__children { margin-left: 22px; }
.linkbox { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px dashed #cfcfcf; }
.linkbox .link { flex: 1; word-break: break-all; }

/* Album sync list + activity */
.list { display: grid; gap: 8px; }
.list__row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; }
.list__row img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.list__row .grow { flex: 1; min-width: 0; }
.list__row small { color: var(--muted); display: block; }
.timeline { display: grid; gap: 10px; font-size: 13px; }
.timeline div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; }
.timeline time { color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 14px; }
  .sidebar .brand { margin: 0 16px 0 0; }
  .sidebar__foot, .sidebar__status { display: none; }
  .main { padding: 18px 16px 50px; }
}
