/* ============ HRK Project Suite — Design System ============ */

:root {
  /* HRK Consultancy — emerald & marigold identity */
  --navy: #0E5A46;          /* primary: deep emerald (replaces navy) */
  --navy-dark: #0A4234;     /* deeper emerald */
  --navy-soft: #2C8067;     /* soft emerald for gradients */
  --navy-deep: #093528;
  --gold: #E0913A;          /* accent: warm marigold */
  --gold-dark: #B26F1E;     /* deeper marigold for text/links */
  --gold-soft: #F3D9AE;
  --gold-bg: #FBF1E0;        /* subtle marigold tint for accent backgrounds */

  /* Neutrals — cool pearl-mint, cleaner than cream */
  --bg: #F4F7F5;            /* page background — soft pearl-mint */
  --surface: #FFFFFF;
  --surface-2: #EEF3F0;     /* cool hover/zebra */
  --surface-3: #E3EBE6;
  --border: #DCE6E0;        /* cool green-grey border */
  --border-soft: #E8EFEA;
  --border-faint: #F0F5F2;
  --text: #16241E;          /* deep green-charcoal for primary */
  --text-muted: #566860;
  --text-light: #8A9A92;

  /* Semantic — slightly more refined */
  --ok-text: #1A6B45;
  --ok-bg: #E6F1E9;
  --ok-border: #BFD8C4;
  --warn-text: #8A5A12;
  --warn-bg: #FAF1DE;
  --warn-border: #E8D6A9;
  --bad-text: #8A2A2A;
  --bad-bg: #F8E5E5;
  --bad-border: #E3BFBF;
  --info-text: #1A4F7E;
  --info-bg: #E2EDF6;
  --info-border: #BBD0E4;

  /* Radius / shadow — softer, more refined */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20,39,74,0.04);
  --shadow-md: 0 2px 8px rgba(20,39,74,0.05);
  --shadow-lg: 0 8px 28px rgba(20,39,74,0.08);
  --shadow-card: 0 1px 3px rgba(27,58,92,0.04), 0 2px 8px rgba(27,58,92,0.03);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ APP SHELL ============ */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  background: linear-gradient(180deg, #FFFFFF 0%, #F1F6F3 100%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(14,90,70,0.04), 0 6px 18px rgba(14,90,70,0.05);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 28px;
  height: 70px;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px;
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-soft) 55%, var(--gold) 165%);
  color: #FFFFFF;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  letter-spacing: 0.3px;
  font-family: var(--font-sans);
  box-shadow: 0 3px 10px rgba(14,90,70,0.28), inset 0 1px 0 rgba(255,255,255,0.22);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; left: 9px; right: 9px; bottom: 9px;
  height: 3px; border-radius: 2px; background: var(--gold);
}
/* Big bold two-tone wordmark */
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-hrk {
  font-family: var(--font-sans);
  font-weight: 800; font-size: 24px; letter-spacing: -0.4px;
  color: var(--navy);
}
.brand-hrk .amp { color: var(--gold-dark); }
.brand-consult {
  font-weight: 700; font-size: 11px; letter-spacing: 4.5px;
  color: var(--gold-dark); text-transform: uppercase; margin-top: 3px;
}
/* legacy fallbacks (kept so nothing breaks if referenced elsewhere) */
.brand-name { font-weight: 800; font-size: 24px; color: var(--navy); letter-spacing: -0.4px; }
.brand-sub  { font-size: 11px; color: var(--gold-dark); letter-spacing: 4.5px; text-transform: uppercase; font-weight: 700; }

.topnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav-link {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s;
}
.nav-link:hover { color: var(--navy); background: var(--surface-2); text-decoration: none; }
.nav-link.active {
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  box-shadow: 0 2px 8px rgba(14,90,70,0.22);
}
.nav-link.active i { color: var(--gold-soft); }
.nav-link i { font-size: 16px; vertical-align: -2px; }
.nav-toggle {
  background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; padding: 6px;
  display: none;
}

@media (max-width: 1100px) {
  .header-inner { gap: 12px; }
  .nav-link span { display: none; }
  .nav-link { padding: 8px 10px; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .topnav { display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; gap: 0; padding: 8px; }
  .topnav.open { display: flex; }
  .topnav .nav-link { width: 100%; padding: 12px; font-size: 14px; }
  .topnav .nav-link span { display: inline; }
}

/* ============ MAIN VIEW ============ */
.view {
  max-width: 1400px; margin: 0 auto;
  padding: 24px;
  width: 100%;
}
@media (max-width: 600px) { .view { padding: 16px; } }

/* ============ TYPOGRAPHY ============ */
.page-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--text); margin: 0 0 4px; letter-spacing: -0.3px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin: 0; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin: 24px 0 12px; }
.section-title:first-child { margin-top: 0; }

/* ============ PAGE HEADER ============ */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; margin: 0; }
.card-title i { color: var(--navy); font-size: 16px; }
.card-flush table { width: 100%; }
.mb-md { margin-bottom: 12px; }

/* ============ WELCOME BANNER ============ */
.welcome-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.welcome-card::before {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(201,162,39,0.18) 0%, rgba(201,162,39,0) 70%);
}
.welcome-date {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 6px;
  font-weight: 500;
}
.welcome-greeting {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  margin: 0 0 4px;
  letter-spacing: -0.4px;
}
.welcome-greeting .name { color: var(--gold-soft); }
.welcome-sub { font-size: 13px; opacity: 0.7; margin: 0; }
.welcome-quote {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255,255,255,0.92);
  max-width: 720px;
  position: relative;
}
.welcome-quote::before {
  content: '"'; font-family: var(--font-display); font-size: 48px;
  color: var(--gold); position: absolute; left: -16px; top: -28px; opacity: 0.4;
  font-style: normal;
}
.welcome-quote-attr {
  display: block; margin-top: 8px; font-size: 11px;
  font-style: normal; letter-spacing: 0.8px;
  text-transform: uppercase; color: rgba(255,255,255,0.55);
}

@media (max-width: 600px) {
  .welcome-card { padding: 22px 20px; }
  .welcome-greeting { font-size: 24px; }
  .welcome-quote { font-size: 14px; }
}

/* ============ METRICS / KPI CARDS ============ */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  border: 1px solid var(--border);
}
.metric.accent { border-left: 3px solid var(--gold); }
.metric-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 6px; font-weight: 500; }
.metric-value { font-size: 26px; font-weight: 600; margin: 0; line-height: 1.05; color: var(--text); font-family: var(--font-display); letter-spacing: -0.5px; }
.metric-sub { font-size: 11px; color: var(--text-light); margin: 4px 0 0; }
.metric-value.danger { color: var(--bad-text); }
.metric-value.ok { color: var(--ok-text); }
.metric-sub.danger { color: var(--bad-text); }

