/* ============================================================
   PhotoVault — admin
   Identity: a contact sheet. Paper ground, hairline rules,
   and mono "rebate" strips carrying real frame data.
   ============================================================ */

:root {
  --ink:        #16181c;
  --ink-2:      #575c65;
  --ink-3:      #8d929b;
  --paper:      #f7f6f2;
  --panel:      #ffffff;
  --rule:       #e3e2dc;
  --rule-2:     #d3d2ca;
  --accent:     #1f4a3f;
  --accent-2:   #2b6355;
  --accent-soft:#e7efeb;
  --signal:     #a8442a;
  --signal-soft:#f7e9e4;

  --r-sm: 4px;
  --r:    8px;
  --r-lg: 14px;

  --shadow: 0 1px 2px rgba(22,24,28,.05), 0 8px 24px -14px rgba(22,24,28,.22);

  --font-ui:   'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-disp: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--accent); }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------------------------------------------------------- data / rebate */

.mono, .rebate {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* The signature element: a film rebate strip. The perforation pattern is
   drawn, not an image, and the text on it is always real frame data. */
.rebate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  height: 22px;
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
  background:
    repeating-linear-gradient(90deg,
      transparent 0 7px,
      color-mix(in srgb, var(--rule) 70%, transparent) 7px 9px,
      transparent 9px 16px) left / 100% 3px no-repeat;
  background-position: 0 3px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
.rebate span { flex: none; }
.rebate .grow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-transform: none; }
.rebate .idx { color: var(--accent); font-weight: 600; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; }

.side {
  width: 244px;
  flex: none;
  border-right: 1px solid var(--rule);
  background: var(--panel);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: baseline; gap: 8px; padding: 0 8px; }
.brand b { font-family: var(--font-disp); font-size: 20px; font-weight: 600; font-variation-settings: 'SOFT' 20, 'WONK' 1; letter-spacing: -0.02em; }
.brand .eyebrow { font-size: 9.5px; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  padding: 8px 10px;
  border-radius: var(--r);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  display: flex; align-items: center; gap: 9px;
}
.nav a:hover { background: var(--paper); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .8; }

.side footer { margin-top: auto; font-size: 12px; color: var(--ink-3); padding: 0 10px; }
.side footer a { color: var(--ink-2); }

.main { flex: 1 1 auto; min-width: 0; padding: 30px 34px 90px; }
.wrap { max-width: 1180px; margin: 0 auto; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 26px;
}
.page-head h1 {
  font-family: var(--font-disp);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  font-variation-settings: 'SOFT' 20, 'opsz' 40;
  line-height: 1.1;
}
.page-head p { margin: 4px 0 0; color: var(--ink-2); }

/* --------------------------------------------------------------- controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--rule-2);
  background: var(--panel);
  color: var(--ink);
  font: inherit; font-weight: 550; font-size: 13.5px;
  padding: 8px 14px;
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none;
  transition: background .13s, border-color .13s, transform .06s;
}
.btn:hover { background: var(--paper); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }

.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--paper); color: var(--ink); }
.btn.danger { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 35%, var(--rule)); }
.btn.danger:hover { background: var(--signal-soft); border-color: var(--signal); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

label.field { display: block; margin-bottom: 14px; }
label.field > span {
  display: block; margin-bottom: 5px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em; color: var(--ink-2);
}
label.field > small { display: block; margin-top: 5px; color: var(--ink-3); font-size: 12px; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  padding: 8px 11px;
  transition: border-color .13s, box-shadow .13s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }

.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; cursor: pointer; }
.check input { margin: 3px 0 0; width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.check span { font-size: 13.5px; }
.check small { display: block; color: var(--ink-3); font-size: 12px; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; min-width: 0; }

/* ---------------------------------------------------------------- surfaces */

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card > .card-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card > .card-head h2 { font-size: 15px; }
.card > .card-body { padding: 18px; }

.notice {
  padding: 10px 14px; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent);
  font-size: 13.5px; margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.notice.err { background: var(--signal-soft); color: var(--signal); border-color: color-mix(in srgb, var(--signal) 25%, transparent); }

.empty {
  text-align: center; padding: 54px 24px; color: var(--ink-2);
  border: 1px dashed var(--rule-2); border-radius: var(--r-lg); background: var(--panel);
}
.empty h3 { font-family: var(--font-disp); font-size: 19px; margin-bottom: 6px; }

/* ------------------------------------------------------------- gallery list */

.g-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

.g-card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .16s cubic-bezier(.2,.7,.3,1), box-shadow .16s, border-color .16s;
}
.g-card:hover { transform: translateY(-2px); border-color: var(--rule-2); box-shadow: 0 2px 4px rgba(22,24,28,.05), 0 18px 34px -18px rgba(22,24,28,.3); }
.g-card .shot {
  aspect-ratio: 4 / 3; background: #eceae4 center/cover no-repeat;
  display: grid; place-items: center; color: var(--ink-3);
}
.g-card .shot .eyebrow { font-size: 10px; }
.g-card .meta { padding: 12px 14px; }
.g-card .meta h3 { font-size: 15.5px; line-height: 1.3; }
.g-card .meta p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 100px;
  background: var(--paper); border: 1px solid var(--rule); color: var(--ink-2);
}
.pill.live { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); }
.pill.off  { background: var(--signal-soft); border-color: color-mix(in srgb, var(--signal) 25%, transparent); color: var(--signal); }

