/* EricOlsen.Studio Client Portal */
:root {
  --ink: #1a1b21; --ink-soft: #2b2d36; --orange: #f57d2d; --orange-dark: #e0691b; --orange-soft: #fdefe4; --orange-text: #b4531a;
  --bg: #fafafa; --surface: #fff; --text: #1a1b21; --muted: #6b6b6b; --accent-light: #f1efec; --border: #e7e4e0;
  --green: #2e7d4f; --green-soft: #e6f4ec; --red: #b3261e; --red-soft: #fdecea; --blue: #1f5fbf; --blue-soft: #e8f0fc;
  --font-body: 'DM Sans', system-ui, sans-serif; --font-heading: 'Space Grotesk', 'DM Sans', sans-serif;
  --radius: 12px; --shadow: 0 1px 2px rgba(26,27,33,.06), 0 8px 24px -12px rgba(26,27,33,.12);
  --sidebar: 260px;
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.55 }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em }
h1 { font-size: 1.75rem } h2 { font-size: 1.25rem } h3 { font-size: 1.05rem }
p { margin: 0 0 1em }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px }
a:hover { color: var(--orange-dark) }
button, input, select, textarea { font: inherit; color: inherit }
img { max-width: 100% }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100 }
.skip:focus { left: 8px }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.muted { color: var(--muted) }
.small { font-size: .875rem }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; word-break: break-all }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; cursor: pointer; text-decoration: none; transition: .2s; line-height: 1.2 }
.btn:hover { background: var(--ink-soft); color: #fff }
.btn.primary { background: var(--orange); border-color: var(--orange) }
.btn.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark) }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--border) }
.btn.ghost:hover { background: var(--accent-light); color: var(--ink) }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red) }
.btn.sm { padding: 6px 12px; font-size: .875rem; border-radius: 8px }
.btn:disabled { opacity: .5; cursor: wait }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer }

/* ---- forms ---- */
.field { margin-bottom: 16px }
.field label, .field .lbl { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem }
.field .help { color: var(--muted); font-size: .875rem; margin: -2px 0 8px }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=date], .field input[type=url], .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; transition: border .2s }
.field textarea { min-height: 110px; resize: vertical }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(245,125,45,.25) }
.field .req { color: var(--orange-text) }
.checks label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 6px 0; cursor: pointer }
.checks input { margin-top: 4px; accent-color: var(--orange) }
.row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }
.error { color: var(--red); background: var(--red-soft); padding: 10px 12px; border-radius: 8px; margin: 0 0 14px; font-size: .95rem }
.notice { background: var(--orange-soft); border-left: 3px solid var(--orange); padding: 12px 14px; border-radius: 0 10px 10px 0; margin: 0 0 18px }

/* ---- auth pages ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%) }
.auth .card { width: 100%; max-width: 420px }
.auth .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px }
.auth .brand img { width: 44px; height: 44px }
.brand-text { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem }
.brand-text .dot { color: var(--orange) }
.brand-text small { font-weight: 500; color: var(--muted); font-size: .8em; margin-left: 2px }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh }
.side { background: var(--ink); color: #fff; padding: 22px 18px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow: auto }
.side .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none }
.side .brand img { width: 36px; height: 36px; border-radius: 8px; background: #fff; padding: 3px }
.side .client { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: #a9abb6; margin: 4px 0 0 }
.side .client strong { display: block; color: #fff; font-size: 1rem; letter-spacing: 0; text-transform: none; font-family: var(--font-heading) }
.nav { display: flex; flex-direction: column; gap: 2px; list-style: none; padding: 0; margin: 0 }
.nav a { display: flex; align-items: center; gap: 10px; color: #d7d8de; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-weight: 500 }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff }
.nav a.active { background: rgba(255,255,255,.1); color: #fff }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85 }
.nav .badge { margin-left: auto; background: var(--orange); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px }
.side .spacer { flex: 1 }
.side .me { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; font-size: .9rem; color: #d7d8de }
.side .me strong { color: #fff; display: block }
.side .me button { color: #a9abb6 }
.side .me button:hover { color: #fff }
.side .section { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #8a8c98; margin: 8px 0 2px; padding-left: 10px }
.main { padding: 32px 40px 80px; max-width: 1080px; width: 100% }
.topbar { display: none }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px }
.page-head .kicker { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px }
.page-head h1 { margin: 0 }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow) }
.card + .card { margin-top: 18px }
.card h2 { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 14px }
.grid2 { display: grid; gap: 18px; grid-template-columns: 1fr 1fr }
.list { list-style: none; margin: 0; padding: 0 }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border) }
.list li:first-child { border-top: 0 }
.list .grow { flex: 1; min-width: 0 }
.list .title { font-weight: 600 }
.list .sub { color: var(--muted); font-size: .875rem }
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--accent-light); color: var(--ink); white-space: nowrap }
.pill.orange { background: var(--orange-soft); color: var(--orange-text) }
.pill.green { background: var(--green-soft); color: var(--green) }
.pill.red { background: var(--red-soft); color: var(--red) }
.pill.blue { background: var(--blue-soft); color: var(--blue) }
.empty { color: var(--muted); padding: 18px 0; text-align: center }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 20px }
.quick a { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 8px 14px; text-decoration: none; font-weight: 500; font-size: .95rem }
.quick a:hover { border-color: var(--ink) }
.quick svg { width: 16px; height: 16px }

/* ---- tracker ---- */
.tracker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 10px 0 6px; position: relative }
.tracker .step { text-align: center; position: relative; padding-top: 26px; font-size: .85rem; color: var(--muted) }
.tracker .step::before { content: ""; position: absolute; top: 8px; left: 50%; width: 100%; height: 2px; background: var(--border); transform: translateX(0) }
.tracker .step:last-child::before { display: none }
.tracker .step::after { content: ""; position: absolute; top: 2px; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--border); transform: translateX(-50%); z-index: 1 }
.tracker .step.done { color: var(--ink) }
.tracker .step.done::after { background: var(--ink); border-color: var(--ink) }
.tracker .step.done::before { background: var(--ink) }
.tracker .step.now { color: var(--ink); font-weight: 700 }
.tracker .step.now::after { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft) }

