/* ==========================================================================
   KALKULATOR RAB PAK DION - MODERN DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #182235;
  --bg-card-hover: #1f2d47;
  --bg-input: #0f172a;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --border-highlight: rgba(59, 130, 246, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #0f172a;

  /* Accents & Brand */
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-indigo: #6366f1;
  --accent-cyan: #06b6d4;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-highlight: 0 0 25px rgba(59, 130, 246, 0.25);

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Dimensions & Transitions */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Light Theme Variables */
body.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.09);
  --border-focus: #2563eb;
  --border-highlight: rgba(37, 99, 235, 0.25);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --text-inverse: #f8fafc;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-highlight: 0 0 20px rgba(37, 99, 235, 0.15);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background-color: rgba(17, 24, 39, 0.85);
}

body.theme-light .app-header {
  background-color: rgba(241, 245, 249, 0.9);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-icon {
  background: var(--primary-gradient);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.brand-titles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.badge-pill {
  display: inline-flex;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.brand-titles h1 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-titles p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.meta-tag-list {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.meta-item strong {
  color: var(--text-main);
}

.meta-label {
  color: var(--text-dim);
  margin-right: 0.25rem;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-500);
  transform: translateY(-1px);
}

/* ==========================================================================
   SUMMARY / KPI HERO BAR
   ========================================================================== */
.summary-hero-wrapper {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.5rem 1.5rem 2rem;
}

.summary-hero-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card.highlight-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18) 0%, rgba(16, 185, 129, 0.12) 100%);
  border: 1px solid var(--border-highlight);
  box-shadow: var(--shadow-highlight);
}

