/* ======================================================
   Excelergy Base Styles
   VERSION: v2026-UNIFIED-PLANNER-CSS-67-CLEAN
   ====================================================== */

:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ================================
   TOP BAR
   ================================ */

.topbar {
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.brand {
  font-weight: 700;
  font-size: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-nav {
  display: flex;
  gap: 16px;
}

.topbar-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.topbar-nav a.active {
  color: var(--text);
}


/* ================================
   MAIN LAYOUT
   ================================ */

.dashboard {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 24px;
  padding: 24px;
}

/* ================================
   LEFT PANEL
   ================================ */

.kpi-panel {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
}

/* Form container */
.control-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Section headers */
.control-form h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 14px 0 6px;
  text-transform: uppercase;
}

/* ================================
   GRID ROWS
   ================================ */

.row {
  display: grid;
  grid-template-columns: 1fr 120px 90px 80px;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}

.row.headers {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* ================================
   INPUTS & SELECTS
   ================================ */

.row input,
.row select {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f9fafb;
  text-align: right;
}

/* ================================
   BUTTONS (GLOBAL, CLEAN)
   ================================ */

form button {
  height: 36px;
  min-width: 120px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  white-space: nowrap;

  display: flex;
  align-items: center;
  justify-content: center;
}

.primary {
  background: var(--primary);
  color: #fff;
}

/* ======================================================
   SCENARIO ACTION BAR (FINAL)
   ====================================================== */

.scenario-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.scenario-actions button {
  height: 36px;
  min-width: 110px;
}


/* ================================
   RIGHT CONTENT
   ================================ */

main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ================================
   SUMMARY TILES
   ================================ */

.scenario-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.panel {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
}

.panel.tile {
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.panel.tile h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 6px;
}

.panel.tile div {
  font-size: 22px;
  font-weight: 700;
}

/* ================================
   LEDGER
   ================================ */

.table-scroll {
  max-height: 460px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 6px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

/* ================================
   FOOTER
   ================================ */

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 12px;
}

/* ======================================================
   PRINT (SINGLE SOURCE OF TRUTH)
   ====================================================== */

@media print {

  body {
    background: #fff;
  }

  .topbar,
  .kpi-panel,
  .scenario-tiles {
    display: none !important;
  }

  .panel {
    display: block !important;
    page-break-inside: avoid;
  }

  .table-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  table {
    width: 100% !important;
    font-size: 11px;
  }

  th,
  td {
    padding: 4px;
  }

  tr {
    page-break-inside: avoid;
  }

  @page {
    size: A4 landscape;
    margin: 12mm;
  }
}
