/* ============================================================
   OmniGrowth Client Zone — stylesheet
   Brand tokens mirrored from the main site (styles.css)
   ============================================================ */

:root {
  --blue: #1a6eff;
  --purple: #7c3aed;
  --navy: #030d1f;
  --navy-mid: #050f26;
  --navy-panel: #0a1630;
  --white: #fff;
  --off-white: #f7f8fc;
  --dim: rgba(255, 255, 255, 0.6);
  --dimmer: rgba(255, 255, 255, 0.4);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  /* raised surfaces — the portal sits above the page, it isn't painted on it */
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --sheen: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,0) 42%);
  --lift: 0 1px 0 rgba(255,255,255,.06) inset, 0 10px 30px rgba(0,0,0,.35);
  --red: #ff4214;
  --green: #16c784;
  --amber: #f7b500;
  --radius: 16px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* class selectors below (.pill, .dot) outrank the UA [hidden] rule — force it */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: 'Barlow', system-ui, sans-serif;
  /* the solid colour must stay a background-COLOR: it is the only layer that
     paints past the viewport once background-attachment is fixed */
  background-color: var(--navy);
  background-image:
    radial-gradient(1100px 600px at 15% -10%, rgba(26, 110, 255, 0.14), transparent 60%),
    radial-gradient(900px 520px at 95% 0%, rgba(124, 58, 237, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 520px);
  background-attachment: fixed;
  color: var(--white);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: 'Bebas Neue', sans-serif; font-weight: 400; letter-spacing: 0.5px; }
.label, .tab, .pill, .badge, .col-title { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 1px; }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------------- layout ---------------- */
.shell { min-height: 100%; display: flex; flex-direction: column; }
.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(3, 13, 31, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 32px; width: auto; display: block; }
.auth-brand { justify-content: center; margin-bottom: 26px; }
.auth-brand img { height: 46px; }
.brand-text { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 1px; }
.brand-text span { color: var(--blue); }

.who { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--dim); }
.who strong { color: var(--white); font-weight: 600; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: none; cursor: pointer;
  padding: 14px 18px; font-size: 14px; color: var(--dim);
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
  position: relative;
}
.tab { display: inline-flex; align-items: center; gap: 8px; }
.tab svg { flex: none; opacity: .75; transition: opacity .2s; }
.tab.active svg, .tab:hover svg { opacity: 1; }
.tab:hover { color: var(--white); }
.tab.active { color: var(--white); border-bottom-color: var(--blue); }
.tab .dot {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 7px;
  background: var(--blue); color: #fff; border-radius: 9px;
  font-size: 11px; line-height: 18px; text-align: center; letter-spacing: 0;
  font-family: 'Barlow', sans-serif;
}

main { flex: 1; padding: 36px 0 80px; }
.view { display: none; }
.view.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-head h1 { font-size: 38px; line-height: 1; }
.view-head p { color: var(--dim); font-size: 14px; }
.view-head .spacer { margin-left: auto; }

/* ---------------- cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--lift);
}
.card.welcome { margin-bottom: 24px; color: var(--dim); }
.card + .card { margin-top: 16px; }

.grid { display: grid; gap: 16px; }
/* grid items default to min-width:auto, so one wide child (a table) stretches
   the whole track and pushes the page sideways on narrow screens */
.grid > *, .msg-layout > * { min-width: 0; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }

.res-card {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 22px 20px;
  position: relative; overflow: hidden;
  transition: border-color .25s, background .25s, transform .25s;
}
.res-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), var(--purple), transparent);
  opacity: 0; transition: opacity .25s;
}
.res-card:hover { border-color: rgba(26,110,255,.35); background: rgba(26,110,255,.04); transform: translateY(-3px); }
.res-card:hover::before { opacity: 1; }
.res-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  color: var(--blue); background: rgba(26, 110, 255, 0.1);
  border: 1px solid rgba(26, 110, 255, 0.25);
  transition: background .25s, border-color .25s;
}
.res-card:hover .res-ico { background: rgba(26, 110, 255, 0.18); border-color: rgba(26, 110, 255, 0.5); }
.res-ico.sm {
  width: 26px; height: 26px; border-radius: 7px; margin-right: 9px;
  vertical-align: -7px; border-color: var(--line-strong); background: rgba(255,255,255,.04);
}
.res-card h3 { font-size: 20px; }
.res-card p { font-size: 13px; color: var(--dim); }
.res-card .go { margin-top: auto; font-size: 12px; color: var(--blue); font-weight: 600; letter-spacing: .5px; }

