/* ============================================================
   ProBuilder 3.0 — EDC Command · Design System
   Brand: #e8592f coral · #1a1a18 charcoal · #faf9f7 cream
   ============================================================ */

:root {
  --primary: #e8592f;
  --primary-soft: #fdeee8;
  --primary-deep: #c2431f;
  --dark: #1a1a18;
  --dark-2: #26261f;
  --dark-3: #33332a;
  --cream: #faf9f7;
  --card: #ffffff;
  --ink: #21211d;
  --muted: #76756e;
  --line: #e8e6e1;
  --good: #1f9d55;
  --good-soft: #e7f6ec;
  --warn: #d97706;
  --warn-soft: #fdf3e3;
  --bad: #dc2626;
  --bad-soft: #fdeaea;
  --info: #2563eb;
  --info-soft: #e9f0fe;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(26,26,24,.06), 0 6px 18px rgba(26,26,24,.05);
  --shadow-lg: 0 8px 40px rgba(26,26,24,.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--cream); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }

/* ---------- Layout shell ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 248px; min-width: 248px; background: var(--dark); color: #d8d6cf;
  display: flex; flex-direction: column; overflow-y: auto;
}
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.content { flex: 1; overflow-y: auto; padding: 26px 32px 60px; }

/* ---------- Sidebar ---------- */
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 17px; letter-spacing: -.5px;
  box-shadow: 0 4px 12px rgba(232,89,47,.4);
}
.brand-name { font-weight: 700; color: #fff; font-size: 15px; line-height: 1.15; }
.brand-sub { font-size: 10.5px; color: #8d8b82; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }

.nav-section { padding: 14px 12px 4px; }
.nav-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #75736a; padding: 0 10px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  color: #c9c7bf; cursor: pointer; font-size: 13.5px; font-weight: 500; margin-bottom: 1px;
  transition: background .12s, color .12s; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 3px 10px rgba(232,89,47,.35); }
.nav-item .ni-icon { width: 20px; text-align: center; font-size: 15px; }
.nav-item .ni-badge {
  margin-left: auto; background: rgba(255,255,255,.14); border-radius: 99px;
  font-size: 10.5px; padding: 1px 7px; font-weight: 700;
}
.nav-item.active .ni-badge { background: rgba(255,255,255,.25); }
.sidebar-footer { margin-top: auto; padding: 14px 18px; font-size: 10.5px; color: #6e6c63; line-height: 1.6; border-top: 1px solid rgba(255,255,255,.07); }

/* ---------- Topbar ---------- */
.topbar {
  height: 58px; min-height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 32px;
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.topbar .crumb { color: var(--muted); font-weight: 500; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.agent-pulse {
  display: flex; align-items: center; gap: 7px; background: var(--good-soft); color: var(--good);
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 99px;
}
.pulse-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--good); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.user-chip { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13px; }
.avatar {
  width: 32px; height: 32px; border-radius: 99px; background: var(--dark); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.orange { background: var(--primary); }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: 1fr 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 12px; font-weight: 500; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px 20px; }
.card-body.flush { padding: 0; }

.kpi { padding: 16px 18px; }
.kpi .k-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kpi .k-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 5px; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi .k-sub b.up { color: var(--good); } .kpi .k-sub b.down { color: var(--bad); }

/* ---------- Page headers ---------- */
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.page-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.4px; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 720px; line-height: 1.5; }
.page-head .right { margin-left: auto; display: flex; gap: 9px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--ink); transition: all .12s; white-space: nowrap;
}
.btn:hover { border-color: #cfccc4; background: #fbfaf8; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(232,89,47,.3); }
.btn.primary:hover { background: var(--primary-deep); }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn.danger { color: var(--bad); border-color: #f3c9c9; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.good { color: var(--good); border-color: #bfe5cc; }
.btn.good:hover { background: var(--good-soft); }

/* ---------- Badges / pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap;
}
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutral { background: #f0efeb; color: var(--muted); }
.pill.brand { background: var(--primary-soft); color: var(--primary-deep); }
.pill.dark { background: var(--dark); color: #fff; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 11px 16px; border-bottom: 1px solid var(--line);
  background: #fcfbf9;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid #f1efeb; vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: #fdf8f5; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- Health ring ---------- */
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-num { position: absolute; font-weight: 800; }

/* ---------- Progress bars ---------- */
.bar { height: 7px; background: #efede8; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.bar.thin { height: 5px; }
.bar > i.good { background: var(--good); } .bar > i.warn { background: var(--warn); } .bar > i.bad { background: var(--bad); }

/* ---------- Feed / timeline ---------- */
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1efeb; }
.feed-item:last-child { border-bottom: none; }
.feed-icon {
  width: 34px; height: 34px; min-width: 34px; border-radius: 10px; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.feed-body { line-height: 1.5; }
.feed-meta { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.feed-meta b { color: var(--ink); }

.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 7px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 13px; width: 8px; height: 8px;
  border-radius: 99px; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--primary);
}
.tl-item.done::before { background: var(--good); box-shadow: 0 0 0 1.5px var(--good); }
.tl-item .tl-time { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: #f4f2ee; border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kb-col h4 { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 2px 4px 10px; display: flex; }
.kb-col h4 .count { margin-left: auto; }
.kb-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; margin-bottom: 9px; box-shadow: var(--shadow); cursor: pointer; transition: transform .1s; }
.kb-card:hover { transform: translateY(-1px); }
.kb-card .kb-title { font-weight: 700; font-size: 13px; line-height: 1.35; }
.kb-card .kb-sub { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.kb-card .kb-foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; }

/* ---------- Gantt ---------- */
.gantt-row { display: grid; grid-template-columns: 230px 1fr; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f1efeb; }
.gantt-label { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.gantt-label .gl-sub { color: var(--muted); font-weight: 500; font-size: 11px; }
.gantt-track { position: relative; height: 26px; background: repeating-linear-gradient(90deg, #f6f4f0 0 1px, transparent 1px calc(100%/12)); border-radius: 6px; }
.gantt-bar { position: absolute; top: 4px; height: 18px; border-radius: 6px; background: #d8d5cd; overflow: hidden; }
.gantt-bar.critical { background: #f3c4b3; }
.gantt-bar > i { display: block; height: 100%; background: var(--primary); }
.gantt-bar:not(.critical) > i { background: var(--dark-3); }
.gantt-bar .gb-pct { position: absolute; right: 6px; top: 2px; font-size: 10px; font-weight: 800; color: rgba(0,0,0,.55); }

/* ---------- Photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.photo {
  aspect-ratio: 4/3; border-radius: 10px; position: relative; overflow: hidden; cursor: pointer;
  display: flex; align-items: flex-end; color: #fff; font-size: 10.5px; font-weight: 700;
}
.photo .ph-label { background: linear-gradient(transparent, rgba(0,0,0,.65)); width: 100%; padding: 18px 8px 7px; }
.photo .ph-ai { position: absolute; top: 6px; right: 6px; background: rgba(26,26,24,.75); border-radius: 6px; padding: 2px 6px; font-size: 9.5px; }

/* ---------- Modal & toast ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(26,26,24,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 30px; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: 86vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; font-weight: 800; }
.modal-close { margin-left: auto; cursor: pointer; font-size: 20px; color: var(--muted); background: none; border: none; padding: 4px 8px; }
.modal-body { padding: 20px 22px; overflow-y: auto; line-height: 1.55; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }

#toast-zone { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--dark); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 13px;
  font-weight: 600; box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: center;
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateY(12px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- iPhone frame ---------- */
.iphone-stage { display: flex; gap: 34px; align-items: flex-start; flex-wrap: wrap; }
.iphone {
  width: 375px; min-width: 375px; height: 760px; background: var(--dark); border-radius: 48px; padding: 11px;
  box-shadow: 0 24px 70px rgba(26,26,24,.35); position: relative;
}
.iphone .notch { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 120px; height: 28px; background: var(--dark); border-radius: 0 0 18px 18px; z-index: 5; }
.iphone-screen { width: 100%; height: 100%; border-radius: 38px; background: var(--cream); overflow: hidden; display: flex; flex-direction: column; }
.ios-status { height: 44px; min-height: 44px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 26px 5px; font-size: 13px; font-weight: 700; background: var(--dark); color: #fff; }
.ios-head { background: var(--dark); color: #fff; padding: 10px 18px 14px; }
.ios-head .ios-title { font-size: 19px; font-weight: 800; }
.ios-head .ios-sub { font-size: 12px; color: #aaa89f; margin-top: 2px; }
.ios-body { flex: 1; overflow-y: auto; padding: 14px; }
.ios-tabbar { height: 72px; min-height: 72px; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: 16px; }
.ios-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.ios-tab.active { color: var(--primary); }
.ios-tab .it-icon { font-size: 19px; }
.ios-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; margin-bottom: 11px; box-shadow: var(--shadow); }
.big-action {
  display: flex; align-items: center; justify-content: center; gap: 9px; background: var(--primary); color: #fff;
  border: none; border-radius: 14px; width: 100%; padding: 15px; font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 18px rgba(232,89,47,.35); margin-bottom: 12px;
}

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.flex { display: flex; align-items: center; gap: 9px; }
.right { margin-left: auto; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 20px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.empty { text-align: center; color: var(--muted); padding: 36px 20px; }
.section-title { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 800; margin: 22px 0 10px; }

.agent-card { display: flex; gap: 14px; padding: 16px 18px; }
.agent-emoji { width: 46px; height: 46px; min-width: 46px; border-radius: 13px; background: var(--dark); display: flex; align-items: center; justify-content: center; font-size: 23px; }
.agent-kpis { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.agent-kpis .ak { font-size: 12px; color: var(--muted); }
.agent-kpis .ak b { display: block; font-size: 15px; color: var(--ink); }

.severity-strip { width: 4px; border-radius: 99px; align-self: stretch; }
.severity-strip.critical { background: var(--bad); }
.severity-strip.warning { background: var(--warn); }
.severity-strip.info { background: var(--info); }

/* Compact agent grid (click to expand) */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 11px; }
.agent-mini {
  display: flex; gap: 11px; align-items: center; padding: 11px 13px; cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}
.agent-mini:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,26,24,.12); border-color: #d8d4cc; }
.agent-emoji.sm { width: 36px; height: 36px; min-width: 36px; font-size: 18px; border-radius: 10px; }
.am-body { min-width: 0; flex: 1; }
.am-name { font-weight: 800; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.am-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--good); animation: pulse 1.8s infinite; }
.am-role { font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-kpi { display: flex; gap: 9px; font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; }
.am-kpi b { color: var(--ink); font-size: 11px; }

/* Login gate */
#login-gate {
  position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 700px at 30% 20%, #2b2b26, var(--dark));
}
.gate-card {
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 400px; padding: 30px 30px 24px;
}

/* Deal Lab editable cells (blue = adjustable, like the workbook) */
.cellin {
  width: 86px; padding: 5px 8px; border: 1px solid #bcd2f0; border-radius: 7px;
  font-size: 12.5px; font-family: inherit; text-align: right; background: #eef4fd; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cellin.wide { width: 120px; }
.cellin:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); background: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6d3cb; border-radius: 99px; border: 2px solid var(--cream); }
::-webkit-scrollbar-track { background: transparent; }

/* File Cabinet tree */
.fc-folder { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; background: #fff; }
.fc-folder > summary { display: flex; align-items: center; gap: 9px; padding: 9px 13px; cursor: pointer; list-style: none; user-select: none; }
.fc-folder > summary::-webkit-details-marker { display: none; }
.fc-folder > summary:hover { background: #fdf8f5; border-radius: 10px; }
.fc-folder[open] > summary { border-bottom: 1px solid var(--line); }
.fc-children { padding: 7px 10px 7px 26px; }
.fc-file { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; }
.fc-file:hover { background: #faf8f5; }
.fc-ic { width: 20px; text-align: center; }

/* Selections dropzone */
.dropzone {
  border: 2px dashed #cfccc4; border-radius: var(--radius); background: #fff;
  padding: 26px 20px; text-align: center; cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- Mobile / iPad responsive ---------- */
.hamburger { display: none; background: none; border: none; font-size: 21px; cursor: pointer; color: var(--ink); padding: 4px 8px; }
.mobile-tabbar { display: none; }
.nav-scrim { display: none; }

@media (max-width: 880px) {
  .hamburger { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 300; transform: translateX(-103%);
    transition: transform .22s ease; box-shadow: 0 0 50px rgba(0,0,0,.4); width: 272px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-scrim { position: fixed; inset: 0; background: rgba(26,26,24,.45); z-index: 290; }
  body:not(.nav-open) .nav-scrim { display: none; }
  body.nav-open .nav-scrim { display: block; }

  .content { padding: 16px 14px 96px; }
  .topbar { padding: 0 14px; gap: 9px; }
  .topbar .crumb { display: none; }
  .agent-pulse { display: none; }
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr 1fr !important; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .page-head { flex-direction: column; }
  .page-head .right { margin-left: 0; flex-wrap: wrap; }
  .card-body.flush, .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data { min-width: 640px; }
  .kanban { grid-auto-columns: 78vw; }
  .iphone-stage .iphone { display: none; }
  .kpi .k-value { font-size: 20px; }

  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 280;
    background: var(--dark); padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(0,0,0,.25);
  }
  .mtab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: #b9b7ae; font-size: 10px; font-weight: 700; cursor: pointer; padding: 3px 0;
    border-radius: 9px; user-select: none;
  }
  .mtab span { font-size: 18px; }
  .mtab.active { color: #fff; background: rgba(232,89,47,.35); }
}
@media (max-width: 520px) {
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr 1fr !important; }
  .modal { max-height: 92vh; border-radius: 14px; }
  .modal-wrap { padding: 10px; align-items: flex-end; }
}

/* Field log form */
.flog-photos { display: flex; gap: 8px; flex-wrap: wrap; }
.flog-photos img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
