/* --- JEDNOLITE STYLE (PLANER HARMONOGRAMU) --- */

:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg: #0f172a;
  --accent: #f97316;
  --muted: #475569;
  --card: #ffffff;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }

/* JEDNOLITE TŁO */
body {
  margin: 0;
  background: linear-gradient(180deg, #0f172a 0%, #f1f5f9 65%, #fff 100%);
  min-height: 100vh; 
  color: #e2e8f0; /* Globalny jasny kolor tekstu */
}

.container {
  width: min(1080px, 94vw);
  margin: 0 auto;
}

.page-header,
.page-footer {
  color: #f1f5f9;
}

/* JEDNOLITY HEADER I STOPKA */
.page-header .container {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  flex-wrap: wrap;
}
.page-footer .container {
  display: flex;
  gap: 8px; 
  align-items: center;
  justify-content: center; /* Wyśrodkowanie w poziomie */
  padding: 20px 0;
  flex-wrap: wrap;
}

.page-footer {
  background: rgba(15,23,42,0.92);
  font-size: 14px;
  text-align: center;
}

.page-footer a { color: #fbd38d; }

.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.breadcrumbs a { color: #e2e8f0; text-decoration: none; }

/* JEDNOLITA SEKCJA HERO/INTRO */
.intro {
  margin: 64px auto 36px;
  text-align: center;
  color:#e2e8f0;
  width: min(720px, 100%);
}

.intro h1 {
  margin: 0 0 12px; color: #fff;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

/* JEDNOLITY BIAŁY PODTYTUŁ */
.intro p {
  margin: 0;
  color: #e2e8f0;
}

.grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 36px;
}

.card {
  background: var(--card);
  border-radius: 22px;
  padding: 28px;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 24px 50px rgba(15,23,42,0.35);
  /* Usunięto nadpisywanie koloru wewnątrz kart */
}

h2 {
    color: #fff; /* Domyślny jasny kolor dla nagłówków */
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #cbd5e1; /* Domyślny jasny kolor dla etykiet */
  margin-bottom: 16px;
} 

.row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* Ujednolicony wygląd inputów */
input,
textarea,
select {
  padding: 12px;
  border-radius: 12px;
  border:1px solid rgba(148,163,184,0.25);
  font: inherit;
  background: rgba(15,23,42,0.9);
  color: #e2e8f0;
}

textarea { resize: vertical; }

/* Ujednolicony wygląd przycisków */
.btn,
.btn.primary,
.btn.success,
.btn.danger {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn { background: #e2e8f0; color: var(--bg); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.success { background: #10b981; color: #fff; }
.btn.danger { background: #fee2e2; color: #b91c1c; }

.btn:hover,
.btn.primary:hover,
.btn.success:hover,
.btn.danger:hover { transform: translateY(-2px); }

/* JEDNOLITY PRZYCISK W STOPCE */
.footer-text {
    line-height: 1.4;
    color: #f1f5f9;
}

.btn-buy-coffee {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  text-align: center;
  
  background: var(--accent); 
  color: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.4); 
}

.btn-buy-coffee:hover {
  background: transparent;
  color: var(--accent);
  transform: translateY(-2px);
}
/* --- KONIEC JEDNOLITYCH STYLÓW --- */


/* --- UNIKALNE STYLE KALKULATORA (TABELE I WYNIKI) --- */

.table-wrap { 
  margin-top: 16px; 
  overflow-x: auto; 
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.table-wrap h3 { 
  margin: 12px 0 8px; 
  color: #fff;
  font-size: 18px;
}

.editable-table { 
  width: 100%; 
  table-layout: auto; 
  border-collapse: collapse;
}

.editable-table thead th { 
  position: sticky; 
  top: 0; 
  background: var(--card); 
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 8px;
  white-space: nowrap;
}

.editable-table th, .editable-table td {
  padding: 8px;
  vertical-align: middle;
  min-width: 60px;
  /* Usunięto nadpisywanie koloru */
  border-bottom: 1px solid var(--border);
}

.editable-table input { 
  width: 100%; 
  padding: 8px 6px;
  border: 1px solid rgba(148,163,184,0.3); 
  border-radius: 6px; 
  font-size: 13px; 
  background: var(--bg); /* Tło inputów (ciemne) */
  color: #e2e8f0;
  box-sizing: border-box;
  min-width: 50px; 
}

.editable-table input:focus, .editable-table input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: rgba(15,23,42,0.7);
}

.editable-table input.error {
  border-color: #ef4444;
  animation: shake 0.3s;
}

.editable-table .del { 
  background: #ef4444; 
  border: 0; 
  color: #fff; 
  border-radius: 6px; 
  padding: 6px 10px; 
  cursor: pointer;
  font-size: 14px;
  opacity: 0.8;
}
.editable-table .del:hover { opacity: 1; }

.totals-row td {
  font-weight: 700;
  background: #f1f5f9;
  position: sticky;
  bottom: 0;
  z-index: 1;
}

.table-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Sekcja wyników */
.results {
  margin-top: 28px;
}

.results-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 18px 0;
}

.results-grid.main {
    border-top: 1px solid var(--border);
    padding-top: 18px;
}

.results-grid.main strong {
    font-size: 1.5em;
    color: var(--accent);
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em; 
  /* Usunięto nadpisywanie koloru */
}

.total {
  font-weight: 700;
}

.compare-form {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.compare-form input {
    color: var(--bg);
    background: var(--border);
}

.compare-form .actions {
    margin-top: 6px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th, .results-table td {
    padding: 8px 0;
    text-align: left;
    /* Usunięto nadpisywanie koloru */
}

.results-table th {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
}

.results-table td:last-child {
    text-align: right;
}

.results-table .del {
    background: none;
    color: #ef4444;
    padding: 0 4px;
    font-size: 1.2em;
    margin-left: 8px;
}

.history {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.history-entry {
    background: #f1f5f9;
    padding: 12px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px; 
    /* Usunięto nadpisywanie koloru */
}
.history-entry button {
    margin-left: 10px;
    padding: 6px 10px;
    font-size: 14px;
}

.history-entry strong {
    font-weight: 700;
    color: var(--accent);
    margin-left: 5px;
}
.history-entry > div {
    display: flex;
    gap: 10px;
}

/* --- RESPONSYWNOŚĆ --- */

@media (max-width: 640px) {
  .actions { flex-direction: column; align-items: stretch; }
  .table-actions { flex-direction: column; align-items: stretch; }
  
  .page-header .container {
    justify-content: center;
    text-align: center;
  }
  .breadcrumbs { display: none; }
  
  /* Wyśrodkowanie w stopce na mobile */
  .page-footer .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px; 
  }
  .btn-buy-coffee {
    width: 100%;
    margin-top: 0;
  }
  .desktop-only {
    display: none;
  }
}