/* ============ PROJECT HEALTH CARDS ============ */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.project-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.project-card-flag {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.project-card-flag.healthy { background: #1F6F45; }
.project-card-flag.watch { background: #C9A227; }
.project-card-flag.unhealthy { background: #8A2727; }
.project-card-flag.bidding { background: #144C7E; }
.project-card-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; color: var(--text); }
.project-card-client { font-size: 11px; color: var(--text-muted); margin-bottom: 12px; }
.project-card-row { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; }
.project-card-row .label { color: var(--text-muted); }
.project-card-row .value { font-weight: 500; }
.project-card-bar {
  margin-top: 12px;
  height: 6px; background: var(--border-soft); border-radius: 3px; overflow: hidden;
  display: flex;
}
.project-card-bar-fill { background: var(--navy); height: 100%; }
.project-card-bar-fill.cert { background: var(--gold); }
.project-card-flag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 10px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.project-card-flag-pill.healthy { background: var(--ok-bg); color: var(--ok-text); }
.project-card-flag-pill.watch { background: var(--warn-bg); color: var(--warn-text); }
.project-card-flag-pill.unhealthy { background: var(--bad-bg); color: var(--bad-text); }
.project-card-flag-pill.bidding { background: var(--info-bg); color: var(--info-text); }
.project-card-meta { display: flex; gap: 10px; align-items: center; font-size: 11px; color: var(--text-muted); margin-top: 10px; flex-wrap: wrap; }
.project-card-meta i { color: var(--gold); font-size: 14px; vertical-align: -2px; }

/* ============ TABS (sub-tabs) ============ */
.subtabs {
  display: inline-flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 2px;
}
.subtab {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer; border: 0; background: none;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.subtab:hover { color: var(--text); }
.subtab.active { background: var(--navy); color: #fff; }
.subtab .count { display: inline-block; padding: 1px 6px; font-size: 10px; border-radius: 8px;
  background: rgba(0,0,0,0.06); color: inherit; margin-left: 2px; }
.subtab.active .count { background: rgba(255,255,255,0.18); }

/* ============ TABS (page tabs) ============ */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 10px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab i { font-size: 16px; }

/* ============ TABLES ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; padding: 10px 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.tbl tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--surface-2); }
.col-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.col-actions { text-align: right; white-space: nowrap; }

.project-title-cell { font-weight: 600; }
.project-sub-cell { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-muted); text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-gold:hover { background: #B8932A; border-color: #B8932A; color: var(--navy); }
.btn-danger { color: var(--bad-text); border-color: var(--border); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad-text); }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-ghost { background: none; border: 0; padding: 6px 8px; color: var(--text-muted); cursor: pointer; }
.btn-ghost:hover { color: var(--navy); }
.btn i { font-size: 15px; }

.flex-row { display: flex; gap: 8px; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============ PILLS ============ */
.pill { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; text-transform: capitalize; }
.pill-ok { background: var(--ok-bg); color: var(--ok-text); }
.pill-warn { background: var(--warn-bg); color: var(--warn-text); }
.pill-bad { background: var(--bad-bg); color: var(--bad-text); }
.pill-info { background: var(--info-bg); color: var(--info-text); }
.pill-neutral { background: var(--border-soft); color: var(--text-muted); }

.source-pill {
  display: inline-block; padding: 1px 6px; font-size: 9px;
  border-radius: 4px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.3px; margin-top: 4px;
}
.source-mine { background: #DEF1E6; color: #1F6F45; }
.source-market { background: var(--warn-bg); color: var(--warn-text); }
.source-web { background: var(--info-bg); color: var(--info-text); }
.source-estimate { background: var(--border-soft); color: var(--text-muted); }

/* ============ FORMS ============ */
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-row label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-row input, .form-row select, .form-row textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--surface);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid var(--gold); outline-offset: -1px; border-color: var(--gold);
}
.form-row textarea { resize: vertical; min-height: 60px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* ============ MODALS ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,39,74,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px; backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.18s ease-out;
}
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 600; margin: 0; color: var(--text); }
.modal-close { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ TOAST ============ */
.toast-root { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy-dark); color: #fff;
  padding: 14px 20px; border-radius: var(--radius-md);
  font-size: 14px; box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease-out;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 420px;
}
.toast i { font-size: 22px; flex-shrink: 0; }
.toast.error { background: var(--bad-text); }
.toast.success { background: var(--ok-text); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============ ALERTS ============ */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 12px;
}
.alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert.warn { background: var(--warn-bg); color: var(--warn-text); border-left: 3px solid #C9A227; }
.alert.bad  { background: var(--bad-bg); color: var(--bad-text); border-left: 3px solid #8A2727; }
.alert.ok   { background: var(--ok-bg); color: var(--ok-text); border-left: 3px solid #1F6F45; }
.alert.info { background: var(--info-bg); color: var(--info-text); border-left: 3px solid #144C7E; }

/* ============ EMPTY STATE ============ */
.empty { text-align: center; padding: 60px 30px; color: var(--text-muted); }
.empty i { font-size: 56px; color: var(--text-light); margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.empty-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* ============ BREADCRUMB ============ */
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-muted); }

/* ============ TOOLBAR ============ */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }

/* ============ UPLOAD ZONE ============ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  background: var(--surface-2);
  margin-bottom: 16px;
  transition: all 0.15s;
  cursor: pointer;
}
.upload-zone:hover { border-color: var(--navy); background: #F9F7F0; }
.upload-zone.drag-over { border-color: var(--gold); background: #FFF8E0; }
.upload-zone-icon { font-size: 32px; color: var(--navy); margin-bottom: 6px; }
.upload-zone-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.upload-zone-sub { font-size: 12px; color: var(--text-muted); }
.upload-zone-hint { font-size: 11px; color: var(--text-light); margin-top: 6px; }
.upload-zone input[type="file"] { display: none; }
.upload-zone.parsing { border-color: var(--gold); background: #FFF8E0; cursor: progress; }
.upload-zone.parsed { border-color: var(--ok-text); background: var(--ok-bg); border-style: solid; }
.upload-zone.failed { border-color: var(--bad-text); background: var(--bad-bg); border-style: solid; }
.upload-zone-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--gold); border-top-color: transparent;
  border-radius: 50%; animation: spin 0.6s linear infinite;
  vertical-align: -3px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.upload-success-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ok-text); }
.parsed-fields-note { margin-top: 6px; font-size: 11px; color: var(--text-muted); }

/* ============ SITE BOT (WhatsApp simulator) ============ */
.bot-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 880px) { .bot-layout { grid-template-columns: 1fr; } }
.bot-sidebar { display: flex; flex-direction: column; gap: 12px; }
.bot-history-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--border); cursor: pointer; gap: 8px; }
.bot-history-row:last-child { border-bottom: 0; }
.bot-history-row:hover { background: var(--surface-2); }

.bot-stage { background: #ECE5DD; border-radius: var(--radius-md); display: flex; flex-direction: column; height: 600px; overflow: hidden; border: 1px solid var(--border); }
.bot-chat-window { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bot-header { background: #128C7E; color: #fff; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.bot-header b { font-weight: 500; }
.bot-header > div:last-child { color: rgba(255,255,255,0.85); }
.bot-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.bot-bubble { max-width: 78%; padding: 7px 10px 5px; border-radius: 8px; position: relative; font-size: 13px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,0.08); }
.bot-bubble-bot { background: #fff; align-self: flex-start; border-top-left-radius: 0; }
.bot-bubble-user { background: #DCF8C6; align-self: flex-end; border-top-right-radius: 0; }
.bot-bubble-text { color: #1F1F1F; }
.bot-bubble-photo { margin-top: 6px; padding: 6px 8px; background: rgba(0,0,0,0.05); border-radius: 4px; font-size: 11px; color: var(--text-muted); }
.bot-bubble-time { font-size: 10px; color: rgba(0,0,0,0.45); text-align: right; margin-top: 2px; }
.bot-completed-banner { background: var(--ok-bg); color: var(--ok-text); padding: 10px 14px; font-size: 12px; border-top: 1px solid var(--border); text-align: center; }
.bot-completed-banner a { color: var(--ok-text); font-weight: 500; text-decoration: underline; }
.bot-composer { background: #F0F0F0; padding: 8px 10px; display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--border); }
.bot-composer input[type="text"], .bot-composer input:not([type="file"]) { flex: 1; padding: 9px 12px; border: 0; border-radius: 18px; background: #fff; font-size: 13px; font-family: inherit; }
.bot-composer input:focus { outline: 1px solid var(--gold); }
.bot-photo-btn { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); }
.bot-photo-btn:hover { color: #128C7E; }
.bot-composer .btn-primary { border-radius: 50%; width: 36px; height: 36px; padding: 0; justify-content: center; }
.bot-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); text-align: center; padding: 40px; }
.bot-empty i { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.bot-empty-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.bot-empty-sub { font-size: 12px; }

/* ============ PRE-TENDER CHAT ============ */
.chat-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
@media (max-width: 880px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); display: flex; flex-direction: column; height: 650px; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; line-height: 1.6; }
.chat-msg-user { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-msg-bot { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 2px; }
.chat-composer { background: var(--surface); padding: 12px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-composer textarea { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 13px; font-family: inherit; resize: none; min-height: 44px; }
.chat-composer textarea:focus { outline: 2px solid var(--gold); outline-offset: -1px; border-color: var(--gold); }

.chat-info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.chat-info-card h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin: 0 0 10px; font-weight: 600; }
.chat-suggestion {
  background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 12px; cursor: pointer; margin-bottom: 6px;
  border: 1px solid transparent; transition: all 0.15s;
}
.chat-suggestion:hover { background: #F9F7F0; border-color: var(--gold); }

/* ============ INFO BANNER (used for cost callouts etc) ============ */
.info-banner {
  background: var(--info-bg); color: var(--info-text);
  border-radius: var(--radius-md); padding: 14px 18px;
  border-left: 3px solid #144C7E;
  font-size: 13px; margin-bottom: 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.info-banner i { font-size: 20px; flex-shrink: 0; }

/* ============ PROJECT WORKSPACE ============ */
.proj-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.proj-header-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.proj-header-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 14px;
}
.proj-stat { min-width: 0; }
.proj-stat-label { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; font-weight: 500; }
.proj-stat-value { font-size: 18px; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.3px; }
.proj-stat-value.danger { color: var(--bad-text); }
.proj-stat-value.warn { color: var(--warn-text); }

.proj-workspace {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .proj-workspace { grid-template-columns: 1fr; }
}

.proj-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  position: sticky;
  top: 76px;
}
@media (max-width: 900px) {
  .proj-sidebar { position: static; }
}
.pside-group { margin-bottom: 6px; }
.pside-group:last-child { margin-bottom: 0; }
.pside-group-title {
  font-size: 10px; color: var(--text-light); text-transform: uppercase;
  letter-spacing: 0.6px; padding: 10px 10px 4px; font-weight: 600;
}
.pside-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  text-decoration: none;
  transition: all 0.12s;
  gap: 8px;
}
.pside-item-main {
  display: inline-flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pside-item i { font-size: 16px; flex-shrink: 0; }
.pside-item:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.pside-item.active {
  background: var(--navy);
  color: #fff;
  font-weight: 500;
}
.pside-item.active i { color: var(--gold); }
.pside-badge {
  font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: 10px;
  flex-shrink: 0;
}
.pside-badge-bad { background: var(--bad-bg); color: var(--bad-text); }
.pside-badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.pside-badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.pside-badge-info { background: var(--info-bg); color: var(--info-text); }
.pside-badge-neutral { background: var(--border-soft); color: var(--text-muted); }
.pside-item.active .pside-badge { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.95); }

.proj-panel { min-width: 0; }

.panel-section-title {
  font-size: 12px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 600;
  margin: 16px 0 10px;
}
.panel-section-title:first-child { margin-top: 0; }

/* Project Summary cards */
.psum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.psum-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.psum-card-label {
  font-size: 10px; color: var(--text-light); text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 600; margin-bottom: 6px;
}
.psum-card-value { font-size: 14px; font-weight: 600; color: var(--text); }
.psum-card-amount { color: var(--text-muted); font-weight: 500; }
.psum-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.psum-card-link {
  display: inline-block; margin-top: 10px;
  font-size: 11px; color: var(--navy); font-weight: 500;
}
.psum-empty { font-size: 13px; color: var(--text-light); margin: 6px 0; }
.psum-card.empty-card { border-style: dashed; background: var(--surface-2); }

/* ============ UTIL ============ */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 11px; }
.danger { color: var(--bad-text); }
.ok { color: var(--ok-text); }
.warn { color: var(--warn-text); }
.mt-md { margin-top: 12px; }
.mt-lg { margin-top: 20px; }
.mb-lg { margin-bottom: 20px; }
.text-center { text-align: center; }
.coming-soon-badge { display: inline-block; background: var(--warn-bg); color: var(--warn-text); padding: 2px 8px; font-size: 10px; font-weight: 600; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.dot-divider { color: var(--border); margin: 0 6px; }

/* Tab strip for sub-navigation within a page */
.tab-strip {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 8px 0 18px;
  padding: 0;
}
.tab-strip .tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-strip .tab-link:hover { color: var(--text); }
.tab-strip .tab-link.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

/* Chip buttons for filter rows */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.chip:hover { background: var(--surface); border-color: var(--navy); }
.chip.chip-active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}
.text-link {
  color: var(--navy);
  text-decoration: none;
  font-size: 12px;
}
.text-link:hover { text-decoration: underline; }

/* Attachments widget - used in every detail/edit modal */
.attachment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  margin-bottom: 6px;
  transition: background 0.12s;
}
.attachment-row:hover { background: var(--surface-2); }
.attachment-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.attachment-label {
  background: var(--info-bg);
  color: var(--info-text);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
}
.attachment-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.attachment-actions .btn-ghost {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.attachment-actions .btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.attachment-actions .btn-ghost.danger:hover { color: var(--bad-text); }
.attachment-uploader {
  margin-top: 8px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.attachment-uploader:hover, .attachment-uploader.drag-over {
  border-color: var(--navy);
  background: var(--surface-2);
}
.attachment-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
.attachment-upload-label i { font-size: 22px; color: var(--navy); }
.attachment-upload-hint { font-size: 10px; opacity: 0.7; }

/* Project documents - card grid */
.pdoc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.pdoc-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pdoc-card:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 58, 104, 0.08);
}
.pdoc-card-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  align-self: flex-start;
}
.pdoc-card-body { flex: 1; min-width: 0; }
.pdoc-card-cat { margin-bottom: 6px; }
.pdoc-card-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pdoc-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.pdoc-card-file {
  font-size: 11px;
  color: var(--navy);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ TODAY DASHBOARD ============ */
.today-hero {
  margin-bottom: 24px;
}
.today-hero-greeting {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.today-hero-date {
  margin-left: 8px;
  font-weight: 400;
  font-size: 13px;
}
.today-hero-headline {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.today-hero-positive { border-left-color: var(--ok-text); }
.today-hero-negative { border-left-color: var(--bad-text); }
.today-hero-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-bottom: 6px;
}
.today-hero-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--text);
}
.today-hero-positive .today-hero-value { color: var(--ok-text); }
.today-hero-negative .today-hero-value { color: var(--bad-text); }
.today-hero-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.today-section-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 600;
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.today-section-title i { font-size: 14px; }
.today-section-count {
  background: var(--bad-text);
  color: white;
  padding: 1px 8px;
  border-radius: 100px;
  font-size: 11px;
  margin-left: 4px;
  font-weight: 700;
}
.today-section-sub {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* Attention cards */
.today-attention-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--ok-bg);
  border: 1px solid #BAE0BD;
  border-radius: 10px;
}
.today-attention-empty-title { font-weight: 600; font-size: 15px; color: var(--ok-text); }
.today-attention-empty-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.today-attention-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.today-attention-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s, box-shadow 0.12s;
}
.today-attention-card:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.today-attention-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text);
}
.today-attention-body { flex: 1; min-width: 0; }
.today-attention-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.today-attention-detail { font-size: 12px; color: var(--text-muted); }
.today-attention-cta { color: var(--text-muted); flex-shrink: 0; }

/* Bottom 2-col: activity + snapshot */
.today-bottom {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-top: 8px;
}
@media (max-width: 900px) {
  .today-bottom { grid-template-columns: 1fr; }
}
.today-activity-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.today-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  text-decoration: none;
  color: var(--text);
  border-radius: 6px;
  transition: background 0.12s;
}
.today-activity-item:hover { background: var(--surface-2); }
.today-activity-icon {
  font-size: 16px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  flex-shrink: 0;
}
.today-activity-body { flex: 1; min-width: 0; }
.today-activity-title { font-size: 13px; font-weight: 500; margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-activity-detail { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-activity-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* Snapshot card */
.today-snap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.today-snap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}
.today-snap-label { color: var(--text-muted); }
.today-snap-value { font-weight: 600; }
.today-snap-value.danger { color: var(--bad-text); }
.today-snap-value.warn { color: #B07000; }
.today-snap-value.ok { color: var(--ok-text); }
.today-snap-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
  margin: 6px 0 8px;
}
.today-snap-bar-fill { height: 100%; transition: width 0.4s; }
.today-snap-divider { border-top: 1px solid var(--border); margin: 8px 0; }

/* ============ COLLAPSIBLE SIDEBAR ============ */
.pside-group-title {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 8px 8px 6px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 4px;
}
.pside-group-title:hover { background: var(--surface-2); color: var(--text); }
.pside-group-chevron { font-size: 13px; opacity: 0.7; transition: transform 0.15s; }
.pside-group-label { flex: 1; }
.pside-group-closed .pside-group-title { color: var(--text-muted); }
.pside-item-primary {
  font-weight: 600;
  background: linear-gradient(90deg, var(--surface-2), transparent);
}
.pside-item-primary .ti { color: var(--navy); }

/* ============ FAB ============ */
#fab-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
}
.fab-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#fab-root.fab-open .fab-backdrop {
  opacity: 1;
  pointer-events: auto;
}
.fab-cluster {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(31, 58, 104, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  position: relative;
  z-index: 2;
}
.fab-main:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(31, 58, 104, 0.45);
  background: #2B4A7C;
}
.fab-main:active { transform: scale(0.95); }
.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  transform-origin: bottom right;
  transition: opacity 0.18s, transform 0.18s;
}
#fab-root.fab-open .fab-menu {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}
.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 8px 8px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s, background 0.12s;
  white-space: nowrap;
}
.fab-menu-item:hover {
  background: var(--surface-2);
  transform: translateX(-2px);
}
.fab-menu-label { padding-right: 4px; }
.fab-menu-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
@media (max-width: 600px) {
  #fab-root { bottom: 16px; right: 16px; }
  .fab-main { width: 52px; height: 52px; font-size: 22px; }
}

