/* Content-Nova client portal. Tokens mirror css/styles.css; no starfield, calm app UI. */
:root {
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --bg-3: #1a1a25;
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.78);
  --text-3: rgba(255, 255, 255, 0.62);
  --gold: #c9a962;
  --gold-2: #e8d5a3;
  --ok: #6fcf97;
  --warn: #f2c94c;
  --bad: #ff8a80;
  --info: #7ab8ff;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font);
  --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; min-height: 100vh; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.3rem; }
a { color: var(--gold-2); }
a:hover { color: #fff; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.muted { color: var(--text-2); }
.lead { font-size: 1.05rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: #0a0a0f; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 32px; padding-bottom: 48px; }
.foot { padding-bottom: 32px; color: var(--text-3); font-size: .875rem; }

/* Logo */
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.logo:hover { color: var(--text); }
.logo-mark { color: var(--gold); font-size: 1.4rem; }
.logo-tag { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #0a0a0f; background: var(--gold); border-radius: 4px; padding: 1px 6px; }
.logo-center { display: flex; justify-content: center; margin-bottom: 1.25rem; }

/* Top bar */
.topbar { background: var(--bg-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav > a { color: var(--text-2); text-decoration: none; padding: .4rem .2rem; border-bottom: 2px solid transparent; }
.nav > a:hover { color: #fff; }
.nav > a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
.nav-user { display: flex; align-items: center; gap: .75rem; margin-left: .75rem; padding-left: 1rem; border-left: 1px solid var(--line); }
.nav-name { color: var(--text-2); font-size: .9rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: .4rem .7rem; font-size: 1.2rem; cursor: pointer; }
.inline-form { display: inline; margin: 0; }

/* Auth */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.auth-title { font-size: 1.5rem; text-align: center; }
.auth-links { text-align: center; margin: 1.25rem 0 0; font-size: .95rem; }
.auth-foot { color: var(--text-3); font-size: .85rem; margin-top: 1.25rem; }
.center-block { text-align: center; padding: 3rem 0; }
.eyebrow { color: var(--gold); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; margin-bottom: .25rem; }

/* Cards, grids */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card-title { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-family: var(--font); font-weight: 600; margin-bottom: .75rem; }
.grid { display: grid; gap: 20px; margin-bottom: 8px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid .card { margin-bottom: 0; }
.plan-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--gold-2); margin-bottom: .1em; }
.stat { font-family: var(--font-display); font-size: 2.4rem; font-weight: 600; line-height: 1.1; margin-bottom: .15em; }
.stat-sm { font-size: 1.3rem; }
.stat-of { font-size: 1.1rem; color: var(--text-3); font-weight: 500; }
.stat-card .stat { color: var(--gold-2); }
.meter { width: 100%; height: 10px; accent-color: var(--gold); margin: .25rem 0 .75rem; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h1, .section-head h2 { margin: 0; }
.crumbs { margin-bottom: .75rem; font-size: .95rem; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 32px 20px; text-align: center; background: var(--bg-2); }
.small-h { font-size: 1rem; margin-top: 1.25rem; }
.prose { color: var(--text); overflow-wrap: anywhere; }

/* Meta lists */
.meta { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 1.25rem; }
.meta > div { min-width: 140px; }
.meta dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.meta.stack { flex-direction: column; gap: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; padding: .65rem 1.2rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; min-height: 44px; transition: background .15s, border-color .15s; }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #0a0a0f; }
.btn-primary:hover { color: #0a0a0f; filter: brightness(1.08); }
.btn-secondary { background: var(--bg-3); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--gold); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { color: #fff; border-color: var(--text-3); }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

/* Forms */
.field { margin-bottom: 1.1rem; flex: 1; min-width: 0; }
label { display: block; font-weight: 500; margin-bottom: .35rem; font-size: .95rem; }
.optional { color: var(--text-3); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px; padding: .65rem .8rem; min-height: 44px;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 1px; border-color: var(--gold); }
select option { background: var(--bg-2); }
.row { display: flex; gap: 16px; }
.hint { color: var(--text-3); font-size: .875rem; margin: .35rem 0 0; }
.hint-warn { color: var(--warn); }
.hint-ok { color: var(--ok); }
.error { color: var(--bad); font-size: .9rem; margin: .35rem 0 0; }
.has-error input, .has-error select, .has-error textarea, .has-error .dropzone { border-color: var(--bad); }
.form-card.narrow { max-width: 520px; }
.filter-bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-bar label { margin: 0; }
.filter-bar select { width: auto; min-width: 180px; }

/* Drop zone */
.dropzone { position: relative; border: 2px dashed rgba(255,255,255,.28); border-radius: var(--radius); padding: 22px 16px; text-align: center; background: var(--bg); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--gold); background: var(--bg-3); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:focus-within { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.dropzone-text { margin: 0; color: var(--text-2); }
.link-like { color: var(--gold-2); text-decoration: underline; }
html:not(.js) .dropzone { padding: 10px; }
html:not(.js) .dropzone input[type=file] { position: static; opacity: 1; height: auto; }
html:not(.js) .dropzone-text { display: none; }
.file-list { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .9rem; color: var(--text-2); }
.file-list li { padding: 4px 0; overflow-wrap: anywhere; }
.file-list .too-big { color: var(--bad); }

/* Flash */
.flash { border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid; overflow-wrap: anywhere; }
.flash-success { background: rgba(111,207,151,.12); border-color: rgba(111,207,151,.5); color: #b9efd0; }
.flash-error { background: rgba(255,138,128,.12); border-color: rgba(255,138,128,.5); color: #ffc4be; }
.flash-warning { background: rgba(242,201,76,.12); border-color: rgba(242,201,76,.5); color: #f7e19a; }

/* Badges: text label always present, colour is secondary */
.badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.badge-submitted { color: var(--info); border-color: rgba(122,184,255,.5); background: rgba(122,184,255,.1); }
.badge-in_review { color: #c9a6ff; border-color: rgba(201,166,255,.5); background: rgba(201,166,255,.1); }
.badge-in_progress { color: var(--gold-2); border-color: rgba(201,169,98,.6); background: rgba(201,169,98,.12); }
.badge-awaiting_client, .badge-build-pending, .badge-user-invited { color: var(--warn); border-color: rgba(242,201,76,.5); background: rgba(242,201,76,.1); }
.badge-completed, .badge-build-paid, .badge-user-active { color: var(--ok); border-color: rgba(111,207,151,.5); background: rgba(111,207,151,.1); }
.badge-declined, .badge-user-disabled { color: var(--bad); border-color: rgba(255,138,128,.5); background: rgba(255,138,128,.1); }
.badge-build-not_required { color: var(--text-2); border-color: var(--line); }
.tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #0a0a0f; background: var(--gold); border-radius: 4px; padding: 1px 6px; margin: 0 .4rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); background: var(--bg-3); font-weight: 600; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255,255,255,.03); }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Thread */
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.msg { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; max-width: 760px; }
.msg-admin { border-color: rgba(201,169,98,.45); }
.msg-head { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; margin-bottom: .4rem; font-size: .95rem; }
.msg-head time, .thread-status time { color: var(--text-3); font-size: .8rem; margin-left: auto; }
.msg-body { overflow-wrap: anywhere; }
.thread-status { color: var(--text-2); font-size: .9rem; display: flex; gap: .75rem; align-items: center; padding: 2px 4px; }
.thread-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }

/* Attachments */
.attach-list { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.attach { display: flex; align-items: center; gap: .6rem; background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; text-decoration: none; color: var(--text); max-width: 100%; }
.attach:hover { border-color: var(--gold); }
.attach-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--bg); }
.attach-name { overflow-wrap: anywhere; font-size: .9rem; }
.attach-size { color: var(--text-3); font-size: .8rem; white-space: nowrap; }

/* Responsive */
@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .row { flex-direction: column; gap: 0; }
  .js .nav-toggle { display: block; }
  .js .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: .25rem; padding: .5rem 0 1rem; }
  .js .nav.open { display: flex; }
  .nav { width: 100%; flex-wrap: wrap; padding-bottom: .75rem; }
  .nav-user { margin: .5rem 0 0; padding: .75rem 0 0; border-left: 0; border-top: 1px solid var(--line); justify-content: space-between; }
  .nav > a { padding: .6rem .2rem; }

  /* Tables become stacked cards */
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive { background: none; border: 0; }
  .table.responsive thead { position: absolute; left: -9999px; }
  .table.responsive tr { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 6px 0; }
  .table.responsive td { border: 0; padding: .4rem 1rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table.responsive td::before { content: attr(data-label); color: var(--text-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; flex: none; padding-top: .15rem; }
  .row-actions { justify-content: flex-end; }
}
@media (max-width: 420px) {
  .auth-card { padding: 24px 18px; }
  .container { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.auth-back { margin-top: .5rem; font-size: .85rem; }
