/* === Wspólne style widoków === */

/* Nagłówek widoku */
.view-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.view-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

.view-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #555;
}

.view-lokal {
  font-weight: 600;
  color: #4a6cf7;
}

.view-sep {
  color: #ccc;
}

/* Statusy */
.status-ok {
  display: inline-block;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-warn {
  display: inline-block;
  background: #fff3e0;
  color: #e65100;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Brak danych */
.brak-danych {
  text-align: center;
  padding: 40px 20px;
  color: #888;
  font-size: 0.95rem;
}

/* Badge kategoria */
.kategoria-badge {
  display: inline-block;
  background: #e8ecff;
  color: #4a6cf7;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Wiersz niezapłacona */
.row-niezaplacona td {
  background-color: #fff8e1 !important;
}

/* Sekcja KPI */
.kpi-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-top: 24px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e0e0e0;
}

/* === Rozliczenie Codzienne === */

/* Header */
.rozliczenie-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.rozliczenie-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

.rozliczenie-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #555;
}

.rozliczenie-lokal {
  font-weight: 600;
  color: #4a6cf7;
}

.rozliczenie-separator {
  color: #ccc;
}

/* Tabs */
.rozliczenie-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab-btn:hover {
  background: #e8ecff;
  border-color: #4a6cf7;
  color: #4a6cf7;
}

.tab-btn.active {
  background: #4a6cf7;
  color: #fff;
  border-color: #4a6cf7;
  font-weight: 600;
}

.tab-btn-roczne {
  margin-left: 8px;
  border-color: #d4a017;
  color: #d4a017;
}

.tab-btn-roczne:hover {
  background: #fef9e7;
}

/* Podsumowanie */
.rozliczenie-podsumowanie {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pods-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 160px;
  flex: 1;
}

.pods-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 4px;
}

.pods-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a2e;
}

.pods-detail {
  font-size: 0.75rem;
  color: #999;
  margin-top: 2px;
}

/* Table wrapper */
.rozliczenie-table-wrapper {
  overflow-x: auto;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  margin-bottom: 16px;
}

/* Table */
.rozliczenie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
}

.rozliczenie-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Nagłówki grup */
.thead-grupy th {
  background: #1a1a2e;
  color: #fff;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.thead-grupy th:not(.grupa-header) {
  background: #232345;
}

/* Nagłówki kolumn */
.thead-kolumny th {
  background: #f5f5fa;
  padding: 8px 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.72rem;
  border-bottom: 2px solid #ddd;
  border-right: 1px solid #e8e8e8;
  color: #444;
}

/* Komórki */
.rozliczenie-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #f0f0f0;
  border-right: 1px solid #f0f0f0;
  vertical-align: middle;
}

.cell-right {
  text-align: right;
}

/* Kolory ról */
.rola-zablokowane {
  background-color: #f9f9f9;
  color: #888;
}

.rola-auto {
  background-color: #e8f5e9;
}

.rola-manager {
  background-color: #f5f5f5;
}

.rola-manager_biuro {
  background-color: #e3f2fd;
}

.rola-biuro {
  background-color: #fffde7;
}

/* Nagłówki kolumn - kolory ról */
th.rola-auto {
  background-color: #c8e6c9;
}

th.rola-manager {
  background-color: #eeeeee;
}

th.rola-manager_biuro {
  background-color: #bbdefb;
}

th.rola-biuro {
  background-color: #fff9c4;
}

/* Wiersze specjalne */
.row-weekend td {
  background-color: inherit;
  font-weight: 500;
}

.row-weekend td.rola-zablokowane {
  background-color: #f0f0f0;
}

.row-wolny td {
  opacity: 0.5;
}

.wartosc-ujemna {
  color: #d32f2f;
  font-weight: 600;
}

/* Wiersz sumy */
.row-sumy td {
  background: #f5f5fa !important;
  border-top: 2px solid #4a6cf7;
  font-weight: 600;
  padding: 8px 6px;
}

.cell-suma-label {
  text-align: left;
  font-size: 0.85rem;
}

.cell-suma {
  text-align: right;
}

/* Legenda */
.rozliczenie-legenda {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: #666;
  padding: 8px 0;
}

.legenda-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legenda-kolor {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid #ccc;
}

.legenda-kolor.rola-zablokowane { background: #f9f9f9; }
.legenda-kolor.rola-auto { background: #e8f5e9; }
.legenda-kolor.rola-manager { background: #f5f5f5; }
.legenda-kolor.rola-manager_biuro { background: #e3f2fd; }
.legenda-kolor.rola-biuro { background: #fffde7; }

/* Responsive */
@media (max-width: 900px) {
  .rozliczenie-header {
    flex-direction: column;
    gap: 4px;
  }

  .rozliczenie-podsumowanie {
    flex-direction: column;
  }

  .pods-card {
    min-width: auto;
  }

  .rozliczenie-tabs {
    gap: 3px;
  }

  .tab-btn {
    padding: 5px 8px;
    font-size: 0.72rem;
  }
}