/* ============ SITE BOT SIMULATOR ============ */
.bot-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  height: 600px;
}
@media (max-width: 900px) {
  .bot-shell { grid-template-columns: 1fr; height: auto; }
}
.bot-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  overflow-y: auto;
}
.bot-side-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.bot-eng {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.12s;
}
.bot-eng:hover { background: var(--surface-2); }
.bot-eng.active { background: var(--info-bg); }
.bot-eng-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.bot-eng-body { flex: 1; min-width: 0; }
.bot-eng-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-eng-phone { font-size: 11px; color: var(--text-muted); }
.bot-trigger {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 6px;
}
.bot-test-hints {
  background: var(--surface-2);
  padding: 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.5;
}
.bot-test-hints code {
  background: white;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
}

/* WhatsApp-like chat panel */
.bot-chat {
  display: flex;
  flex-direction: column;
  background: #ECE5DD;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 500px;
}
.bot-chat-header {
  background: #075E54;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bot-chat-header i { font-size: 24px; }
.bot-chat-title { font-weight: 600; font-size: 14px; }
.bot-chat-sub { font-size: 11px; opacity: 0.85; }
.bot-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-image: linear-gradient(rgba(255,255,255,0.6), rgba(255,255,255,0.6)), url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Ccircle cx='100' cy='100' r='2' fill='%23999' opacity='0.1'/%3E%3C/svg%3E");
}
.bot-msg {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}
.bot-msg-in {
  align-self: flex-end;
}
.bot-msg-out {
  align-self: flex-start;
}
.bot-msg-bubble {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}
.bot-msg-in .bot-msg-bubble {
  background: #DCF8C6;
  border-bottom-right-radius: 2px;
}
.bot-msg-out .bot-msg-bubble {
  background: white;
  border-bottom-left-radius: 2px;
}
.bot-msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 4px;
}
.bot-msg-in .bot-msg-time { text-align: right; }
.bot-chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #F0F0F0;
  border-top: 1px solid #D0D0D0;
}
.bot-chat-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 14px;
  font-size: 14px;
  background: white;
}
.bot-chat-input input:focus {
  outline: none;
  border-color: var(--navy);
}
.bot-chat-input button {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============ SITE BOT HUB (top-level) ============ */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
  display: block;
}
.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(20,39,74,0.08);
  border-color: var(--navy);
  text-decoration: none;
}
.hub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.hub-card-title {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
  line-height: 1.3;
}
.hub-card-header i {
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}
.hub-card-client { margin: 2px 0 12px; }
.hub-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 10px;
}
.hub-stat { text-align: center; }
.hub-stat-val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--navy);
  line-height: 1.2;
}
.hub-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.hub-card-engineers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.hub-eng-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 8px 2px 2px;
  font-size: 11px;
}
.hub-eng-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}

