:root {
  --jd-green: #367C2B;
  --jd-green-dark: #2a6122;
  --jd-green-light: #4a9a3a;
  --jd-yellow: #FFDE00;
  --bg-dark: #111111;
  --bg-card: #1e1e1e;
  --bg-input: #1a2e1a;
  --text-primary: #e8e8e8;
  --text-muted: #9ca3af;
  --border: #333;
  --border-green: #3a6a2a;
  --sidebar-w: 250px;
  --header-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
}

#appContainer {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ---- Auth Screen ---- */
.auth-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: hidden;
}

.auth-bg-pattern {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(54,124,43,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(54,124,43,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(54,124,43,0.1) 0%, transparent 50%);
  animation: authPulse 8s ease-in-out infinite alternate;
}

@keyframes authPulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.auth-card {
  position: relative;
  text-align: center;
  max-width: 440px;
  width: 92%;
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(54,124,43,0.3);
  border-radius: 20px;
  padding: 40px 36px 32px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 20px 60px rgba(0,0,0,0.5),
    0 0 80px rgba(54,124,43,0.08);
}

.auth-brand {
  margin-bottom: 8px;
}

.auth-logo-icon {
  margin-bottom: 12px;
  display: inline-block;
  filter: drop-shadow(0 4px 12px rgba(54,124,43,0.4));
}

.auth-logo {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--jd-yellow);
  letter-spacing: 10px;
  text-shadow: 0 2px 20px rgba(255,222,0,0.2);
}

.auth-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 2px;
}

.auth-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--jd-green), transparent);
  margin: 20px auto 12px;
  border-radius: 2px;
}

.auth-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-footer-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #1a3d10 0%, #1e1e1e 100%);
  border-right: 1px solid var(--border-green);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 2px solid var(--jd-green);
  background: linear-gradient(135deg, #2d5a1b 0%, #367C2B 100%);
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--jd-yellow);
  letter-spacing: 3px;
}

.logo-sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}

.nav-list {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(54,124,43,0.1);
  color: var(--text-primary);
}

.nav-item.active {
  color: var(--jd-yellow);
  background: rgba(54,124,43,0.2);
  border-left-color: var(--jd-yellow);
}

.nav-icon { font-size: 1.1rem; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.store-addr {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-logout {
  width: 100%;
  margin-top: 12px;
  padding: 8px 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover {
  background: rgba(255,60,60,0.1);
  border-color: rgba(255,60,60,0.3);
  color: #ff6b6b;
}

/* ---- Mobile header ---- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(135deg, #2d5a1b 0%, #367C2B 100%);
  border-bottom: 2px solid var(--jd-yellow);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 99;
}

.menu-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 1.4rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.mobile-title {
  font-weight: 600;
  color: var(--jd-yellow);
  font-size: 1rem;
}

/* ---- Main Content ---- */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 40px;
  min-height: 100vh;
}

.page { display: none; }
.page.active { display: flex; flex-direction: column; min-height: calc(100vh - 92px); }

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 28px;
  color: var(--jd-yellow);
  letter-spacing: -0.02em;
}

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border-top: 3px solid var(--jd-green);
}

.stat-card:hover {
  border-color: var(--jd-green);
  background: #252525;
  transform: translateY(-2px);
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--jd-yellow);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Dashboard Grid ---- */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  flex: 1;
}
.dash-grid > .panel {
  margin-bottom: 0;
}

/* ---- Panels ---- */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 32px;
  margin-bottom: 20px;
  width: 100%;
}

.page.active > .panel:last-child {
  flex: 1;
}

.panel h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--jd-yellow);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

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

/* ---- Forms ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full-width { grid-column: 1 / -1; }

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input,
.field select,
.field textarea {
  background: var(--bg-input);
  border: 2px solid var(--border-green);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--jd-green-light);
  box-shadow: 0 0 0 3px rgba(54,124,43,0.2);
}

.field select { cursor: pointer; }
.field textarea { resize: vertical; }

/* ---- Buttons ---- */
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #2d5a1b 0%, #367C2B 100%);
  color: #fff;
  border: 2px solid var(--jd-green);
  padding: 13px 32px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary:hover { background: linear-gradient(135deg, #367C2B 0%, #4a9a3a 100%); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 13px 32px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

/* ---- Results ---- */
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 12px;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
}

.result-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  font-weight: 600;
}

.result-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.result-value.highlight {
  color: var(--jd-yellow);
  font-size: 1.8rem;
}

.result-explanation {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: pre-line;
}

