/* HRC Social — dark internal tool, icon-stacked top nav (matches crm.haroldragan.com) */
:root {
  --bg:#0b1220; --surface:#111c30; --surface2:#16233a; --line:#253349;
  --ink:#e6edf6; --mut:#93a4bd; --dim:#6b7c96;
  --sky:#0ea5e9; --mint:#06d6a0; --violet:#a78bfa; --amber:#f59e0b; --danger:#f43f5e;
  --radius:14px; --shadow:0 12px 30px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0; text-wrap: balance; }
h2 { font-size: 1.08rem; margin: 0; }
.mut { color: var(--mut); margin: 0; }
.small { font-size: .84rem; }
code { font: .82rem ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface2); padding: 3px 7px; border-radius: 6px; word-break: break-all; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(11,18,32,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-mark { background: linear-gradient(135deg, var(--sky), var(--violet)); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .06em; padding: 4px 6px; border-radius: 7px; }
.brand.big { font-size: 1.4rem; }
.iconnav { display: flex; gap: 4px; }
.iconnav a, .iconnav button { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--mut); background: none; border: 0;
  font: 600 .7rem/1 system-ui, sans-serif; letter-spacing: .02em; padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.iconnav a:hover, .iconnav button:hover { color: var(--ink); background: var(--surface); text-decoration: none; }
.iconnav a.on { color: var(--sky); background: var(--surface); }
.iconnav form { margin: 0; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-right)) 60px max(16px, env(safe-area-inset-left)); display: grid; gap: 18px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: .85rem; color: var(--mut); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 12px; min-width: 0; }
.card.empty { text-align: center; padding: 40px 18px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 .9rem system-ui, sans-serif; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface2); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--sky); text-decoration: none; }
.btn.primary { background: var(--sky); border-color: var(--sky); color: #04131f; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 5px 10px; font-size: .8rem; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
form { margin: 0; }

.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); color: var(--mut); white-space: nowrap; }
.pill.ok { color: var(--mint); border-color: rgba(6,214,160,.4); }
.pill.wait { color: var(--amber); border-color: rgba(245,158,11,.4); }

/* clients grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.client-card { color: var(--ink); }
.client-card:hover { border-color: var(--sky); text-decoration: none; }
.cc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); filter: grayscale(1); opacity: .7; }
.chip.on { color: var(--ink); filter: none; opacity: 1; border-color: rgba(6,214,160,.45); }
.chip.wait { color: var(--amber); filter: none; opacity: 1; border-color: rgba(245,158,11,.4); }

/* client page */
.linkcard { grid-template-columns: 1fr; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; }
.connectors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.connector header, .row { display: flex; gap: 12px; align-items: center; }
.connector header > svg, .row > svg { flex: none; }
.row .pill { margin-left: auto; }
.connector.soon { opacity: .6; }
.conn { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface2); border-left: 3px solid var(--mint); flex-wrap: wrap; }
.conn.wait { border-left-color: var(--amber); }
.conn.err { border-left-color: var(--danger); }
.conn-actions { display: flex; gap: 6px; }
.note-wait { color: var(--amber); margin: 0; }
.note-err { color: var(--danger); }
.note-ok { color: var(--mint); }
.assets { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.asset { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.asset img, .noimg { width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover; }
.noimg { display: grid; place-items: center; background: var(--surface2); color: var(--mut); font-weight: 700; }
.asset-txt { display: grid; min-width: 0; flex: 1; }
.asset-txt strong, .asset-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch { flex: none; width: 42px; height: 24px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface2); position: relative; cursor: pointer; padding: 0; }
.switch span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--dim); transition: transform .15s, background .15s; }
.switch.on { background: rgba(6,214,160,.25); border-color: var(--mint); }
.switch.on span { transform: translateX(18px); background: var(--mint); }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.events li { border-bottom: 1px solid var(--line); padding-bottom: 6px; }