.hub-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.hub-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}
.hub-list-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.hub-activity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}
.hub-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
}
.hub-activity-item:hover { background: var(--surface-2); text-decoration: none; }
.hub-activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.hub-activity-daily_log { background: var(--info-bg); color: var(--info-text); }
.hub-activity-safety { background: var(--bad-bg); color: var(--bad-text); }
.hub-activity-body { flex: 1; min-width: 0; }
.hub-activity-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-activity-detail { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-activity-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* ============ DPR REVIEW QUEUE (hub) ============ */
.dpr-allclear {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--ok-bg);
  border: 1px solid #BAE0BD;
  border-left: 4px solid var(--ok-text);
  border-radius: 10px;
  margin-bottom: 16px;
}
.dpr-allclear i { font-size: 32px; color: var(--ok-text); }
.dpr-allclear-title { font-weight: 600; font-size: 15px; color: var(--ok-text); }
.dpr-allclear-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.dpr-queue-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #B07000;
  margin: 0 0 12px;
}
.dpr-queue-count {
  background: #B07000;
  color: white;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 13px;
}
.dpr-queue { display: flex; flex-direction: column; gap: 12px; }

.dpr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid #C9881A;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dpr-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.dpr-card-project { font-weight: 600; font-size: 15px; }
.dpr-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dpr-card-met {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}
.dpr-card-met-yes { background: var(--ok-bg); color: var(--ok-text); }
.dpr-card-met-no { background: var(--bad-bg); color: var(--bad-text); }

