/* Tupo Pamoja workspace v2: field-first, blueprint night mode, calm light mode. */

:root {
  --bg: #061522;
  --surface: #0b2234;
  --surface-2: #0e2b40;
  --surface-3: #12354c;
  --ink: #edf6fb;
  --muted: #91aabc;
  --line: #1f465e;
  --primary: #35c58a;
  --primary-ink: #042316;
  --primary-soft: rgba(53, 197, 138, .14);
  --accent: #f2c14e;
  --good: #35c58a;
  --warn: #f2c14e;
  --warn-soft: rgba(242, 193, 78, .14);
  --danger: #ff7272;
  --danger-soft: rgba(255, 114, 114, .13);
  --grid: rgba(104, 177, 213, .075);
  --shadow: 0 12px 32px rgba(0, 0, 0, .22);
  --radius: 8px;
  --radius-sm: 7px;
  --wrap: 1180px;
}

html[data-theme="light"] {
  --bg: #f2f6f4;
  --surface: #ffffff;
  --surface-2: #f6faf8;
  --surface-3: #eaf2ee;
  --ink: #15251f;
  --muted: #667870;
  --line: #d4e1da;
  --primary: #157052;
  --primary-ink: #ffffff;
  --primary-soft: rgba(21, 112, 82, .10);
  --accent: #d99c16;
  --good: #157052;
  --warn: #a96f00;
  --warn-soft: #fff3d2;
  --danger: #c74343;
  --danger-soft: #fbe7e7;
  --grid: rgba(21, 112, 82, .045);
  --shadow: 0 8px 24px rgba(17, 42, 32, .08);
}

body {
  background:
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  color: var(--ink);
  letter-spacing: 0;
}

h1, h2, h3, p, td, th, dd, .btn { overflow-wrap: anywhere; }
h1 { font-size: 2rem; letter-spacing: 0; }
h2 { letter-spacing: 0; }
.eyebrow { font-family: Consolas, "Courier New", monospace; color: var(--primary); letter-spacing: .08em; }

.app-frame { min-height: 100vh; }
.app-column { min-width: 0; }
.sidebar { display: none; }
.mobile-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 58px; padding: .65rem 1rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.mobile-topbar .who { display: none; }
.mobile-role { color: var(--muted); font-size: .82rem; font-weight: 700; }
.mobile-nav {
  position: fixed; left: .7rem; right: .7rem; bottom: max(.65rem, env(safe-area-inset-bottom)); z-index: 40;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .25rem;
  padding: .35rem; background: color-mix(in srgb, var(--bg) 94%, transparent);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.mobile-nav a {
  display: grid; place-items: center; min-height: 46px; padding: .25rem;
  color: var(--muted); text-decoration: none; text-align: center; font-size: .73rem; font-weight: 800;
  border-radius: 7px;
}
.mobile-nav a.active { color: var(--primary-ink); background: var(--primary); }

.wrap {
  width: min(100%, var(--wrap)); max-width: var(--wrap); margin: 0 auto;
  padding: 1rem 1rem calc(6.4rem + env(safe-area-inset-bottom));
}
.foot { display: none; }

.brand { color: var(--ink); }
.brand-mark { background: var(--primary); color: var(--primary-ink); border-radius: 6px; }
.side-brand span:last-child { min-width: 0; }
.side-brand strong, .side-brand small { display: block; line-height: 1.12; }
.side-brand small { color: var(--muted); font-size: .76rem; font-weight: 600; }

.card, .panel, .rowcard, .stat {
  background: var(--surface); border-color: var(--line); border-radius: var(--radius); box-shadow: none;
}
.card, .panel { padding: 1rem; }
.rowcard { padding: .78rem .9rem; }
.rowcard:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); background: var(--surface-2); }
.page-head { align-items: end; margin-bottom: 1rem; }
.page-head h1 { margin-bottom: .15rem; }

.field input, .field select, .field textarea,
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  color: var(--ink); background: var(--surface-2); border-color: var(--line); border-radius: 7px;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.field input:focus, .field select:focus, .field textarea:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}