.kpi-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.kpi-status-badge.saving {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.kpi-status-badge.higher {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.pdf-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

.variance-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.variance-pill.positive {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.variance-pill.negative {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.counter-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-card-hover);
  color: var(--text-muted);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.35rem 0;
}

.currency-symbol {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-main-number {
  font-family: var(--font-heading);
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
}

.kpi-secondary-number {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-subtext {
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.5rem;
  margin-top: 0.35rem;
}

.kpi-subtext strong {
  color: var(--text-main);
}

/* Terbilang Banner */
.terbilang-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.terbilang-icon {
  color: var(--accent-gold);
  display: flex;
  align-items: center;
}

.terbilang-content {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.terbilang-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent-gold);
}

.terbilang-text {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  font-style: italic;
}

/* ==========================================================================
   WORKSPACE & TOOLBAR
   ========================================================================== */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 450px;
}

.search-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 0.875rem;
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 2.25rem 0.65rem 2.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.clear-btn {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
}

.filter-box select {
  padding: 0.65rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.filter-box select:focus {
  border-color: var(--border-focus);
}

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

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--border-focus);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-outline:hover {
  color: var(--text-main);
  border-color: var(--text-dim);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

/* Popover for batch markup */
.action-dropdown-group {
  position: relative;
}

.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: 1rem;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.popover-header {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.quick-markup-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.btn-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-chip:hover {
  border-color: var(--primary-500);
  background: var(--bg-card-hover);
}

.custom-markup-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.custom-markup-row input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.875rem;
  outline: none;
}

.pct-sign {
  font-weight: 700;
  color: var(--text-muted);
}

.popover-help {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* ==========================================================================
   RECAPITULATION OVERVIEW GRID (A to L)
   ========================================================================== */
.recap-overview-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title-row h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.sub-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.recap-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.85rem;
}

.recap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.recap-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.recap-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recap-code-badge {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  color: white;
  font-size: 0.8125rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recap-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.recap-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.2rem;
}

.recap-price {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.recap-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.recap-progress-fill {
  height: 100%;
  background: var(--primary-500);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* ==========================================================================
   TABLES & DETAILED CALCULATION
   ========================================================================== */
.rab-tables-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.table-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.default { background: var(--text-dim); }
.legend-dot.modified { background: var(--accent-gold); }

.sections-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.section-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.section-block.has-modified {
  border-color: rgba(245, 158, 11, 0.4);
}

.section-header-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-badge {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: white;
  background: var(--primary-gradient);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-header-right {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.section-subtotal-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.section-subtotal-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Table Design */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.rab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.rab-table th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.rab-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.rab-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* Col specific alignments */
.col-no { width: 55px; text-align: center; }
.col-desc { min-width: 280px; }
.col-vol { width: 85px; text-align: right; font-family: var(--font-mono); }
.col-sat { width: 65px; text-align: center; color: var(--text-dim); }
.col-base { width: 140px; text-align: right; font-family: var(--font-mono); color: var(--text-muted); }
.col-input { width: 175px; text-align: right; }
.col-total { width: 155px; text-align: right; font-family: var(--font-mono); font-weight: 700; }
.col-action { width: 45px; text-align: center; }

/* Parent Heading in Table (e.g. Fondasi Tapak, Sloof, Kolom) */
.parent-row {
  background: rgba(148, 163, 184, 0.05);
}

.parent-row td {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.parent-title {
  font-weight: 700;
  color: var(--primary-500);
}

.sub-item-row .col-desc {
  padding-left: 2rem;
  color: var(--text-main);
}

/* Price Input Field */
.price-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.price-input-wrapper .input-prefix {
  position: absolute;
  left: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  pointer-events: none;
  font-family: var(--font-mono);
}

.price-input {
  width: 100%;
  padding: 0.4rem 0.5rem 0.4rem 1.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-align: right;
  outline: none;
  transition: all var(--transition-fast);
}

.price-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.price-input.is-modified {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.05);
  color: #fde047;
}

.btn-reset-item {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-reset-item:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary-500);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.success { border-left-color: var(--accent-emerald); }
.toast.info { border-left-color: var(--primary-500); }
.toast.warning { border-left-color: var(--accent-gold); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   PRINT STYLESHEET (PROFESSIONAL INDONESIAN RAB LAYOUT)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9pt;
    line-height: 1.3;
  }

  .app-header,
  .summary-hero-wrapper,
  .toolbar-card,
  .recap-overview-section,
  .table-legend,
  .btn-reset-item,
  .col-action,
  .col-base,
  .toast-container {
    display: none !important;
  }

  .main-container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .print-document {
    display: block !important;
  }

  .print-header {
    text-align: center;
    margin-bottom: 1.5cm;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5cm;
  }

  .print-title {
    font-size: 14pt;
    font-weight: 800;
    margin-bottom: 0.5cm;
  }

  .print-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-size: 9pt;
    text-align: left;
    gap: 0.2cm;
  }

  .rab-tables-section {
    gap: 1cm;
  }

  .section-block {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 0.8cm;
  }

  .section-header-bar {
    background: #f1f5f9 !important;
    border: 1px solid #94a3b8 !important;
    color: #000000 !important;
    padding: 0.25cm 0.4cm;
  }

  .section-badge {
    background: #000000 !important;
    color: #ffffff !important;
  }

  .rab-table {
    border: 1px solid #94a3b8 !important;
  }

  .rab-table th,
  .rab-table td {
    border: 1px solid #cbd5e1 !important;
    color: #000000 !important;
    padding: 0.2cm 0.3cm !important;
  }

  .rab-table th {
    background: #e2e8f0 !important;
  }

  .price-input {
    border: none !important;
    background: transparent !important;
    color: #000000 !important;
    padding: 0 !important;
    text-align: right !important;
    font-weight: 600 !important;
  }

  .price-input-wrapper .input-prefix {
    display: none !important;
  }

  .print-signatures {
    margin-top: 1.5cm;
    display: flex;
    justify-content: space-between;
    page-break-inside: avoid;
  }

  .sig-box {
    text-align: center;
    width: 220px;
  }

  .sig-space {
    height: 2.2cm;
  }

  .print-page-break {
    page-break-after: always;
  }
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .toolbar-left, .toolbar-right {
    width: 100%;
  }

  .search-box {
    flex: 1;
  }

  .recap-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .recap-cards-grid {
    grid-template-columns: 1fr;
  }

  .meta-tag-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .kpi-main-number {
    font-size: 1.75rem;
  }
}

/* ==========================================================================
   MODAL - CLOUD SESSION MANAGER
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease-out;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-body { padding: 1.25rem; }

.modal-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.modal-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.modal-form-row label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-form-row input,
.modal-form-row textarea {
  padding: 0.6rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.modal-form-row input:focus,
.modal-form-row textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 340px;
  overflow-y: auto;
}

.session-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition: border-color var(--transition-fast);
}

.session-item:hover { border-color: var(--primary-500); }
.session-info { flex: 1; }

.session-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.session-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.session-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
}

.session-actions { display: flex; gap: 0.4rem; }

.btn-load-session {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--transition-fast);
}

.btn-load-session:hover { filter: brightness(1.15); }

.btn-delete-session {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-delete-session:hover {
  color: var(--accent-rose);
  border-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

.loading-text, .empty-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0;
}

.empty-text { color: var(--text-dim); font-style: italic; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.3rem;
}

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

/* ==========================================================================
   MATERIAL STORE PANEL (Satuan Pasar Awam) & AHSP RECIPES
   ========================================================================== */
.material-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.material-panel-header {
  padding: 1rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(30, 41, 59, 0.02) 100%);
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
}

body.theme-light .material-panel-header {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.06) 0%, rgba(241, 245, 249, 0.5) 100%);
}

.material-panel-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.material-panel-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.material-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.material-panel-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.auto-link-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.material-panel-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.material-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-toggle-icon {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.btn-toggle-icon:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

.material-panel-card.collapsed .btn-toggle-icon svg {
  transform: rotate(-90deg);
}

.material-panel-card.collapsed .material-panel-content {
  display: none;
}

.material-panel-content {
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.material-categories-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.15rem;
}

@media (max-width: 1350px) {
  .material-categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .material-categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .material-categories-grid {
    grid-template-columns: 1fr;
  }
}

.material-cat-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.material-cat-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-500);
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 0.4rem;
}

.material-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.material-item-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

.material-item-card.is-modified {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.05);
}