.dpr-card-pmnote {
  background: #FFF7E0;
  border-left: 3px solid #C9881A;
  padding: 8px 12px;
  border-radius: 4px;
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}
.dpr-card-preview {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin: 10px 0 12px;
  max-height: 180px;
  overflow: hidden;
  position: relative;
}
.dpr-card-preview::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--surface-2));
  pointer-events: none;
}
.dpr-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ============ DPR MODAL (review workflow) ============ */
.dpr-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 13px;
}
.dpr-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.dpr-tab {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.dpr-tab:hover { color: var(--text); }
.dpr-tab-active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}
.dpr-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.dpr-pm-note-wrap {
  background: #FFF7E0;
  border: 1px dashed #C9881A;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.dpr-pm-note-wrap textarea {
  width: 100%;
  border: 1px solid #E0CC92;
  border-radius: 4px;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  margin: 4px 0 8px;
  resize: vertical;
  background: white;
}
.dpr-pm-note-locked {
  background: #FFF7E0;
  border-left: 3px solid #C9881A;
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.dpr-rendered {
  background: white;
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  font-family: var(--font-sans);
  white-space: normal;
  max-height: 480px;
  overflow-y: auto;
}
.dpr-edit-area {
  width: 100%;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}
.dpr-raw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) {
  .dpr-raw-grid { grid-template-columns: 1fr; }
}
.dpr-raw-block {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 12px 14px;
}
.dpr-raw-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.dpr-raw-row {
  font-size: 13px;
  margin-bottom: 6px;
  line-height: 1.5;
}
.dpr-modal-footer { gap: 8px; }

/* ============ PER-PROJECT SITE BOT (today) ============ */
.sb-today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.sb-eng-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sb-eng-head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sb-eng-name { font-weight: 600; font-size: 14px; }
.sb-eng-phone { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.sb-state {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.sb-state i { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.sb-state-label { font-weight: 600; }
.sb-state-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sb-state-pending { background: var(--surface-2); }
.sb-state-pending i { color: var(--text-muted); }
.sb-state-progress { background: var(--info-bg); color: var(--info-text); }
.sb-state-review { background: #FFF7E0; color: #8A5A14; }
.sb-state-approved { background: var(--info-bg); color: var(--info-text); }
.sb-state-sent { background: var(--ok-bg); color: var(--ok-text); }
.sb-eng-actions { display: flex; gap: 8px; }

/* Recent DPRs list */
.sb-recent-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.sb-recent-row {
  display: grid;
  grid-template-columns: 110px 1fr 100px 200px 80px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
}
.sb-recent-row:last-child { border-bottom: none; }
.sb-recent-row:hover { background: var(--surface-2); text-decoration: none; }
.sb-recent-date { font-weight: 500; }
.sb-recent-cta { color: var(--navy); font-size: 12px; text-align: right; }

/* Tools collapsible */
.sb-tools {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.sb-tools-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
  list-style: none;
}
.sb-tools-summary::-webkit-details-marker { display: none; }
.sb-tools-summary:hover { background: var(--surface-2); }
.sb-tools-summary > i:first-child { font-size: 16px; }
.sb-tools-chevron {
  margin-left: auto;
  transition: transform 0.2s;
}
.sb-tools[open] .sb-tools-chevron { transform: rotate(180deg); }
.sb-tools-body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--border-soft);
}

/* ============ TEMPLATES LIBRARY ============ */
.tmpl-trade-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 12px;
}
.tmpl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  transition: all 0.12s;
}
.tmpl-chip:hover { background: var(--surface-2); border-color: var(--navy); }
.tmpl-chip-active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}
.tmpl-chip i { font-size: 14px; }
.tmpl-chip-count {
  background: rgba(0,0,0,0.08);
  padding: 1px 7px;
  border-radius: 100px;
  font-size: 10px;
  margin-left: 2px;
  min-width: 18px;
  text-align: center;
}
.tmpl-chip-active .tmpl-chip-count {
  background: rgba(255,255,255,0.25);
  color: white;
}

.tmpl-search-bar {
  position: relative;
  margin-bottom: 16px;
}
.tmpl-search-bar i.ti-search {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}
.tmpl-search-bar input {
  width: 100%;
  padding: 9px 36px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: inherit;
}
.tmpl-search-bar input:focus {
  outline: none;
  border-color: var(--navy);
}
.tmpl-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}
.tmpl-search-clear:hover { color: var(--text); }

.tmpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.tmpl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.14s, border-color 0.14s;
}
.tmpl-card:hover {
  box-shadow: 0 2px 10px rgba(20,39,74,0.06);
  border-color: #B8C0D0;
}
.tmpl-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 2px;
}
.tmpl-code {
  background: var(--navy);
  color: white;
  font-family: monospace;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.tmpl-trade-tag {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.tmpl-mandatory {
  background: var(--bad-bg);
  color: var(--bad-text);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.tmpl-custom {
  background: #E8F1FF;
  color: #1F5A8A;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.tmpl-card-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  color: var(--text);
}
.tmpl-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.tmpl-when {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  border-left: 2px solid var(--gold);
  padding-left: 8px;
  background: rgba(201,162,39,0.05);
  border-radius: 0 4px 4px 0;
  padding: 6px 8px;
}
.tmpl-standards {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.tmpl-standards i { font-size: 12px; }
.tmpl-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}
.tmpl-card-actions .btn { flex: 1; justify-content: center; }
.tmpl-card-actions .btn:last-child:not(.btn-primary) { flex: 0; }

/* ============ SCHEDULE / GANTT ============ */
.sched-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.sched-view-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}
.sched-view-btn:last-child { border-right: none; }
.sched-view-btn:hover { background: var(--surface-2); color: var(--text); }
.sched-view-active { background: var(--navy); color: white; }
.sched-view-active:hover { background: var(--navy); color: white; }

.sched-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0 16px;
}
@media (max-width: 900px) { .sched-kpis { grid-template-columns: repeat(2, 1fr); } }
.sched-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.sched-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.sched-kpi-value {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.sched-kpi-good { color: var(--ok-text); }
.sched-kpi-bad { color: var(--bad-text); }
.sched-kpi-delta {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 100px;
}
.sched-kpi-delta-bad { background: var(--bad-bg); color: var(--bad-text); }
.sched-kpi-delta-good { background: var(--ok-bg); color: var(--ok-text); }
.sched-progress {
  height: 4px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
}
.sched-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), #2B4A7C);
}

/* Layout: split view shows table + gantt stacked */
.sched-shell { display: flex; flex-direction: column; gap: 16px; }
.sched-table-wrap, .sched-gantt-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

/* Schedule table */
.sched-table {
  font-size: 12px;
  width: 100%;
}
.sched-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sched-table td { padding: 8px 10px; vertical-align: middle; }
.sched-row-summary {
  background: rgba(31, 58, 104, 0.04);
  font-weight: 600;
}
.sched-row-summary td { font-weight: 600; }
.sched-wbs { font-family: monospace; font-size: 11px; color: var(--text-muted); }
.sched-name { line-height: 1.4; }
.sched-discipline {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 100px;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.sched-milestone-icon {
  color: var(--gold);
  font-size: 12px;
  margin-right: 4px;
}
.sched-var {
  font-family: monospace;
  font-weight: 600;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
}
.sched-var-bad { background: var(--bad-bg); color: var(--bad-text); }
.sched-var-good { background: var(--ok-bg); color: var(--ok-text); }

.sched-pct { min-width: 110px; }
.sched-pct-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
.sched-pct-inline:hover { background: var(--surface-2); }
.sched-pct-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
}
.sched-pct-fill {
  height: 100%;
  background: var(--navy);
}
.sched-pct-num { font-weight: 600; min-width: 30px; text-align: right; font-size: 11px; }