.btn { min-height: 44px; border-color: var(--line); border-radius: 7px; background: var(--surface-3); color: var(--ink); }
.btn:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #2a1b00; }
.btn-ghost { background: transparent; }
.btn-wa { background: #1b9651; border-color: #1b9651; color: #fff; }

.chip, .type-btn, .suggest-chip { background: var(--surface-2); border-color: var(--line); color: var(--ink); border-radius: 7px; }
.chip:has(input:checked), .type-btn.sel { background: var(--primary-soft); border-color: var(--primary); color: var(--ink); }
.svc-tag { background: var(--primary-soft); color: var(--ink); }
.tip-card { background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 36%, var(--line)); }

.stat-row { gap: .55rem; }
.stat { padding: .75rem; }
.stat span { color: var(--muted); }
.stat strong { font-size: 1.35rem; }
.pill { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.pill-active { background: var(--primary-soft); color: var(--primary); }
.pill-lead { background: var(--warn-soft); color: var(--warn); }
.pill-overdue { background: var(--danger-soft); color: var(--danger); }
.pill-suspended { background: var(--surface-3); color: var(--muted); }
.flash-success { background: var(--primary-soft); color: var(--ink); border: 1px solid var(--primary); }
.flash-error { background: var(--danger-soft); color: var(--ink); border: 1px solid var(--danger); }

.dl > div, th, td { border-color: var(--line); }
.dl dt, .muted, .rowcard .main small { color: var(--muted); }
.tabs a { background: var(--surface); border-color: var(--line); color: var(--muted); border-radius: 7px; }
.tabs a.active { background: var(--primary); color: var(--primary-ink); }

.tour { background: var(--surface); border-left: 6px solid var(--primary); }
.steps > li { background: var(--surface-2); border-color: var(--line); border-radius: 7px; }
.steps > li::before { background: var(--primary); color: var(--primary-ink); }
.steps > li span { color: var(--muted); }
.wiz-dot { background: var(--line); }
.wiz-dot.now { background: var(--accent); }
.wiz-dot.done { background: var(--primary); }

.theme-switch {
  display: flex; align-items: center; justify-content: space-between; gap: .7rem;
  color: var(--muted); font-size: .82rem; font-weight: 700;
}
.theme-switch input { position: absolute; opacity: 0; pointer-events: none; }
.theme-switch i { position: relative; width: 44px; height: 25px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); }
.theme-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: transform .16s ease; }
.theme-switch input:checked + i::after { transform: translateX(19px); background: var(--primary); }
.permission-box { min-width: 0; margin: 0; padding: .85rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.permission-box legend { padding: 0 .35rem; color: var(--muted); font-size: .82rem; font-weight: 800; }
.permission-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.permission-list > label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; padding: .65rem .75rem; background: var(--surface); }
.permission-list label > span:first-child { min-width: 0; }
.permission-list strong, .permission-list small { display: block; }
.permission-list small { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.permission-list select { width: auto; min-width: 150px; min-height: 38px; font-size: .86rem; }
.switch-row { position: relative; flex: 0 0 auto; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; display: block; width: 44px; height: 25px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); }
.switch-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: transform .16s ease; }
.switch-row input:checked + i::after { transform: translateX(19px); background: var(--primary); }
.switch-setting { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; padding: .65rem .75rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.switch-setting strong, .switch-setting small { display: block; }
.switch-setting small { margin-top: .15rem; color: var(--muted); font-size: .78rem; font-weight: 500; }

.tool-switch { display: inline-flex; gap: .25rem; margin-bottom: 1rem; padding: .25rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.tool-switch a { min-height: 40px; padding: .55rem .8rem; color: var(--muted); border-radius: 6px; text-decoration: none; font-weight: 800; }
.tool-switch a.active { color: var(--primary-ink); background: var(--primary); }
.quote-layout { display: grid; gap: 1rem; align-items: start; }
.quote-output { position: sticky; top: 1rem; padding: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 7px solid var(--accent); border-radius: 8px; }
.quote-output > div, .domain-prices > div { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.quote-output span, .quote-output strong, .domain-prices span, .domain-prices strong { display: block; }
.quote-output span, .domain-prices span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.quote-output strong, .domain-prices strong { margin-top: .1rem; font-size: 1.65rem; }
.quote-output > p:last-of-type { margin-top: .8rem; color: var(--muted); }
.quote-output details { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.quote-output details summary { cursor: pointer; color: var(--muted); font-weight: 800; }
.quote-output details dl div { display: flex; justify-content: space-between; gap: .8rem; padding: .4rem 0; }
.quote-output details dd { margin: 0; font-weight: 800; text-align: right; }
.domain-search { display: grid; gap: .75rem; align-items: end; }
.domain-name { margin: 1rem 0 .4rem; font-family: Consolas, "Courier New", monospace; font-size: 1.35rem; font-weight: 900; }
.domain-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.note-list { display: grid; gap: .55rem; margin-top: .8rem; }
.note-list article { padding: .75rem; background: var(--surface-2); border-left: 4px solid var(--primary); border-radius: 6px; }
.note-list article p { margin: 0; }
.note-list article small { display: block; margin-top: .35rem; color: var(--muted); }
.service-note { display: grid; gap: .2rem; padding: .8rem; background: var(--primary-soft); border-left: 5px solid var(--primary); border-radius: 7px; }
.service-note span { color: var(--muted); }
.quote-equation { display: grid !important; grid-template-columns: 1fr; gap: .2rem; padding: .8rem 0 !important; }
.quote-equation b { margin-bottom: .55rem; }
.toolkit-grid { display: grid; gap: .7rem; margin-bottom: 1rem; }
.toolkit-action { display: grid; gap: .2rem; padding: .9rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: 8px; text-decoration: none; }
.toolkit-action span, .promise-grid span { color: var(--muted); }
.promise-grid { display: grid; gap: 1px; margin: .8rem 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 8px; }
.promise-grid div { display: grid; gap: .15rem; padding: .8rem; background: var(--surface-2); }
.script-list { display: grid; gap: .75rem; }
.script-card { padding: .8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.script-card > div { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .55rem; }
.script-card textarea { min-height: 118px; background: var(--surface); }
.field-sheet h2 { margin-top: 1.2rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
.paper-grid { display: grid; gap: .35rem 1rem; }
.paper-grid p { margin: 0; }
.write-space { min-height: 90px; margin-bottom: .7rem; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, var(--line) 30px); }
.write-space.large { min-height: 150px; }
.form-terms { margin-top: 1rem; padding: .7rem; border: 1px solid var(--line); }
.signatures { margin-top: 2rem; }
.activity-officers, .activity-feed { display: grid; gap: .55rem; }
.activity-officers a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; text-decoration: none; }
.activity-officers span:last-child { text-align: right; }
.activity-officers strong, .activity-officers b, .activity-officers small { display: block; }
.activity-officers small, .activity-feed small { color: var(--muted); }
.activity-feed article { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.activity-feed article > i { width: 9px; height: 9px; margin-top: .4rem; background: var(--primary); border-radius: 50%; }
.activity-feed article p { margin: .15rem 0; color: var(--muted); }

/* New dashboard primitives. */
.work-hero { display: grid; gap: .9rem; padding: 1rem; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 7px solid var(--primary); border-radius: 8px; }
.work-hero h1 { margin: 0; }
.work-hero p { color: var(--muted); margin: .35rem 0 0; }
.compact-head { align-items: center; margin-bottom: .75rem; }
.compact-head h2 { margin: 0; }
.priority-grid { display: grid; gap: .75rem; margin-bottom: 1rem; }
.priority-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.priority-card strong, .priority-card small { display: block; }
.priority-card small { color: var(--muted); }
.priority-card b { font-size: 1.5rem; color: var(--primary); }
.snapshot { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-bottom: 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.snapshot div { padding: .8rem; background: var(--surface); }
.snapshot span, .snapshot strong { display: block; }
.snapshot span { color: var(--muted); font-size: .76rem; font-weight: 700; }
.snapshot strong { margin-top: .15rem; font-size: 1.25rem; }

@media (min-width: 900px) {
  .app-frame { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; align-self: start; display: grid; grid-template-rows: auto auto 1fr auto;
    gap: 1rem; height: 100vh; padding: 1rem; background: color-mix(in srgb, var(--bg) 94%, #000 6%);
    border-right: 1px solid var(--line);
  }
  .side-brand { padding: .25rem; }
  .start-visit { display: flex; align-items: center; gap: .55rem; min-height: 44px; padding: .6rem .75rem; background: var(--primary); color: var(--primary-ink); border-radius: 7px; text-decoration: none; font-weight: 900; }
  .start-visit span { font-size: 1.2rem; }
  .side-nav { display: grid; align-content: start; gap: .25rem; }
  .side-nav a { min-height: 42px; padding: .58rem .72rem; color: var(--muted); border: 1px solid transparent; border-radius: 7px; text-decoration: none; font-weight: 800; }
  .side-nav a:hover, .side-nav a.active { color: var(--ink); background: var(--surface); border-color: var(--line); }
  .side-nav a.active { box-shadow: inset 4px 0 0 var(--primary); }
  .side-footer { display: grid; gap: .8rem; padding: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
  .signed-in strong, .signed-in small { display: block; }
  .signed-in small { color: var(--muted); }
  .mobile-topbar, .mobile-nav { display: none; }
  .wrap { padding: 1.35rem 1.5rem 3rem; }
  .work-hero { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .priority-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .priority-card { min-height: 112px; align-items: flex-start; }
  .snapshot { grid-template-columns: repeat(4, 1fr); }
  .quote-layout { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); }
  .domain-search { grid-template-columns: minmax(0, 1fr) 150px auto; }
  .toolkit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .promise-grid, .paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  h1 { font-size: 1.65rem; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-head .btn { width: 100%; }
  .page-head.compact-head { align-items: center; flex-direction: row; }
  .page-head.compact-head .btn { width: auto; }
  .row-2, .chip-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .actions .btn, .actions form, .actions form .btn { width: 100%; }
  .dl > div { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .dl dd { max-width: 100%; text-align: left; }
  .tour-head { align-items: stretch; flex-direction: column; }
  .permission-list > label { align-items: stretch; flex-direction: column; gap: .45rem; }
  .permission-list select { width: 100%; }
  .domain-prices { grid-template-columns: 1fr; gap: 0; }
  .activity-officers a { align-items: flex-start; flex-direction: column; }
  .activity-officers span:last-child { text-align: left; }
}

@media (max-width: 899px) {
  .quote-output { position: static; order: -1; }
}

@media print {
  .sidebar, .mobile-topbar, .mobile-nav { display: none !important; }
  .app-frame { display: block; }
  .wrap { max-width: 100%; padding: 0; }
}

/* ---- 2026-07-11 worker-audit additions ---- */
.wiz-progress { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin: 0 0 .8rem; }
.wiz-progress .wiz-dots { margin: 0; }
.wiz-progress strong { font-size: .9rem; letter-spacing: .01em; opacity: .85; }
.price-preview { border: 1px solid var(--line, rgba(140,160,200,.25)); border-radius: 10px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .15rem; background: rgba(80,140,255,.08); }
.price-preview span { font-size: .8rem; opacity: .75; }
.price-preview b { font-size: 1.05rem; }
.script-quote { margin: .4rem 0; padding: .7rem .9rem; border-left: 3px solid rgba(80,140,255,.6); border-radius: 6px; background: rgba(80,140,255,.07); font-size: .92rem; }
.example-site .btn { margin-top: .3rem; }
.welcome-part h2 { margin-top: .1rem; }
.welcome-confirm { border: 1px solid rgba(80,200,140,.4); }