.material-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
}

.material-item-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.material-item-unit {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.material-input-group {
  display: flex;
  align-items: center;
  position: relative;
}

.material-input-prefix {
  position: absolute;
  left: 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  pointer-events: none;
}

.material-price-input {
  width: 100%;
  padding: 0.4rem 0.5rem 0.4rem 2rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
  outline: none;
  transition: border-color var(--transition-fast);
}

.material-price-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.material-item-card.is-modified .material-price-input {
  color: var(--accent-gold);
}

.material-item-note {
  font-size: 0.6875rem;
  color: var(--text-dim);
  line-height: 1.25;
}

/* AHSP Recipe Button in RAB Table */
.btn-ahsp-recipe {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary-500);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-left: 0.5rem;
  transition: all var(--transition-fast);
  vertical-align: middle;
}

.btn-ahsp-recipe:hover {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
}

/* Modal Recipe / AHSP Breakdown */
.modal-recipe-card {
  max-width: 600px;
}

.recipe-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary-500);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.recipe-summary-box {
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary-500);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.recipe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

.recipe-table th {
  text-align: left;
  padding: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.recipe-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.recipe-sub-calc {
  font-size: 0.725rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 0.1rem;
}

.recipe-total-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recipe-total-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.recipe-total-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-500);
}

/* ==========================================================================
   WALL MATERIAL SELECTOR (Bata Merah vs Batako vs Hebel)
   ========================================================================== */
.wall-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.wall-selector-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.wall-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
  flex-wrap: wrap;
}

.wall-header-left {
  flex: 1;
  min-width: 280px;
}

.wall-header-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.wall-title-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: linear-gradient(135deg, hsl(25, 90%, 52%), hsl(15, 85%, 48%));
  color: #fff;
}

.wall-volume-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.wall-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.3rem 0;
}

.wall-panel-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

.wall-header-right {
  display: flex;
  align-items: center;
}

.wall-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 0.4rem 0.85rem;
  white-space: nowrap;
}

.wall-active-pill strong {
  color: var(--primary-500);
  font-weight: 700;
}

.wall-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.wall-option-card {
  position: relative;
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wall-option-card:hover {
  border-color: var(--primary-400);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.wall-option-card.is-selected {
  border-color: var(--primary-500);
  background: linear-gradient(135deg, 
    hsla(var(--primary-hue, 220), 80%, 55%, 0.06), 
    hsla(var(--primary-hue, 220), 80%, 55%, 0.02));
  box-shadow: 0 0 0 3px hsla(var(--primary-hue, 220), 80%, 55%, 0.15);
}

.wall-option-card.is-selected::after {
  content: '✓ Aktif';
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--primary-500);
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  letter-spacing: 0.03em;
}

.wall-option-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.wall-option-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.wall-option-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.wall-option-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.15rem;
}