.btn-icon {
  padding: 4px 6px;
  min-width: 0;
}

/* ============ GANTT CHART (2-column layout) ============ */
.gantt-shell {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 11px;
  background: var(--surface);
}
.gantt-labels-col {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  z-index: 2;
}
.gantt-labels-hdr {
  height: 28px;
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gantt-labels-hindrance {
  height: 24px;
  background: #FFFAF5;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--bad-text);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.gantt-labels-body { /* container for label rows */ }
.gantt-label-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}
.gantt-label-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-label-row.gantt-row-summary {
  background: rgba(31, 58, 104, 0.05);
  font-weight: 600;
}
.gantt-scroll-col {
  flex: 1;
  overflow-x: auto;
  position: relative;
}
.gantt-scroll-inner {
  position: relative;
}
.gantt-months-hdr {
  height: 28px;
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
  position: relative;
}
.gantt-month {
  position: absolute;
  top: 0;
  height: 100%;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 6px;
}
.gantt-hindrance-row {
  height: 24px;
  border-bottom: 1px solid var(--border);
  background: #FFFAF5;
  position: relative;
}
.gantt-hindrance {
  position: absolute;
  top: 2px;
  color: var(--bad-text);
  font-size: 14px;
  width: 20px;
  text-align: center;
  cursor: help;
}
.gantt-bars-body {
  position: relative;
}
.gantt-bar-row {
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  background: var(--surface);
}
.gantt-bar-row.gantt-row-summary { background: rgba(31, 58, 104, 0.05); }
.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bad-text);
  z-index: 3;
  pointer-events: none;
}
.gantt-today-line::before {
  content: "TODAY";
  position: absolute;
  top: -4px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--bad-text);
  background: white;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.gantt-bar {
  position: absolute;
  top: 6px;
  height: 16px;
  border-radius: 3px;
  cursor: pointer;
}
.gantt-bar-planned {
  background: #C8D2E0;
  border: 1px solid #94A3BE;
}
.gantt-bar-summary {
  background: #5A6B85 !important;
  border: 1px solid var(--navy) !important;
  height: 8px !important;
  top: 10px !important;
  border-radius: 0 !important;
}
.gantt-bar-summary::before,
.gantt-bar-summary::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 0;
  height: 0;
  border-style: solid;
  border-color: var(--navy) transparent transparent transparent;
  border-width: 4px 4px 0 4px;
}
.gantt-bar-summary::before { left: -1px; }
.gantt-bar-summary::after { right: -1px; }
.gantt-bar-actual {
  background: var(--navy);
  top: 14px;
  height: 8px;
  opacity: 0.95;
  border-radius: 2px;
}
.gantt-bar-progress {
  position: absolute;
  top: 6px;
  height: 16px;
  background: rgba(31, 58, 104, 0.55);
  border-radius: 3px 0 0 3px;
  pointer-events: none;
}
.gantt-milestone {
  position: absolute;
  top: 4px;
  width: 16px;
  height: 16px;
  color: var(--gold);
  font-size: 18px;
  text-align: center;
  line-height: 16px;
  text-shadow: 0 0 2px rgba(0,0,0,0.3);
  cursor: pointer;
}
.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -1px;
}
.gantt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gantt-legend-swatch {
  display: inline-block;
  width: 18px;
  height: 10px;
  border-radius: 2px;
  position: static !important;
  top: auto !important;
}
.gantt-legend-swatch.gantt-bar-actual { height: 6px; }
.gantt-legend-today {
  display: inline-block;
  color: var(--bad-text);
  font-weight: 700;
  font-size: 14px;
}

/* ============ PROJECT CHECKLISTS & FORMS ============ */
.chk-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0 16px;
}
@media (max-width: 900px) { .chk-kpis { grid-template-columns: repeat(2, 1fr); } }
.chk-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.chk-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.chk-kpi-value {
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
}
.chk-kpi-good { color: var(--ok-text); }
.chk-kpi-bad { color: var(--bad-text); }

.chk-mandatory-banner {
  background: #FFF7E0;
  border: 1px solid #E0CC92;
  border-left: 4px solid #C9881A;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.chk-mandatory-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.chk-mandatory-head > i {
  font-size: 20px;
  color: #C9881A;
  flex-shrink: 0;
}
.chk-mandatory-title {
  font-weight: 600;
  font-size: 14px;
  color: #8A5A14;
}
.chk-mandatory-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.chk-mandatory-head > div { flex: 1; }
.chk-mandatory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chk-missing-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #E0CC92;
  border-radius: 100px;
  background: white;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.12s;
}
.chk-missing-chip:hover {
  background: #FFE9B8;
  border-color: #C9881A;
}
.chk-missing-code {
  background: #C9881A;
  color: white;
  font-family: monospace;
  font-weight: 700;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.chk-missing-chip i { color: var(--text-muted); font-size: 14px; }

/* Table */
.chk-table { font-size: 13px; }
.chk-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chk-code {
  background: var(--navy);
  color: white;
  font-family: monospace;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.chk-trade-tag {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Add checklist modal */
.chk-add-group { margin-bottom: 16px; }
.chk-add-group:last-child { margin-bottom: 0; }
.chk-add-trade {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-soft);
}
.chk-add-row {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: all 0.12s;
}
.chk-add-row:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

/* ============ AESTHETIC REFINEMENTS ============ */
/* Refined cards with subtle elegant shadows */
.proj-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.proj-header-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--gold) 100%);
  opacity: 0.85;
}

/* ============ COMPACT FINANCIAL STRIP (financial tabs only) ============ */
/* Sits below the project header card. Visually subordinate. 3 cards, single line. */
.proj-fin-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: -8px 0 16px 0;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
@media (max-width: 900px) { .proj-fin-strip { grid-template-columns: 1fr; gap: 6px; } }

.proj-fin-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 10px;
  border-left: 2px solid var(--border);
}
.proj-fin-stat.fin-positive { border-left-color: var(--ok-text); }
.proj-fin-stat.fin-negative { border-left-color: var(--bad-text); }

.proj-fin-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.proj-fin-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-left: auto;
}
.proj-fin-stat.fin-positive .proj-fin-value { color: var(--ok-text); }
.proj-fin-stat.fin-negative .proj-fin-value { color: var(--bad-text); }
.proj-fin-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 2px;
}
.proj-fin-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border: 1px solid var(--text-light);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 700;
  color: var(--text-light);
  cursor: help;
  margin-left: 2px;
  background: white;
}

/* Compact header KPIs (3 stats instead of 6) */
.proj-header-stats-compact {
  grid-template-columns: repeat(3, max-content) !important;
  gap: 32px !important;
}

/* Today greeting (simplified, without big hero) */
.today-greeting {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 18px;
  letter-spacing: -0.3px;
}
.today-greeting-date {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 12px;
}

/* ============ MATERIALS / RECONCILIATION ============ */
.mat-table { font-size: 12.5px; }
.mat-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  white-space: nowrap;
}
.mat-table td { vertical-align: middle; padding: 9px 10px; }
.mat-table tr.clickable { cursor: pointer; }
.mat-table tr.clickable:hover { background: var(--surface-2); }

.mat-detail-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
}
.mat-detail-stats > div {
  text-align: center;
}
.mat-detail-stats > div > b {
  display: block;
  font-size: 15px;
  margin-top: 2px;
  font-family: var(--font-display);
}