/* ---------------- pipeline ---------------- */
.stage-row {
  display: grid; grid-template-columns: minmax(120px, 1.4fr) 3fr auto minmax(80px, auto);
  align-items: center; gap: 14px; padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.stage-row:last-child { border-bottom: 0; }
.stage-name { font-size: 14px; overflow-wrap: anywhere; }
.stage-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.stage-bar i {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
}
.stage-n { font-family: 'Bebas Neue', sans-serif; font-size: 21px; line-height: 1; min-width: 26px; text-align: right; }
.stage-v { font-size: 13px; color: var(--dim); text-align: right; white-space: nowrap; }
.sub-line { font-size: 12px; color: var(--dimmer); margin-top: 3px; }

@media (max-width: 620px) {
  /* the bar is decoration; on a phone the numbers matter more */
  .stage-row { grid-template-columns: 1fr auto auto; gap: 10px; }
  .stage-bar { display: none; }
}

/* ---------------- admin: headings, buttons, glance ---------------- */
.card-head {
  font-size: 20px; display: flex; align-items: center; gap: 10px;
}
.card-head svg { flex: none; color: var(--blue); opacity: .9; }

/* every button that carries an icon lines it up with the label */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
/* keep labels on one line where there is room, but never at the cost of
   pushing a phone screen sideways — the mobile block releases this */
@media (min-width: 621px) { .btn { white-space: nowrap; } }
.btn { max-width: 100%; }
.btn svg { flex: none; opacity: .85; }
/* a delete in a list is a quiet ghost until you reach for it — .btn.danger
   (solid red) is reserved for a deliberate, prominent destructive action */
.btn.ghost.del:hover {
  border-color: rgba(255, 66, 20, .55); color: #ff9878;
  background: rgba(255, 66, 20, .08);
}

.picker { position: relative; display: inline-flex; align-items: center; }
.picker select { padding-left: 12px; }

.res-ico.sm.brand { background: #fff; border-color: rgba(255,255,255,.7); padding: 3px; }
.res-ico.sm.brand svg { width: 100%; height: 100%; }

/* at-a-glance strip: what needs attention on this client */
.glance {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.glance-cell {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; cursor: pointer;
  background: var(--surface); background-image: var(--sheen);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--lift);
  transition: transform .2s, border-color .2s, background-color .2s;
}
.glance-cell:hover { transform: translateY(-2px); border-color: var(--line-strong); background-color: var(--surface-2); }
.glance-ico {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 13px;
  color: var(--blue); background: rgba(26,110,255,.14); border: 1px solid rgba(26,110,255,.3);
}
.glance-ico svg { width: 22px; height: 22px; }
.glance-ico.amber  { color: var(--amber); background: rgba(247,181,0,.14);  border-color: rgba(247,181,0,.32); }
.glance-ico.green  { color: var(--green); background: rgba(22,199,132,.14); border-color: rgba(22,199,132,.32); }
.glance-ico.red    { color: #ff7a55;      background: rgba(255,66,20,.14);  border-color: rgba(255,66,20,.34); }
.glance-ico.violet { color: #a78bfa;      background: rgba(124,58,237,.16); border-color: rgba(124,58,237,.34); }
.glance-ico.grey   { color: var(--dim);   background: rgba(255,255,255,.05); border-color: var(--line); }
.glance-txt { display: flex; flex-direction: column; min-width: 0; }
.glance-v { font-family: 'Bebas Neue', sans-serif; font-size: 27px; line-height: 1.05; }
.glance-k {
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  letter-spacing: 1px; font-size: 12px; color: var(--dim);
}
.glance-n { font-size: 12px; color: var(--dimmer); overflow-wrap: anywhere; }

/* ---------------- operator preview banner ---------------- */
.preview-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 24px;
  background: linear-gradient(90deg, rgba(247,181,0,.18), rgba(247,181,0,.06));
  border-bottom: 1px solid rgba(247,181,0,.4);
  color: #ffd97a; font-size: 13px;
}
.preview-bar strong {
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  letter-spacing: 1px; color: var(--amber);
}
.preview-bar .btn { margin-left: auto; }
.is-preview .topbar { top: 0; }

/* ---------------- app launcher ---------------- */
.launcher {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}
.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 20px 18px 18px;
  border-radius: 20px;
  background: var(--surface);
  background-image: var(--sheen);
  border: 1px solid var(--line);
  box-shadow: var(--lift);
  min-height: 168px;
  overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.8,.3,1), border-color .22s, background-color .22s, box-shadow .22s;
}
.tile:hover {
  transform: translateY(-4px);
  background-color: var(--surface-2);
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,.09) inset, 0 18px 44px rgba(0,0,0,.5);
}
.tile:active { transform: translateY(-1px); }
.tile:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* the squircle — an iOS app icon, sized to be the thing you actually see */
.tile-ico {
  display: grid; place-items: center;
  width: 62px; height: 62px;
  border-radius: 18px;
  margin-bottom: 14px;
  color: var(--blue);
  background: rgba(26, 110, 255, 0.14);
  border: 1px solid rgba(26, 110, 255, 0.3);
  box-shadow: 0 6px 18px rgba(0,0,0,.32);
  transition: transform .22s cubic-bezier(.2,.8,.3,1);
}
.tile:hover .tile-ico { transform: scale(1.06); }
.tile-ico svg { width: 30px; height: 30px; display: block; }