.wall-option-badge.badge-baseline {
  background: hsla(210, 70%, 50%, 0.12);
  color: hsl(210, 70%, 50%);
}

.wall-option-badge.badge-savings {
  background: hsla(145, 65%, 40%, 0.12);
  color: hsl(145, 65%, 35%);
}

.wall-option-badge.badge-modern {
  background: hsla(270, 60%, 55%, 0.12);
  color: hsl(270, 60%, 50%);
}

.wall-option-tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.wall-option-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.wall-option-price-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.wall-option-price-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.wall-option-price-unit {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.wall-option-savings {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.wall-option-savings.savings-positive {
  background: hsla(145, 65%, 40%, 0.1);
  color: hsl(145, 65%, 35%);
}

.wall-option-savings.savings-negative {
  background: hsla(0, 65%, 50%, 0.1);
  color: hsl(0, 65%, 45%);
}

.wall-option-savings.savings-neutral {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.wall-option-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding-top: 0.35rem;
}

.wall-option-total-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.78rem;
}

.wall-selected-summary {
  margin: 0 1.5rem 1.25rem 1.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, hsla(var(--primary-hue, 220), 80%, 55%, 0.08), hsla(var(--primary-hue, 220), 80%, 55%, 0.03));
  border: 1px solid hsla(var(--primary-hue, 220), 80%, 55%, 0.25);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wall-sum-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.wall-sum-left {
  flex: 1;
  min-width: 260px;
}

.wall-sum-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.wall-sum-icon {
  font-size: 1.3rem;
}

.wall-sum-heading {
  font-size: 0.95rem;
  color: var(--text-main);
}

.wall-sum-applied-pill {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: var(--primary-500);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.wall-sum-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin: 0;
}

.wall-sum-right {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.wall-sum-metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

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

.wall-metric-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.wall-metric-value.highlight {
  color: var(--primary-500);
  font-size: 1rem;
}

.wall-sum-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-sans);
}

.wall-sum-badge.badge-baseline {
  background: hsla(210, 70%, 50%, 0.12);
  color: hsl(210, 70%, 50%);
}

.wall-sum-badge.badge-saving {
  background: hsla(145, 65%, 40%, 0.15);
  color: hsl(145, 65%, 35%);
}

.wall-sum-badge.badge-higher {
  background: hsla(0, 65%, 50%, 0.15);
  color: hsl(0, 65%, 45%);
}

@media (max-width: 900px) {
  .wall-options-grid {
    grid-template-columns: 1fr;
  }
  .wall-sum-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .wall-selector-header {
    flex-direction: column;
    padding: 1rem;
  }
  .wall-options-grid {
    padding: 1rem;
    gap: 0.75rem;
  }
}

/* ==========================================================================
   BUDGET OPTIMIZER (VALUE ENGINEERING & SUBSTITUSI MATERIAL)
   ========================================================================== */
.budget-optimizer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.budget-optimizer-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.09);
  border-color: hsla(145, 65%, 45%, 0.3);
}

.budget-opt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, hsla(145, 65%, 45%, 0.06), hsla(210, 70%, 50%, 0.03));
  gap: 1rem;
  flex-wrap: wrap;
}

.budget-opt-header-left {
  flex: 1;
  min-width: 280px;
}

.budget-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.budget-title-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: linear-gradient(135deg, hsl(145, 75%, 38%), hsl(160, 80%, 34%));
  color: #fff;
}

.budget-safety-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: hsla(210, 80%, 50%, 0.12);
  color: hsl(210, 80%, 55%);
  border: 1px solid hsla(210, 80%, 50%, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.budget-panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.budget-panel-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  max-width: 900px;
}