/* Reconciliation */
.recon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 8px;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 12px;
}
.recon-period {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}
.recon-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius-md);
}
.recon-totals > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recon-totals b {
  font-size: 16px;
  font-family: var(--font-display);
  color: var(--text);
}

@media print {
  body { background: white; }
  .top-nav, .proj-sidebar, .btn, .nav-link { display: none !important; }
  .proj-workspace { display: block; }
  .proj-panel { padding: 0; }
}

/* Bot tips help section */
.bot-tips {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.7;
}
.bot-tips code {
  background: white;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  color: var(--navy);
}

/* ============ BULK IMPORT MODAL ============ */
.bi-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  margin-bottom: 8px;
}
.bi-col {
  font-size: 11px;
  padding: 3px 7px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
}
.bi-col code { background: transparent; padding: 0; color: var(--navy); font-weight: 600; font-size: 11px; }
.bi-col-req { border-color: var(--gold); background: var(--gold-bg); }
.bi-col-req code { color: var(--gold-dark); }

/* ============ CONTRACT MANAGEMENT ============ */
.contract-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.contract-type-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.contract-type-bad   { border-left: 3px solid var(--bad-text); }
.contract-type-warn  { border-left: 3px solid var(--warn-text); }
.contract-type-ok    { border-left: 3px solid var(--ok-text); }
.contract-type-info  { border-left: 3px solid var(--info-text); }
.contract-type-neutral { border-left: 3px solid var(--gold); }
.contract-type-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy);
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.contract-type-head i { color: var(--gold-dark); font-size: 14px; }
.contract-term {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}
.contract-term:last-child { border-bottom: none; }
.contract-term-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.contract-term-title { font-weight: 600; font-size: 13px; }
.contract-term-ref {
  font-size: 10px;
  font-family: monospace;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 3px;
}
.contract-term-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  padding: 4px 8px;
  background: var(--gold-bg);
  border-radius: 4px;
  display: inline-block;
  margin: 2px 0;
}
.contract-term-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.contract-term-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

/* Defense statement */
.defense-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.defense-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.defense-banner > i {
  font-size: 28px;
  flex-shrink: 0;
}
.defense-banner-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}
.defense-banner-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.defense-banner-ok { background: linear-gradient(135deg, #F0F7F1 0%, var(--surface) 100%); }
.defense-banner-ok > i { color: var(--ok-text); }
.defense-banner-warn { background: linear-gradient(135deg, var(--warn-bg) 0%, var(--surface) 100%); }
.defense-banner-warn > i { color: var(--warn-text); }
.defense-banner-neutral { background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%); }
.defense-banner-neutral > i { color: var(--navy); }

.defense-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-soft);
  margin: 0;
}
@media (max-width: 900px) { .defense-kpis { grid-template-columns: repeat(2, 1fr); } }
.defense-kpi {
  background: var(--surface);
  padding: 14px 18px;
}
.defense-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.defense-kpi-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.defense-kpi-good { color: var(--ok-text); }
.defense-kpi-bad { color: var(--bad-text); }
.defense-kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.defense-block { padding: 16px 20px; border-top: 1px solid var(--border-soft); }
.defense-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy);
  margin-bottom: 10px;
}
.defense-block-title i { color: var(--gold-dark); }
.defense-hind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.defense-hind-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.defense-hind-grid b { font-size: 14px; }
.defense-ld-clause {
  background: var(--gold-bg);
  border: 1px solid var(--gold-soft);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.defense-final {
  padding: 20px;
  background: var(--surface-2);
  border-top: 2px solid var(--gold);
}
.defense-final-ok { background: linear-gradient(135deg, var(--ok-bg) 0%, var(--surface-2) 100%); }
.defense-final-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}
.defense-final-grid {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.defense-final-grid > div:not(.defense-final-minus):not(.defense-final-equals) {
  text-align: center;
}
.defense-final-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  margin-top: 4px;
  letter-spacing: -1px;
}
.defense-final-ok-text { color: var(--ok-text); }
.defense-final-bad-text { color: var(--bad-text); }
.defense-final-minus, .defense-final-equals {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--text-muted);
  font-weight: 300;
}
.defense-final-stmt {
  margin-top: 18px;
  padding: 14px;
  background: var(--surface);
  border-left: 3px solid var(--ok-text);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
}

/* ============ RESOURCES & PRODUCTIVITY ============ */
.res-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 1100px) { .res-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .res-kpis { grid-template-columns: repeat(2, 1fr); } }
.res-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  position: relative;
}
.res-kpi-card-ok { border-left: 3px solid var(--ok-text); background: linear-gradient(135deg, #F4FAF5 0%, var(--surface) 100%); }
.res-kpi-card-bad { border-left: 3px solid var(--bad-text); background: linear-gradient(135deg, #FCF4F4 0%, var(--surface) 100%); }
.res-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.res-kpi-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.1;
}
.res-kpi-good { color: var(--ok-text); }
.res-kpi-bad { color: var(--bad-text); }
.res-kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.res-today {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
}
.res-today-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy);
  margin-bottom: 10px;
}
.res-today-title i { color: var(--gold-dark); }
.res-today-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.res-today-stats > div { display: flex; flex-direction: column; gap: 2px; }
.res-today-stats b { font-size: 15px; }

.res-table { font-size: 12.5px; }
.res-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.res-table tr.clickable { cursor: pointer; }
.res-table tr.clickable:hover { background: var(--surface-2); }
.res-leak-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.res-leak-bad { background: var(--bad-bg); color: var(--bad-text); }
.res-leak-ok { background: var(--ok-bg); color: var(--ok-text); }

/* ============ CONTRACT MANAGEMENT ============ */
.ctr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.ctr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
  box-shadow: var(--shadow-card);
}
.ctr-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.ctr-card-head > i {
  color: var(--gold-dark);
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}
.ctr-card-head > div { flex: 1; min-width: 0; }
.ctr-card-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--text-muted);
}
.ctr-card-title {
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.3;
}
.ctr-clause {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-soft);
  color: var(--gold-dark);
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.ctr-card-value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border-left: 3px solid var(--navy);
}
.ctr-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.ctr-card-actions {
  margin-top: 10px;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

/* ============ CLAIMS DEFENSE STATEMENT ============ */
.cd-statement {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-top: 14px;
  box-shadow: var(--shadow-card);
}
.cd-letterhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 18px;
}
.cd-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.5px;
}
.cd-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-top: 4px;
}
.cd-sub-2 {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.cd-stamp {
  text-align: center;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 140px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.cd-stamp.ok { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok-text); }
.cd-stamp.bad { border-color: var(--bad-border); background: var(--bad-bg); color: var(--bad-text); }
.cd-stamp.neutral { background: var(--surface-2); }
.cd-stamp-big {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}
.cd-headline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .cd-headline { grid-template-columns: repeat(2, 1fr); } }
.cd-headline-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.cd-headline-card.cd-ok { background: var(--ok-bg); border-color: var(--ok-border); }
.cd-headline-card.cd-bad { background: var(--bad-bg); border-color: var(--bad-border); }
.cd-headline-card.cd-info { background: var(--info-bg); border-color: var(--info-border); }
.cd-headline-card.cd-neutral { background: var(--surface-2); }
.cd-h-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.cd-h-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  line-height: 1;
}
.cd-h-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.cd-section {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.cd-section:last-child { border-bottom: none; }
.cd-section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
}
.cd-table {
  width: 100%;
  font-size: 12.5px;
  border-collapse: collapse;
}
.cd-table td, .cd-table th {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
}
.cd-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
  background: var(--surface-2);
}
.cd-table-sub {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cd-payment-summary {
  display: flex;
  gap: 24px;
  padding: 10px 14px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
}
.cd-defense-conclusion {
  background: var(--gold-bg);
  border: 1px solid var(--gold-soft);
  padding: 16px 18px;
  border-radius: var(--radius-md);
  margin-top: 24px;
}
.cd-defense-conclusion .cd-section-title { color: var(--gold-dark); }
.cd-conclusion-grid {
  margin-top: 8px;
}
.cd-conc-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-size: 13px;
}
.cd-conc-total {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 2px solid var(--gold);
  border-bottom: none;
}
.cd-conc-narrative {
  margin-top: 12px;
  padding: 10px 12px;
  background: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.cd-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.cd-sign-line {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 4px;
}
.bot-trigger-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  margin-left: 4px;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
}

