/* HSD Client Studio. Tokens and the card are lifted from the ad sniper (hsd-ad-intelligence) so the
   team sees the same look everywhere. */
:root {
  --bg: #f8f9fb; --bg-2: #f1f3f7; --panel: #ffffff; --panel-2: #f5f6fa;
  --border: #e7e9ef; --border-strong: #d6d9e0;
  --text: #0a0e16; --text-2: #334155; --text-3: #475569;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-soft: #e9f0fe;
  --green: #16a34a; --green-soft: #dcfce7; --orange: #ef6c2f; --orange-soft: #fdebe0;
  --gold: #a87c06; --gold-soft: #fbf3da; --red: #e8466b; --red-soft: #fbe3e8;
  --font-display: 'Poppins', 'Inter', -apple-system, sans-serif;
  --radius: 10px; --shadow-md: 0 6px 24px rgba(20, 25, 43, .08); --shadow-lg: 0 12px 48px rgba(20, 25, 43, .15);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; background: var(--panel); border-bottom: 1px solid var(--border); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.3px; white-space: nowrap; }
.logo span { color: var(--green); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; justify-content: flex-end; }
.toolbar select, .toolbar input { height: 38px; border: 1.5px solid var(--border-strong); border-radius: 8px; background: var(--panel); padding: 0 12px; font-size: 14px; font-weight: 500; }
.toolbar input { min-width: 220px; }
.toolbar select:focus, .toolbar input:focus { outline: none; border-color: var(--accent); }
.logout { font-size: 13px; font-weight: 600; color: var(--text-3); padding: 8px 10px; border-radius: 8px; }
.logout:hover { background: var(--panel-2); color: var(--text); }

