:root {
  color-scheme: light;
  --canvas: #f3f5f1;
  --canvas-deep: #e9ede8;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --surface-strong: #eef2ed;
  --ink: #0b1814;
  --ink-soft: #33463f;
  --muted: #697871;
  --line: #dce3de;
  --line-strong: #c8d1cb;
  --sidebar: #07130f;
  --sidebar-soft: #0d211a;
  --brand: #76f000;
  --brand-dark: #45ad00;
  --brand-ink: #132408;
  --magenta: #ff4edb;
  --blue: #1769c2;
  --green: #198754;
  --amber: #a86700;
  --red: #ba3535;
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(7, 19, 15, 0.04);
  --shadow-sm: 0 8px 24px rgba(7, 19, 15, 0.06);
  --shadow-lg: 0 26px 70px rgba(7, 19, 15, 0.14);
  --focus: 0 0 0 3px rgba(118, 240, 0, 0.28);
  --sidebar-width: 272px;
  --topbar-height: 72px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% -14%, rgba(118, 240, 0, 0.09), transparent 25rem),
    var(--canvas);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.75rem, 2.5vw, 2.35rem);
  font-weight: 730;
}

h2 {
  margin-bottom: 0.7rem;
  font-size: 1.18rem;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar);
  background: var(--brand);
  transform: translateY(-150%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.app-shell {
  min-height: 100vh;
  padding-left: var(--sidebar-width);
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  padding: 1.35rem 1rem 1rem;
  color: #f6fbf8;
  background:
    radial-gradient(circle at 20% 4%, rgba(118, 240, 0, 0.14), transparent 13rem),
    linear-gradient(180deg, var(--sidebar-soft), var(--sidebar) 42%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.1rem 0.55rem 1.2rem;
}

.brand img {
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
}

.brand-name {
  display: block;
  font-size: 1.21rem;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.brand-sub {
  display: block;
  margin-top: 0.05rem;
  color: rgba(239, 249, 244, 0.58);
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.nav-label {
  padding: 0.6rem 0.7rem 0.45rem;
  color: rgba(239, 249, 244, 0.42);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-link {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 0.72rem;
  padding: 0.66rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(239, 249, 244, 0.72);
  font-size: 0.9rem;
  font-weight: 560;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #fff;
  background: rgba(118, 240, 0, 0.115);
  border-color: rgba(118, 240, 0, 0.15);
}

.nav-link.active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -0.45rem;
  width: 3px;
  border-radius: 8px;
  background: var(--brand);
  content: "";
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-user {
  margin-top: auto;
  padding: 1rem 0.55rem 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.user-block {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(118, 240, 0, 0.28);
  border-radius: 50%;
  color: var(--brand-ink);
  background: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
}

.user-name {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  display: block;
  margin-top: 0.08rem;
  color: rgba(239, 249, 244, 0.48);
  font-size: 0.72rem;
}

.sidebar-actions {
  display: flex;
  margin-top: 0.85rem;
  gap: 0.45rem;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 2rem;
  border-bottom: 1px solid rgba(200, 209, 203, 0.76);
  background: rgba(243, 245, 241, 0.88);
  backdrop-filter: blur(18px);
}

.topbar-context {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}

.topbar-eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topbar-title {
  overflow: hidden;
  margin-top: 0.05rem;
  font-size: 0.92rem;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.status-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
  content: "";
}

.mobile-menu {
  display: none;
}

.nav-scrim {
  display: none;
}

.main {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 1.65rem 2rem 3rem;
}

.page-enter {
  animation: page-in 0.22s ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.35rem;
}

.page-header p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.page-actions,
.row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.row-wrap {
  flex-wrap: wrap;
}

.row-between {
  justify-content: space-between;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  align-items: start;
  gap: 1rem;
}

.grid-equal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.panel-raised {
  box-shadow: var(--shadow-sm);
}

.panel-pad {
  padding: 1.15rem 1.2rem;
}

.panel-head {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
}

.panel-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.panel-accent {
  position: relative;
}

.panel-accent::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand-dark);
  content: "";
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid;
  border-radius: var(--radius);
}

.notice-warn {
  color: #633d00;
  background: #fff8e8;
  border-color: #efd8a7;
}

.notice-danger {
  color: #752020;
  background: #fff1f1;
  border-color: #edc2c2;
}

.notice-good {
  color: #125a38;
  background: #edfaf2;
  border-color: #c6ead5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.stat-card {
  position: relative;
  min-height: 126px;
  padding: 1rem;
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d7e9c8;
  border-radius: 10px;
  color: #326908;
  background: #efffe3;
}

.stat-label {
  margin-top: 0.78rem;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 620;
}

.stat-value {
  margin-top: 0.08rem;
  font-size: 1.8rem;
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.stat-hint {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.73rem;
}

.btn {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.55rem 0.82rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 650;
  line-height: 1.1;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  color: var(--brand-ink);
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 5px 15px rgba(82, 180, 0, 0.14);
}

.btn-primary:hover:not(:disabled) {
  background: #82ff0b;
  border-color: #82ff0b;
}

.btn-dark {
  color: #fff;
  background: var(--sidebar);
  border-color: var(--sidebar);
}

.btn-dark:hover:not(:disabled) {
  background: #123127;
}

.btn-secondary {
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: #acb9b1;
}

.btn-ghost {
  min-height: 34px;
  padding: 0.4rem 0.55rem;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-strong);
}

.sidebar .btn-ghost {
  color: rgba(239, 249, 244, 0.68);
}

.sidebar .btn-ghost:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
  color: var(--red);
  background: #fff7f7;
  border-color: #eecaca;
}

.btn-sm {
  min-height: 32px;
  padding: 0.38rem 0.62rem;
  font-size: 0.78rem;
}

.btn-icon {
  width: 38px;
  padding: 0;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label,
.field > span:first-child {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.field .optional {
  margin-left: 0.25rem;
  color: var(--muted);
  font-weight: 480;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.62rem 0.72rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9aa69f;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebbb3;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(118, 240, 0, 0.18);
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand-dark);
}

.input-icon {
  position: relative;
}

.input-icon .icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.input-icon input {
  padding-left: 2.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.15rem;
}

.field-error,
.form-error {
  color: var(--red);
  font-size: 0.82rem;
}

.help-text {
  color: var(--muted);
  font-size: 0.76rem;
}

.muted {
  color: var(--muted);
}

.text-sm {
  font-size: 0.82rem;
}

.text-xs {
  font-size: 0.74rem;
}

.strong {
  font-weight: 680;
}

.link {
  color: #266e00;
  font-weight: 620;
  text-decoration: underline;
  text-decoration-color: rgba(38, 110, 0, 0.24);
  text-underline-offset: 3px;
}

.link:hover {
  color: #163f00;
  text-decoration-color: currentColor;
}

.badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.52rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.7;
}

.badge-good {
  color: #12633d;
  background: #e9f8ef;
  border-color: #c2e8d1;
}

.badge-ok {
  color: #15548d;
  background: #eaf4fc;
  border-color: #c8dff1;
}

.badge-warn {
  color: #805000;
  background: #fff5df;
  border-color: #edd6a6;
}

.badge-bad {
  color: #9c2929;
  background: #fff0f0;
  border-color: #edc5c5;
}

.badge-muted {
  color: #53635c;
  background: #f0f3f1;
  border-color: #dae1dc;
}

.badge-brand {
  color: #2c6500;
  background: #efffe2;
  border-color: #cef3af;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

table.data th,
table.data td {
  padding: 0.82rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

table.data th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.67rem;
  font-weight: 720;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  white-space: nowrap;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr {
  transition: background 0.12s ease;
}

table.data tbody tr:hover {
  background: #fbfdfb;
}

.cell-main {
  font-weight: 660;
}

.cell-sub {
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.cell-note {
  max-width: 340px;
  color: var(--ink-soft);
  font-size: 0.81rem;
  line-height: 1.4;
}

.code-line {
  display: inline-block;
  max-width: min(520px, 54vw);
  overflow-wrap: anywhere;
  color: #173f29;
  font-size: 0.76rem;
  line-height: 1.45;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 130px;
}

.empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 0.75rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface-soft);
}

.empty-state strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--ink-soft);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.toolbar .input-icon {
  width: min(440px, 100%);
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.22rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.segmented button {
  min-height: 32px;
  padding: 0.34rem 0.65rem;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 650;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 5px rgba(7, 19, 15, 0.09);
}

.tabs {
  display: flex;
  gap: 0.22rem;
  overflow-x: auto;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-strong);
}

.tab {
  min-height: 35px;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 660;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(7, 19, 15, 0.08);
}

.timeline {
  position: relative;
}

.timeline-item {
  position: relative;
  padding: 0.8rem 0 0.8rem 1.35rem;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-item::before {
  position: absolute;
  top: 1.12rem;
  left: 0.1rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-dark);
  box-shadow: 0 0 0 4px #efffe4;
  content: "";
}

.timeline-copy {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.timeline-meta {
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.list-item {
  padding: 0.82rem 0;
  border-bottom: 1px solid var(--line);
}

.list-item:first-child {
  padding-top: 0;
}

.list-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.risk-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.conflict-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.conflict-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(168, 103, 0, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.52);
}

.overdue {
  color: var(--red);
  font-weight: 650;
}

.done-row {
  opacity: 0.56;
}

.done-row .cell-main {
  text-decoration: line-through;
}

.login-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(340px, 0.9fr) minmax(520px, 1.1fr);
  background: var(--canvas);
}

.login-brand {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.5rem);
  color: #f4fff8;
  background:
    radial-gradient(circle at 20% 15%, rgba(118, 240, 0, 0.18), transparent 20rem),
    radial-gradient(circle at 90% 80%, rgba(255, 78, 219, 0.11), transparent 20rem),
    var(--sidebar);
}

.login-brand::after {
  position: absolute;
  right: -70px;
  bottom: 8%;
  width: 270px;
  height: 270px;
  border: 1px dashed rgba(255, 78, 219, 0.4);
  border-radius: 36px;
  content: "";
  transform: rotate(11deg);
}

.login-logo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login-logo img {
  width: 49px;
  height: 49px;
}

.login-logo .brand-name {
  font-size: 1.42rem;
}

.login-message {
  position: relative;
  z-index: 1;
  max-width: 530px;
  padding: 4rem 0;
}

.login-message h1 {
  max-width: 520px;
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 720;
  letter-spacing: -0.055em;
}

.login-message h1 span {
  color: var(--brand);
}

.login-message p {
  max-width: 500px;
  color: rgba(239, 249, 244, 0.63);
  font-size: 1rem;
}

.login-points {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  color: rgba(239, 249, 244, 0.56);
  font-size: 0.78rem;
}

.login-points span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.login-points span::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  content: "";
}

.login-form-wrap {
  display: grid;
  min-width: 0;
  min-height: 100%;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.login-card {
  width: 100%;
  max-width: 430px;
  min-width: 0;
}

.login-card h2 {
  margin-bottom: 0.4rem;
  font-size: 1.8rem;
}

.login-card > p {
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.password-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.password-wrap input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  width: 36px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

.login-foot {
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

.boot-screen {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  color: var(--muted);
  background: var(--canvas);
  font-size: 0.84rem;
}

.boot-screen img {
  width: 56px;
  height: 56px;
}

.boot-spinner,
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--brand-dark);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.spinner-sm {
  width: 15px;
  height: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-loading {
  display: grid;
  min-height: 360px;
  place-items: center;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #e9eeea;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255,255,255,0.72) 50%, transparent 75%);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.25s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.error-page {
  display: grid;
  min-height: 65vh;
  place-items: center;
  text-align: center;
}

.error-card {
  width: min(480px, 100%);
  padding: 2rem;
}

.error-card .empty-icon {
  color: var(--red);
  background: #fff1f1;
  border-color: #edc2c2;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  width: min(390px, calc(100vw - 2rem));
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #243a31;
  border-radius: 11px;
  color: #fff;
  background: #0c1d16;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.2s ease both;
}

.toast.success .toast-icon {
  color: var(--brand);
}

.toast.error .toast-icon {
  color: #ff8b8b;
}

.toast-copy {
  flex: 1;
  font-size: 0.82rem;
}

.toast-close {
  padding: 0;
  border: 0;
  color: rgba(255,255,255,0.55);
  background: transparent;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

dialog {
  width: min(620px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(4, 12, 9, 0.62);
  backdrop-filter: blur(4px);
}

.dialog-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
}

.dialog-head h2 {
  margin: 0;
}

.dialog-body {
  padding: 1.2rem;
}

.dialog-close {
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.profile-summary .avatar {
  width: 45px;
  height: 45px;
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.meta-item {
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.meta-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.meta-value {
  margin-top: 0.18rem;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
}

.quick-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.quick-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 680;
}

.section-gap {
  margin-top: 1rem;
}

.filter-count {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.67rem;
}

.mobile-cards {
  display: none;
}

.mobile-card {
  padding: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.mobile-card:last-child {
  border-bottom: 0;
}

.mobile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.mobile-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.mobile-card-grid .meta-item {
  padding: 0;
  border: 0;
  background: transparent;
}

.noscript {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 2rem;
  place-items: center;
  color: #fff;
  background: var(--sidebar);
  text-align: center;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 236px;
  }

  .main,
  .topbar {
    padding-right: 1.25rem;
    padding-left: 1.25rem;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  }
}

@media (max-width: 920px) {
  :root {
    --topbar-height: 64px;
  }

  .app-shell {
    padding-left: 0;
  }

  .sidebar {
    width: min(300px, 86vw);
    padding-top: 1rem;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-scrim {
    position: fixed;
    z-index: 40;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(3, 11, 8, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .main {
    padding: 1.2rem 1rem 2.5rem;
  }

  .grid-2,
  .grid-equal {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-brand {
    min-height: 260px;
    padding: 1.5rem;
  }

  .login-message {
    padding: 2rem 0 1rem;
  }

  .login-message h1 {
    max-width: 600px;
    font-size: clamp(2.2rem, 9vw, 3.8rem);
  }

  .login-points {
    display: none;
  }

  .login-form-wrap {
    padding: 2.5rem 1.25rem;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 14px;
  }

  .topbar-status {
    display: none;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .page-header .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .page-header .page-actions .btn {
    flex: 1;
  }

  .stats,
  .skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 112px;
    padding: 0.85rem;
  }

  .stat-value {
    font-size: 1.55rem;
  }

  .form-grid,
  .form-grid-3,
  .meta-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .input-icon {
    width: 100%;
  }

  .panel-pad {
    padding: 1rem;
  }

  .desktop-table-mobile-cards .table-wrap {
    display: none;
  }

  .desktop-table-mobile-cards .mobile-cards {
    display: block;
  }

  .dialog-body,
  .dialog-head {
    padding: 1rem;
  }

  .code-line {
    max-width: 80vw;
  }
}

@media (max-width: 430px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-dot {
    display: none;
  }

  .mobile-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-brand {
    min-height: 225px;
  }

  .login-message p {
    margin-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .page-actions,
  .toolbar,
  .btn,
  .toast-region {
    display: none !important;
  }

  .app-shell {
    padding: 0;
  }

  .main {
    max-width: none;
    padding: 0;
  }

  .panel {
    box-shadow: none;
  }
}

/* Collaboration, data-management, and daily-work modules */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.data-actions,
.ownership-actions,
.notification-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.import-mode select {
  width: auto;
  min-width: 132px;
  min-height: 38px;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.78rem;
}

.page-actions > .data-actions {
  padding-right: 0.25rem;
  border-right: 1px solid var(--line);
}

.toolbar-wrap,
.filter-form {
  flex-wrap: wrap;
}

.filter-form {
  justify-content: flex-start;
}

.filter-form .input-icon {
  flex: 1 1 280px;
}

.filter-form > .field {
  min-width: 150px;
}

.search-form {
  flex: 1 1 420px;
  justify-content: flex-end;
}

.search-form .input-icon {
  flex: 1 1 280px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}

.share-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.share-picker legend {
  margin-bottom: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.readonly-value {
  min-height: 42px;
  padding: 0.58rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface-strong);
  font-weight: 620;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.check-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  cursor: pointer;
}

.check-card:has(input:checked) {
  border-color: rgba(69, 173, 0, 0.45);
  background: rgba(118, 240, 0, 0.08);
}

.check-card span,
.check-card strong,
.check-card small {
  display: block;
  min-width: 0;
}

.check-card small {
  overflow: hidden;
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ownership-banner,
.pipeline-route-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.ownership-banner {
  border-left: 4px solid var(--brand-dark);
}

.ownership-icon,
.pipeline-route-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--brand-ink);
  background: rgba(118, 240, 0, 0.15);
}

.ownership-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.ownership-copy strong {
  font-size: 1rem;
}

.ownership-copy > span:last-child {
  color: var(--muted);
  font-size: 0.76rem;
}

.pipeline-route-card {
  border-color: rgba(69, 173, 0, 0.28);
  background: linear-gradient(110deg, rgba(118, 240, 0, 0.08), #fff 55%);
}

.pipeline-route-card h2,
.pipeline-route-card p,
.quick-route p {
  margin-bottom: 0;
}

.pipeline-route-card p,
.quick-route p {
  color: var(--muted);
  font-size: 0.78rem;
}

.quick-route {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
}

.quick-route .btn {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.notification-wrap {
  position: relative;
}

.notification-button {
  position: relative;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 99px;
  color: #fff;
  background: var(--red);
  font-size: 0.62rem;
  font-weight: 760;
}

.notification-panel {
  position: absolute;
  z-index: 90;
  top: calc(100% + 0.65rem);
  right: 0;
  width: min(410px, calc(100vw - 2rem));
  max-height: min(650px, calc(100vh - 100px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.notification-head strong,
.notification-head span {
  display: block;
}

.notification-head span {
  color: var(--muted);
  font-size: 0.72rem;
}

.notification-list {
  max-height: min(570px, calc(100vh - 170px));
  overflow-y: auto;
}

.notification-item {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item.unread {
  border-left: 3px solid var(--brand-dark);
  background: rgba(118, 240, 0, 0.055);
}

.notification-copy p {
  margin: 0.12rem 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.notification-copy small {
  color: var(--muted);
  font-size: 0.68rem;
}

.work-cards {
  padding: 0.8rem;
}

.work-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.work-card + .work-card {
  margin-top: 0.65rem;
}

.work-card.complete {
  opacity: 0.78;
  background: var(--surface-soft);
}

.work-card-status {
  grid-column: 1 / -1;
}

.work-card h3,
.work-card p {
  margin-bottom: 0.35rem;
}

.work-card-action {
  align-self: end;
}

.completion-note {
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface-strong);
  font-size: 0.77rem;
}

.daily-feed {
  max-height: 720px;
  overflow-y: auto;
}

.team-card-email {
  margin-top: 0.7rem;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.team-hours-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.team-hours-card .btn,
.team-card-action {
  grid-column: 1 / -1;
}

.team-hours-card .btn,
.team-card-action .btn {
  width: 100%;
}

.selection-cell {
  width: 44px;
  min-width: 44px;
  padding-right: 0.35rem !important;
  padding-left: 0.7rem !important;
  text-align: center !important;
}

.selection-placeholder {
  display: inline-block;
  width: 18px;
  height: 18px;
}

.prospect-property-cell {
  min-width: 210px;
  max-width: 310px;
}

.prospect-contact-cell {
  min-width: 190px;
  max-width: 280px;
}

.prospect-context-cell {
  min-width: 145px;
  max-width: 230px;
}

.prospect-actions-cell {
  min-width: 205px;
}

.prospect-primary-link,
.prospect-site,
.prospect-card-contact,
.prospect-card-source,
.prospect-note {
  min-width: 0;
  overflow-wrap: anywhere;
}

.prospect-primary-link,
.prospect-site {
  display: block;
}

.prospect-contact-links {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.12rem 0.55rem;
}

.prospect-contact-links .cell-sub {
  margin-top: 0.14rem;
  overflow-wrap: anywhere;
}

.prospect-stage.section-gap {
  margin-top: 0.4rem;
}

.prospect-card-contact {
  display: flex;
  flex-direction: column;
  margin-top: 0.72rem;
}

.prospect-card-contact strong {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.prospect-card-source {
  margin-top: 0.72rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.prospect-card-actions {
  margin-top: 0.72rem;
}

.prospect-note {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.prospect-follow-ups {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.prospect-follow-ups h3,
.prospect-empty-copy {
  margin-bottom: 0;
}

.prospect-follow-ups .section-gap,
.prospect-history .section-gap {
  margin-top: 0.45rem;
}

.prospect-profile-list .meta-item {
  min-height: 76px;
}

.prospect-profile-list .meta-value a {
  overflow-wrap: anywhere;
}

.prospect-table tbody tr.is-selected {
  background: rgba(118, 240, 0, 0.09);
  box-shadow: inset 3px 0 0 var(--brand-dark);
}

.prospect-table tbody tr.is-selected:hover {
  background: rgba(118, 240, 0, 0.13);
}

.owner-unassigned {
  color: #2c6500;
  font-weight: 700;
}

.prospect-bulk-bar {
  display: flex;
  position: sticky;
  z-index: 15;
  top: calc(var(--topbar-height) + 0.75rem);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(69, 173, 0, 0.34);
  border-radius: var(--radius);
  background: rgba(248, 255, 243, 0.97);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.prospect-bulk-bar[hidden] {
  display: none;
}

.bulk-selection-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.bulk-selection-copy strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.bulk-selection-copy span:last-child {
  color: var(--muted);
  font-size: 0.7rem;
}

.prospect-bulk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.bulk-owner-field select {
  width: auto;
  min-width: 170px;
  min-height: 34px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.76rem;
}

.prospect-card-title {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: flex-start;
  gap: 0.65rem;
}

.prospect-card-title > div {
  min-width: 0;
}

.prospect-card.is-selected {
  background: rgba(118, 240, 0, 0.08);
  box-shadow: inset 3px 0 0 var(--brand-dark);
}

@media (max-width: 900px) {
  .ownership-banner,
  .pipeline-route-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ownership-actions,
  .pipeline-route-card > .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .data-actions {
    width: 100%;
  }

  .data-actions .import-mode {
    flex: 1 1 100%;
  }

  .data-actions .import-mode select {
    width: 100%;
  }

  .page-actions > .data-actions {
    padding-right: 0;
    padding-bottom: 0.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .data-actions .btn,
  .ownership-actions .btn {
    flex: 1;
  }

  .check-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .notification-panel {
    position: fixed;
    top: calc(var(--topbar-height) - 4px);
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .ownership-banner,
  .pipeline-route-card {
    align-items: start;
  }

  .filter-form .input-icon,
  .search-form .input-icon {
    flex: 0 0 auto;
    width: 100%;
  }

  .filter-form > .field {
    width: 100%;
    min-width: 0;
  }

  .main:has(.prospect-bulk-bar:not([hidden])) {
    padding-bottom: calc(14rem + env(safe-area-inset-bottom));
  }

  .prospect-bulk-bar {
    position: fixed;
    top: auto;
    right: calc(0.75rem + env(safe-area-inset-right));
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    left: calc(0.75rem + env(safe-area-inset-left));
    align-items: stretch;
    flex-direction: column;
    max-height: calc(100dvh - var(--topbar-height) - 1.5rem);
    overflow-y: auto;
  }

  .prospect-bulk-actions,
  .bulk-owner-field,
  .bulk-owner-field select {
    width: 100%;
  }

  .prospect-bulk-actions .btn {
    flex: 1 1 130px;
  }

  .prospect-card-title input[type="checkbox"] {
    width: 22px;
    min-width: 22px;
    min-height: 22px;
  }

  .prospect-card-actions .btn {
    flex: 1 1 120px;
  }
}

@media (max-width: 430px) {
  .team-hours-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Plans and progress */
.plans-progress-page {
  --plan-accent: #45ad00;
}

.plan-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(10px);
}

.plan-toolbar .toolbar {
  justify-content: flex-end;
  margin: 0;
}

.work-period-tabs {
  flex: 0 0 auto;
}

.work-period-tabs .tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.plan-editor-stack {
  display: grid;
  gap: 1rem;
}

.automatic-progress-panel {
  border-color: #d5e7c9;
  background: linear-gradient(125deg, rgba(118, 240, 0, 0.055), #fff 45%);
}

.smart-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #316a09;
  font-size: 0.74rem;
  font-weight: 720;
  white-space: nowrap;
}

.smart-label .icon {
  width: 16px;
  height: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.metric-card {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
}

.metric-card-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.metric-card-head > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card-head strong {
  color: #2c6500;
}

.metric-value {
  margin-top: 0.38rem;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.metric-value small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 580;
  letter-spacing: 0;
}

.metric-source {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.65rem;
}

.progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  margin-top: 0.55rem;
  border-radius: 999px;
  background: #e5ebe6;
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  transition: width 0.3s ease;
}

.work-plan-form {
  overflow: visible;
}

.work-plan-form > .form-error {
  margin: 1rem 1.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #edc2c2;
  border-radius: 9px;
  background: #fff1f1;
  line-height: 1.45;
}

.work-plan-form.is-read-only input:disabled,
.work-plan-form.is-read-only select:disabled,
.work-plan-form.is-read-only textarea:disabled {
  cursor: default;
  opacity: 1;
  background: var(--surface-soft);
}

.work-plan-form.is-read-only [data-plan-action] {
  display: none;
}

.plan-form-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 94% -30%, rgba(118, 240, 0, 0.18), transparent 14rem),
    var(--surface);
}

.plan-form-hero h2 {
  margin: 0.75rem 0 0.3rem;
  font-size: 1.4rem;
}

.plan-form-hero p,
.section-title-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.saved-state {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.7rem;
}

.plan-form-section {
  padding: 1.15rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.plan-form-section:last-of-type {
  border-bottom: 0;
}

.field-inline-head,
.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.section-title-row {
  margin-bottom: 0.85rem;
}

.section-title-row h3 {
  margin: 0 0 0.22rem;
}

.priority-list {
  display: grid;
  gap: 0.5rem;
}

.priority-input {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 0.5rem;
}

.priority-number {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-ink);
  background: rgba(118, 240, 0, 0.17);
  font-size: 0.72rem;
  font-weight: 760;
}

.priority-input input {
  min-height: 40px;
}

.priority-input .btn-icon {
  width: 36px;
  min-height: 36px;
}

.objective-list {
  display: grid;
  gap: 0.75rem;
}

.objective-row {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.objective-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.objective-index {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 720;
}

.objective-fields textarea,
.review-section textarea {
  min-height: 82px;
}

.objective-manual-current.is-hidden {
  display: none;
}

.target-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 0.42fr);
  gap: 0.4rem;
}

.objective-progress {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(180px, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

.objective-progress strong,
.objective-progress span {
  display: block;
}

.objective-progress strong {
  font-size: 0.78rem;
}

.objective-progress div > span {
  color: var(--muted);
  font-size: 0.67rem;
}

.objective-progress .progress-track {
  margin-top: 0;
}

.review-section {
  background: linear-gradient(180deg, #fff, var(--surface-soft));
}

.plan-form-actions {
  position: sticky;
  z-index: 12;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 22px rgba(7, 19, 15, 0.045);
  backdrop-filter: blur(10px);
}

.save-help {
  color: var(--muted);
  font-size: 0.7rem;
}

.compact-notice {
  margin: 0;
}

.plan-comments {
  display: grid;
  gap: 0.8rem;
}

.plan-comments article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.65rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.plan-comments article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.plan-comments .avatar {
  width: 34px;
  height: 34px;
  font-size: 0.68rem;
}

.plan-comments article > div > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.plan-comments time {
  color: var(--muted);
  font-size: 0.66rem;
}

.plan-comments p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  white-space: pre-wrap;
}

.comment-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.comment-form textarea {
  min-height: 78px;
}

.team-overview {
  display: grid;
  gap: 1rem;
}

.team-overview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.team-overview-head h2 {
  margin-bottom: 0.25rem;
}

.team-overview-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-stats {
  margin-bottom: 0;
}

.team-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.team-progress-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.team-progress-card.has-blocker {
  border-color: #e3c997;
}

.team-progress-card.needs-attention {
  box-shadow: inset 3px 0 0 #d59a2d, var(--shadow-xs);
}

.team-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.team-progress-head .profile-summary > span:last-child,
.team-progress-head .profile-summary strong,
.team-progress-head .profile-summary small {
  display: block;
}

.attention-list,
.founder-attention-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.founder-attention-summary {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.attention-chip {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 0.28rem;
  padding: 0.25rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.67rem;
  font-weight: 680;
}

.attention-chip .icon {
  width: 13px;
  height: 13px;
}

.attention-chip.bad {
  color: #8c2929;
  background: #fff1f1;
  border-color: #edc2c2;
}

.attention-chip.warn {
  color: #6c4505;
  background: #fff8e9;
  border-color: #ead1a3;
}

.attention-chip.good {
  color: #12633d;
  background: #edf9f1;
  border-color: #c6ead5;
}

.last-update {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.65rem;
}

.plan-attention-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #ead1a3;
  border-radius: var(--radius);
  color: #6c4505;
  background: #fff8e9;
}

.plan-attention-banner > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
}

.plan-attention-banner .icon {
  flex: 0 0 auto;
}

.plan-attention-banner strong,
.plan-attention-banner small {
  display: block;
}

.plan-attention-banner small {
  font-size: 0.7rem;
}

.team-progress-head .profile-summary small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.team-progress-score {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.team-progress-score strong,
.team-progress-score span {
  display: block;
}

.team-progress-score strong {
  font-size: 1.2rem;
}

.team-progress-score div > span {
  color: var(--muted);
  font-size: 0.65rem;
}

.team-progress-score .progress-track {
  margin: 0;
}

.team-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.team-kpis span {
  padding: 0.45rem;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.64rem;
  text-align: center;
}

.team-kpis strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.team-priorities {
  display: grid;
  gap: 0.4rem;
}

.team-priorities > span {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 0.42rem;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.team-priorities .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 0.1rem;
  color: var(--brand-dark);
}

.team-trend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
}

.team-trend strong {
  color: var(--ink-soft);
}

.team-trend .trend-up {
  color: var(--green);
}

.team-trend .trend-down {
  color: var(--amber);
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(38px, 1fr));
  align-items: end;
  gap: 0.65rem;
  min-height: 190px;
  overflow-x: auto;
}

.trend-point {
  display: grid;
  min-width: 38px;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.63rem;
  text-align: center;
}

.trend-bar {
  display: flex;
  height: 128px;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0.18rem;
  border-bottom: 1px solid var(--line-strong);
  background: repeating-linear-gradient(to top, transparent 0, transparent 31px, rgba(11, 24, 20, 0.05) 32px);
}

.trend-bar span {
  width: min(34px, 72%);
  min-height: 6px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
}

.trend-point strong {
  color: var(--ink);
  font-size: 0.75rem;
}

.trend-latest {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.trend-latest span {
  padding: 0.38rem 0.55rem;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.68rem;
}

.trend-latest strong {
  color: var(--ink-soft);
}

.blocker-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem;
  border: 1px solid #ead1a3;
  border-radius: 9px;
  color: #6c4505;
  background: #fff8e9;
  font-size: 0.75rem;
}

.blocker-note .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.blocker-note strong,
.blocker-note span {
  display: block;
}

.blocker-note strong {
  margin-bottom: 0.12rem;
}

.drilldown-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(69, 173, 0, 0.28);
  border-radius: var(--radius);
  background: rgba(118, 240, 0, 0.07);
}

.drilldown-banner > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.65rem;
}

.drilldown-banner > div > .icon {
  color: #326908;
}

.drilldown-banner strong,
.drilldown-banner small {
  display: block;
}

.drilldown-banner small {
  color: var(--muted);
  font-size: 0.7rem;
}

.daily-board {
  margin-top: 1rem;
  scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .plan-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .work-period-tabs {
    width: 100%;
  }

  .work-period-tabs .tab {
    flex: 1;
  }

  .plan-toolbar .toolbar {
    justify-content: flex-start;
  }

  .team-progress-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .plan-toolbar,
  .automatic-progress-panel .panel-head,
  .plan-form-hero,
  .field-inline-head,
  .section-title-row,
  .plan-form-actions,
  .team-overview-head,
  .drilldown-banner,
  .plan-attention-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .plan-toolbar .toolbar {
    width: 100%;
  }

  .plan-toolbar .toolbar .btn {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-form-hero,
  .plan-form-section,
  .plan-form-actions {
    padding: 1rem;
  }

  .work-plan-form > .form-error {
    margin-right: 1rem;
    margin-left: 1rem;
  }

  .saved-state {
    align-self: flex-start;
  }

  .attention-list .last-update {
    width: 100%;
    margin-left: 0;
  }

  .section-title-row .btn,
  .field-inline-head .btn,
  .plan-form-actions .row,
  .plan-form-actions .btn,
  .drilldown-banner .btn {
    width: 100%;
  }

  .objective-progress,
  .team-progress-score {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-form-actions {
    bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 430px) {
  .metric-grid,
  .team-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .priority-input {
    grid-template-columns: 26px minmax(0, 1fr) 34px;
    gap: 0.35rem;
  }

  .target-input {
    grid-template-columns: minmax(0, 1fr);
  }

  .team-progress-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
