/* ══ Kansas Farm Assistant — Dark Earthy Theme ══ */

:root {
  --bg-body: #1a1612;
  --bg-card: #5c4e3a;
  --bg-card-hover: #6a5a44;
  --bg-input: #3a3125;
  --border: #4a3f30;
  --border-light: #5a4d3a;
  --accent: #c8b89a;
  --yellow: #f0c040;
  --gold: #e8b820;
  --green: #5b9a3c;
  --green-dark: #3d7a22;
  --red: #d64c3a;
  --red-bright: #e85a48;
  --blue: #4a90c4;
  --orange: #cc7832;
  --purple: #8a6daa;
  --text: #e8dcc8;
  --text-muted: #b8ab96;
  --text-heading: #f5eddb;
  --brown-warm: #6d5840;
  --cream: #f0e6d2;
  --cream-cell: #2a241c;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-body);
  color: var(--text);
  min-height: 100vh;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }

/* ══════════════════ */
/* ══ Navbar ════════ */
/* ══════════════════ */
.main-navbar {
  background: #0f0d0a;
  border-bottom: 2px solid var(--accent);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1050;
}

.main-navbar .container-fluid { max-width: 1400px; }

.navbar-brand {
  color: var(--text-heading) !important;
  font-size: 1.05rem;
  text-decoration: none !important;
  padding: 0.6rem 0;
}

.brand-icon {
  width: 40px; height: 40px;
  background: transparent;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 0;
}
.brand-icon img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.brand-sub { font-size: 0.68rem; color: var(--text-muted); margin-top: -1px; }

.navbar-toggler { border-color: var(--border-light) !important; }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23c8b89a' stroke-linecap='round' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

#nav-tabs { gap: 2px; }

#nav-tabs .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s;
  background: none;
  white-space: nowrap;
}

#nav-tabs .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

#nav-tabs .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,0.15) !important;
  font-weight: 700;
  border-color: rgba(255,255,255,0.2);
}

/* ═══════════════════════ */
/* ══ Page accent colors ══ */
/* ═══════════════════════ */
.page-weather .card-heading,
.page-weather .page-header h4 i { color: var(--blue) !important; }
.page-weather .main-navbar { border-bottom-color: var(--blue); }

.page-rotation .card-heading,
.page-rotation .page-header h4 i { color: var(--orange) !important; }
.page-rotation .main-navbar { border-bottom-color: var(--orange); }

.page-markets .card-heading,
.page-markets .page-header h4 i { color: var(--green) !important; }
.page-markets .main-navbar { border-bottom-color: var(--green); }

.page-balance .card-heading,
.page-balance .page-header h4 i,
.page-balance h4 i { color: var(--purple) !important; }
.page-balance .main-navbar { border-bottom-color: var(--purple); }

.page-equipment .card-heading,
.page-equipment .page-header h4 i,
.page-equipment h4 i { color: var(--yellow) !important; }
.page-equipment .main-navbar { border-bottom-color: var(--yellow); }
.page-equipment .equip-header { background: rgba(240,192,64,0.1); border-bottom-color: rgba(240,192,64,0.3); }
.page-equipment .equip-card { border-left: 4px solid var(--yellow); }
.page-equipment .service-due { color: var(--yellow); }
.page-equipment .btn-amber { background: var(--yellow) !important; border-color: var(--yellow) !important; }

/* ══════════════════ */
/* ══ Cards ═════════ */
/* ══════════════════ */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s;
}

.content-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.card-heading {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent);
}

/* ══════════════════ */
/* ══ Buttons ═══════ */
/* ══════════════════ */
.btn-accent {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #1a1612 !important;
  font-weight: 600;
}
.btn-accent:hover {
  background: #b0a080 !important;
  border-color: #b0a080 !important;
  color: #1a1612 !important;
}

.btn-amber {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #1a1612 !important;
  font-weight: 600;
}
.btn-amber:hover {
  background: #b0a080 !important;
  border-color: #b0a080 !important;
}