/* client sections + card grid */
main { max-width: 1320px; margin: 0 auto; padding: 22px 20px 60px; }
.count { color: var(--text-3); font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.client-h { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin: 28px 0 12px; display: flex; align-items: baseline; gap: 10px; }
.client-h:first-of-type { margin-top: 4px; }
.client-h small { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; color: var(--text-3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1.5px solid #dde1ea; border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(20, 25, 43, .04), 0 4px 14px rgba(20, 25, 43, .04); }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(20, 25, 43, .12); border-color: #c4cad6; }
.card:hover .thumb-overlay { opacity: 1; }
.thumb { width: 100%; aspect-ratio: 4 / 5; background: #f0f2f7; position: relative; overflow: hidden; border-bottom: 1px solid #ebedf2; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-tl { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; z-index: 3; }
.badge { background: rgba(20, 25, 43, .85); color: #fff; font-size: 11.5px; padding: 4px 8px; border-radius: 5px; font-weight: 600; }
.thumb-overlay { position: absolute; inset: 0; z-index: 2; background: linear-gradient(to top, rgba(20, 25, 43, .65), transparent 50%); opacity: 0; transition: opacity .16s; display: flex; align-items: flex-end; justify-content: center; padding: 14px; pointer-events: none; }
.view-btn { background: #fff; color: var(--text); font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 8px; box-shadow: var(--shadow-md); }
.card .body { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-size: 15.5px; font-weight: 700; line-height: 1.32; letter-spacing: -.25px; }
.card .copy { font-size: 13.5px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .footer { padding: 0 16px 14px; display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 5px; white-space: nowrap; }
.st-review { background: var(--orange-soft); color: #b4471a; }
.st-ready { background: var(--accent-soft); color: var(--accent); }
.st-uploaded { background: var(--gold-soft); color: var(--gold); }
.st-live { background: var(--green-soft); color: #15803d; }
.st-off { background: var(--panel-2); color: var(--text-3); }
.pill.muted { background: var(--panel-2); color: var(--text-2); }
.empty { padding: 60px 20px; text-align: center; color: var(--text-3); font-size: 15px; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(10, 14, 22, .45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .18s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(980px, 100vw); background: var(--panel); z-index: 41; transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer.on { transform: none; }
.d-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.d-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 800; margin: 0; flex: 1; letter-spacing: -.2px; }
.x { width: 36px; height: 36px; border-radius: 8px; font-size: 22px; line-height: 1; color: var(--text-3); }
.x:hover { background: var(--panel-2); color: var(--text); }
.d-body { flex: 1; overflow-y: auto; padding: 22px; display: grid; grid-template-columns: 340px 1fr; gap: 26px; align-items: start; }
.player { width: 100%; aspect-ratio: 4 / 5; background: #000; border-radius: 12px; display: block; }
.player.wide { aspect-ratio: 9 / 16; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 18px; border-radius: 9px; font-weight: 700; font-size: 14.5px; text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; width: 100%; margin-top: 12px; }
.btn.primary:hover { background: var(--accent-hover); }
.meta { font-size: 13.5px; color: var(--text-2); margin-top: 10px; line-height: 1.7; }
.field { margin-bottom: 18px; }
.field label { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--text-2); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; border: 1.5px solid var(--border-strong); border-radius: 9px; padding: 10px 12px; font-size: 15px; background: var(--panel); }
.field textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.script { white-space: pre-wrap; font-size: 15px; line-height: 1.65; padding: 14px 16px; background: var(--panel-2); border-radius: var(--radius); }
.notes { font-size: 14px; line-height: 1.6; padding: 12px 14px; background: var(--orange-soft); border-radius: var(--radius); color: #5a2a10; white-space: pre-wrap; }
.copy-btn { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--accent); padding: 2px 6px; border-radius: 5px; }
.copy-btn:hover { background: var(--accent-soft); }
.saved { font-size: 12.5px; color: var(--green); font-weight: 600; min-height: 18px; }
.save-err { color: var(--red); }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 400px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow-md); }
.login .logo { font-size: 24px; margin-bottom: 4px; }
.login p { color: var(--text-2); margin: 0 0 22px; font-size: 15px; }
.login .btn.primary { margin-top: 6px; height: 46px; }
.err { color: var(--red); font-size: 14px; font-weight: 600; min-height: 20px; margin-top: 10px; }

@media (max-width: 760px) {
  .top-in { padding: 12px 16px; }
  .toolbar { justify-content: flex-start; }
  .toolbar input { min-width: 0; flex: 1 1 100%; }
  main { padding: 16px 16px 50px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card .body { padding: 12px; }
  .card .footer { padding: 0 12px 12px; }
  .d-body { grid-template-columns: 1fr; padding: 16px; }
  .player { max-width: 360px; margin: 0 auto; }
}

/* ---- 2026-10-06 v2: client sidebar + pipeline board ---- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 67px); }
.side { background: var(--panel); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 67px; height: calc(100vh - 67px); overflow-y: auto; }
.side-h { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-3); padding: 0 10px 8px; }
.side-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.side-item:hover { background: var(--panel-2); color: var(--text); }
.side-item.on { background: var(--accent-soft); color: var(--accent); }
.side-item .n { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--text-3); background: var(--panel-2); border-radius: 10px; padding: 1px 8px; }
.side-item.on .n { background: #fff; color: var(--accent); }
.side-item .ava { width: 24px; height: 24px; border-radius: 50%; background: var(--green-soft); color: #15803d; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.side-item.all .ava { background: var(--accent-soft); color: var(--accent); }
.side-add { margin: 10px 10px 0; font-size: 13.5px; font-weight: 600; color: var(--accent); padding: 6px 0; }
.side-add:hover { text-decoration: underline; }

.boardwrap { min-width: 0; padding: 18px 20px 30px; }
.board-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.board-top h1 { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin: 0; flex: 1; min-width: 200px; }
.board-top select, .board-top input { height: 38px; border: 1.5px solid var(--border-strong); border-radius: 8px; background: var(--panel); padding: 0 12px; font-size: 14px; font-weight: 500; }
.board-top input { min-width: 220px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--bg-2); border-radius: 12px; padding: 10px; min-height: 160px; display: flex; flex-direction: column; gap: 10px; transition: background .12s, box-shadow .12s; }
.col.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px; }
.col-h .dot { width: 9px; height: 9px; border-radius: 50%; }
.col-h b { font-size: 14px; font-weight: 700; }
.col-h .n { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.col-h .add { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--accent); padding: 3px 8px; border-radius: 6px; }
.col-h .add:hover { background: #fff; }
.col-empty { font-size: 13px; color: var(--text-3); text-align: center; padding: 18px 8px; border: 1.5px dashed var(--border-strong); border-radius: 10px; }
.dot.planned { background: #94a3b8; } .dot.scripted { background: #8b5cf6; } .dot.recorded { background: var(--orange); }
.dot.edited { background: var(--gold); } .dot.ready { background: var(--accent); } .dot.live { background: var(--green); }

.col .card { cursor: grab; }
.col .card.dragging { opacity: .45; }
.col .thumb { aspect-ratio: 1 / 1; }
.col .thumb img { object-position: 50% 30%; }
.card .body { padding: 12px 13px 10px; gap: 5px; }
.card .name { font-size: 14.5px; }
.card .footer { padding: 0 13px 12px; }
.idea { padding: 12px 13px 4px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.idea .tag { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.idea p { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pill.client { background: var(--green-soft); color: #15803d; }

.st-planned { background: #eef1f5; color: #475569; } .st-scripted { background: #efe9fe; color: #6d28d9; }
.st-recorded { background: var(--orange-soft); color: #b4471a; } .st-edited { background: var(--gold-soft); color: var(--gold); }

.noclip { width: 100%; aspect-ratio: 4 / 5; border-radius: 12px; background: var(--panel-2); border: 1.5px dashed var(--border-strong); display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--text-3); font-size: 14.5px; font-weight: 500; }
.btn.danger { color: var(--red); background: none; border: 1.5px solid var(--red-soft); width: 100%; margin-top: 12px; }
.btn.danger:hover { background: var(--red-soft); }

.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 14, 22, .45); }
.modal.on { display: flex; }
.modal form { background: var(--panel); border-radius: 16px; width: 100%; max-width: 520px; padding: 24px; box-shadow: var(--shadow-lg); max-height: 92vh; overflow-y: auto; }
.modal h3 { font-family: var(--font-display); font-size: 19px; font-weight: 800; margin: 0 0 16px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.btn.ghost { background: var(--panel-2); color: var(--text-2); }
.btn.solid { background: var(--accent); color: #fff; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 12px; display: flex; gap: 6px; overflow-x: auto; }
  .side-h { display: none; }
  .side-item { width: auto; white-space: nowrap; flex-shrink: 0; border: 1.5px solid var(--border); }
  .side-add { margin: 0; white-space: nowrap; flex-shrink: 0; padding: 9px 10px; }
  .boardwrap { padding: 14px 12px 24px; }
  .board-top input { min-width: 0; flex: 1 1 100%; }
  .board { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
}
/* six columns fit a laptop screen: narrower sidebar, columns share the width (min 180px, then scroll) */
.app { grid-template-columns: 220px 1fr; }
.boardwrap { padding: 18px 16px 30px; }
.board { grid-auto-flow: initial; grid-auto-columns: initial; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; }
.pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.card .name { font-size: 14px; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(6, 82vw); }
}
.jump { display: none; }
@media (max-width: 900px) {
  .jump { display: flex; gap: 6px; overflow-x: auto; margin: 0 -12px 12px; padding: 0 12px; }
  .jump button { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--text-2); background: var(--panel); border: 1.5px solid var(--border); border-radius: 20px; padding: 6px 12px; }
  .jump button b { color: var(--text); }
  .jump .dot { width: 8px; height: 8px; border-radius: 50%; }
}