/* ---- Calculator Detail Results ---- */
.calc-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.calc-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.calc-detail-row:last-child { border-bottom: none; }
.calc-detail-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  flex-shrink: 0;
}
.calc-detail-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
  max-width: 60%;
}
.calc-detail-value.calc-breakdown {
  font-size: 0.82rem;
  color: var(--jd-green-light);
  background: rgba(54,124,43,0.1);
  padding: 4px 10px;
  border-radius: 6px;
}
.calc-charge-total {
  text-align: center;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--jd-yellow);
  margin: 20px 0 12px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(255,222,0,0.15);
}
.calc-charge-total.no-rate {
  font-size: 1.2rem;
  color: #f87171;
}
.calc-warning {
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #fbbf24;
}
.calc-recalc-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.calc-recalc-row .btn-secondary {
  white-space: nowrap;
  margin-bottom: 0;
}
.calc-map-container {
  margin-top: 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ---- Event List ---- */
.event-list { display: flex; flex-direction: column; gap: 10px; }

.event-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgba(54,124,43,0.08);
  border-radius: 8px;
  border-left: 4px solid var(--jd-green);
  cursor: pointer;
  transition: background 0.2s;
}

.event-card:hover { background: rgba(54,124,43,0.15); }
.event-card.pickup { border-left-color: #e74c3c; }
.event-card.pickup:hover { background: rgba(231,76,60,0.1); }

.event-date {
  text-align: center;
  min-width: 50px;
}

.event-day {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--jd-yellow);
  line-height: 1;
}

.event-month {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.event-info { flex: 1; }

.event-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.event-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Activity List ---- */
.activity-list { display: flex; flex-direction: column; gap: 8px; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 6px;
  padding: 8px;
}

.activity-item:hover { background: rgba(54,124,43,0.1); }

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.activity-icon.calculator { background: rgba(54,124,43,0.2); }
.activity-icon.estimator { background: rgba(255,222,0,0.15); }
.activity-icon.scheduler { background: rgba(52,152,219,0.2); }

.activity-detail { flex: 1; color: var(--text-primary); }
.activity-time { font-size: 0.72rem; color: var(--text-muted); }

/* ---- Slot Cards ---- */
.slot-card {
  padding: 14px;
  background: rgba(54,124,43,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.slot-info { flex: 1; }

.slot-day {
  font-weight: 600;
  font-size: 0.95rem;
}

.slot-time {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.slot-breakdown {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-slot {
  background: var(--jd-green);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-slot:hover { background: var(--jd-green-dark); }

/* ---- Modal ---- */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--jd-green);
  border-radius: 12px;
  padding: 28px;
  max-width: 500px;
  width: 90%;
}

.modal-content h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--jd-yellow);
}

#modalDetails {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 20px;
}

#modalDetails strong { color: var(--jd-yellow); }

/* ---- Detail Modal ---- */
.detail-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.detail-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--jd-green);
  border-radius: 12px;
  padding: 28px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.detail-modal-content h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--jd-yellow);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--jd-green);
}

.detail-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.detail-close:hover { color: var(--text-primary); }

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.88rem;
}

.detail-row-label { color: var(--text-muted); }
.detail-row-value { color: var(--text-primary); font-weight: 500; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--jd-green);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 300;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border: 1px solid var(--jd-yellow);
}

/* ---- Upload status ---- */
#uploadStatus {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--jd-green-light);
}

/* ======================== ESTIMATOR STYLES ======================== */
.est-tabs {
  display: flex;
  background: #1a1a1a;
  border-bottom: 3px solid var(--jd-green);
  overflow-x: auto;
  padding: 0 4px;
  border-radius: 8px 8px 0 0;
  gap: 2px;
}

.est-tab {
  padding: 10px 18px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: transparent;
  white-space: nowrap;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  font-family: inherit;
}