/* ══════════════════ */
/* ══ Tables ════════ */
/* ══════════════════ */
.table { color: var(--cream); margin-bottom: 0; }
.table thead th {
  background: #1a1410;
  color: var(--yellow);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #0f0a06;
  border-top: 1px solid #0f0a06;
  padding: 0.7rem 0.75rem;
}
.table tbody td {
  background: var(--cream-cell);
  border-color: rgba(240,230,210,0.08);
  color: var(--cream);
  padding: 0.7rem 0.75rem;
  vertical-align: middle;
}
.table tbody tr:first-child td { border-top: 1px solid rgba(240,230,210,0.08); }
.table-hover tbody tr:hover td { background: #332b21 !important; }

/* ══════════════════ */
/* ══ Forms ═════════ */
/* ══════════════════ */
.form-control, .form-select {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-input);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(200,184,154,0.12);
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { color: var(--text-muted); }

/* ══════════════════════════════ */
/* ══ Dashboard — no scroll ════ */
/* ══════════════════════════════ */
.dash-layout {
  height: calc(100vh - 80px);
  max-height: calc(100vh - 80px);
  overflow: hidden;
}
.dash-layout > .col-lg-8,
.dash-layout > .col-lg-4 {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.dash-layout > .col-lg-8 {
  height: 100%;
  gap: 0.5rem;
}
.dash-layout > .col-lg-8 > .welcome-banner,
.dash-layout > .col-lg-8 > .row.g-2:not(.dash-mid-panel):not(.dash-bottom-panel),
.dash-layout > .col-lg-8 > .row.g-2.dash-bottom-panel {
  flex: 0 0 auto;
  margin: 0;
}
.dash-layout > .col-lg-8 > .row.g-2:not(.dash-mid-panel):not(.dash-bottom-panel) .summary-link {
  padding: 0.35rem 0.75rem;
}
.dash-layout > .col-lg-8 > .row.g-2:not(.dash-mid-panel):not(.dash-bottom-panel) .summary-link .sl-icon {
  width: 24px;
  height: 24px;
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
}
.dash-layout > .col-lg-8 > .row.g-2:not(.dash-mid-panel):not(.dash-bottom-panel) .summary-link .sl-label {
  font-size: 0.6rem;
  margin-bottom: 0.1rem;
}
.dash-layout > .col-lg-8 > .row.g-2:not(.dash-mid-panel):not(.dash-bottom-panel) .summary-link .sl-value {
  font-size: 1rem;
  line-height: 1.15;
}
.dash-layout > .col-lg-8 > .row.g-2:not(.dash-mid-panel):not(.dash-bottom-panel) .summary-link .sl-sub {
  font-size: 0.62rem;
}
.dash-layout > .col-lg-8 > .dash-mid-panel {
  flex: 0 0 auto;
  flex-shrink: 0;
  min-height: calc((100vh - 250px) * 0.76);
  margin: 0;
  overflow: hidden;
}
.dash-layout > .col-lg-8 > .dash-bottom-panel {
  flex-shrink: 0;
  height: auto;
}
.dash-layout > .col-lg-4 > .chat-panel {
  height: 100%;
  min-height: 0;
}

@media (max-width: 991px) {
  .dash-layout {
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: auto;
  }
  .dash-layout > .col-lg-8,
  .dash-layout > .col-lg-4 {
    height: auto;
  }
}

.welcome-banner {
  background: linear-gradient(135deg, #2a4a2a, #3a6535);
  border: 1px solid rgba(91,154,60,0.4);
  border-radius: 12px;
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  box-shadow: 0 4px 16px rgba(42,74,42,0.35);
}
.welcome-banner h5 { color: #fff; font-size: 1.05rem; }
.welcome-banner .location-badge {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}

.summary-link {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  text-decoration: none !important;
  color: var(--text) !important;
  transition: all 0.2s;
  height: 100%;
}
.summary-link:hover {
  border-color: rgba(255,255,255,0.35);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

.summary-link .sl-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.summary-link .sl-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); font-weight: 600; margin-bottom: 0.2rem;
}
.summary-link .sl-value {
  font-size: 1.2rem; font-weight: 800; line-height: 1.2;
}
.summary-link .sl-sub {
  font-size: 0.68rem; color: var(--text-muted); margin-top: 0.1rem;
}

/* Dashboard compact forecast/market panel — flexes to fill available space */
.dash-mid-panel {
  display: flex;
  min-height: 0;
}
.dash-mid-panel > [class*="col-"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dash-mid-panel .summary-link {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.dash-mid-panel #dash-forecast,
.dash-mid-panel #dash-markets {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* ── 7-Day Forecast Columns (dashboard) ── */
.dash-mid-panel #dash-forecast { padding: 0.2rem 0; }
.dash-fc-cols {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 0.3rem;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
}
.fc-col {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.3rem 0.15rem;
  overflow: hidden;
  min-width: 0;
  gap: 0.15rem;
}
.fc-col .fc-day {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
}
.fc-col .fc-icon { font-size: 1.15rem; line-height: 1; margin: 0; }
.fc-col .fc-temps {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0.2rem 0;
  margin: 0.1rem 0;
}
.fc-col .fc-hi-row, .fc-col .fc-lo-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.fc-col .fc-tlbl {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}
.fc-col .fc-hi {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-top: 1px;
}
.fc-col .fc-lo {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 1px;
}
.fc-col .fc-stats {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  justify-content: space-around;
  gap: 0.2rem;
}
.fc-col .fc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}
.fc-col .fc-lbl {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  font-size: 0.55rem;
}
.fc-col .fc-val {
  color: var(--text);
  font-weight: 700;
  font-size: 0.7rem;
  font-family: 'Courier New', monospace;
  margin-top: 1px;
}

/* ── Dashboard Market Grid — cells with 2 columns ── */
.dash-mid-panel #dash-markets { display: flex; flex-direction: column; padding: 0.25rem 0; min-height: 0; }
.dash-mkt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  grid-auto-rows: 1fr;
}
.dash-mkt-cell {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  min-width: 0;
  min-height: 0;
}
.mkt-cell-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
}
.mkt-cell-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.mkt-cell-right svg { display: block; }
.mkt-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.15;
}
.mkt-price {
  font-size: 0.95rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: var(--text);
  line-height: 1.1;
}
.mkt-price .mkt-unit {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  margin-left: 2px;
}

/* Status pills — opaque solid colors */
.status-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.status-pill.status-growing {
  background: var(--green);
  color: #fff;
}
.status-pill.status-planned {
  background: var(--yellow);
  color: #1a1612;
}
.status-pill.status-active {
  background: var(--blue);
  color: #fff;
}
.status-pill.status-completed {
  background: var(--brown-warm);
  color: #fff;
}

/* Level pills for rotation templates */
.status-pill.level-low {
  background: var(--green);
  color: #fff;
}
.status-pill.level-moderate {
  background: var(--yellow);
  color: #1a1612;
}
.status-pill.level-high {
  background: var(--orange);
  color: #fff;
}
.status-pill.level-very-high {
  background: var(--red);
  color: #fff;
}
.status-pill.level-region {
  background: var(--brown-warm);
  color: #fff;
  text-transform: none;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ══════════════════════ */
/* ══ Weather ═══════════ */
/* ══════════════════════ */
.forecast-day {
  text-align: center;
  padding: 0.4rem 0.2rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.forecast-day:hover { border-color: rgba(255,255,255,0.3); transform: translateY(-1px); }
.forecast-day .day-name { font-weight: 700; font-size: 0.66rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }
.forecast-day .day-icon { font-size: 1.1rem; margin: 0.05rem 0; }
.forecast-day .day-hi { font-weight: 700; color: var(--text-heading); font-size: 0.78rem; }
.forecast-day .day-lo { color: var(--text-muted); font-size: 0.78rem; }
.forecast-day .day-rain { font-size: 0.62rem; color: var(--blue); }

.wx-stat-box {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 0.8rem;
  text-align: center;
  border: 1px solid var(--border);
}
.wx-stat-box .wx-stat-icon { font-size: 1.3rem; margin-bottom: 0.15rem; }
.wx-stat-box .wx-stat-val { font-size: 1rem; font-weight: 700; color: var(--text-heading); }
.wx-stat-box .wx-stat-lbl { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.hourly-item {
  text-align: center;
  padding: 0.6rem 0.3rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}
.hourly-item .hour-time { font-size: 0.72rem; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.3px; }
.hourly-item .hour-icon { font-size: 1.3rem; }
.hourly-item .hour-temp { font-size: 0.95rem; font-weight: 800; color: var(--text-heading); }
.hourly-item .hour-rain { font-size: 0.66rem; color: var(--blue); }

/* ══════════════════════ */
/* ══ Markets ═══════════ */
/* ══════════════════════ */
.market-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 1.15rem;
  transition: all 0.15s;
  height: 100%;
}
.market-card:hover { border-color: rgba(255,255,255,0.3); transform: translateY(-2px); }
.market-card .crop-name { font-weight: 700; font-size: 0.92rem; color: var(--green); }
.market-card .crop-price { font-size: 1.5rem; font-weight: 800; font-family: 'Courier New', monospace; color: var(--text-heading); }
.market-card .crop-unit { font-size: 0.75rem; color: var(--text-muted); }

.price-value { font-weight: 700; font-family: 'Courier New', monospace; font-size: 0.92rem; }

/* ══════════════════════ */
/* ══ Rotation ══════════ */
/* ══════════════════════ */
.rotation-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-left: 4px solid var(--orange);
  margin-bottom: 1rem;
  transition: all 0.2s;
}
.rotation-card:hover { border-color: rgba(255,255,255,0.25); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }

.cycle-step {
  display: inline-block;
  background: var(--brown-warm);
  color: var(--text-heading);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 500;
}
.cycle-arrow { color: var(--text-muted); font-size: 0.8rem; margin: 0 0.1rem; }

.rotation-metric { text-align: center; padding: 0.4rem; }
.rotation-metric .metric-val { font-weight: 700; font-size: 0.8rem; }
.rotation-metric .metric-lbl { font-size: 0.64rem; color: var(--text-muted); text-transform: uppercase; }

/* ══════════════════════ */
/* ══ Balance Sheet ═════ */
/* ══════════════════════ */
.summary-card {
  border-radius: 12px;
  padding: 1.15rem;
  text-align: center;
  border: 1px solid var(--border);
}
.summary-card .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; color: var(--text-muted); }
.summary-card .value { font-size: 1.5rem; font-weight: 800; margin-top: 0.2rem; }

.summary-income { background: rgba(91,154,60,0.1); border-color: rgba(91,154,60,0.3); }
.summary-income .value { color: var(--green); }
.summary-expense { background: rgba(214,76,58,0.1); border-color: rgba(214,76,58,0.3); }
.summary-expense .value { color: var(--red); }
.summary-net { background: rgba(138,109,170,0.1); border-color: rgba(138,109,170,0.3); }
.summary-net .value { color: var(--purple); }

.breakdown-bar { display: flex; align-items: center; margin-bottom: 0.5rem; }
.breakdown-bar .bar-label { width: 105px; font-size: 0.78rem; font-weight: 500; flex-shrink: 0; }
.breakdown-bar .bar-track { flex: 1; height: 18px; background: rgba(255,255,255,0.05); border-radius: 5px; overflow: hidden; margin: 0 0.6rem; }
.breakdown-bar .bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.breakdown-bar .bar-amount { font-size: 0.78rem; font-weight: 600; font-family: monospace; width: 80px; text-align: right; flex-shrink: 0; }

.ledger-income td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.ledger-expense td:first-child { box-shadow: inset 4px 0 0 var(--red); }

/* ══════════════════════ */
/* ══ Equipment ═════════ */
/* ══════════════════════ */
.equip-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin-bottom: 1rem;
  overflow: hidden;
}
.equip-card:hover { border-color: var(--border-light); }