/* ============ RESOURCES & PRODUCTIVITY ============ */
.res-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0 18px;
}
@media (max-width: 1100px) { .res-kpis { grid-template-columns: repeat(2, 1fr); } }
.res-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--navy);
}
.res-kpi.res-kpi-good { border-left-color: var(--ok-text); background: var(--ok-bg); }
.res-kpi.res-kpi-bad { border-left-color: var(--bad-text); background: var(--bad-bg); }
.res-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.res-kpi-good .res-kpi-label { color: var(--ok-text); }
.res-kpi-bad .res-kpi-label { color: var(--bad-text); }
.res-kpi-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text);
  line-height: 1.1;
}
.res-kpi-good .res-kpi-value { color: var(--ok-text); }
.res-kpi-bad .res-kpi-value { color: var(--bad-text); }
.res-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.res-today {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.res-today-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--gold-dark);
}
.res-today-head > i { font-size: 18px; }
.res-today-head > b { font-family: var(--font-display); color: var(--text); }
.res-today-head > span { margin-left: auto; }
.res-today-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.res-today-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.res-today-stats > div > b {
  font-family: var(--font-display);
  font-size: 16px;
}

.res-table { font-size: 12.5px; }
.res-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.res-table tr.clickable { cursor: pointer; }
.res-table tr.clickable:hover { background: var(--surface-2); }

.res-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.res-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 10px;
  font-size: 11px;
}
.res-skill-name { color: var(--text-muted); }

.res-rate-note {
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.5;
}
.res-rate-note > i {
  color: var(--gold-dark);
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* vendor type filter chips */
.vtype-chips .chip{padding:7px 14px;border-radius:20px;border:1.5px solid var(--border);background:#fff;color:var(--text);font-size:13px;font-weight:600;cursor:pointer;transition:all .15s;}
.vtype-chips .chip:hover{border-color:var(--navy);}
.vtype-chips .chip.chip-active{background:var(--navy);color:#fff;border-color:var(--navy);}

/* smart drawing upload drop-zone */
.dwg-drop{display:block;border:2px dashed var(--border);border-radius:12px;padding:28px 20px;text-align:center;cursor:pointer;transition:all .15s;background:var(--surface-2);}
.dwg-drop:hover,.dwg-drop.drag{border-color:var(--navy);background:var(--surface-3);}

/* ---- Site Reports hub: clear main vs sub hierarchy ---- */
.sr-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px;margin-top:6px;}
.sr-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:20px;cursor:pointer;
  transition:transform .12s ease,box-shadow .12s ease,border-color .12s;position:relative;overflow:hidden;}
.sr-card:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(0,0,0,.10);border-color:var(--navy);}
.sr-card .sr-ico{width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;
  font-size:24px;color:#fff;margin-bottom:14px;}
/* MAIN title — big and bold */
.sr-card h3{font-size:21px;font-weight:800;letter-spacing:-.2px;color:var(--text);margin:0 0 4px;line-height:1.15;}
/* SUB text — clearly smaller and lighter */
.sr-card .sr-sub{font-size:12.5px;color:var(--text-muted);line-height:1.45;margin:0 0 12px;}
.sr-card .sr-stat{font-size:30px;font-weight:800;color:var(--navy);line-height:1;}
.sr-card .sr-stat small{font-size:12px;font-weight:600;color:var(--text-muted);margin-left:5px;}
.sr-chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px;}
.sr-chips .sr-chip{font-size:11px;font-weight:600;padding:3px 9px;border-radius:20px;background:var(--surface-2);color:var(--text-muted);}
.sr-chip.ok{background:#E4F3EC;color:#0E5A46;} .sr-chip.warn{background:#FBF1E0;color:#B26F1E;} .sr-chip.bad{background:#FBE9E9;color:#A93226;}
.sr-section-title{font-size:13px;font-weight:800;letter-spacing:1.6px;text-transform:uppercase;color:var(--text-muted);margin:26px 0 4px;}
.sr-today{background:linear-gradient(135deg,var(--navy),#146B54);color:#fff;border-radius:16px;padding:22px 24px;margin-bottom:8px;}
.sr-today h2{font-size:24px;font-weight:800;margin:0 0 4px;color:#fff;}
.sr-today .sr-t-sub{font-size:13px;opacity:.85;margin-bottom:16px;}
.sr-today-grid{display:flex;gap:28px;flex-wrap:wrap;}
.sr-today-grid div p:first-child{font-size:11px;text-transform:uppercase;letter-spacing:1px;opacity:.8;margin:0 0 3px;}
.sr-today-grid div p:last-child{font-size:26px;font-weight:800;margin:0;}
.sr-back{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--navy);cursor:pointer;margin-bottom:12px;}
.sr-back:hover{text-decoration:underline;}

/* ---- login / setup screen ---- */
.auth-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#09342A,#0E5A46);padding:20px;}
.auth-card{background:#fff;border-radius:18px;padding:38px 34px;width:100%;max-width:410px;box-shadow:0 24px 60px rgba(0,0,0,.28);}
.auth-brand{font-size:26px;font-weight:800;letter-spacing:-.4px;}
.auth-hrk{color:#0E5A46;} .auth-word{color:#E0913A;font-weight:700;letter-spacing:2px;font-size:16px;}
.auth-tag{font-size:12px;letter-spacing:2px;text-transform:uppercase;color:#7d8d85;margin:2px 0 26px;}
.auth-card h2{font-size:23px;font-weight:800;color:#16241E;margin:0 0 6px;}
.auth-sub{font-size:13.5px;color:#5b6b63;line-height:1.5;margin:0 0 20px;}
.auth-card label{display:block;font-size:12px;font-weight:700;color:#5b6b63;margin:12px 0 5px;text-transform:uppercase;letter-spacing:.6px;}
.auth-card input{width:100%;padding:12px 14px;border:1.5px solid #dbe5e0;border-radius:10px;font-size:15px;}
.auth-card input:focus{outline:none;border-color:#0E5A46;}
.auth-btn{width:100%;margin-top:22px;padding:13px;background:#0E5A46;color:#fff;border:none;border-radius:10px;font-size:15px;font-weight:700;cursor:pointer;}
.auth-btn:hover{background:#0A4234;}
.auth-help{font-size:11.5px;color:#8a9992;margin-top:20px;line-height:1.6;}
.auth-help code{background:#F1F5F3;padding:2px 6px;border-radius:5px;color:#0E5A46;}
.auth-msg{margin-top:14px;font-size:13px;padding:10px 12px;border-radius:8px;}
.auth-msg.bad{background:#FBE9E9;color:#A93226;} .auth-msg.ok{background:#E4F3EC;color:#0E5A46;}
