/* Foxipop Creators: shared tokens and components */
:root {
  --ink: #111318;
  --text: #1C1E2E;
  --gold: #F59E0B;
  --gold-deep: #D97706;
  --gold-soft: #FFFBEB;
  --cream: #F5F6FA;
  --paper: #FFFFFF;
  --sand: #F0F2F8;
  --line: #E8EAF0;
  --line-2: #D5D9E4;
  --muted: #5A6072;
  --faint: #9EA8B8;
  --bad: #EF4444;
  --good: #10B981;
  --warn: #92400E;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.15);
  --font-h: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-b: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--text); font: 400 13.5px/1.5 var(--font-b); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-h); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; margin: 0; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14.5px; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* buttons (CRM style: gold primary, white secondary) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--line-2); background: #fff; color: #2E3244; border-radius: var(--radius); padding: 8px 14px; font-weight: 600; font-size: 12.5px; cursor: pointer; text-decoration: none; transition: all .15s; white-space: nowrap; }
.btn:hover { background: var(--cream); border-color: var(--faint); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #000; box-shadow: 0 2px 8px rgba(245,158,11,.3); }
.btn.gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); box-shadow: 0 4px 12px rgba(245,158,11,.4); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--cream); color: var(--text); }
.btn.danger { background: #FEE2E2; color: #DC2626; border-color: rgba(239,68,68,.25); }
.btn.danger:hover { background: #FECACA; }
.btn.sm { padding: 5px 10px; font-size: 11.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* forms */
.field { margin-bottom: 14px; }
.field > label, .lbl { display: block; font-weight: 600; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], input[type=url], select, textarea { width: 100%; border: 1.5px solid var(--line-2); background: #fff; border-radius: var(--radius); padding: 8px 11px; font: inherit; color: var(--text); }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pills label { position: relative; cursor: pointer; }
.pills input { position: absolute; opacity: 0; inset: 0; }
.pills span { display: inline-block; padding: 6px 12px; border-radius: 99px; border: 1.5px solid var(--line-2); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--muted); user-select: none; }
.pills input:checked + span { background: var(--text); color: #fff; border-color: var(--text); }
.pills input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--gold); flex: none; }
.err { color: var(--bad); font-size: 13.5px; font-weight: 500; }
.notice { background: #FEF3C7; border: 1px solid #FCD34D; color: #92400E; border-radius: var(--radius); padding: 11px 14px; font-size: 14px; }
.notice.bad { background: #FEE2E2; border-color: #FCA5A5; color: #991B1B; }

/* chips */
.chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--sand); color: var(--muted); white-space: nowrap; }
.chip.creator { background: #DBEAFE; color: #1D4ED8; }
.chip.model { background: #EDE9FE; color: #6D28D9; }
.chip.influencer { background: #FEF3C7; color: #92400E; }
.chip.good { background: #D1FAE5; color: #047857; }
.chip.bad { background: #FEE2E2; color: #B91C1C; }
.chip.warn { background: #FEF3C7; color: #92400E; }
.chip.local { background: #CCFBF1; color: #0F766E; }

/* team shell */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--ink); color: #EDE6D6; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 0; overflow-y: auto; border-right: 1px solid rgba(255,255,255,.05); }
.brand { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand img { height: 28px; width: auto; max-width: 100%; display: block; }
.brand small { display: block; font: 600 10px var(--font-b); color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: 1.2px; margin-top: 8px; }
.rail nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rail nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: var(--radius); color: rgba(255,255,255,.5); text-decoration: none; font-weight: 500; font-size: 12.5px; transition: all .12s; }
.rail nav a:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.88); }
.rail nav a.on { background: rgba(245,158,11,.15); color: var(--gold); font-weight: 600; }
.rail nav .count { background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.rail nav .sep { height: 1px; background: rgba(255,255,255,.06); margin: 10px 8px; }
.me { border-top: 1px solid rgba(255,255,255,.06); padding: 14px 18px 16px; font-size: 11px; color: rgba(255,255,255,.35); }
.me b { display: block; color: rgba(255,255,255,.8); font-weight: 600; font-size: 12.5px; }
.me button { background: none; border: 0; color: var(--gold); cursor: pointer; padding: 0; margin-top: 6px; font-weight: 600; font-size: 12px; }
.main { padding: 20px 24px 90px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 9px 14px; font-weight: 600; font-size: 12.5px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.tabs .n { font-weight: 500; color: var(--muted); margin-left: 4px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=text], .toolbar input[type=search] { max-width: 260px; }
.toolbar select { width: auto; min-width: 120px; padding: 8px 10px; }
.toolbar .grow { flex: 1; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 16px; }
.two > .panel + .panel { margin-top: 0; }
.media-item .btn { white-space: nowrap; }
.panel > h3 { margin-bottom: 14px; }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-sm); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--cream); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #F0F2F8; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #FFFDF5; }
.thumb { width: 42px; height: 52px; border-radius: 6px; object-fit: cover; background: var(--sand); display: block; }
.thumb.empty { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.code { font-weight: 800; letter-spacing: -0.01em; }
.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); background: var(--paper); border: 1.5px dashed var(--line-2); border-radius: var(--radius-lg); }
.empty-state b { display: block; color: var(--ink); font-family: var(--font-h); font-size: 17px; margin-bottom: 4px; }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 20px; box-shadow: var(--shadow-sm); }
.stat .v { font-weight: 800; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; }
.stat .l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); margin-top: 4px; }
.stat.hot { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.hot .l { color: rgba(255,255,255,.45); }
.stat.hot .v { color: var(--gold); }
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F0F2F8; align-items: center; }
.list-row:last-child { border-bottom: 0; }
.list-row a { text-decoration: none; font-weight: 600; }

/* profile */
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.avatar { width: 84px; height: 104px; border-radius: 10px; object-fit: cover; background: var(--sand); flex: none; }
.profile-head h1 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; position: relative; }
.media-item.cover { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.media-item img, .media-item video { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #111; }
.media-item .bar { padding: 7px; display: grid; gap: 6px; }
.media-item select { padding: 4px 6px; font-size: 12.5px; }
.media-item .tag { position: absolute; top: 6px; left: 6px; background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.drop { border: 2px dashed var(--line-2); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); }
.drop { margin: 0 0 14px; transition: border-color .12s, background .12s; }
.drop.over { border-color: var(--gold); background: #FFF8E8; color: var(--text, #1C1E2E); }
.progress { height: 6px; background: var(--sand); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .15s; }
.savebar { position: sticky; bottom: 0; background: rgba(245, 246, 250, .94); backdrop-filter: blur(6px); border-top: 1.5px solid var(--line); padding: 12px 0; margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; z-index: 5; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0; font-weight: 600; }
.cal button { aspect-ratio: 1.2; border: 1.5px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; position: relative; font-size: 13.5px; }
.cal button.off { background: repeating-linear-gradient(135deg, #E3E6EE, #E3E6EE 5px, #F0F2F8 5px, #F0F2F8 10px); color: var(--muted); }
.cal button.booked { background: #FEF3C7; border-color: var(--gold); color: #92400E; }
.cal button.today { box-shadow: inset 0 0 0 2px var(--text); }
.cal button.pad { visibility: hidden; }

/* modal + toast */
.modal-back { position: fixed; inset: 0; background: rgba(17, 19, 24, .6); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; overflow-y: auto; z-index: 60; }
.modal { background: var(--paper); border-radius: 16px; width: 100%; max-width: 600px; padding: 24px; box-shadow: var(--shadow-lg); }
.modal.wide { max-width: 900px; }
.modal h2 { margin-bottom: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: 12.5px; z-index: 90; border: 1.5px solid var(--gold); max-width: 92vw; }
.toast.bad { border-color: var(--bad); background: #3a1114; }

/* pool picker */
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; max-height: 460px; overflow-y: auto; padding: 2px; }
.pool label { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius); padding: 8px; cursor: pointer; }
.pool label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.pool input { accent-color: var(--gold); width: 17px; height: 17px; }
.pool .thumb { width: 38px; height: 48px; }

/* login */
.gate { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 20px; }
.gate .card { background: #fff; border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.gate .brand { padding: 0; border: 0; margin-bottom: 26px; display: flex; justify-content: center; }
.gate .brand img { height: 44px; }
.gate h2 { text-align: center; }
.gate .sub { text-align: center; color: var(--faint); font-size: 13px; margin: 6px 0 26px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; overflow-x: auto; }
  .rail .brand small, .rail .me b + span { display: none; }
  .brand { border: 0; padding: 0 8px 0 0; flex: none; }
  .brand img { height: 24px; }
  .rail nav { flex-direction: row; margin: 0; flex: none; gap: 2px; }
  .rail nav { padding: 0; }
  .rail nav a { white-space: nowrap; }
  .rail nav .sep { display: none; }
  .me { border: 0; padding: 0 6px; display: flex; gap: 10px; align-items: center; flex: none; }
  .main { padding: 22px 16px 80px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two, .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
