:root {
  --brand: #0d6efd;
}

body {
  background: #f6f7f9;
  font-size: 0.95rem;
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.2px;
}

.card {
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #eef0f3;
  font-weight: 600;
}

table.table thead th {
  border-bottom: 2px solid #e5e7eb;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
}

.badge {
  font-weight: 500;
}

[x-cloak] { display: none !important; }

/* ============ TABELE — sticky header + hover ============ */
table.invoice-table thead.sticky-top th,
table thead.sticky-top th {
  background: #f8f9fa !important;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

table.table-hover tbody tr:hover {
  background-color: #f0f4f8 !important;
}

table.table tbody td.text-end,
table.table tbody th.text-end {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ============ STATUSY ============ */
.status-overdue {
  color: #dc3545;
  font-weight: 600;
}
.status-due-soon {
  color: #fd7e14;
  font-weight: 500;
}

/* ============ FORM — kompaktowy filtr ============ */
.card-body .form-label.small {
  margin-bottom: 0.15rem;
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 500;
}

/* ============ Sticky totals panel ============ */
.sticky-totals {
  position: sticky;
  top: 56px; /* pod navbar */
  z-index: 5;
}

/* ============ ZAKUPY — stała szerokość kolumn ============ */
.purchases-table {
  table-layout: fixed;
  width: 100%;
}
.purchases-table th, .purchases-table td {
  overflow: hidden;
  word-wrap: break-word;
  vertical-align: middle;
}

/* Nazwa pozycji — szeroka kolumna z 2-liniowym truncate */
.purchases-table .col-item-name { width: 22%; }
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-height: 2.4em;
  word-wrap: break-word;
}

/* Kwoty — stała szerokość, wyrównanie do prawej, monospace numeric */
.purchases-table .amount-col {
  width: 7.5%;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

/* Wąskie kolumny */
.purchases-table .col-date     { width: 7%; }
.purchases-table .col-inv-no   { width: 9%; }
.purchases-table .col-seller   { width: 12%; }
.purchases-table .col-building { width: 7%; }
.purchases-table .col-category { width: 8%; }
.purchases-table .col-qty      { width: 5%; text-align: right; }
.purchases-table .col-unit     { width: 4%; }
.purchases-table .col-vat-rate { width: 4%; }

/* Etap 28: resizable columns */
table.resizable-table { table-layout: auto; }
table.resizable-table th { position: relative; overflow: hidden; white-space: nowrap; }
table.resizable-table th .col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 6px;
  cursor: col-resize;
  user-select: none;
  background: transparent;
  border-right: 2px solid transparent;
}
table.resizable-table th .col-resizer:hover {
  border-right-color: #0d6efd;
}

/* Etap 45: kompaktowy navbar — mniej paddingu między linkami, by zmieścić
   wszystkie pozycje na 1366px bez zawijania. Wysokość navbara NIE zmieniona. */
.navbar.navbar-compact .navbar-nav .nav-link {
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}
.navbar.navbar-compact .navbar-brand {
  margin-right: 0.5rem;
  padding-left: 0;
}
/* Drobny "oddech" wokół ikon w pozycjach navbara — ikony nie nakładają się
   na tekst gdy padding jest zmniejszony. */
.navbar.navbar-compact .navbar-nav .nav-link i.bi {
  margin-right: 0.15rem;
}