.est-tab:hover { color: #fff; background: #252525; }
.est-tab.active {
  color: var(--jd-yellow);
  background: #222;
  border-bottom-color: var(--jd-yellow);
}

.est-sheet { display: none; }
.est-sheet.active { display: block; }

.est-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.est-section {
  background: #252525;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.est-section-header {
  background: linear-gradient(135deg, #2d5a1b 0%, #367C2B 100%);
  color: #fff;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
}

.est-section-body { padding: 14px; }

.est-job-block {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.est-job-block:last-child { margin-bottom: 0; }

.est-job-header {
  background: linear-gradient(135deg, #1a3d10 0%, #2a5520 100%);
  color: var(--jd-yellow);
  padding: 8px 12px;
  margin: -12px -12px 12px -12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px 8px 0 0;
}

.est-form-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.est-form-row:last-child { margin-bottom: 0; }

.est-form-label {
  width: 90px;
  font-size: 0.75rem;
  color: #222;
  flex-shrink: 0;
  background: #d1d5db;
  padding: 6px 10px;
  border-radius: 5px;
  font-weight: 600;
}

.est-form-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.est-input {
  background: var(--bg-input);
  border: 2px solid var(--border-green);
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  width: 100%;
  max-width: 120px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
}

.est-input:focus {
  border-color: var(--jd-green-light);
  box-shadow: 0 0 0 3px rgba(54,124,43,0.2);
}

.est-input.text-input { max-width: 100%; }

.est-computed {
  font-size: 0.88rem;
  color: #7cb8ff;
  font-weight: 600;
  text-align: right;
  min-width: 80px;
}

.est-subtotal-row {
  border-top: 2px solid #444;
  padding-top: 8px;
  margin-top: 4px;
}

.est-subtotal-label {
  font-weight: 700;
  color: #fff;
  background: #444;
}

.est-subtotal-value {
  font-weight: 700;
  color: #fff;
}

.est-fee-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.est-fee-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.est-fee-label {
  font-size: 0.82rem;
  color: #d1d5db;
  font-weight: 600;
}

.est-diag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.78rem;
}

.est-diag-total {
  border-top: 2px solid #444;
  padding-top: 8px;
  margin-top: 4px;
  font-weight: 700;
  color: #fff;
  font-size: 0.88rem;
}

.est-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.est-summary-row:last-child { border-bottom: none; }
.est-summary-label { color: #d1d5db; font-weight: 500; }

.est-summary-value {
  color: #7cb8ff;
  font-weight: 600;
  min-width: 80px;
  text-align: right;
}

.est-grand-total {
  background: linear-gradient(135deg, #2d5a1b 0%, #367C2B 100%);
  margin: 8px -14px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 2px solid var(--jd-yellow);
}

.est-grand-total .est-summary-label {
  color: var(--jd-yellow);
  font-size: 1.1rem;
  font-weight: 800;
}

.est-grand-total .est-summary-value {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
}

.est-less-deposit {
  background: linear-gradient(135deg, #1a3d10 0%, #2a5520 100%);
  margin: 0 -14px -14px -14px;
  padding: 12px 16px;
  border-radius: 0 0 10px 10px;
  border-top: 2px solid #4a8a3a;
}

.est-less-deposit .est-summary-label {
  color: var(--jd-yellow);
  font-size: 1rem;
  font-weight: 700;
}

.est-less-deposit .est-summary-value {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
}

.est-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-clear-est {
  padding: 8px 18px;
  background: #8B0000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-clear-est:hover { background: #a00; }

/* ---- Saved Estimates ---- */
.saved-est-card {
  background: rgba(54,124,43,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.saved-est-card:hover { background: rgba(54,124,43,0.1); }

.saved-est-info { flex: 1; }

.saved-est-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--jd-yellow);
}

.saved-est-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.saved-est-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--jd-yellow);
  min-width: 100px;
  text-align: right;
}

.saved-est-actions {
  display: flex;
  gap: 6px;
}

.saved-est-actions button {
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
}

.saved-est-actions button:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.saved-est-actions button.delete-btn:hover { background: rgba(139,0,0,0.3); color: #ff6b6b; }

/* ---- Print Styles ---- */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .sidebar, .mobile-header, .nav-list, .sidebar-footer, .sidebar-header,
  .btn-row, .btn-primary, .btn-secondary, .btn-clear-est, .btn-slot,
  #toast, #confirmModal, #detailModal,
  .saved-est-actions, #estSearchInput,
  .est-tabs { display: none !important; }
  .content { margin-left: 0 !important; padding: 10px !important; max-width: 100% !important; }
  .page { display: none !important; }
  #page-estimator { display: block !important; }
  .panel, .est-section { border: 1px solid #ccc !important; background: #fff !important; }
  .est-section-header { background: #367C2B !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .est-job-header { background: #2a5520 !important; color: #FFDE00 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .est-grand-total { background: #367C2B !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .est-less-deposit { background: #2a5520 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .est-input { border: 1px solid #ccc !important; background: #f0fff0 !important; color: #000 !important; }
  .est-computed, .est-summary-value { color: #000 !important; }
  .est-form-label { background: #e5e7eb !important; color: #000 !important; }
  .page-title { color: #367C2B !important; }
  .est-grid { grid-template-columns: 1fr 1fr 1fr !important; }
  * { font-size: 11px !important; }
  .page-title { font-size: 18px !important; }
  .est-section-header { font-size: 12px !important; }
  .est-grand-total .est-summary-label { font-size: 14px !important; }
  .est-grand-total .est-summary-value { font-size: 16px !important; }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .est-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .content { margin-left: 0; padding: 72px 16px 24px; }
  .dash-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full-width { grid-column: auto; }
  .slot-card { flex-direction: column; align-items: stretch; }
  .btn-slot { text-align: center; }
  .est-grid { grid-template-columns: 1fr; }
}