.equip-header {
  background: rgba(240,192,64,0.1);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.15rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  flex-wrap: wrap;
}
.equip-name { font-weight: 700; font-size: 0.95rem; color: var(--text-heading); }
.equip-type { font-size: 0.75rem; color: var(--text-muted); }
.equip-body { padding: 1rem 1.15rem; }

.equip-stat { text-align: center; padding: 0.3rem 0; }
.equip-stat .es-val { font-weight: 700; font-size: 0.88rem; color: var(--text-heading); }
.equip-stat .es-lbl { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; }

.service-record {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border); gap: 0.4rem;
}
.service-record:last-child { border-bottom: none; }
.sr-date { font-size: 0.72rem; color: var(--text-muted); min-width: 80px; }
.sr-desc { font-size: 0.82rem; flex: 1; }
.sr-cost { font-weight: 600; font-family: monospace; font-size: 0.78rem; color: var(--red); min-width: 65px; text-align: right; }
.sr-miles { font-size: 0.7rem; color: var(--text-muted); min-width: 75px; text-align: right; }

.service-due { color: var(--yellow); font-weight: 600; font-size: 0.78rem; }
.service-overdue { color: var(--red); font-weight: 600; font-size: 0.78rem; }

/* ══════════════════════ */
/* ══ AI Chat (YELLOW accent) ══ */
/* ══════════════════════ */
.dash-layout > .col-lg-4 { padding-top: 0; padding-bottom: 0; }
.chat-panel {
  flex: 1 1 auto;
  height: 98%;
  min-height: 0;
  max-height: 98%;
  border: 1px solid rgba(240,192,64,0.5) !important;
  box-shadow: 0 0 0 1px rgba(240,192,64,0.15), 0 4px 20px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel .chat-header { flex: 0 0 auto; }
.chat-panel .chat-footer { flex: 0 0 auto; }
.chat-panel #chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
@media (max-width: 991px) {
  .chat-panel { min-height: 400px; max-height: 500px; height: auto; }
}

.chat-header {
  padding: 1rem 1.1rem 0.85rem;
  background: linear-gradient(135deg, #2a2010, #3a2e14);
  border-bottom: 2px solid var(--yellow);
  border-radius: 11px 11px 0 0;
  color: var(--text-heading);
  text-align: center;
}

.chat-header .chat-title {
  font-weight: 800;
  font-size: 1.35rem;
  color: #ffffff;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-header .chat-avatar {
  width: 2rem;
  height: 2rem;
}

.chat-header .chat-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.chat-quick-topics {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.6rem;
}

.chat-quick-topics .topic-chip {
  font-size: 0.64rem;
  padding: 0.22rem 0.55rem;
  border-radius: 12px;
  background: rgba(240,192,64,0.08);
  border: 1px solid rgba(240,192,64,0.25);
  color: var(--yellow);
  cursor: pointer;
  transition: all 0.15s;
}
.chat-quick-topics .topic-chip:hover {
  background: rgba(240,192,64,0.2);
  color: #fff;
  border-color: var(--yellow);
}
.chat-quick-topics .topic-chip-demo {
  background: rgba(138,109,170,0.15);
  border-color: rgba(138,109,170,0.45);
  color: #c9a9ff;
  font-weight: 600;
}
.chat-quick-topics .topic-chip-demo:hover {
  background: rgba(138,109,170,0.35);
  color: #fff;
  border-color: #c9a9ff;
}

.chat-footer {
  padding: 0.6rem 0.85rem;
  border-top: 1px solid rgba(240,192,64,0.2);
  background: rgba(0,0,0,0.2);
  border-radius: 0 0 11px 11px;
}

.chat-msg {
  max-width: 85%;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
.chat-msg.user {
  margin-left: auto;
  background: rgba(240,192,64,0.18);
  color: #fff;
  border: 1px solid rgba(240,192,64,0.35);
  border-bottom-right-radius: 3px;
}
.chat-msg.assistant {
  margin-right: auto;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}

/* AI suggested follow-up prompts */
.suggested-prompts {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
  margin-top: 0.5rem; margin-bottom: 0.4rem;
  padding-left: 0.25rem;
}
.suggested-prompts .suggestion-chip {
  font-size: 0.7rem;
  padding: 0.3rem 0.65rem;
  border-radius: 14px;
  background: rgba(240,192,64,0.1);
  border: 1px solid rgba(240,192,64,0.3);
  color: var(--yellow);
  cursor: pointer;
  transition: all 0.15s;
}
.suggested-prompts .suggestion-chip:hover {
  background: rgba(240,192,64,0.25);
  color: #fff;
  border-color: var(--yellow);
  transform: translateY(-1px);
}

.chat-send-btn {
  background: var(--yellow) !important;
  border-color: var(--yellow) !important;
  color: #1a1612 !important;
  font-weight: 700;
}
.chat-send-btn:hover {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
}

/* Typing indicator */
.typing-indicator { opacity: 0.7; }
.typing-dots {
  display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 4px;
}
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--yellow);
  animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ══════════════════════ */
/* ══ Page header ═══════ */
/* ══════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem;
}
.page-header h4 { color: var(--text-heading); }
.page-header p { color: var(--text-muted); }

.location-badge {
  background: rgba(200,184,154,0.1);
  color: var(--accent);
  font-size: 0.72rem; font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid rgba(200,184,154,0.2);
}

/* ══════════════════ */
/* ══ Modal ═════════ */
/* ══════════════════ */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}
.modal-header { background: #0f0d0a; border-bottom: 1px solid var(--border-light); color: var(--text-heading); }
.modal-footer { border-top: 1px solid var(--border); }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* ══════════════════ */
/* ══ Badges ════════ */
/* ══════════════════ */
.badge.bg-success-subtle { background: rgba(91,154,60,0.15) !important; }
.badge.text-success { color: var(--green) !important; }
.badge.bg-danger-subtle { background: rgba(214,76,58,0.15) !important; }
.badge.text-danger { color: var(--red) !important; }
.badge.bg-warning-subtle { background: rgba(240,192,64,0.15) !important; }
.badge.text-warning-emphasis { color: var(--yellow) !important; }
.badge.bg-success { background: var(--green) !important; }
.badge.bg-secondary { background: var(--brown-warm) !important; }

.text-success { color: var(--green) !important; }
.text-danger { color: var(--red) !important; }

/* ══════════════════ */
/* ══ Responsive ════ */
/* ══════════════════ */
@media (max-width: 992px) {
  .chat-panel { min-height: 350px; max-height: 500px; }
  .dash-layout { max-height: none; overflow: auto; }
}
@media (max-width: 768px) {
  .summary-link .sl-value { font-size: 1.1rem; }
  .chat-msg { max-width: 92%; }
  .summary-card .value { font-size: 1.2rem; }
  .equip-header { flex-direction: column; align-items: flex-start; }
}