/* --------------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; flex-wrap: wrap; }
.tabs button {
  appearance: none; background: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 550; font-size: 13.5px; color: var(--ink-3);
  padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 7px;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.tab-panel[hidden] { display: none; }

/* ------------------------------------------------------------------ upload */

.drop {
  border: 1.5px dashed var(--rule-2);
  border-radius: var(--r-lg);
  background: var(--panel);
  padding: 34px 22px;
  text-align: center;
  transition: border-color .15s, background .15s;
  margin-bottom: 20px;
}
.drop.hot { border-color: var(--accent); background: var(--accent-soft); }
.drop h3 { font-family: var(--font-disp); font-size: 17px; margin-bottom: 4px; }
.drop p { margin: 0 0 14px; color: var(--ink-2); font-size: 13.5px; }

.q-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.q-item {
  display: grid; grid-template-columns: 1fr 120px 62px; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 8px 12px; font-size: 13px;
}
.q-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-bar { height: 4px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.q-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .18s linear; }
.q-item .st { text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.q-item.done .st { color: var(--accent); }
.q-item.fail .st { color: var(--signal); }
.q-item.fail { border-color: color-mix(in srgb, var(--signal) 40%, var(--rule)); }

/* -------------------------------------------------------------- media grid */

.m-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }

.m-tile {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  overflow: hidden; position: relative; cursor: grab;
  transition: border-color .13s, box-shadow .13s, opacity .13s;
}
.m-tile:hover { border-color: var(--rule-2); box-shadow: var(--shadow); }
.m-tile.dragging { opacity: .35; cursor: grabbing; }
.m-tile.over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.m-tile.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.m-tile .img { aspect-ratio: 1; background: #eceae4 center/cover no-repeat; display: block; }
.m-tile .badge {
  position: absolute; top: 7px; left: 7px;
  background: rgba(16,18,22,.78); color: #fff; backdrop-filter: blur(6px);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 4px;
}
.m-tile .pick {
  position: absolute; top: 6px; right: 6px; width: 21px; height: 21px;
  border-radius: 50%; border: 1.5px solid rgba(255,255,255,.9);
  background: rgba(16,18,22,.35); backdrop-filter: blur(4px);
  cursor: pointer; display: grid; place-items: center;
}
.m-tile.sel .pick { background: var(--accent); border-color: var(--accent); }
.m-tile .pick svg { width: 12px; height: 12px; stroke: #fff; opacity: 0; }
.m-tile.sel .pick svg { opacity: 1; }
.m-tile .cover-flag {
  position: absolute; bottom: 26px; left: 7px;
  background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
}

.bulkbar {
  position: sticky; bottom: 18px; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff;
  padding: 9px 10px 9px 16px; border-radius: 100px;
  box-shadow: 0 12px 34px -10px rgba(22,24,28,.5);
  width: fit-content; margin: 20px auto 0;
}
.bulkbar .n { font-family: var(--font-mono); font-size: 12px; }
.bulkbar .btn { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.bulkbar .btn:hover { background: rgba(255,255,255,.2); }
.bulkbar .btn.danger { color: #ffb4a0; }
.bulkbar .btn.danger:hover { background: rgba(255,120,90,.22); }

/* ------------------------------------------------------------ share links */

.link-row {
  border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--panel);
  overflow: hidden; margin-bottom: 12px;
}
.link-row .top { padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.link-row .who { flex: 1 1 180px; min-width: 0; }
.link-row .who b { font-size: 14.5px; font-weight: 600; }
.link-row .who .eyebrow { display: block; margin-top: 2px; }

.url-box {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden;
  flex: 2 1 320px; min-width: 0; background: var(--paper);
}
.url-box input {
  border: 0; border-radius: 0; background: transparent;
  font-family: var(--font-mono); font-size: 12px; padding: 7px 10px;
}
.url-box input:focus { box-shadow: none; }
.url-box button {
  border: 0; border-left: 1px solid var(--rule-2); background: var(--panel);
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 0 13px; cursor: pointer; color: var(--ink-2);
}
.url-box button:hover { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------ design panel */

.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.swatches button {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  padding: 0;
}
.swatches button[aria-pressed=true] { border-color: var(--ink); }

.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choices label {
  border: 1px solid var(--rule-2); border-radius: var(--r);
  padding: 8px 13px; cursor: pointer; font-size: 13px; font-weight: 550;
  background: var(--panel); color: var(--ink-2);
}
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.choices label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.asset-slot {
  border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--paper);
}
.asset-slot .prev {
  height: 108px; display: grid; place-items: center;
  background-image:
    linear-gradient(45deg, #eceae4 25%, transparent 25%, transparent 75%, #eceae4 75%),
    linear-gradient(45deg, #eceae4 25%, transparent 25%, transparent 75%, #eceae4 75%);
  background-size: 14px 14px; background-position: 0 0, 7px 7px; background-color: #fff;
}
.asset-slot .prev img { max-width: 78%; max-height: 78px; object-fit: contain; }
.asset-slot .prev.bg { background: #16181c center/cover no-repeat; }
.asset-slot .act { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--rule); align-items: center; }
.asset-slot .act input[type=file] { font-size: 11.5px; border: 0; padding: 0; }

/* preview of client look, right inside the design tab */
.mini-preview {
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--rule);
  min-height: 210px; display: grid; place-items: center; text-align: center;
  padding: 30px 22px; position: relative; isolation: isolate;
  background: #16181c center/cover no-repeat;
}
.mini-preview .pv-logo { max-width: 130px; max-height: 46px; margin: 0 auto 14px; display: block; }
.mini-preview h4 { font-size: 25px; margin: 0 0 6px; font-weight: 500; line-height: 1.15; }
.mini-preview .sub { font-size: 12.5px; opacity: .8; letter-spacing: .06em; text-transform: uppercase; }
.mini-preview .fake-btn {
  display: inline-block; margin-top: 16px; padding: 7px 16px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
}

/* ------------------------------------------------------------------ login */

.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(70% 55% at 50% 0%, #ffffff 0%, transparent 70%),
    var(--paper);
}
.auth-card { width: 100%; max-width: 372px; }
.auth-card .mark { text-align: center; margin-bottom: 26px; }
.auth-card .mark b {
  font-family: var(--font-disp); font-size: 27px; font-weight: 600;
  font-variation-settings: 'SOFT' 30, 'WONK' 1; letter-spacing: -.02em;
}
.auth-card .mark p { margin: 2px 0 0; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side {
    width: auto; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 14px;
    padding: 12px 16px; overflow-x: auto;
  }
  .side footer { display: none; }
  .nav { flex-direction: row; }
  .main { padding: 22px 18px 80px; }
  .q-item { grid-template-columns: 1fr 80px 52px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
