/* EWOK TECH Client Portal: black band + red rule, Space Grotesk, red only to point. */
:root {
  --black: #111111; --red: #E5483B; --red-text: #B8312A; --bg: #F5F5F4; --card: #FFFFFF;
  --ink: #111111; --body: #2A2A2A; --muted: #4A4A4A; --rule: #DDDDDB; --field: #8A8A8A;
  --tint: #FDECEA; --ok: #1F6B3A; --ok-bg: #E5F4E4; --warn: #8A5A00; --warn-bg: #FFF4D6; --blue: #1E5A8C; --blue-bg: #E7F1FB;
  --font: 'Space Grotesk', Arial, Helvetica, sans-serif; color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red-text); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }

.topbar { position: sticky; top: 0; z-index: 20; background: var(--black); border-bottom: 4px solid var(--red); }
.top-in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: calc(9px + env(safe-area-inset-top, 0px)) 20px 9px; }
.brand img { display: block; height: 34px; width: auto; }
.tag { color: #C8C8C8; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; border-left: 1.5px solid #3A3A3A; padding-left: 14px; white-space: nowrap; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { color: #C8C8C8; text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 6px; font-size: 15px; }
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; background: #262626; }
.who { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.who select { background: #262626; color: #fff; border: 1px solid #3A3A3A; border-radius: 6px; padding: 6px 8px; max-width: 190px; }
.signout { background: none; border: none; color: #A8A8A8; cursor: pointer; font-size: 14px; padding: 6px; }
.signout:hover { color: #fff; }
.tabbar { display: none; }
@media (max-width: 760px) {
  .nav, .tag { display: none; }
  .top-in { padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--black);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #262626; }
  .tabbar a { color: #A8A8A8; text-decoration: none; font-size: 11px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: #fff; }
  .tabbar a[aria-current="page"] svg { stroke: var(--red); }
}

main { max-width: 1040px; margin: 0 auto; padding: 26px 20px 80px; outline: none; }
@media (max-width: 760px) { main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px)); } }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--red-text); }
h1 { margin: 2px 0 18px; font-size: 30px; line-height: 1.12; letter-spacing: -.02em; }
h2 { margin: 0 0 12px; font-size: 19px; letter-spacing: -.01em; }
h3 { margin: 0; font-size: 16px; }
@media (max-width: 600px) { h1 { font-size: 26px; } }

.btn { border: none; border-radius: 6px; padding: 11px 18px; min-height: 46px; font-weight: 700; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: 14px; }
.btn-primary { background: var(--red); color: var(--black); }
.btn-primary:hover { background: #EC5A4E; }
.btn-dark { background: var(--black); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--field); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; }
.card.hot { border: 2px solid var(--red); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.grid .card { margin-bottom: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-head a { font-size: 14px; font-weight: 700; text-decoration: none; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--body); white-space: nowrap; display: inline-block; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.red { background: var(--tint); color: var(--red-text); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }

.bar { height: 10px; background: #EBEBE9; border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; background: var(--red); border-radius: 999px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid #EEEEEC; }
.list li:first-child { border-top: none; }
.list a.item, .list .item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; text-decoration: none; color: inherit; }
.list .item b { display: block; }
.list .meta { font-size: 14px; color: var(--muted); }
.empty { color: var(--muted); font-size: 15px; padding: 6px 0; }

/* login */
.login { max-width: 420px; margin: 7vh auto 0; }
.login-head { background: var(--black); border-bottom: 4px solid var(--red); border-radius: 14px 14px 0 0; padding: 22px 24px; display: flex; align-items: center; gap: 14px; }
.login-head img { height: 40px; }
.login-head span { color: #C8C8C8; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; border-left: 1.5px solid #3A3A3A; padding-left: 14px; }
.login-body { background: #fff; border: 1px solid var(--rule); border-top: none; border-radius: 0 0 14px 14px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login-body h1 { margin: 0; font-size: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 14px; font-weight: 500; color: var(--body); }
.field input, .field textarea, .field select { width: 100%; padding: 11px 12px; border: 1.5px solid var(--field); border-radius: 6px; background: #fff; min-height: 46px; font-size: 16px; }
.field textarea { min-height: 120px; resize: vertical; }
.code-input { font-size: 28px !important; letter-spacing: .4em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.msg { border-radius: 6px; padding: 10px 12px; font-size: 15px; font-weight: 500; }
.msg.err { background: var(--tint); color: var(--red-text); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: var(--blue-bg); color: var(--blue); }

/* proposal sheet */
.sheet-doc { background: #fff; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.doc-head { background: var(--black); border-bottom: 5px solid var(--red); color: #fff; padding: 26px 28px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.doc-head .eb { font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--red); text-transform: uppercase; }
.doc-head h1 { color: #fff; margin: 6px 0 4px; font-size: 28px; }
.doc-head .sub { color: #C8C8C8; font-size: 15px; }
.doc-head img { height: 44px; background: transparent; }
@media (max-width: 600px) { .doc-head { padding: 20px; flex-direction: column-reverse; } .doc-head img { height: 34px; } }
.doc-body { padding: 24px 28px 28px; }
@media (max-width: 600px) { .doc-body { padding: 18px 18px 22px; } }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-bottom: 18px; }
.kv div { border-bottom: 1px solid #EEEEEC; padding: 8px 0; }
.kv span { display: block; font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } }
.sec { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--red-text); margin: 22px 0 8px; }
.bul { list-style: none; margin: 0; padding: 0; }
.bul li { position: relative; padding-left: 18px; margin-bottom: 6px; }
.bul li::before { content: ""; position: absolute; left: 1px; top: 9px; width: 7px; height: 7px; background: var(--red); }
table.items { width: 100%; border-collapse: collapse; font-size: 15px; }
table.items th { background: var(--black); color: #fff; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; text-align: left; padding: 8px 10px; }
table.items td { padding: 9px 10px; border-bottom: 1px solid #EEEEEC; vertical-align: top; }
table.items .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.items tr.secrow td { background: var(--bg); color: var(--red-text); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 6px 10px; }
table.items tr.opt td { background: #FAFAF9; }
table.items label.optpick { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
table.items label.optpick input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--black); flex-shrink: 0; }
@media (max-width: 600px) { table.items .hide-sm { display: none; } }
.totals { margin: 14px 0 0 auto; max-width: 340px; display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; font-variant-numeric: tabular-nums; }
.totals .t { font-size: 20px; font-weight: 700; border-top: 2px solid var(--ink); padding-top: 6px; }
.accept { border: 2px solid var(--red); border-radius: 14px; background: #fff; padding: 20px 22px; margin-bottom: 18px; }
.accept h2 { margin-bottom: 6px; }
.sig { font-family: 'Brush Script MT', 'Segoe Script', 'Snell Roundhand', cursive; font-size: 30px !important; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--black); flex-shrink: 0; margin-top: 1px; }
.accepted { background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; font-weight: 500; }
.accepted b { color: var(--ink); }

/* project */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 30px; bottom: -8px; width: 2px; background: var(--rule); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--field); background: #fff; display: grid; place-items: center; position: relative; z-index: 1; }
.timeline li.done .dot { background: var(--ink); border-color: var(--ink); }
.timeline li.done .dot::after { content: ""; width: 9px; height: 5px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.timeline li.next .dot { border-color: var(--red); border-width: 3px; }
.timeline li.next b { color: var(--red-text); }
.timeline .when { font-size: 14px; color: var(--muted); white-space: nowrap; }
.update { border-top: 1px solid #EEEEEC; padding: 14px 0; }
.update:first-child { border-top: none; padding-top: 0; }
.update .when { font-size: 13px; color: var(--muted); }
.update p { margin: 4px 0 8px; white-space: pre-wrap; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photos a { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* docs */
.doc-row { display: flex; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid #EEEEEC; text-decoration: none; color: inherit; }
.doc-row:first-child { border-top: none; }
.doc-row .ic { width: 40px; height: 40px; border-radius: 8px; background: var(--black); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.doc-row .ic.pdf { background: var(--red-text); }
.doc-row .ic.vid { background: var(--blue); }
.doc-row .w { flex: 1; min-width: 0; }
.doc-row .w b { display: block; }
.doc-row:hover b { text-decoration: underline; }

/* support */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1.5px solid var(--rule); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 40px; }
.chips button[aria-pressed="true"] { background: var(--black); color: #fff; border-color: var(--black); }
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.bubble { max-width: 84%; border-radius: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--rule); }
.bubble.staff { align-self: flex-start; border-left: 4px solid var(--red); }
.bubble.client { align-self: flex-end; background: var(--black); color: #fff; border-color: var(--black); }
.bubble .by { font-size: 12px; opacity: .75; margin-bottom: 4px; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble .photos { margin-top: 8px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-list span { background: var(--bg); border-radius: 6px; padding: 5px 10px; font-size: 13px; }

/* invoices */
.inv { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid #EEEEEC; }
.inv:first-child { border-top: none; }
.inv .w { flex: 1; min-width: 200px; }
.inv .amt { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 70; background: var(--black); color: #fff; padding: 11px 16px; border-radius: 6px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
@media (min-width: 761px) { .toast { bottom: 28px; } }

@media print {
  .topbar, .tabbar, .no-print, .toast { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .sheet-doc { border: none; border-radius: 0; }
  .doc-head, table.items th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