.budget-opt-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.budget-input-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.budget-input-row {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.budget-field-group {
  flex: 1;
  min-width: 280px;
}

.budget-field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.budget-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.budget-currency-prefix {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.budget-main-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  transition: all 0.2s ease;
}

.budget-main-input:focus {
  border-color: var(--primary-500);
  outline: none;
  box-shadow: 0 0 0 3px hsla(var(--primary-hue, 220), 80%, 55%, 0.15);
}

.btn-action-primary {
  background: linear-gradient(135deg, hsl(145, 75%, 38%), hsl(160, 80%, 34%));
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-action-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.budget-presets-group {
  flex: 1.5;
  min-width: 320px;
}

.budget-preset-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.budget-preset-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.budget-preset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: all 0.2s ease;
  text-align: left;
}

.budget-preset-btn:hover {
  border-color: var(--primary-500);
  transform: translateY(-1px);
}

.budget-preset-btn.is-active {
  background: hsla(145, 65%, 45%, 0.12);
  border-color: hsl(145, 65%, 40%);
  color: hsl(145, 65%, 30%);
}

.budget-preset-btn .preset-target {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.budget-preset-btn .preset-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Analysis Bar */
.budget-analysis-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding-top: 1.15rem;
  border-top: 1px dashed var(--border-subtle);
}

.analysis-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.analysis-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.analysis-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.analysis-value.highlight-target {
  color: hsl(210, 80%, 55%);
}

.analysis-value.highlight-gap {
  color: hsl(25, 90%, 50%);
}

.analysis-value.highlight-savings {
  color: hsl(145, 65%, 40%);
}

.analysis-value.highlight-new {
  color: hsl(160, 80%, 35%);
  font-size: 1.15rem;
}

/* Alternatives Table & Cards */
.budget-alternatives-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.budget-alt-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.budget-alt-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.budget-alt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all 0.25s ease;
}

.budget-alt-card:hover {
  border-color: var(--border-color);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.budget-alt-card.is-selected {
  border-color: hsla(145, 65%, 45%, 0.5);
  background: linear-gradient(135deg, hsla(145, 65%, 45%, 0.05), hsla(145, 65%, 45%, 0.01));
}

.budget-alt-checkbox-wrapper {
  padding-top: 0.25rem;
}

.budget-alt-checkbox {
  width: 18px;
  height: 18px;
  accent-color: hsl(145, 70%, 38%);
  cursor: pointer;
}

.budget-alt-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.budget-alt-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.budget-alt-name-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.budget-alt-category {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.budget-alt-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.budget-alt-savings-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: hsl(145, 65%, 35%);
  background: hsla(145, 65%, 40%, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  white-space: nowrap;
}

.budget-alt-specs {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  background: var(--bg-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.budget-spec-item strong {
  color: var(--text-main);
}

.budget-alt-reason {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.safety-check-icon {
  color: hsl(145, 65%, 40%);
  font-weight: 800;
}

/* Footer Action */
.budget-opt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.budget-footer-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex: 1;
  min-width: 280px;
}

.footer-shield-icon {
  font-size: 1.4rem;
}

.budget-footer-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, hsl(145, 75%, 38%), hsl(160, 80%, 34%));
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 14px hsla(145, 75%, 38%, 0.35);
  transition: all 0.2s ease;
}

.btn-primary-gradient:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px hsla(145, 75%, 38%, 0.45);
}

@media (max-width: 900px) {
  .budget-input-row {
    flex-direction: column;
    gap: 1rem;
  }
  .budget-opt-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .budget-footer-buttons {
    justify-content: flex-end;
  }
}

/* ==========================================================================
   PRINT MEDIA STYLES (PDF / Print Export)
   ========================================================================== */
@media print {
  .app-header,
  .summary-hero-wrapper,
  .material-panel-card,
  .toolbar-card,
  .recap-overview-section,
  .sections-container,
  .modal-overlay,
  .toast-container,
  .quick-markup-popover,
  button,
  .btn-reset-item {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9pt;
    padding: 0;
    margin: 0;
  }

  .print-document {
    display: block !important;
    padding: 0;
    margin: 0;
    color: #000000;
  }

  .print-header {
    text-align: center;
    margin-bottom: 1cm;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5cm;
  }

  .print-title {
    font-size: 14pt;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 0.5cm;
  }

  .print-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3cm;
    font-size: 9pt;
    text-align: left;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
    margin-bottom: 0.8cm;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #cbd5e1;
    padding: 5px 8px;
    color: #0f172a;
  }

  .print-table th {
    background-color: #f1f5f9 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 8pt;
    color: #0f172a !important;
  }

  .print-page-break {
    page-break-before: always;
  }

  .print-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5cm;
    page-break-inside: avoid;
  }

  .sig-box {
    width: 220px;
    text-align: center;
    font-size: 9pt;
  }

  .sig-space {
    height: 2cm;
  }
}

