:root {
  --bg: #0f0f10;
  --panel: #18181b;
  --panel2: #1f1f24;
  --border: #2c2c33;
  --text: #f2efe8;
  --muted: #9a948a;
  --accent: #c45c26;
  --accent2: #e8b86d;
  --ok: #5cb87a;
  --danger: #d45b5b;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); min-height: 100%; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, .btn {
  appearance: none; border: 1px solid var(--border); background: var(--panel2);
  color: var(--text); border-radius: 10px; padding: 8px 14px; cursor: pointer; font: inherit;
}
button:hover, .btn:hover { border-color: #444; background: #26262d; }
button.primary { background: linear-gradient(135deg, var(--accent), #a84a1c); border-color: transparent; }
button.primary:hover { filter: brightness(1.05); }
input, select {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font: inherit; width: 100%;
}
input:focus, select:focus { outline: 2px solid #3a3a44; border-color: #555; }
.layout { max-width: 1400px; margin: 0 auto; padding: 20px 24px 48px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 1.35rem; font-weight: 600; }
.topbar .sub { color: var(--muted); font-size: .9rem; }
.filters {
  display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)) repeat(3, auto);
  gap: 10px; align-items: end; margin-bottom: 18px;
  padding: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.filters label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.totals {
  display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 18px; color: var(--muted);
}
.totals b { color: var(--text); font-size: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } .filters { grid-template-columns: 1fr 1fr; } }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 16px;
}
.panel h2 {
  margin: 0; padding: 12px 14px; font-size: .95rem; border-bottom: 1px solid var(--border);
  background: var(--panel2); color: #ddd6cb;
}
.table-wrap { max-height: 420px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #222228; }
th { position: sticky; top: 0; background: #1a1a1f; color: var(--muted); font-weight: 500; z-index: 1; }
tr:hover td { background: #1d1d23; }
tr.clickable { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid #444; }
.color-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #222; margin-top: 6px; }
.color-bar i { display: block; height: 100%; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 12px; }
.shot {
  display: block; background: #111; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; color: inherit; text-decoration: none;
}
.shot img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: #000; }
.shot .meta { padding: 6px 8px; font-size: 11px; color: var(--muted); line-height: 1.35; }
.shot .meta strong { display: block; color: var(--text); font-size: 12px; }
.season-block { border-top: 1px solid var(--border); }
.season-block h3 { margin: 0; padding: 10px 14px; font-size: .9rem; color: #ddd6cb; background: #151518; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(380px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 6px; font-size: 1.5rem; }
.login-card p { margin: 0 0 20px; color: var(--muted); }
.login-card label { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.login-card .error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.search-row { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.hidden { display: none !important; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #26262d; font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; }

/* look cards */
.shot-card {
  display: block; width: 100%; text-align: left;
  position: relative; background: #111; border: 2px solid var(--border); border-radius: 10px;
  overflow: hidden; transition: border-color .15s; cursor: pointer; padding: 0;
  color: inherit; font: inherit;
}
.shot-card:hover { border-color: #444; }
.shot-card.bookmarked { border-color: #ff6b9d; box-shadow: 0 0 0 1px #ff6b9d55; }
.shot-card .shot-img-wrap { position: relative; }
.shot-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: #000; pointer-events: none; }
.shot-zones {
  position: absolute; inset: 0; display: grid; grid-template-rows: 1fr 1fr; z-index: 1;
}
.shot-zone {
  border: none; margin: 0; padding: 0; background: transparent; cursor: pointer;
}
.shot-zone-view:hover { background: rgba(255, 255, 255, .07); }
.shot-zone-bookmark:hover { background: rgba(255, 107, 157, .16); }
.shot-img-wrap::after {
  content: ''; position: absolute; left: 10%; right: 10%; top: 50%; z-index: 2;
  border-top: 1px dashed rgba(255, 255, 255, .18); pointer-events: none;
}
.shot-card .meta { padding: 6px 8px; font-size: 11px; color: var(--muted); line-height: 1.35; }
.shot-card .meta strong { display: block; color: var(--text); font-size: 12px; }

/* modals */
body.looks-modal-open,
body.detail-modal-open { overflow: hidden; }
body.looks-modal-open > .layout { visibility: hidden; }
.modal { position: fixed; inset: 0; z-index: 1000; }
.modal.hidden { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: #0f0f10; }

#looks-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh; height: 100dvh;
  margin: 0; padding: 0; border: none; border-radius: 0;
  display: flex !important; flex-direction: column;
  background: #0f0f10; z-index: 1000;
  max-width: none; max-height: none;
}
#looks-modal.hidden { display: none !important; }
#looks-modal .modal-fullscreen-panel {
  display: flex; flex-direction: column; flex: 1;
  width: 100%; height: 100%; min-height: 0;
  background: #0f0f10;
}
#looks-modal .looks-modal-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 52px 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--panel2); position: sticky; top: 0; z-index: 2;
  width: 100%;
}
#looks-modal .looks-modal-head h2 { margin: 0; font-size: 1rem; font-weight: 600; }
#looks-modal .looks-modal-head .pagination { margin-left: auto; }
#looks-modal .looks-modal-head .modal-close { position: absolute; top: 10px; right: 12px; }
#looks-modal .looks-modal-body {
  flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
  width: 100%; background: #0f0f10;
}
#looks-modal .shot-grid { width: 100%; max-width: none; box-sizing: border-box; }

.modal-detail { z-index: 1100; display: grid; place-items: center; }
.modal-detail .modal-backdrop { background: rgba(0, 0, 0, .92); }
.modal-panel {
  position: relative; z-index: 1; width: min(1200px, 96vw); height: min(90vh, 900px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow);
}
.modal-toolbar {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  display: flex; gap: 8px; align-items: center;
}
.modal-close {
  width: 36px; height: 36px; border-radius: 10px; font-size: 22px; line-height: 1;
  background: #222; border: 1px solid #444; cursor: pointer; color: var(--text);
}
.modal-bookmark {
  width: 36px; height: 36px; border-radius: 10px; font-size: 18px; line-height: 1;
  background: #222; border: 1px solid #444; cursor: pointer; opacity: .55;
}
.modal-bookmark.on { opacity: 1; border-color: #ff6b9d; background: #2a1a22; box-shadow: 0 0 0 1px #ff6b9d55; }
.modal-body { display: grid; grid-template-columns: 1fr 340px; height: 100%; min-height: 0; }
@media (max-width: 900px) { .modal-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } }
.modal-visual {
  display: flex; flex-direction: column; min-height: 0; background: #0a0a0c;
  border-right: 1px solid var(--border);
}
.zoom-hint { font-size: 11px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid #222; }
.zoom-stage {
  flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center;
  cursor: default; touch-action: none;
}
.zoom-stage.zoomed { cursor: grab; }
.zoom-stage.dragging { cursor: grabbing; }
.zoom-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center;
  will-change: transform; user-select: none;
}
.modal-side {
  overflow: auto; padding: 16px 14px 24px; font-size: 13px;
}
.modal-side h2 { margin: 0 0 4px; font-size: 1.1rem; }
.modal-sub { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.modal-section { margin-bottom: 18px; }
.modal-section h3 { margin: 0 0 8px; font-size: .85rem; color: #ddd6cb; text-transform: uppercase; letter-spacing: .04em; }
.break-list { margin-top: 8px; display: grid; gap: 4px; }
.break-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.break-row.small { font-size: 11px; color: var(--muted); }
.garment-block { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #222; }
.garment-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; }

.btn-toggle.active { border-color: #ff6b9d; color: #ffb3cc; background: #2a1a22; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { margin: 0; padding: 0; border: none; }
.pagination { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.pagination b { color: var(--text); }
.pagination button:disabled { opacity: .35; cursor: default; }
.looks-empty { padding: 24px; text-align: center; grid-column: 1 / -1; }

th.icon-mark, td.icon-mark,
th.icon-view, td.icon-view {
  width: 34px; text-align: center; padding-left: 8px; padding-right: 4px;
}
.row-bookmark {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border: none; border-radius: 8px; background: transparent; cursor: pointer;
  color: #555; transition: background .15s, box-shadow .15s;
}
.row-bookmark:hover { background: #ff6b9d18; }
.row-bookmark.on {
  background: #ff6b9d28; box-shadow: 0 0 0 1px #ff6b9d88;
}
tr.row-bookmarked td.icon-mark { background: #2a1a22; }
tr.row-bookmarked .row-bookmark { background: #ff6b9d22; box-shadow: 0 0 0 1px #ff6b9d66; }
tr.row-viewing td:nth-child(3) { color: var(--accent2); font-weight: 500; }
tr.row-viewing td { box-shadow: inset 3px 0 0 var(--accent2); }
.view-check {
  width: 18px; height: 18px; border-radius: 4px; border: 2px solid #555;
  background: transparent; display: inline-grid; place-items: center; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.view-check::after {
  content: ''; width: 6px; height: 10px; border: solid transparent;
  border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); opacity: 0;
}
.view-check.on {
  border-color: var(--accent2); background: #e8b86d22; box-shadow: 0 0 0 1px #e8b86d55;
}
.view-check.on::after { border-color: var(--accent2); opacity: 1; }
.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-sm:disabled { opacity: .35; cursor: default; }
.pill-pink { border: 1px solid #ff6b9d55; color: #ffb3cc; background: #2a1a22; }
.active-filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 14px; min-height: 0;
}
.active-filters:empty { display: none; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; border: 1px solid #ff6b9d66; background: #2a1a22;
  color: #ffb3cc; font-size: 12px;
}
.filter-chip button {
  border: none; background: transparent; color: #ff8fb3; padding: 0; line-height: 1;
  font-size: 14px; cursor: pointer;
}
.filter-chip button:hover { color: #fff; }
.filter-chip.filter-chip-view {
  border-color: #e8b86d66; background: #2a2418; color: #f0d9a8;
}
.filter-chip.filter-chip-view button { color: #e8b86d; }
#tbl-brands tbody tr[data-brand], #tbl-colors tbody tr[data-color] { cursor: default; }
#tbl-brands tbody tr[data-brand]:hover td, #tbl-colors tbody tr[data-color]:hover td { background: #1d1d23; }
#tbl-brands tbody tr[data-brand]:hover td.icon-mark,
#tbl-colors tbody tr[data-color]:hover td.icon-mark { background: #2a1a22; }
