:root {
  --ink: #15231f;
  --muted: #68766f;
  --line: #e4e9e6;
  --canvas: #f4f6f4;
  --panel: #ffffff;
  --green: #186a4c;
  --green-dark: #0f5038;
  --mint: #dff1e9;
  --gold: #c79a41;
  --red: #a44444;
  --shadow: 0 12px 35px rgba(25, 45, 36, 0.07);
}

* { box-sizing: border-box; }
html { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 244px; padding: 24px 18px;
  color: #fff; background: #112d24; display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand:hover { color: #fff; }
.brand-mark, .login-brand {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  color: #102c23; background: #a7d9c4; font-weight: 800; letter-spacing: -.04em;
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: #a7b9b2; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.nav { display: grid; gap: 4px; margin-top: 22px; overflow: auto; }
.nav a { color: #cbd9d4; padding: 10px 12px; border-radius: 9px; font-size: 14px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 18px 8px 0; }
.user-card { display: flex; gap: 10px; align-items: center; }
.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 13px; }
.user-card small { color: #9fb2aa; font-size: 11px; margin-top: 2px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #295342; font-weight: 700; }
.text-button { border: 0; background: none; color: #9fb2aa; padding: 12px 0 0; cursor: pointer; font: inherit; font-size: 12px; }

.main { margin-left: 244px; padding: 42px; min-height: 100vh; }
.auth-main { min-height: 100vh; }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 28px; }
.page-header.compact { align-items: center; margin-bottom: 22px; }
h1, h2 { margin: 0; letter-spacing: -.03em; }
h1 { font-size: clamp(28px, 3vw, 42px); }
h2 { font-size: 20px; }
.eyebrow { margin: 0 0 7px; color: var(--green); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.muted { color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.header-actions { display: flex; gap: 10px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
  padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { color: #fff; background: var(--green-dark); }
.button-secondary { color: var(--green); background: var(--mint); }
.button-ghost { color: var(--muted); background: #fff; border-color: var(--line); }
.button-wide { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.metric-card span, .metric-card small, .metric-card strong { display: block; }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { margin: 8px 0 5px; font-size: 30px; letter-spacing: -.04em; }
.metric-card small { color: #8a958f; font-size: 11px; }
.metric-card.accent { background: #173d31; color: #fff; border-color: #173d31; }
.metric-card.accent span, .metric-card.accent small { color: #b9d0c7; }
.metric-card.success { border-top: 3px solid var(--gold); }

.dashboard-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-header a { font-size: 13px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 11px 12px; color: #7a8781; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; font-size: 13px; border-bottom: 1px solid #edf0ee; vertical-align: top; }
tbody tr:hover { background: #f8faf8; }
.row-action { text-align: right; white-space: nowrap; font-weight: 700; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: var(--green-dark); background: var(--mint); font-size: 11px; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.followup-list { display: grid; }
.followup-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.followup-item strong, .followup-item small { display: block; }
.followup-item small { margin-top: 4px; color: var(--muted); }
.followup-item time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pipeline { display: flex; gap: 10px; overflow-x: auto; }
.pipeline-item { min-width: 150px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.pipeline-item span, .pipeline-item strong { display: block; }
.pipeline-item span { color: var(--muted); font-size: 11px; min-height: 28px; }
.pipeline-item strong { margin-top: 8px; font-size: 24px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 18px; }
.search-input { max-width: 440px; }
.input {
  width: 100%; min-height: 42px; border: 1px solid #d9e0dc; border-radius: 9px;
  padding: 9px 11px; background: #fff; color: var(--ink); font: inherit;
}
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { outline: 3px solid rgba(24,106,76,.12); border-color: var(--green); }
.form-panel { max-width: 1080px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; color: #3e4c46; font-size: 13px; font-weight: 700; }
.field b { color: var(--red); }
.field small { color: var(--muted); font-weight: 400; }
.field em { color: var(--red); font-style: normal; font-weight: 500; }
.field-checkbox { display: flex; align-items: center; padding-top: 28px; }
.checkbox { width: 18px; height: 18px; accent-color: var(--green); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.form-error { padding: 12px 14px; color: #7c2424; background: #fdecec; border: 1px solid #f0c8c8; border-radius: 9px; margin-bottom: 16px; }
.pagination { display: flex; justify-content: center; gap: 20px; padding-top: 20px; font-size: 13px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #dfeee8, #f6f7f5 55%); }
.login-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 38px; box-shadow: 0 25px 70px rgba(18,46,37,.13); }
.login-brand { margin-bottom: 24px; }
.login-card h1 { font-size: 30px; line-height: 1.1; }
.stack { display: grid; gap: 16px; margin-top: 26px; }
.stack label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }

.messages { margin-bottom: 16px; }
.message { padding: 12px 14px; border-radius: 9px; background: var(--mint); color: var(--green-dark); }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: auto; min-height: auto; }
  .nav { grid-template-columns: repeat(2, 1fr); }
  .sidebar-footer { display: none; }
  .main { margin-left: 0; padding: 24px 16px; }
  .page-header, .page-header.compact { align-items: flex-start; flex-direction: column; }
  .metric-grid, .form-grid { grid-template-columns: 1fr; }
  .header-actions, .toolbar { width: 100%; flex-wrap: wrap; }
  .header-actions .button { flex: 1; }
}

