:root {
  --primary: #e05a2b;        /* Cipta Rosa Jingga Accent */
  --primary-dark: #c0461b;
  --primary-soft: #fff3ee;
  --dark: #18202c;
  --slate: #475569;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Navbar */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dark);
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #f5824a);
  color: var(--white);
  font-weight: 800;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.brand-name {
  display: block;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-btn.active {
  background: var(--primary);
  color: var(--white);
}

/* Main & Views */
.main-wrapper {
  flex: 1;
  padding-top: 28px;
  padding-bottom: 48px;
}

.view {
  display: none;
  animation: fadeIn 0.25s ease;
}

.view.active {
  display: block;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero-card {
  background: linear-gradient(135deg, #18202c 0%, #2a3649 100%);
  color: var(--white);
  padding: 36px 28px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(224, 90, 43, 0.35), transparent 70%);
  border-radius: 50%;
}

.badge {
  display: inline-block;
  background: rgba(224, 90, 43, 0.2);
  color: #ff9c78;
  border: 1px solid rgba(224, 90, 43, 0.4);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.hero-card h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin-bottom: 10px;
  max-width: 720px;
}

.hero-card p {
  color: #cbd5e1;
  max-width: 640px;
  font-size: 0.95rem;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* Founder Card */
.founder-card {
  border-left: 4px solid var(--primary);
}

.founder-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.founder-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.founder-header h2 {
  font-size: 1.15rem;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.founder-body p {
  margin-bottom: 12px;
  color: #334155;
  font-size: 0.94rem;
}

.founder-sign {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.founder-sign h4 {
  font-size: 1.05rem;
  color: var(--dark);
}

.founder-sign span {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

/* Calculator Grid */
.section-title {
  margin-bottom: 16px;
}

.section-title h2 {
  font-size: 1.3rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.calc-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 0;
  transition: transform 0.2s, border-color 0.2s;
}

.calc-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.calc-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.calc-card h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.calc-dropdown {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 18px;
  font-size: 0.86rem;
}

.calc-dropdown summary {
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  user-select: none;
}

.calc-dropdown p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-whatsapp {
  background: #16a34a;
  color: var(--white);
}

.btn-whatsapp:hover {
  background: #15803d;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-back {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 8px;
  display: inline-block;
}

/* Page Header & Info Banner */
.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.info-banner {
  background: var(--primary-soft);
  border: 1px solid #ffd5c4;
  color: #7c2d12;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
}

/* Mode Switch */
.mode-switch {
  display: inline-flex;
  background: var(--bg);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.mode-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--slate);
  cursor: pointer;
}

.mode-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

input[readonly] {
  background: #f1f5f9;
  color: var(--muted);
}

.mt-1 { margin-top: 16px; }

.form-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Dynamic Bars */
.dynamic-section {
  margin-top: 18px;
}

.section-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dynamic-bar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

.dynamic-bar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bar-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.bar-grid-4 {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr auto;
  gap: 10px;
  align-items: end;
}

.btn-remove {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
}

/* Material Selection List */
.material-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.material-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 0.8fr;
  gap: 14px;
  align-items: center;
  background: var(--bg);
}

.mat-cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
}

.mat-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.mat-vol {
  font-size: 0.84rem;
  color: var(--slate);
  text-align: right;
  font-weight: 600;
}

/* RAB Report Output */
.rab-paper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.rab-kop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--dark);
  padding-bottom: 14px;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.rab-kop h2 {
  font-size: 1.25rem;
  color: var(--primary);
}

.rab-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  background: var(--bg);
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 0.86rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.rab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.rab-table th,
.rab-table td {
  border: 1px solid var(--border);
  padding: 9px 10px;
}

.rab-table th {
  background: var(--dark);
  color: var(--white);
  text-align: left;
  font-weight: 600;
}

.text-right { text-align: right; }
.text-center { text-align: center; }

.rab-table tr.summary-row td {
  background: #f8fafc;
  font-weight: 600;
}

.rab-table tr.grand-total-row td {
  background: var(--primary-soft);
  color: var(--dark);
  font-weight: 800;
  font-size: 0.95rem;
  border-top: 2px solid var(--primary);
}

.rab-table tr.perm2-row td {
  background: var(--dark);
  color: var(--white);
  font-weight: 700;
}

.rab-notes {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.82rem;
  color: #78350f;
  margin-bottom: 20px;
}

.rab-notes h4 {
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.rab-notes ol {
  padding-left: 18px;
}

.rab-notes li {
  margin-bottom: 4px;
}

.rab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

/* Footer */
.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}

/* Responsive Mobile */
@media (max-width: 820px) {
  .calc-grid,
  .form-grid,
  .rab-meta {
    grid-template-columns: 1fr;
  }

  .material-item {
    grid-template-columns: 1fr;
  }

  .mat-vol {
    text-align: left;
  }

  .bar-grid-3,
  .bar-grid-4 {
    grid-template-columns: 1fr;
  }

  .hero-card h1 {
    font-size: 1.35rem;
  }
}

/* Print Layout A4 Landscape */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #ffffff;
    font-size: 10pt;
  }

  .no-print {
    display: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .rab-paper {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}