/* ---- tasks ---- */
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border) }
.task:first-child { border-top: 0 }
.task .box { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px; flex: none; margin-top: 2px; background: #fff; cursor: pointer; display: grid; place-items: center; color: #fff }
.task .box.on { background: var(--green); border-color: var(--green) }
.task .box:disabled { cursor: default; opacity: .6 }
.task .box svg { width: 14px; height: 14px }
.task.done .t { text-decoration: line-through; color: var(--muted) }
.task .t { font-weight: 600 }
.task .d { color: var(--muted); font-size: .875rem; white-space: pre-line }
.task .who { margin-left: auto; flex: none }
.phase-h { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 4px }

/* ---- files ---- */
.folders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px }
.folder { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fff; cursor: pointer; text-align: left; font-weight: 600 }
.folder.on { border-color: var(--ink); background: var(--accent-light) }
.folder small { display: block; font-weight: 400; color: var(--muted) }
.drop { border: 2px dashed var(--border); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); margin-top: 16px }
.drop.over { border-color: var(--orange); background: var(--orange-soft) }
.drop input { display: none }

/* ---- messages ---- */
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px }
.msg { max-width: 78%; padding: 12px 14px; border-radius: 14px; background: var(--accent-light); white-space: pre-wrap; word-wrap: break-word }
.msg.mine { align-self: flex-end; background: var(--ink); color: #fff }
.msg .meta { font-size: .75rem; opacity: .7; margin-bottom: 4px }
.msg a { color: inherit }
.compose textarea { min-height: 80px }

/* ---- contract ---- */
.doc { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 32px; line-height: 1.6; font-size: .97rem }
.doc h2, .doc h3 { font-family: var(--font-heading) }
.doc h3 { font-size: 1rem; margin-top: 1.4em }
.sig { margin-top: 22px; padding: 18px; background: var(--accent-light); border-radius: 10px; font-size: .9rem }
.sig .name { font-family: 'Space Grotesk', cursive; font-size: 1.6rem; font-style: italic; font-weight: 600; margin: 6px 0 }
.invoice-amt { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; white-space: nowrap }

/* ---- activity ---- */
.act { font-size: .9rem; color: var(--muted); padding: 6px 0; border-top: 1px dashed var(--border) }
.act:first-child { border-top: 0 }
.act b { color: var(--ink); font-weight: 500 }

/* ---- studio ---- */
.table { width: 100%; border-collapse: collapse; font-size: .95rem }
.table th { text-align: left; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--border) }
.table td { padding: 10px 6px; border-bottom: 1px solid var(--border); vertical-align: top }
details.box { border: 1px solid var(--border); border-radius: 10px; padding: 0; background: #fff; margin-top: 12px }
details.box summary { cursor: pointer; font-weight: 600; padding: 12px 16px }
details.box .inner { padding: 4px 16px 16px }

/* ---- toast ---- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; max-width: 90vw }
#toast.show { opacity: 1; transform: translateX(-50%) }
#toast.err { background: var(--red) }
.loading { padding: 40px; text-align: center; color: var(--muted) }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .25s; z-index: 40; height: 100vh }
  .side.open { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.35) }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 30 }
  .topbar .brand-text { color: #fff }
  .topbar button { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 8px; padding: 6px 10px }
  .main { padding: 20px 16px 60px }
  .row, .grid2 { grid-template-columns: 1fr }
  .folders { grid-template-columns: 1fr }
  .tracker .step { font-size: .7rem }
  .doc { padding: 18px }
  .msg { max-width: 92% }
}
@media print {
  .side, .topbar, .no-print, #toast { display: none !important }
  .shell { display: block } .main { padding: 0; max-width: none }
  .doc { border: 0; padding: 0 }
  body { background: #fff }
}
