/* Nex Stay Collabs — shared theme. Cream/Nex brand, refined hospitality. */
:root {
  --cream: #F5F0E0;
  --cream-deep: #EFE8D4;
  --card: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #6B6B6B;
  --red: #E4002B;
  --red-deep: #B80023;
  --line: #E6DFC8;
  --gold: #C9A227;
  --shadow: 0 1px 2px rgba(26,26,26,.04), 0 8px 28px rgba(26,26,26,.06);
  --shadow-lg: 0 2px 4px rgba(26,26,26,.05), 0 18px 50px rgba(26,26,26,.10);
  --radius: 14px;
  --maxw: 1120px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  /* subtle paper grain / atmosphere */
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(201,162,39,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(228,0,43,.05), transparent 60%);
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-deep); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,240,224,.85);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: baseline; font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand .dot { color: var(--red); margin-left: 6px; }
.brand small { font-family: var(--sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-left: 10px; }
.nav-cta { font-size: 14px; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  font: 600 15px/1 var(--sans); cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(228,0,43,.22); }
.btn-primary:hover { background: var(--red-deep); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--cream-deep); }

/* Shared header nav (marketing pages) */
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { font-size: 14px; font-weight: 600; color: var(--ink); }
.site-nav a:hover { color: var(--red); }
.site-nav .btn { padding: 10px 18px; }
.site-nav .btn-primary, .site-nav .btn-primary:hover { color: #fff; }
@media (max-width: 640px) {
  .site-nav { gap: 14px; }
  .site-nav .nav-plain { display: none; }
  .brand { white-space: nowrap; }
  .brand small { display: none; }
  .btn { white-space: nowrap; }
}

/* below ~480px, brand + "Get a proposal" + lang toggle no longer fit on one row —
   that's what was pushing the header (and the whole document) wider than the
   viewport. Wrap to a second row instead of shrinking text until it's unreadable. */
@media (max-width: 480px) {
  .site-header .wrap { flex-wrap: wrap; height: auto; padding: 12px 24px; row-gap: 10px; }
  .site-nav { flex: 1 0 100%; justify-content: space-between; }
}

/* EN/ID language toggle, shared by every page */
html[lang="en"] .id { display: none !important; }
html[lang="id"] .en { display: none !important; }
.lang-toggle { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-toggle button { border: none; background: transparent; padding: 7px 16px; cursor: pointer; font: 600 13px var(--sans); color: var(--muted); }
.lang-toggle button.on { background: var(--ink); color: #fff; }
@media print { .lang-toggle { display: none !important; } }

/* Hero, hero visual, stat strip, proof band and the loop diagram are
   homepage-only — they live in css/home.css, loaded by index.html alone. */

/* Sections */
section { padding: 64px 0; }
.section-title { font-family: var(--serif); font-size: clamp(26px,3.4vw,38px); font-weight: 600; letter-spacing: -.015em; margin: 0 0 10px; }
.section-sub { color: var(--muted); max-width: 60ch; margin: 0 0 40px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 20px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); position: relative; }
.step .num { font-family: var(--serif); font-size: 14px; color: #fff; background: var(--ink); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 16px; }
.step h3 { margin: 0 0 8px; font-size: 18px; }
.step p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* Cards / forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.access { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; overflow: hidden; }
.access .pitch { padding: 44px; background: var(--ink); color: #fff; }
.access .pitch h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 0 0 14px; }
.access .pitch p { color: rgba(255,255,255,.72); font-size: 15px; }
.access .pitch ul { padding-left: 18px; color: rgba(255,255,255,.86); font-size: 14.5px; }
.access .pitch li { margin: 8px 0; }
.form-pane { padding: 44px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.field { margin-bottom: 18px; }
input, textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #FCFAF3; font: 15px var(--sans); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(228,0,43,.12); background: #fff; }
textarea { min-height: 92px; resize: vertical; }
.form-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.form-msg { margin-top: 14px; font-size: 14px; font-weight: 600; }
.form-msg.ok { color: #1c7a3f; background: #E9F5EC; border: 1px solid #C9E7D0; border-radius: 10px; padding: 12px 14px; }
.form-msg.ok::before { content: "✓ "; }
.form-msg.err { color: var(--red-deep); background: #FBECEE; border: 1px solid #F3C9D0; border-radius: 10px; padding: 12px 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; color: var(--muted); font-size: 13px; background: var(--cream-deep); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr .7fr; gap: 36px; margin-bottom: 32px; }
.footer-brand p { margin: 12px 0 0; font-size: 13.5px; line-height: 1.65; max-width: 34ch; }
.footer-col h3 { font: 700 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.footer-col a { display: block; color: var(--ink); opacity: .78; padding: 4px 0; font-size: 13.5px; }
.footer-col a:hover { color: var(--red); opacity: 1; }
.footer-base { border-top: 1px solid var(--line); padding-top: 20px; display: flex; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .access { grid-template-columns: 1fr; }
  .access .pitch { padding: 32px; }
  .form-pane { padding: 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Console gate ---------- */
.gate { max-width: 480px; margin: 90px auto; padding: 0 24px; text-align: center; }
.gate .card { padding: 40px; text-align: left; }
.gate h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 0 0 8px; }
.gate p { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.hidden { display: none !important; }

.badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 4px 9px; border-radius: 999px; }
.cc-city { padding: 4px 20px 0; color: var(--muted); font-size: 13px; }

/* Profile avatar + account drawer */
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--red); color: #fff; font: 700 15px var(--sans);
  display: grid; place-items: center;
}
.avatar-btn:hover { background: var(--red-deep); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(26,26,26,.4); backdrop-filter: blur(2px); z-index: 100; }
.drawer {
  position: absolute; top: 0; right: 0; height: 100%; width: min(320px, 90vw);
  background: var(--card); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; padding: 20px;
  animation: drawer-in .25s cubic-bezier(.2,.7,.2,1);
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.drawer-close { align-self: flex-start; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; padding: 0; }
.drawer-profile { text-align: center; padding: 28px 0; }
.drawer-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--red); color: #fff; font: 600 28px var(--sans); display: inline-grid; place-items: center; }
.avatar-btn img, .drawer-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.drawer-name { font-weight: 600; font-size: 16px; margin: 14px 0 0; }
.drawer-name:empty { display: none; }
.drawer-email { color: var(--muted); font-size: 14px; margin: 4px 0 0; overflow-wrap: anywhere; }
.drawer-section-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.drawer-actions { margin-top: auto; display: grid; gap: 10px; }
.drawer-signout { width: 100%; background: #FBECEE; color: var(--red-deep); border-color: #F3C9D0; }
.drawer-signout:hover { background: #F3C9D0; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(26,26,26,.5); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 720px; width: 100%; }
.modal-head { padding: 24px 28px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h2 { font-family: var(--serif); font-size: 24px; margin: 0; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 24px 28px; }
.dash-title { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0 0 20px; }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 14px; margin-bottom: 22px; }
.metric { background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.metric b { display: block; font-family: var(--serif); font-size: 20px; }
.metric span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tier-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13.5px; }
.tier-table th, .tier-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.created-time { color: var(--muted); font-size: 12px; }
.tier-table th { color: var(--muted); font-weight: 600; }
.subhead { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 700; }

/* ---------- Console (ops) — status badges, new-lead highlight ---------- */
.badge.new { background: #FBECEE; color: var(--red-deep); border: 1px solid #F3C9D0; }
.badge.converted { background: #E9F5EC; color: #1c7a3f; border: 1px solid #C9E7D0; }
.badge.dismissed { background: #F0F0F0; color: var(--muted); border: 1px solid var(--line); }
.tier-table tr.lead-new { background: #FBF6E3; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Deal editor (Task 5) ---------- */
.badge.accepted { background: #E9F5EC; color: #1c7a3f; border: 1px solid #C9E7D0; }
.badge.pending { background: #F0F0F0; color: var(--muted); border: 1px solid var(--line); }
.stage-control { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 4px; }
.stage-guard-msg { font-size: 12.5px; color: var(--red-deep); margin: 0 0 16px; }
.assign-search { display: flex; gap: 8px; margin-bottom: 10px; }
.assign-search input { flex: 1; }
.assign-results { border: 1px solid var(--line); border-radius: 10px; max-height: 220px; overflow-y: auto; margin-bottom: 18px; }
.assign-result-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.assign-result-row:last-child { border-bottom: none; }
.assign-result-row button { padding: 6px 12px; font-size: 12.5px; }
.recon-exceptions { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px; }
.recon-exception-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.recon-exception-row:last-child { border-bottom: none; }
.slug-suggest { position: relative; max-width: 280px; }
.slug-suggest-list {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; z-index: 20;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  max-height: 220px; overflow-y: auto; box-shadow: var(--shadow);
}
.slug-suggest-row { padding: 8px 14px; font-size: 14px; cursor: pointer; }
.slug-suggest-row:hover { background: var(--cream-deep); }
.payout-table td, .payout-table th { white-space: nowrap; }
.payout-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 14px; margin: 4px 0 22px; }
.num-input { width: 100px; padding: 8px 10px; }

/* ---------- Console shell (Minimals-style: sidebar nav + card tables) ---------- */
.co-layout { display: flex; align-items: stretch; }
.co-nav {
  flex: 0 0 240px; position: sticky; top: 68px; align-self: flex-start;
  height: calc(100vh - 68px); overflow-y: auto;
  padding: 24px 16px; border-right: 1px solid var(--line);
}
.co-content { flex: 1 1 auto; min-width: 0; padding: 32px 32px 80px; }
.co-nav-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px 12px; font-weight: 700; }
.co-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.co-nav a:hover { background: var(--cream-deep); color: var(--ink); }
.co-nav a.active { background: var(--cream-deep); color: var(--red); }
.co-nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.co-view h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0 0 16px; }
.co-view .form-msg { margin: 0 0 14px; }

.co-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.co-tabs { display: flex; gap: 26px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.co-tab { background: none; border: none; cursor: pointer; padding: 15px 0; font: 600 14px var(--sans); color: var(--muted); border-bottom: 2px solid transparent; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.co-tab.active { color: var(--ink); border-bottom-color: var(--red); }
.co-count { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--cream-deep); color: var(--muted); }
.co-tab.active .co-count { background: var(--ink); color: #fff; }
.co-toolbar { padding: 16px 20px; }
.co-table-mount { overflow-x: auto; }

.co-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.co-table th { background: #FCFAF3; color: var(--muted); font-weight: 600; text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.co-table td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: top; }
.co-table td.nowrap { white-space: nowrap; }
.co-table tbody tr:last-child td { border-bottom: none; }
.co-table tbody tr:hover { background: #FCFAF3; }
.co-table tr.lead-new { background: #FBF6E3; }

.badge.approved { background: #E9F5EC; color: #1c7a3f; border: 1px solid #C9E7D0; }
.badge.stage { background: var(--cream); color: var(--ink); border: 1px solid var(--line); }

/* ---------- Partner dashboard — creator pills linking to TikTok ---------- */
.creator-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.creator-pill {
  background: var(--cream); color: var(--ink); border: 1px solid var(--line);
  text-decoration: none; display: inline-block;
}
.creator-pill:hover { background: var(--line); }

@media (max-width: 760px) {
  .co-layout { flex-direction: column; }
  .co-nav { position: static; height: auto; width: auto; flex: none; display: flex; overflow-x: auto; gap: 6px; border-right: none; border-bottom: 1px solid var(--line); }
  .co-nav-label { display: none; }
  .co-nav a { white-space: nowrap; }
  .co-content { padding: 20px 16px 60px; }
}
