/* dashboard.css
   Interaktivní kalkulačka — pouze obrazovka
   Pozor: pořadí načtení v index.html určuje kaskádu — neměňte ho. */

/* ================================================================
   DASHBOARD (pouze obrazovka)
   ================================================================ */

.page {
  display: none;
}

@media screen {
  body {
    background: #edf1e9;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('assets/img/MBS241_foto.png') center center / min(96vw, 1500px) no-repeat;
    opacity: .07;
    pointer-events: none;
    z-index: 0;
  }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  padding: 18px 22px 46px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--green-dark);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}

.app-header .logo {
  height: 40px;
  width: auto;
  background: white;
  border-radius: 10px;
  padding: 6px 10px;
  box-sizing: content-box;
}

.app-title {
  font-size: 17px;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.app-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, .75);
  margin-top: 2px;
}

.app-sub b {
  color: var(--green-lime);
}

.app-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.app-btn {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 10px 18px;
  border-radius: 100px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform .12s ease, background .12s ease;
  border: none;
}

.app-btn:hover {
  transform: translateY(-1px);
}

.app-btn.primary {
  background: var(--green-lime);
  color: var(--green-dark);
}

.app-btn.primary:hover {
  background: var(--green-lime-light);
}

.app-btn.ghost {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(141, 198, 63, .55);
}

.app-btn.ghost:hover {
  background: rgba(141, 198, 63, .15);
}

.app-hero {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

#app .ctrl-card {
  gap: 13px;
  padding: 16px 18px 17px;
}

#app .ctrl-name {
  font-size: 12.5px;
}

#app .ctrl-val {
  font-size: 16px;
}

#app .ctrl-sub {
  font-size: 10.5px;
}

#app input[type=range] {
  height: 28px;
}

#app input[type=number] {
  font-size: 14px;
  padding: 7px 12px;
}

#app .ctrl-row {
  padding-bottom: 10px;
}

.app-results {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.hero-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-card.big {
  padding: 16px 20px 17px;
}

.kpi-card.big .kpi-label {
  font-size: 10.5px;
  margin-bottom: 5px;
}

.kpi-card.big .kpi-val {
  font-size: 36px;
}

.kpi-card.big .kpi-sub {
  font-size: 10.5px;
  margin-top: 4px;
}

#app .kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

#app .kpi-card {
  padding: 11px 15px 12px;
}

#app .kpi-label {
  font-size: 9.5px;
}

#app .kpi-val {
  font-size: 21px;
}

#app .kpi-sub {
  font-size: 9.5px;
}

#app .chart-card {
  flex: 1;
  padding: 14px 18px 10px;
}

#app .chart-card svg {
  min-height: 250px;
}

#app .chart-title {
  font-size: 12.5px;
}

#app .chart-legend {
  font-size: 10px;
}

.app-sec-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: -.01em;
  margin: 4px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-sec-title::before {
  content: '';
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--green-lime);
}

#app .break-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

#app .break-row {
  font-size: 11.5px;
  padding: 7px 15px;
}

#app .break-row.total .k,
#app .break-row.total .v {
  font-size: 12px;
}

/* Rozbalovací panel konstant */
.const-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.const-panel summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 12px 18px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--green-mid);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.const-panel summary::-webkit-details-marker {
  display: none;
}

.const-panel summary::after {
  content: '▾';
  margin-left: auto;
  transition: transform .15s ease;
}

.const-panel[open] summary::after {
  transform: rotate(180deg);
}

.const-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0 26px;
  padding: 2px 18px 10px;
}

.const-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  padding: 5px 0;
  border-bottom: 1px solid var(--green-tint);
}

.const-item .k {
  color: var(--text-muted);
  font-weight: 500;
}

.const-item .v {
  font-weight: 700;
  color: var(--green-dark);
  white-space: nowrap;
  text-align: right;
}

.const-note {
  font-size: 10px;
  color: var(--text-muted);
  padding: 8px 18px 13px;
  line-height: 1.5;
}

.app-footer {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.app-footer b {
  color: var(--green-dark);
}

@media (max-width: 960px) {
  .app-hero {
    grid-template-columns: 1fr;
  }

  .hero-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .app-actions {
    margin-left: 0;
    width: 100%;
  }
}
