:root {
  --page-bg: #f4f7f7;
  --primary: #0f6a71;
  --primary-dark: #0b4f54;
  --primary-soft: #e4f1f1;
  --ink: #25343F;
  --muted: #7c8b8d;
  --border: #e7edee;
  --danger: #d64545;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--page-bg);
  color: var(--ink);
}

/* Catatan: pages/add-project.html sekarang di-load sebagai
   FRAGMENT murni (lihat komentar di bagian atas file itu), jadi TIDAK
   lagi punya wrapper .edash-layout/.edash-main/.edash-content/
   #sidebar-root/#header-root sendiri — semua itu sudah didefinisikan
   sekali oleh shell utama di index.html. Dulu file ini masih
   mendefinisikan ulang class-class tsb (peninggalan dari versi
   standalone-nya) yang berakibat wrapper ke-nested dobel di dalam
   punya index.html → muncul 2 scrollbar bertumpuk. JANGAN tambahkan
   lagi rule .edash-layout/.edash-main/.edash-content di sini. */

#sidebar-root:empty, #header-root:empty { display: none; }

/* ---------- Page header ---------- */
.page-title { font-size: 16px; font-weight: 600; color: var(--ink); }

.ap-wrap { max-width: 1320px; margin: 0 auto; }

.ap-head { margin-bottom: 20px; }
.ap-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.ap-head p { font-size: 13px; color: var(--muted); }

/* ---------- Two-column layout ---------- */
.ap-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 20px;
}

.ap-col-left { display: flex; flex-direction: column; gap: 18px; }

.ap-col-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 24px;
}

/* ---------- Form cards ---------- */
.ap-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(16,24,32,0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ap-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--primary-soft);
  padding-bottom: 10px;
}
.ap-card-head h3 { font-size: 14.5px; font-weight: 600; color: var(--primary-dark); }

/* ---------- Inverter Tab Styling ---------- */
.ap-inverter-wrapper {
  padding: 0;
  overflow: hidden;
  gap: 0;
}

.ap-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafb;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px 0 16px;
  gap: 12px;
}

.ap-tabs-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
.ap-tabs-nav::-webkit-scrollbar { height: 4px; }
.ap-tabs-nav::-webkit-scrollbar-thumb { background: #d0d7d8; border-radius: 4px; }

.ap-tab-btn {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
  top: 1px;
}

.ap-tab-btn:hover {
  color: var(--primary-dark);
  background: rgba(15, 106, 113, 0.05);
}

.ap-tab-btn.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  border-color: var(--border);
  box-shadow: 0 -2px 4px rgba(0,0,0,0.02);
}

.ap-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
}

.ap-tab-btn .ap-tab-close {
  font-size: 11px;
  color: var(--muted);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.ap-tab-btn .ap-tab-close:hover {
  background: var(--danger);
  color: #fff;
}

.ap-add-inverter-btn {
  border: 1px dashed var(--primary);
  background: #fff;
  color: var(--primary-dark);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}
.ap-add-inverter-btn:hover {
  background: var(--primary-soft);
}

.ap-tab-contents {
  padding: 22px;
}

.ap-tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.2s ease;
}

.ap-tab-pane.active {
  display: flex;
}

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

.ap-pane-header {
  border-bottom: 1px solid var(--primary-soft);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.ap-pane-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ---------- Form Controls ---------- */
.ap-field { display: flex; flex-direction: column; gap: 6px; }
.ap-field label { font-size: 13px; font-weight: 600; color: var(--ink); }

.ap-field input,
.ap-field select {
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.ap-field input::placeholder { color: #a8b0b8; }
.ap-field input:focus,
.ap-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.ap-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.ap-subtitle { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 4px; }

.ap-file-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ap-file-btn {
  border: 1px solid var(--border);
  background: #f5f6f7;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
}
.ap-file-name { font-size: 12.5px; color: var(--muted); }

.ap-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ap-btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.ap-btn-primary { background: var(--primary); color: #fff; width: 100%; font-size: 14px; }
.ap-btn-primary:hover { background: var(--primary-dark); }

/* ---------- Modal Overlay ---------- */
.ap-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 25, 35, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  padding: 20px;
}

.ap-modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.ap-modal {
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  text-align: center;
  transform: scale(0.92);
  transition: all 0.25s ease;
}

.ap-modal-overlay.is-visible .ap-modal {
  transform: scale(1);
}

.ap-modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e8f7f5;
  color: var(--primary);
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.ap-modal h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.ap-modal p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.ap-modal-summary {
  background: #f8fafb;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-modal-summary-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}
.ap-modal-summary-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.ap-modal-summary-label { color: var(--muted); font-weight: 500; }
.ap-modal-summary-val { font-weight: 600; color: var(--primary-dark); }

/* ---------- Modal Variant: Danger (Remove Inverter confirmation) ---------- */
.ap-modal-icon-danger {
  background: #fdeceb;
  color: #e0433c;
}

.ap-modal-actions-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
}
.ap-modal-actions-row .ap-btn { width: 100%; }

.ap-btn-secondary {
  background: #f1f3f5;
  color: var(--ink);
}
.ap-btn-secondary:hover { background: #e4e7ea; }

.ap-btn-danger { background: #e0433c; color: #fff; }
.ap-btn-danger:hover { background: #c7362f; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .ap-form { grid-template-columns: 1fr; }
  .ap-col-right { position: static; }
}

@media (max-width: 700px) {
  .ap-grid-2 { grid-template-columns: 1fr; }
  .ap-tab-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .ap-add-inverter-btn { width: 100%; justify-content: center; }
}