/* forms */
label { display: block; font-size: .8rem; font-weight: 600; color: var(--mut); margin: 10px 0 4px; letter-spacing: .02em; }
input, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
input:focus, textarea:focus { border-color: var(--sky); outline: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form { display: grid; gap: 4px; }
.form .btn { margin-top: 14px; }
.settings { display: grid; gap: 16px; justify-items: start; }
.settings .card { width: 100%; }
.kv { display: grid; gap: 8px; margin-top: 6px; }
.kv > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kv span { font-size: .8rem; color: var(--mut); min-width: 190px; }
.alert { padding: 10px 12px; border-radius: 9px; font-size: .9rem; }
.alert.err { background: rgba(244,63,94,.12); color: #fda4af; border: 1px solid rgba(244,63,94,.35); }
.alert.ok { background: rgba(6,214,160,.12); color: #0b6b52; border: 1px solid rgba(6,214,160,.4); }

/* drawer (slides in from the LEFT) */
.drawer-wrap { position: fixed; inset: 0; z-index: 40; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .2s; }
.drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(440px, 100%); background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); transform: translateX(-100%); transition: transform .22s ease; }
.drawer-wrap.open .drawer { transform: none; }
.drawer-wrap.open .drawer-scrim { opacity: 1; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.x { font-size: 1.6rem; color: var(--mut); line-height: 1; }
.x:hover { text-decoration: none; color: var(--ink); }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; width: min(420px, 100%); box-shadow: var(--shadow); }
.modal-card h3 { margin: 0 0 6px; }
.modal-card p { color: var(--mut); margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 70; max-width: calc(100% - 32px);
  background: var(--surface2); border: 1px solid var(--mint); color: var(--ink); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; }
.toast.err { border-color: var(--danger); }
.toast.warn { border-color: var(--amber); }

/* login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(400px, 100%); }
.login-card { gap: 2px; }
.login-card .btn { margin-top: 16px; }

/* public pages (client connect link + legal): light, friendly */
body.public { background: #f2f5f9; color: #1b2433; color-scheme: light; }
.pub { max-width: 640px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); display: grid; gap: 18px; }
.pub-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #1b2433; }
.pub-card { background: #fff; border: 1px solid #dde4ee; border-radius: 16px; padding: 24px; box-shadow: 0 10px 30px -18px rgba(20,40,80,.35); display: grid; gap: 12px; }
.pub-card h1 { font-size: 1.45rem; }
.pub-card p { margin: 0; color: #3c4a60; }
.pub-steps { display: grid; gap: 10px; margin: 6px 0; }
.pub-step { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid #d3dce8; border-radius: 14px; color: #1b2433; background: #fbfcfe; }
.pub-step:hover { border-color: #0e7dc2; text-decoration: none; background: #f3f9fe; }
.pub-step > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.pub-step small { color: #5a6880; font-size: .85rem; }
.pub-step em { font-style: normal; font-weight: 700; color: #0b5f94; border: 1px solid #0e7dc2; background: #eaf5fd; border-radius: 9px; padding: 7px 12px; white-space: nowrap; }
.pub-step.done { border-color: #39b98d; background: #f1fbf7; }
.pub-step.done em { color: #0b6b52; border-color: #39b98d; background: #e3f7ef; }
.duo { display: flex; gap: 4px; flex: none; }
.pbtn { display: inline-block; font-weight: 700; color: #0b5f94; border: 1px solid #0e7dc2; background: #eaf5fd; border-radius: 9px; padding: 8px 14px; }
.pub-foot { font-size: .8rem; color: #6a7890; text-align: center; }
.pub-foot a, .pub-card a { color: #0b5f94; }
.legal h2 { font-size: 1.05rem; margin-top: 8px; }
.legal ul { margin: 0; padding-left: 22px; color: #3c4a60; display: grid; gap: 6px; }

@media (max-width: 760px) {
  .connectors { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .iconnav a, .iconnav button { padding: 6px 7px; }
  .kv span { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-scrim, .switch span { transition: none; } }

/* crew uploads (client page) */
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.copyrow .btn { flex: none; }
.crew-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.crew-item { display: grid; gap: 6px; align-content: start; min-width: 0; }
.crew-media { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface2); border: 1px solid var(--line); color: var(--mut); }
.crew-media img { width: 100%; height: 100%; object-fit: cover; }
.crew-media em { position: absolute; font-style: normal; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; }
.crew-note { aspect-ratio: 1; padding: 12px; border-radius: 10px; background: var(--surface2); border: 1px dashed var(--line); font-size: .88rem; overflow: auto; }
.crew-cap { font-size: .84rem; overflow-wrap: anywhere; }
.crew-meta { overflow-wrap: anywhere; }

/* crew upload page (public, phone-first) */
.crew { gap: 14px; }
.crew-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.crew-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 110px; padding: 14px; border-radius: 16px;
  border: 2px solid #0e7dc2; background: #eaf5fd; color: #0b5f94; font-weight: 700; font-size: 1.02rem; cursor: pointer; text-align: center; margin: 0; }
.crew-btn.primary { background: #0e7dc2; color: #fff; }
.crew-btn svg { width: 34px; height: 34px; }
.crew-btn:focus-within, .crew-btn:hover { filter: brightness(1.05); }
.crew-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crew-queue:empty { display: none; }
.crew-queue li { display: grid; grid-template-columns: 52px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px; border: 1px solid #d3dce8; border-radius: 12px; background: #fbfcfe; }
.qthumb { grid-row: span 2; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: #e7edf5; }
.qthumb img { width: 100%; height: 100%; object-fit: cover; }
.qname { font-size: .9rem; color: #1b2433; }
.qbar { grid-column: 2; height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.qbar i { display: block; height: 100%; width: 0; background: #0e7dc2; transition: width .2s; }
.qx { grid-row: 1 / span 2; grid-column: 3; border: 0; background: none; font-size: 1.5rem; color: #6a7890; width: 40px; height: 40px; cursor: pointer; }
.crew-queue li.ok { border-color: #39b98d; background: #f1fbf7; }
.crew-queue li.ok .qbar i { background: #39b98d; width: 100%; }
.crew-queue li.ok .qx { visibility: hidden; }
.crew-queue li.bad { border-color: #e2667a; }
.pub-label { font-size: .9rem; font-weight: 700; color: #1b2433; margin: 4px 0 -6px; }
.pub-label span { font-weight: 400; color: #6a7890; }
.crew textarea, .crew input:not([type=file]) { width: 100%; font: inherit; font-size: 16px; color: #1b2433; background: #fff; border: 1px solid #c8d3e1; border-radius: 12px; padding: 12px; }
.crew textarea:focus, .crew input:focus { outline: 2px solid #0e7dc2; border-color: #0e7dc2; }
.pbtn.big { display: block; width: 100%; text-align: center; font-size: 1.1rem; padding: 15px; border-radius: 14px; background: #0e7dc2; color: #fff; border: 0; cursor: pointer; font-family: inherit; }
.pbtn.big:disabled { opacity: .6; }
.crew-status { margin: 0; min-height: 1.4em; font-weight: 600; color: #3c4a60; text-align: center; }
.crew-status.ok { color: #0b6b52; }
.crew-status.err { color: #b4233a; }
.others { margin-top: 2px; }
.others summary { cursor: pointer; font-size: .84rem; color: var(--mut); padding: 4px 2px; list-style: none; }
.others summary::-webkit-details-marker { display: none; }
.others summary::before { content: '▸ '; }
.others[open] summary::before { content: '▾ '; }
.others summary:hover { color: var(--ink); }
.others .assets { margin-top: 8px; }

/* crew page v2: tray, count, progress, in-page camera */
button.crew-btn { font-family: inherit; }
.crew-count { font-weight: 700; color: #0b5f94; text-align: center; }
.crew-tray { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.crew-tray:empty { display: none; }
.crew-tray li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e7edf5; border: 2px solid transparent; }
.crew-tray li.ok { border-color: #39b98d; }
.crew-tray li.ok::after { content: '✓'; position: absolute; inset: auto 4px 4px auto; background: #39b98d; color: #fff; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; font-size: .75rem; }
.crew-tray li.bad { border-color: #e2667a; }
.tthumb { display: grid; place-items: center; width: 100%; height: 100%; color: #0b5f94; font-size: 1.4rem; }
.tthumb img { width: 100%; height: 100%; object-fit: cover; }
.tx { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.crew-tray li.ok .tx { display: none; }
.crew-progress { height: 8px; border-radius: 4px; background: #e2e8f0; overflow: hidden; }
.crew-progress i { display: block; height: 100%; width: 0; background: #0e7dc2; transition: width .25s; }

.cam { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: camflash .18s ease-out; }
@keyframes camflash { from { opacity: .85; } to { opacity: 0; } }
.cam-top { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); background: linear-gradient(rgba(0,0,0,.55), transparent); font-weight: 700; }
.cam-done { font: 700 1rem system-ui, sans-serif; background: #fff; color: #000; border: 0; border-radius: 999px; padding: 10px 20px; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.cam-last { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 2px solid #fff; background: rgba(255,255,255,.15); }
.cam-last:empty { visibility: hidden; }
.cam-last img { width: 100%; height: 100%; object-fit: cover; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .08s; }
.shutter:active span { transform: scale(.88); }
@media (prefers-reduced-motion: reduce) { .cam-flash.go { animation: none; } }
