/* Staff app shell */
.boot { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 22px; }
.boot img { border-radius: 16px; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.app-shell > * { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 500;
  background: rgba(250,248,244,.92); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: calc(6px + var(--safe-t)) 8px 6px 12px;
  display: flex; align-items: center; gap: 6px; min-height: 58px;
}
.topbar .title { flex: 1; min-width: 0; font: 700 19px/1.2 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brandmark { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.topbar .actions { display: flex; align-items: center; gap: 2px; }

.clock-pill {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px 0 10px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--white);
  font: 600 13.5px/1 var(--font-body); color: var(--slate); cursor: pointer; white-space: nowrap;
}
.clock-pill .led { width: 9px; height: 9px; border-radius: 50%; background: var(--stone-light); }
.clock-pill.on { background: var(--green); border-color: var(--green); color: #fff; }
.clock-pill.on .led { background: var(--green-light); box-shadow: 0 0 0 3px rgba(168,194,72,.35); }

.content { padding: 14px 14px calc(96px + var(--safe-b)); max-width: 900px; width: 100%; margin: 0 auto; }
.content.full { padding: 0; max-width: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 600;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 4px 4px calc(4px + var(--safe-b));
}
.tabbar a {
  display: grid; justify-items: center; gap: 2px; padding: 6px 0 4px; min-height: 52px;
  color: var(--stone); text-decoration: none; font-size: 11.5px; font-weight: 600; position: relative; border-radius: 12px;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--green); }
.tabbar a[aria-current="page"]::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }
.tabbar .count {
  position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/18px var(--font-body); text-align: center;
}
.sidebar { display: none; }

@media (min-width: 960px) {
  .app-shell { grid-template-columns: 248px minmax(0, 1fr); }
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh;
    padding: 18px 14px; border-right: 1px solid var(--line); background: var(--white);
  }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
  .sidebar .brand img { width: 38px; height: 38px; border-radius: 10px; }
  .sidebar .brand b { font: 700 17px/1.1 var(--font-display); display: block; }
  .sidebar a {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
    color: var(--slate); text-decoration: none; font-weight: 600; font-size: 15px;
  }
  .sidebar a:hover { background: var(--cream); }
  .sidebar a[aria-current="page"] { background: var(--green-pale); color: var(--green); }
  .sidebar a svg { width: 21px; height: 21px; }
  .sidebar .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 12px; }
  .sidebar .foot { margin-top: auto; font-size: 13px; color: var(--stone); padding: 8px 12px; }
  .content { padding: 22px 28px 48px; }
  .toasts { bottom: 24px; }
  .topbar .brandmark { display: none; }
}

.sync-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #8A6420; background: var(--gold-pale); border-radius: 999px; padding: 4px 10px; }

/* page header blocks */
.hero { padding: 6px 2px 4px; }
.hero .greet { font: 700 clamp(26px, 7vw, 32px)/1.1 var(--font-display); letter-spacing: -.015em; }
.hero .date { color: var(--stone); margin-top: 4px; }

.client-head { display: flex; gap: 14px; align-items: center; }
.client-head .avatar { width: 54px; height: 54px; font-size: 19px; }
.client-head .name { font: 700 24px/1.15 var(--font-display); }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-actions a, .quick-actions button {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--white); color: var(--slate); font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.quick-actions svg { width: 22px; height: 22px; color: var(--green); }

.value-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); overflow: hidden; }
.value-strip > div { padding: 11px 12px; }
.value-strip > div + div { border-left: 1px solid var(--line); }
.value-strip .v { font: 700 18px/1.15 var(--font-display); margin-top: 3px; }
@media (max-width: 480px) { .value-strip { grid-template-columns: repeat(2, 1fr); } .value-strip > div:nth-child(3) { border-left: 0; } .value-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; position: sticky; top: calc(58px + var(--safe-t)); background: var(--cream); z-index: 400; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 12px 13px; color: var(--stone); font-weight: 600; font-size: 15px; text-decoration: none; border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="true"] { color: var(--midnight); border-bottom-color: var(--green); }
.tabs .n { font: 500 11px var(--font-mono); background: var(--red); color: #fff; border-radius: 8px; padding: 0 5px; margin-left: 4px; }
@media (min-width: 960px) { .tabs { margin: 0; padding: 0; top: 0; } }

.map-wrap { position: relative; }
.map-wrap .map { height: calc(100dvh - 420px - var(--safe-b)); min-height: 320px; }
@media (min-width: 960px) { .map-wrap .map { height: calc(100dvh - 330px); } }
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.map-tools .btn { min-height: 42px; }
.map-banner {
  position: absolute; top: 10px; left: 10px; right: 60px; z-index: 450; background: var(--midnight); color: #fff;
  border-radius: 12px; padding: 10px 14px; font-size: 14.5px; box-shadow: var(--shadow-md); display: flex; gap: 10px; align-items: center;
}
.kind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kind-grid button {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--white); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--slate);
}
.kind-grid .pin { width: 26px; height: 26px; }

.visit-row { display: flex; gap: 12px; align-items: stretch; }
.visit-row .when { flex: none; width: 64px; text-align: center; padding-top: 2px; }
.visit-row .when b { display: block; font: 700 15px/1.2 var(--font-body); }
.visit-row .bar { width: 4px; border-radius: 4px; background: var(--green-mid); flex: none; }

.timer { font: 600 30px/1 var(--font-mono); letter-spacing: -.02em; }
.req-card { border-left: 4px solid var(--line-strong); }
.req-card.urgent { border-left-color: var(--red); }
.req-card.soon { border-left-color: var(--gold); }
.req-card.normal { border-left-color: var(--water); }

.week-day { margin-top: 18px; }
.week-day .day-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 8px; }
.week-day.today .day-head .label { color: var(--green); }

.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font: 500 11px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--stone); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }

.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 10% -10%, #EEF4D2 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #F5EEE4 0, transparent 60%), var(--cream); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 18px; }

/* pipeline */
.content.wide { max-width: 1440px; }
.pipe-card { display: block; text-decoration: none; color: inherit; padding: 13px 14px; border-left: 4px solid var(--line-strong); }
.pipe-card.urgent { border-left-color: var(--red); }
.pipe-card.soon { border-left-color: var(--gold); }
.pipe-card:active { transform: scale(.99); }
.pipe-desc { margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-col { display: none; }
.board-col[data-active] { display: block; }
.board-head { display: none; }
@media (min-width: 960px) {
  .pipe-tabs { display: none; }
  .board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
  .board-col, .board-col[data-active] { display: block; background: var(--cream-dark); border-radius: var(--r); padding: 10px; min-height: 200px; }
  .board-head { display: block; padding: 4px 4px 10px; }
}
@media (min-width: 1360px) {
  .board { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