/* brand marks need a light plate — Drive and Meta are coloured, not monochrome */
.tile-ico.brand {
  background: #fff;
  border-color: rgba(255,255,255,.75);
}
.tile-ico.brand svg { width: 34px; height: 34px; }

.tile-ico.violet { color: #a78bfa; background: rgba(124,58,237,.16); border-color: rgba(124,58,237,.34); }
.tile-ico.amber  { color: #f7b500; background: rgba(247,181,0,.14);  border-color: rgba(247,181,0,.32); }
.tile-ico.green  { color: #16c784; background: rgba(22,199,132,.14); border-color: rgba(22,199,132,.32); }
.tile-ico.blue   { color: #4f8bff; background: rgba(26,110,255,.16); border-color: rgba(26,110,255,.34); }

.tile-name {
  font-family: 'Barlow', sans-serif; font-weight: 600;
  font-size: 15px; line-height: 1.25; color: var(--white);
  overflow-wrap: anywhere;
}
.tile-sub {
  font-size: 12.5px; line-height: 1.35; color: var(--dim);
  overflow-wrap: anywhere;
}
.tile-badge {
  position: absolute; top: 14px; right: 14px;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; display: grid; place-items: center;
  background: var(--red); color: #fff;
  font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.empty.sm { padding: 34px 20px; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--lift); }
.stat .k { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; color: var(--dim); }
.stat .v { font-family: 'Bebas Neue', sans-serif; font-size: 40px; line-height: 1.1; }
.stat .sub { font-size: 12px; color: var(--dimmer); }
.bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--purple)); }

/* ---------------- buttons ---------------- */
.btn {
  background: linear-gradient(135deg, #1a6eff, #5b21b6);
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .3px;
  padding: 12px 24px; border-radius: 8px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 24px rgba(26,110,255,.35);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(26,110,255,.5); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.sm { font-size: 12px; padding: 8px 16px; }
.btn.ghost {
  background: transparent; border: 1.5px solid var(--line-strong);
  color: var(--dim); box-shadow: none; font-weight: 600;
}
.btn.ghost:hover { border-color: rgba(255,255,255,.45); color: #fff; }
.btn.danger { background: linear-gradient(135deg, #ff4214, #b91c1c); box-shadow: none; }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; color: var(--dim); }
input, textarea, select {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 11px 13px; width: 100%;
  transition: border-color .2s, background .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: rgba(26,110,255,.6); background: rgba(26,110,255,.06);
}
select option { background: var(--navy-mid); }
textarea { resize: vertical; min-height: 90px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* ---------------- pills / badges ---------------- */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; border: 1px solid var(--line-strong); color: var(--dim);
}
.pill.blue  { color: #7fb0ff; border-color: rgba(26,110,255,.45);  background: rgba(26,110,255,.12); }
.pill.green { color: #5ff0b8; border-color: rgba(22,199,132,.45);  background: rgba(22,199,132,.12); }
.pill.amber { color: #ffd76a; border-color: rgba(247,181,0,.45);   background: rgba(247,181,0,.12); }
.pill.red   { color: #ff9c80; border-color: rgba(255,66,20,.45);   background: rgba(255,66,20,.12); }
.pill.purple{ color: #c4a6ff; border-color: rgba(124,58,237,.5); background: rgba(124,58,237,.14); }
.pill.grey  { color: var(--dim); }

/* ---------------- tables ---------------- */
table { width: 100%; border-collapse: collapse; }
th {
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  letter-spacing: 1px; font-size: 12px; color: var(--dim);
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
td { padding: 14px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.table-wrap { width: 100%; }
.mini-select { width: auto; padding: 5px 8px; font-size: 12px; }

/* ---------------- todos ---------------- */
.todo {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.02); transition: border-color .2s;
}
.todo + .todo { margin-top: 10px; }
.todo:hover { border-color: var(--line-strong); }
.todo.done { opacity: .5; }
.todo.done .todo-title { text-decoration: line-through; }
.todo-check {
  width: 22px; height: 22px; flex: none; margin-top: 2px;
  border: 1.5px solid var(--line-strong); border-radius: 6px;
  background: transparent; cursor: pointer; display: grid; place-items: center;
  font-size: 13px; color: transparent; transition: all .2s;
}
.todo-check.on { background: linear-gradient(135deg,#1a6eff,#5b21b6); border-color: transparent; color: #fff; }
.todo-check:disabled { cursor: default; }
.todo-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.todo-title { font-weight: 600; }
.todo-detail { font-size: 13px; color: var(--dim); margin-top: 3px; overflow-wrap: anywhere; }
.todo-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.col-title { font-size: 13px; color: var(--dim); margin-bottom: 12px; }

.group-head {
  font-size: 22px; margin: 30px 0 14px; display: flex; align-items: center; gap: 12px;
}
.group-head svg {
  flex: none; padding: 7px; box-sizing: content-box;
  color: var(--blue); background: rgba(26, 110, 255, 0.1);
  border: 1px solid rgba(26, 110, 255, 0.28); border-radius: 9px;
}
.group-head::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(26,110,255,.45), transparent);
}

/* ---------------- messages ---------------- */
.msg-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: 560px; }
.thread-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-y: auto; max-height: 640px; }
.thread-item { padding: 12px; border-radius: 10px; cursor: pointer; transition: background .2s; }
.thread-item:hover { background: rgba(255,255,255,.04); }
.thread-item.active { background: rgba(26,110,255,.12); border: 1px solid rgba(26,110,255,.35); }
.thread-item .t { font-weight: 600; font-size: 14px; }
.thread-item .s { font-size: 12px; color: var(--dimmer); margin-top: 2px; }

.msg-pane { display: flex; flex-direction: column; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.msg-scroll { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; max-height: 480px; }
.bubble { max-width: 74%; padding: 13px 16px; border-radius: 14px; font-size: 14px; overflow-wrap: anywhere; }
.bubble .meta { font-size: 11px; color: var(--dimmer); margin-top: 6px; }
.bubble.them { align-self: flex-start; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, rgba(26,110,255,.28), rgba(124,58,237,.22)); border: 1px solid rgba(26,110,255,.4); border-bottom-right-radius: 4px; }
.composer { border-top: 1px solid var(--line); padding: 14px; display: flex; gap: 10px; align-items: flex-end; background: rgba(0,0,0,.2); }
.composer textarea { min-height: 46px; max-height: 160px; }

/* ---------------- login ---------------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(160deg, rgba(26,110,255,.1), rgba(124,58,237,.07)), var(--navy-mid);
  border: 1px solid rgba(26,110,255,.35);
  border-radius: 20px; padding: 40px 34px;
  box-shadow: var(--shadow), 0 0 70px rgba(26,110,255,.14);
  position: relative; overflow: hidden;
}
.auth-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--purple)); }
.auth-card h1 { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.auth-card .sub { color: var(--dim); font-size: 14px; margin-bottom: 26px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.auth-alt { margin-top: 18px; text-align: center; font-size: 13px; color: var(--dim); }
.auth-alt a { color: var(--blue); font-weight: 600; cursor: pointer; }

.notice { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.notice.err { background: rgba(255,66,20,.12); border: 1px solid rgba(255,66,20,.4); color: #ffb4a0; }
.notice.ok  { background: rgba(22,199,132,.12); border: 1px solid rgba(22,199,132,.4); color: #7ff0c0; }
.notice.warn{ background: rgba(247,181,0,.12); border: 1px solid rgba(247,181,0,.4); color: #ffdf95; }
.notice:not(.ok):not(.err):not(.warn) {
  background: var(--surface); border: 1px solid var(--line); color: var(--dim);
}

/* small explanatory copy under a field or heading */
.hint { display: block; font-size: 12.5px; color: var(--dimmer); line-height: 1.5; margin-bottom: 14px; }
.field .hint { margin: 6px 0 0; }
.hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 5px; color: var(--dim);
}

.check {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--dim); margin-bottom: 16px; cursor: pointer;
}
.check input { width: auto; min-height: 0; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.empty { text-align: center; padding: 56px 20px; color: var(--dimmer); }
.empty .big { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: var(--dim); margin-bottom: 6px; }

.loader { display: grid; place-items: center; padding: 70px; color: var(--dim); font-size: 14px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--navy-panel); border: 1px solid rgba(26,110,255,.45);
  padding: 12px 22px; border-radius: 10px; font-size: 14px; z-index: 100;
  box-shadow: var(--shadow); animation: fade .25s ease;
}

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .msg-layout { grid-template-columns: 1fr; }
  .thread-list { max-height: 200px; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 32px); }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  /* tiles stay two-up on a phone — one-up wastes the screen */
  .launcher { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .glance-cell { padding: 13px 12px; gap: 11px; }
  .glance-ico { width: 38px; height: 38px; border-radius: 11px; }
  .glance-ico svg { width: 19px; height: 19px; }
  .glance-v { font-size: 23px; }
  .tile { min-height: 152px; padding: 16px 14px 14px; border-radius: 18px; }
  .tile-ico { width: 54px; height: 54px; border-radius: 16px; margin-bottom: 11px; }
  .tile-ico svg { width: 26px; height: 26px; }
  .tile-ico.brand svg { width: 30px; height: 30px; }
  .tile-name { font-size: 14px; }
  .tile-sub { font-size: 12px; }
  .view-head h1 { font-size: 30px; }
  .who .email { display: none; }

  /* ---- iOS zooms the whole page when you focus a field under 16px ---- */
  input, textarea, select { font-size: 16px; }

  /* ---- header wraps instead of pushing the page sideways ---- */
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px 14px; }
  .who { width: 100%; margin-left: 0; justify-content: flex-end; gap: 10px; }
  #client-picker { min-width: 0 !important; flex: 1; }

  /* ---- tabs: swipeable, no visible scrollbar ---- */
  .tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; padding: 14px 14px; }

  /* ---- stacked form fields ---- */
  .row { flex-direction: column; gap: 0; }

  /* ---- comfortable touch targets ---- */
  .btn { min-height: 46px; }
  .btn.sm { min-height: 40px; padding: 10px 16px; font-size: 13px; }
  .auth-alt a { display: inline-block; padding: 12px 8px; }
  .todo-check { width: 28px; height: 28px; position: relative; }
  .todo-check::after {
    content: ''; position: absolute; top: -8px; right: -8px; bottom: -8px; left: -8px;
  }
  .mini-select { min-height: 40px; font-size: 16px !important; padding: 6px 10px !important; }

  /* ---- messaging fills the screen properly ---- */
  .msg-layout { min-height: 0; }
  .thread-list { max-height: 148px; }
  .msg-scroll { max-height: 52vh; padding: 16px; }
  .bubble { max-width: 88%; }
}

/* ---- invoices: a 6-column table cannot work on a phone, so each
        row becomes its own card with inline labels ---- */
@media (max-width: 620px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table thead { display: none; }
  .stack-table tr {
    border: 1px solid var(--line); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 12px; background: rgba(255, 255, 255, 0.02);
  }
  .stack-table td { border: none; padding: 4px 0; text-align: left; }
  .stack-table td.num { text-align: left; }
  .stack-table td[data-l]::before {
    content: attr(data-l);
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase; letter-spacing: 1px; font-size: 12px;
    color: var(--dim); display: inline-block; min-width: 92px;
  }
  .stack-table td[data-l="Invoice"]::before { display: none; }
  .stack-table td[data-l="Invoice"] { font-size: 17px; margin-bottom: 6px; }
  .stack-table td:last-child { margin-top: 10px; }
  .stack-table td:last-child .btn { width: 100%; justify-content: center; }
}

/* iOS: 100vh includes the address bar, so the login card can sit off-screen */
@supports (min-height: 100dvh) {
  .auth-page { min-height: 100dvh; }
}
