:root{
  /* Spotify-inspired paleta z czerwonym Orlenem */
  --black: #121212;          /* Spotify główne tło - głęboki czarny */
  --gray: #1a1a1a;           /* Spotify secondary - ciemny szary */
  --red: #ff0000;            /* Mocny jaskrawy czerwony jak Spotify green */
  --red-hover: #ff3333;      /* Czerwony hover - jaśniejszy */
  --red-light: #ff6666;      /* Czerwony jasny dla tekstu na ciemnym */
  --white: #ffffff;          /* Czysty biały dla tekstu */
  --gray-text: #b3b3b3;      /* Spotify szary tekst */
  --gray-light: #535353;     /* Spotify jaśniejszy szary */
  
  /* Kolory tła i tekstu */
  --bg: var(--black);
  --bg-secondary: var(--gray);
  --fg: var(--white);
  --fg-secondary: var(--gray-text);
  --muted: var(--red);
  --card: #1a1a1a;           /* Spotify card background */
  --card-hover: #2a2a2a;     /* Spotify card hover */
  --border: #2a2a2a;         /* Spotify border color */
  --border-light: #404040;   /* Jaśniejsza ramka */
  
  /* Pozostałe zmienne */
  --gap:.5rem; --radius:8px; --maxw:100%;
  --font: 'Circular', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* header i layout */
  --header-h: 80px; /* Zwiększona wysokość dla lepszych proporcji logo */
  --wrap-vmargin: 1rem;

  /* tabela */
  --cell-fs: 13px;
  --cell-pad-v: 3px;
  --cell-pad-h: 3px;
  --thead-h: 34px;
  --section-title-h: 24px;
  --row-border: 1px;
  --thead-borders: 2px;
  --card-pad: 12px;

  /* kolumny - usuwamy stałe szerokości dla skalowania */
  --emp-col-w: auto;
  --date-col-w: auto;
  --day-col-w: auto;
}

/* Globalne wyłączenie zaznaczania tekstu dla całej aplikacji */
* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Wyjątki - tylko pola input, textarea i edytowalne elementy mogą mieć zaznaczanie tekstu */
input[type="text"],
input[type="email"], 
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
[contenteditable="true"],
.slot[contenteditable="true"] {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  cursor: text;
  color: var(--white);
}

/* Domyślny kursor dla wszystkich elementów */
* {
  cursor: default;
  color: var(--white);
}

/* Elementy .muted w delikatnym czerwonym */
.muted {
  color: var(--fg-secondary) !important;
}

/* Spotify-style cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--card-pad);
  border: 1px solid var(--border);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: var(--card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

/* Kursor pointer dla przycisków i linków */
button, .btn, .nav-btn, a, [role="button"] {
  cursor: pointer;
  font-family: var(--font);
  font-weight: var(--font-weight-medium);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* Spotify-style buttons */
.btn {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 500px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 100px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* Mniejsze przyciski dla panelu funkcji */
.w100 {
  width: 100%;
  margin-bottom: 8px;
  font-size: 11px;
  height: 28px;
  min-width: auto;
  background: var(--bg-secondary) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 500px !important;
  text-transform: uppercase !important;
  font-weight: var(--font-weight-bold) !important;
  letter-spacing: 0.5px !important;
}

/* Przycisk wyloguj - taki sam rozmiar jak przyciski w panelu Funkcje */
.logout-area .btn {
  width: 100% !important;
  height: 70px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  background: var(--bg-secondary) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 500px !important;
  letter-spacing: 0.5px !important;
}

.btn:hover {
  background: var(--red-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(211, 47, 47, 0.4);
}

.btn:active {
  background: var(--red);
  /* Subtelny efekt aktywacji bez powiększania */
}

/* Hover effects dla przycisków funkcji i wyloguj */
.w100:hover,
.logout-area .btn:hover {
  background: rgba(211, 47, 47, 0.8) !important;
  border-color: var(--red) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3) !important;
}

.w100:active,
.logout-area .btn:active {
  background: var(--red) !important;
  transform: translateY(0) !important;
  box-shadow: 0 2px 6px rgba(211, 47, 47, 0.2) !important;
}

/* Style dla nagłówków paneli */
.left-panel h2,
.right-panel h2 {
  text-transform: uppercase !important;
  font-weight: var(--font-weight-bold) !important;
  letter-spacing: 0.8px !important;
  font-size: 1.1rem !important;
  color: var(--fg) !important;
  margin: 0 0 1rem 0 !important;
  padding: 0.5rem 0 !important;
  border-bottom: 2px solid var(--border) !important;
  text-align: center !important;
  background: transparent !important;
  border-radius: 0 !important;
  transition: border-bottom-color 0.3s ease !important;
}

/* Hover effect dla paneli - zmiana koloru linii */
.left-panel:hover h2,
.right-panel:hover h2 {
  border-bottom-color: var(--gray-light) !important;
}

/* Style dla podnagłówków w panelach */
.left-panel h3,
.right-panel h3 {
  text-transform: uppercase !important;
  font-weight: var(--font-weight-bold) !important;
  letter-spacing: 0.8px !important;
  font-size: 1rem !important;
  color: var(--fg) !important;
  margin: 0.8rem 0 0.5rem 0 !important;
  padding: 0.3rem 0 !important;
  border: none !important;
  text-align: center !important;
  background: transparent !important;
  position: relative !important;
}

/* Dodatkowe wyróżnienie dla nagłówków zmian */
.left-panel h3::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 25% !important;
  height: 2px !important;
  background: var(--red) !important;
  border-radius: 1px !important;
}

/* Drukowane litery dla list pracowników */
.left-panel ul li,
.left-panel p.muted {
  text-transform: uppercase !important;
  font-weight: var(--font-weight-medium) !important;
  letter-spacing: 0.3px !important;
}

/* Style dla list pracowników - wyśrodkowanie i usunięcie kropek */
.left-panel ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: center !important;
}

.left-panel ul li {
  text-align: center !important;
  margin: 0.2rem 0 !important;
  padding: 0 !important;
}

/* Style dla sekcji Dniówka i Nocka */
.left-panel .stack > div {
  margin-bottom: 1.5rem !important;
  text-align: center !important;
  padding: 0.5rem 0 !important;
  border-bottom: 1px solid var(--border) !important;
  transition: border-bottom-color 0.3s ease !important;
}

.left-panel .stack > div:last-of-type {
  border-bottom: none !important;
  margin-bottom: 1rem !important;
}

/* Hover effect dla linii oddzielających sekcje */
.left-panel:hover .stack > div {
  border-bottom-color: var(--gray-light) !important;
}

/* Style dla sekcji Wyloguj */
.left-panel .logout-area {
  margin-top: 2rem !important;
  padding-top: 1rem !important;
  border-top: 2px solid var(--border) !important;
  text-align: center !important;
  transition: border-top-color 0.3s ease !important;
}

/* Hover effect dla linii nad Wyloguj */
.left-panel:hover .logout-area {
  border-top-color: var(--gray-light) !important;
}

/* Upewnij się, że w lewym panelu nie ma przycisków akcji */
.left-panel .actions {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Style dla przycisków Zapisz i Anuluj w prawym panelu */
.right-panel .actions {
  margin-top: 0.5rem !important;
  padding-top: 0.5rem !important;
  border-top: 2px solid var(--border) !important;
  text-align: center !important;
  transition: border-top-color 0.3s ease !important;
  display: none !important;
  flex-direction: row !important;
  gap: 0.5rem !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: var(--card) !important;
  padding: 1rem !important;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1) !important;
  z-index: 10 !important;
}

.right-panel .actions.show {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.right-panel .actions .btn {
  width: 50% !important;
  height: 28px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 500px !important;
  font-weight: var(--font-weight-bold) !important;
  font-size: 11px !important;
  background: var(--red) !important;
  color: var(--white) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.right-panel .actions .btn:hover {
  background: var(--white) !important;
  color: var(--black) !important;
  transform: none !important;
}

/* Hover effect dla linii nad przyciskami akcji w prawym panelu */
.right-panel:hover .actions {
  border-top-color: var(--gray-light) !important;
}

/* ===== TRYB EDYCJI - CIEMNIEJSZY KOLOR I CZERWONE AKCENTY ===== */
body.edit-mode {
  /* filter: brightness(0.8) saturate(1.1); - Wyłączone dla lepszej wydajności */
}

body.edit-mode .main-panel {
  background: rgba(0, 0, 0, 0.1) !important;
  border: 2px solid var(--red) !important;
  /* box-shadow: 0 0 20px rgba(255, 0, 0, 0.3) !important; - Wyłączone dla lepszej wydajności */
}

body.edit-mode .table {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid var(--red) !important;
}

body.edit-mode .table th {
  background: rgba(255, 0, 0, 0.05) !important;
  color: var(--red) !important;
  font-weight: 700 !important;
}

body.edit-mode .table td {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(255, 0, 0, 0.1) !important;
}

body.edit-mode .table td.col-summary {
  background: var(--bg-secondary) !important;
}

body.edit-mode .slot {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(255, 0, 0, 0.2) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
}

body.edit-mode .slot:hover {
  background: rgba(255, 0, 0, 0.1) !important;
  border-color: var(--red) !important;
  /* transform: scale(1.05) !important; - Wyłączone dla lepszej wydajności */
  /* transition: background-color 0.15s ease, transform 0.15s ease !important; - Wyłączone dla lepszej wydajności */
}

body.edit-mode .slot.editing {
  background: var(--red) !important;
  color: var(--white) !important;
  /* animation: pulse-orange 1s infinite !important; - Wyłączone dla lepszej wydajności */
  border-color: var(--white) !important;
  transition: background-color 0.05s ease, color 0.05s ease !important;
}

body.edit-mode .slot.saved {
  background: var(--red) !important;
  color: var(--white) !important;
  /* animation: pulse-green 0.8s !important; - Wyłączone dla lepszej wydajności */
}

body.edit-mode .slot.deleted {
  background: var(--red) !important;
  color: var(--white) !important;
  /* animation: pulse-red 0.8s !important; - Wyłączone dla lepszej wydajności */
}

body.edit-mode .slot.selected {
  background: rgba(255, 0, 0, 0.1) !important;
  color: var(--white) !important;
  border-color: var(--red) !important;
}

/* ===== PODŚWIETLENIE DZISIEJSZEGO DNIA ===== */
/* Podświetlenie tylko napisów w kolumnach DATA i DZIEŃ */
.col-date.today, .col-day.today {
  color: var(--red) !important;
  font-weight: 700 !important;
}

/* Podświetlenie kolumny podsumowania w dzisiejszym dniu */
.col-summary.today {
  border: 0.5px solid var(--red) !important;
}

/* Podświetlenie liter D i N w dzisiejszym dniu */
.slot.today {
  position: relative !important;
}

/* D - żółty jak słońce - tylko czcionka */
.slot.today.dniowka {
  color: #FFD700 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 3px rgba(255, 215, 0, 0.4) !important;
}

/* N - niebieski jaskrawy - tylko czcionka */
.slot.today.nocka {
  color: #00BFFF !important;
  font-weight: 900 !important;
  text-shadow: 0 0 3px rgba(0, 191, 255, 0.4) !important;
}

/* Własne napisy - pomarańczowy */
.slot.today.custom-shift {
  color: #FF8C00 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 3px rgba(255, 140, 0, 0.4) !important;
}

/* ===== WYRÓŻNIENIE ZALOGOWANEJ OSOBY ===== */
/* Czerwone imię zalogowanej osoby w nagłówku */
th.col-emp.current-user,
th.col-emp.current-user .rot {
  color: var(--red) !important;
  font-weight: 700 !important;
}

/* Wszystkie komórki w kolumnie zalogowanej osoby - 5% jaśniejsze */
.slot.current-user {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* ===== KOLUMNA LICZNIKA ZMIAN (TYLKO DLA ADMINÓW) ===== */
.col-summary {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border) !important;
  text-align: center !important;
  vertical-align: middle !important;
  min-width: 0 !important; /* Pozwala na zmniejszenie */
  width: auto !important; /* Automatyczne skalowanie */
  max-width: none !important; /* Usuwamy ograniczenie szerokości */
  font-size: 12px !important;
  font-weight: 600 !important;
  position: sticky !important;
  right: 0 !important;
  z-index: 10 !important;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1) !important;
  white-space: normal !important; /* Pozwala na zawijanie tekstu */
  word-wrap: break-word !important; /* Zawijanie długich słów */
  word-break: break-word !important; /* Łamanie długich słów */
  box-sizing: border-box !important;
  overflow: visible !important; /* Cała zawartość widoczna */
  text-overflow: clip !important; /* Bez ellipsis */
}

.summary-item {
  margin: 2px 0 !important;
  padding: 2px 4px !important;
  border-radius: 3px !important;
  font-size: 11px !important;
  display: inline-block !important;
  width: 45% !important;
  text-align: center !important;
}

.dniowka-count {
  color: #FFD700 !important;
  background: rgba(255, 215, 0, 0.1) !important;
  font-weight: 700 !important;
  float: left !important;
  margin-right: 2px !important;
}

.nocka-count {
  color: #00BFFF !important;
  background: rgba(0, 191, 255, 0.1) !important;
  font-weight: 700 !important;
  float: right !important;
  margin-left: 2px !important;
}

/* W trybie edycji podświetl kolumnę podsumowania */
body.edit-mode .col-summary {
  border: 0.5px solid rgba(255, 0, 0, 0.3) !important;
}

/* Responsywność dla kolumny podsumowania */
@media (max-width: 1200px) {
  .col-summary {
    font-size: 11px !important;
  }
  
  .summary-item {
    font-size: 10px !important;
    padding: 1px 2px !important;
  }
}

html,body{margin:0;padding:0; overflow-x:hidden; overflow-y:auto}
body{
  background:var(--bg);color:var(--fg);font-family:var(--font);
  font-weight: var(--font-weight-normal);
  line-height:1.5;
  font-size: 14px;
}

/* Pozwól na scrollowanie na urządzeniach mobilnych */
@media (max-width: 900px) {
  html, body {
    overflow: auto;
  }
}

/* ===== HEADER - SPOTIFY STYLE ===== */

/* Podstawowe style headera w stylu Spotify */
.site-header {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border);
  /* backdrop-filter: blur(10px); - Wyłączone dla lepszej wydajności */
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

/* Kontener headera - grid 3-kolumnowy */
.header-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 0.5rem;
  gap: 0.5rem;
}

/* Lewa sekcja - logo i przycisk instalacji */
.header-left {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 1rem; /* Większy odstęp między logo a przyciskiem PWA */
}

/* Środkowa sekcja - nawigacja miesiąca */
.header-center {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Prawa sekcja - zegar */
.header-right {
  justify-self: center; /* Wycentrowany, bo ma tylko zegar */
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Logo */
.logo {
  max-height: 43px; /* 36px * 1.2 = 43px */
  height: auto;
  width: auto;
  display: block;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  margin: 12px 8px; /* Większy górny/dolny margines, mniejszy lewy/prawy */
}

/* Etykieta miesiąca - Spotify style */
.month-label {
  font-weight: var(--font-weight-bold);
  color: var(--white);
  font-size: 1.1rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Przyciski nawigacji - Spotify style */
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  color: var(--fg-secondary);
  text-decoration: none;
  background: transparent;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  font-size: 24px; /* Powiększone strzałki */
  font-weight: var(--font-weight-medium);
  min-width: 44px;
  min-height: 44px;
}

.nav-btn:hover {
  background: rgba(211, 47, 47, 0.1);
  color: var(--red);
  transform: scale(1.1);
  border-radius: 50%;
}

.nav-btn:active {
  background: var(--card);
  color: var(--red);
}

/* Zegar - Spotify style */
#clock {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.3px;
}

/* Przycisk PWA - Spotify style */
.pwa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  min-height: 36px;
}

.pwa-btn:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.pwa-btn:active {
  background: var(--red);
  transform: translateY(0);
}

.pwa-btn svg {
  flex-shrink: 0;
}

/* kontener na treść */
.wrap{
  max-width:var(--maxw);
  width:100%;
  margin: 0 auto; /* Usunięty margines pionowy - panele wyznaczają granice */
  padding: 0; /* Usuwamy padding - zawartość ma się mieścić w 100% ekranu */
}

/* ===== KOMPLETNY RESET - NOWY UKŁAD GRID ===== */

/* Usuwam wszystkie stare style i robię czysty grid */
.grid3, .grid3 > * {
  display: none !important;
}

/* Nowy układ pionowy - CZYSTY GRID */
.grid3-vertical {
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 100%; /* Zapewniamy, że nie przekracza szerokości ekranu */
  padding: 0; /* Usuwamy cały padding - tabela bezpośrednio pod headerem */
  box-sizing: border-box; /* Padding wliczony w szerokość */
  height: auto; /* Wysokość dostosowuje się do zawartości */
  overflow: visible; /* Cała zawartość widoczna */
}

/* Główny panel z grafikiem - RZĄD 1 */
.main-panel {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  /* Usuwamy background - tabela bezpośrednio na tle */
}

.main-panel .table-wrap {
  width: 100%;
  overflow: visible;
  position: relative;
}

/* Kontener dla dwóch paneli bocznych - RZĄD 2 */
.panels-container {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 100%; /* Zapewniamy, że nie przekracza szerokości ekranu */
  box-sizing: border-box; /* Padding wliczony w szerokość */
  height: auto; /* Wysokość dostosowuje się do zawartości */
  overflow: visible; /* Cała zawartość widoczna */
}

/* Lewy panel - RZĄD 2, KOLUMNA 1 */
.left-panel {
  grid-column: 1;
  width: 100%;
  max-width: 100%; /* Zapewniamy, że nie przekracza szerokości ekranu */
  min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--card-pad);
  min-height: 280px;
  height: auto; /* Wysokość dostosowuje się do zawartości */
  overflow: visible; /* Cała zawartość widoczna */
  box-sizing: border-box; /* Padding wliczony w szerokość */
}

/* Prawy panel - RZĄD 2, KOLUMNA 2 */
.right-panel {
  grid-column: 2;
  width: 100%;
  max-width: 100%; /* Zapewniamy, że nie przekracza szerokości ekranu */
  min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--card-pad);
  min-height: 280px;
  height: auto; /* Wysokość dostosowuje się do zawartości */
  overflow: visible; /* Cała zawartość widoczna */
  box-sizing: border-box; /* Padding wliczony w szerokość */
}

/* Style dla wewnętrznych elementów paneli */
.left-panel h2, .right-panel h2 {
  margin-bottom: 1rem;
  text-align: center;
}

.left-panel .stack, .right-panel .stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.left-panel h3 { 
  text-align: center;
  margin-bottom: 0.75rem;
}

.left-panel .muted { 
  text-align: center;
}

.right-panel .stack .btn {
  width: 100%;
  height: 70px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-width: 2px;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.85rem;
}



/* ===== RESPONSYWNOŚĆ DLA NOWEGO GRID ===== */

/* Responsywność - zachowujemy układ poziomy na wszystkich szerokościach */
@media (max-width: 900px) {
  .grid3-vertical {
    gap: 0.5rem;
    padding: 0; /* Usuwamy padding - tabela bezpośrednio pod headerem */
  }
  
  .main-panel {
    padding: 0; /* Usuwamy padding - tabela bezpośrednio na tle jak na 901px+ */
  }
  
  /* Zachowujemy układ poziomy - panele obok siebie */
  .panels-container {
    grid-template-columns: 1fr 1fr; /* Zawsze 2 kolumny obok siebie */
    gap: 0.5rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.75rem;
    min-height: 200px; /* Zmniejszona wysokość na węższych ekranach */
    min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
    height: auto; /* Wysokość dostosowuje się do zawartości */
    overflow: visible; /* Cała zawartość widoczna */
  }
}

/* Wąskie tablety - dodatkowe dostosowanie dla 730px */
@media (max-width: 730px) {
  .grid3-vertical {
    gap: 0.4rem;
    padding: 0; /* Usuwamy padding - tabela bezpośrednio pod headerem */
  }
  
  .main-panel {
    padding: 0; /* Usuwamy padding - tabela bezpośrednio na tle */
  }
  
  .panels-container {
    grid-template-columns: 1fr 1fr; /* Zachowujemy 2 kolumny */
    gap: 0.4rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.6rem;
    min-height: 180px; /* Jeszcze mniejsza wysokość */
    min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
    height: auto; /* Wysokość dostosowuje się do zawartości */
    overflow: visible; /* Cała zawartość widoczna */
  }
  
  /* Zmniejszamy czcionki w tabeli */
  .table {
    font-size: 10px !important;
    max-width: 100% !important; /* Zapewniamy, że nie przekracza szerokości ekranu */
  }
  
  .table .col-emp {
    font-size: 9px !important;
    padding: 2px 2px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table .col-date,
  .table .col-day {
    font-size: 9px !important;
    padding: 2px 2px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table th, .table td {
    font-size: 9px !important;
    padding: 2px 2px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
    white-space: normal !important; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word !important; /* Zawijanie długich słów */
    word-break: break-word !important; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 8px !important;
    line-height: 1.0 !important;
  }
  
  /* Zmniejszamy przyciski */
  .btn {
    padding: 0.5rem 0.7rem;
    font-size: 0.8rem;
    min-height: 40px;
  }
  
  .stack .btn {
    height: 55px;
    font-size: 0.75rem;
  }
  
  .actions .btn {
    height: 35px;
    font-size: 0.7rem;
  }
}

/* Bardzo wąskie tablety - dla 650px */
@media (max-width: 650px) {
  .grid3-vertical {
    gap: 0.3rem;
    padding: 0; /* Usuwamy padding - tabela bezpośrednio pod headerem */
  }
  
  .main-panel {
    padding: 0; /* Usuwamy padding - tabela bezpośrednio na tle */
  }
  
  .panels-container {
    grid-template-columns: 1fr 1fr; /* Zachowujemy 2 kolumny */
    gap: 0.3rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.5rem;
    min-height: 160px; /* Jeszcze mniejsza wysokość */
    min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
    height: auto; /* Wysokość dostosowuje się do zawartości */
    overflow: visible; /* Cała zawartość widoczna */
  }
  
  /* Jeszcze mniejsze czcionki */
  .table {
    font-size: 9px !important;
    max-width: 100% !important; /* Zapewniamy, że nie przekracza szerokości ekranu */
  }
  
  .table .col-emp {
    font-size: 8px !important;
    padding: 1px 1px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table .col-date,
  .table .col-day {
    font-size: 8px !important;
    padding: 1px 1px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table th, .table td {
    font-size: 8px !important;
    padding: 1px 1px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
    white-space: normal !important; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word !important; /* Zawijanie długich słów */
    word-break: break-word !important; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 7px !important;
    line-height: 0.9 !important;
  }
  
  /* Jeszcze mniejsze przyciski */
  .btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    min-height: 36px;
  }
  
  .stack .btn {
    height: 50px;
    font-size: 0.7rem;
  }
  
  .actions .btn {
    height: 32px;
    font-size: 0.65rem;
  }
}

/* Bardzo wąskie ekrany - dla 600px i mniejszych */
@media (max-width: 600px) {
  .grid3-vertical {
    gap: 0.2rem;
    padding: 0; /* Usuwamy padding - tabela bezpośrednio pod headerem */
  }
  
  .main-panel {
    padding: 0;
  }
  
  .panels-container {
    grid-template-columns: 1fr 1fr; /* Zachowujemy 2 kolumny */
    gap: 0.2rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.4rem;
    min-height: 140px;
    min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
    height: auto; /* Wysokość dostosowuje się do zawartości */
    overflow: visible; /* Cała zawartość widoczna */
  }
  
  /* Bardzo małe czcionki */
  .table {
    font-size: 8px !important;
    max-width: 100% !important; /* Zapewniamy, że nie przekracza szerokości ekranu */
  }
  
  .table .col-emp {
    font-size: 7px !important;
    padding: 0.5px 0.5px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table .col-date,
  .table .col-day {
    font-size: 7px !important;
    padding: 0.5px 0.5px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table th, .table td {
    font-size: 7px !important;
    padding: 0.5px 0.5px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
    white-space: normal !important; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word !important; /* Zawijanie długich słów */
    word-break: break-word !important; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 6px !important;
    line-height: 0.8 !important;
  }
  
  /* Bardzo małe przyciski */
  .btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    min-height: 32px;
  }
  
  .stack .btn {
    height: 45px;
    font-size: 0.65rem;
  }
  
  .actions .btn {
    height: 28px;
    font-size: 0.6rem;
  }
}

/* Ekstremalnie wąskie ekrany - dla 500px i mniejszych */
@media (max-width: 500px) {
  .grid3-vertical {
    gap: 0.1rem;
    padding: 0; /* Usuwamy padding - tabela bezpośrednio pod headerem */
  }
  
  .main-panel {
    padding: 0;
  }
  
  .panels-container {
    grid-template-columns: 1fr 1fr; /* Zachowujemy 2 kolumny */
    gap: 0.1rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.3rem;
    min-height: 120px;
    min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
    height: auto; /* Wysokość dostosowuje się do zawartości */
    overflow: visible; /* Cała zawartość widoczna */
  }
  
  /* Ekstremalnie małe czcionki */
  .table {
    font-size: 7px !important;
    max-width: 100% !important; /* Zapewniamy, że nie przekracza szerokości ekranu */
  }
  
  .table .col-emp {
    font-size: 6px !important;
    padding: 0.25px 0.25px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table .col-date,
  .table .col-day {
    font-size: 6px !important;
    padding: 0.25px 0.25px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table th, .table td {
    font-size: 6px !important;
    padding: 0.25px 0.25px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
    white-space: normal !important; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word !important; /* Zawijanie długich słów */
    word-break: break-word !important; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 5px !important;
    line-height: 0.7 !important;
  }
  
  /* Ekstremalnie małe przyciski */
  .btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.65rem;
    min-height: 28px;
  }
  
  .stack .btn {
    height: 40px;
    font-size: 0.6rem;
  }
  
  .actions .btn {
    height: 24px;
    font-size: 0.55rem;
  }
}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding: var(--card-pad);
  min-height:0;
}
.muted{color:var(--muted)}

ul{margin:.25rem 0 0 1rem;padding:0}
h2{margin:0 0 .25rem 0;font-size:1.05rem;line-height:1}
h2.center{text-align:center}
h3{margin:.25rem 0 .25rem 0;font-size:.95rem}

/* ===== STYLE DLA NOWEGO GRID ===== */

.logout-area {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding: 1rem;
  box-sizing: border-box;
}

/* Style dla przycisków w nowym układzie */
.stack .btn {
  width: 100% !important;
  height: 70px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-width: 2px !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
}

.actions .btn {
  width: 100% !important;
  height: 28px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  border-radius: 500px !important;
  text-transform: uppercase !important;
  font-weight: var(--font-weight-bold) !important;
  font-size: 11px !important;
  background: var(--red) !important;
  color: var(--white) !important;
  transition: background-color 0.15s ease, transform 0.15s ease !important;
}

.actions .btn:hover {
  background: var(--white) !important;
  color: var(--black) !important;
  transform: none !important;
}

.actions .btn:active {
  background: var(--red) !important;
  color: var(--white) !important;
}

/* ===== STYLE DLA TABELI W NOWYM GRID ===== */

/* Tabela w głównym panelu */
.main-panel .table-wrap {
  width: 100%;
  overflow: visible;
  position: relative;
}

/* Tabela w center-panel (dla kompatybilności) */
.center-panel .table-wrap {
  width: 100%;
  overflow: visible;
  position: relative;
}

.center-panel-no-title .table-wrap {
  width: 100%;
  overflow: visible;
  position: relative;
}

/* tabela – pionowe linie, 100% szer./wys. */
.table{
  width:100%;
  max-width: 100%; /* Zapewniamy, że nie przekracza szerokości ekranu */
  height:100%;
  table-layout:auto; /* Pozwala na skalowanie kolumn */
  border-collapse:separate;
  border-spacing:0;
}

/* Tabela w panelu bez karty */
.center-panel:not(.card) .table {
  border-radius: 0;
  overflow: hidden;
  max-width: 100%; /* Zapewniamy, że nie przekracza szerokości ekranu */
}
.table thead th{
  background: var(--bg-secondary);
  height: var(--thead-h);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--fg-secondary);
  font-weight: var(--font-weight-bold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table thead th:first-child{ border-left:1px solid var(--border) }

/* Nagłówki tabeli w panelu bez karty */
.center-panel:not(.card) .table thead th:first-child {
  border-top-left-radius: 0;
}

.center-panel:not(.card) .table thead th:last-child {
  border-top-right-radius: 0;
}

.table td{
  border-bottom:1px solid var(--border);
  border-right:1px solid var(--border);
}
.table td:first-child{ border-left:1px solid var(--border) }

/* Ostatni wiersz tabeli w panelu bez karty - zaokrąglone rogi na dole */
.center-panel:not(.card) .table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 0;
}

.center-panel:not(.card) .table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 0;
}

.table th,.table td{
  padding: var(--cell-pad-v) var(--cell-pad-h);
  font-size: var(--cell-fs);
  text-align:center;
  overflow:visible; /* Cała zawartość widoczna */
  text-overflow:clip; /* Bez ellipsis */
  white-space:normal; /* Pozwala na zawijanie tekstu */
  word-wrap: break-word; /* Zawijanie długich słów */
  word-break: break-word; /* Łamanie długich słów */
  background: var(--bg);
  min-width: 0; /* Pozwala na zmniejszenie */
  font-weight: var(--font-weight-medium);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  color: var(--fg);
}

/* Komórki tabeli w panelu bez karty */
.center-panel:not(.card) .table th,
.center-panel:not(.card) .table td {
  background: var(--bg);
  border-color: var(--border);
}

/* Spotify-style slots */
.slot {
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  border-radius: 4px;
  font-weight: var(--font-weight-medium);
  position: relative;
}

.slot:hover {
  background: var(--card-hover) !important;
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slot:active {
  background: var(--card) !important;
}

/* weekendy i święta */
.table tbody tr.off-day td,
.table tbody tr.off-day th{
  background: var(--gray);
  color: var(--white) !important;
  border: 1px solid var(--border);
}

/* Weekendy i święta w panelu bez karty */
.center-panel:not(.card) .table tbody tr.off-day td,
.center-panel:not(.card) .table tbody tr.off-day th {
  background: var(--gray);
  color: var(--white) !important;
  border: 1px solid var(--border);
}

/* WYSOKOŚĆ WIERSZY:
   bierzemy wysokość całej siatki i odejmujemy:
   - tytuł sekcji,
   - thead (plus jego 2 bordery),
   - górny i dolny padding karty,
   - sumę borderów wszystkich wierszy tbody (days * 1px),
   a resztę dzielimy przez liczbę dni. */
.table tbody tr{
  height: calc(
    (
      var(--grid-h)
      - var(--section-title-h)
      - var(--thead-h) - var(--thead-borders)
      - (2 * var(--card-pad))
      - (var(--row-border) * var(--days-count))
    ) / var(--days-count)
  );
}

/* WYSOKOŚĆ WIERSZY dla panelu bez tytułu */
.center-panel-no-title .table tbody tr{
  height: calc(
    (
      var(--grid-h)
      - var(--thead-h) - var(--thead-borders)
      - (2 * var(--card-pad))
      - (var(--row-border) * var(--days-count))
    ) / var(--days-count)
  );
}

/* WYSOKOŚĆ WIERSZY dla panelu bez karty - równa wysokość */
.center-panel:not(.card) .table tbody tr {
  height: calc(100% / var(--days-count));
}

/* WYSOKOŚĆ WIERSZY dla głównego panelu w układzie pionowym */
.main-panel .table tbody tr {
  height: calc(100% / var(--days-count));
}

/* WYSOKOŚĆ WIERSZY dla panelu bez tytułu w układzie pionowym */
.main-panel.center-panel-no-title .table tbody tr {
  height: calc(100% / var(--days-count));
}

/* szerokości kolumn – dostosowują się do ekranu */
.col-emp  { min-width: 0; width: auto; max-width: none; }
.col-date { min-width: 0; width: auto; max-width: none; }
.col-day  { min-width: 0; width: auto; max-width: none; }

/* Szerokości kolumn - automatyczne skalowanie */
.center-panel:not(.card) .table .col-emp,
.main-panel .table .col-emp {
  width: auto; /* Automatyczne skalowanie */
  min-width: 0; /* Pozwala na zmniejszenie */
  max-width: none; /* Usuwamy ograniczenie szerokości */
}

.center-panel:not(.card) .table .col-date,
.center-panel:not(.card) .table .col-day,
.main-panel .table .col-date,
.main-panel .table .col-day {
  width: auto; /* Automatyczne skalowanie */
  min-width: 0; /* Pozwala na zmniejszenie */
  max-width: none; /* Usuwamy ograniczenie szerokości */
}

/* nagłówki w poziomie */
.rot{
  display:inline-block;
  transform: none;
  transform-origin: initial;
  white-space: normal;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  word-wrap: break-word;
  max-width: 100%;
}

/* wyrównanie zawartości nagłówków kolumn pracowników */
.table thead th.col-emp{vertical-align: middle; padding-bottom: 0}

/* Dodatkowe style dla ukośnych nagłówków */
.table thead th.col-emp .rot {
  font-size: 11px; /* Jeszcze mniejsza czcionka dla ukośnych nagłówków */
  line-height: 1.0;
  padding: 0 2px; /* Dodatkowy padding */
  transform-origin: bottom left; /* Lepsze pozycjonowanie ukośnego tekstu */
}

/* ===== STYLE DLA KOLUMN Z IMIENIAMI PRACOWNIKÓW ===== */
/* Zapewnienie, że imiona są widoczne */
.table .col-emp {
  max-width: none; /* Usuwamy ograniczenie szerokości */
  overflow: visible; /* Cała zawartość widoczna */
  text-overflow: clip; /* Bez ellipsis */
  white-space: normal; /* Pozwala na zawijanie tekstu */
  word-break: break-word; /* Pozwala na łamanie długich słów */
  hyphens: auto; /* Automatyczne dzielenie wyrazów */
  min-width: 0; /* Pozwala na zmniejszenie */
}

/* Responsywne czcionki dla imion pracowników */
@media (max-width: 1024px) {
  .table .col-emp {
    font-size: 12px;
    min-width: 0; /* Pozwala na zmniejszenie */
    max-width: none; /* Usuwamy ograniczenie szerokości */
  }
}

@media (max-width: 900px) {
  .table .col-emp {
    font-size: 11px;
    min-width: 0; /* Pozwala na zmniejszenie */
    max-width: none; /* Usuwamy ograniczenie szerokości */
  }
}

@media (max-width: 768px) {
  .table .col-emp {
    font-size: 10px;
    padding: 2px 3px !important;
    min-width: 0; /* Pozwala na zmniejszenie */
    max-width: none; /* Usuwamy ograniczenie szerokości */
  }
}

@media (max-width: 480px) {
  .table .col-emp {
    font-size: 9px;
    padding: 1px 2px !important;
    min-width: 0; /* Pozwala na zmniejszenie */
    max-width: none; /* Usuwamy ograniczenie szerokości */
  }
}

@media (max-width: 360px) {
  .table .col-emp {
    font-size: 8px;
    padding: 1px !important;
    min-width: 0; /* Pozwala na zmniejszenie */
    max-width: none; /* Usuwamy ograniczenie szerokości */
  }
}

/* przyciski */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:.55rem .8rem;border-radius:10px;border:1px solid var(--border);
  background:var(--card);color:var(--white);cursor:pointer;transition:all 0.2s
}
.btn:hover{
  background: rgba(211, 47, 47, 0.8); 
  border-color: var(--red);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}
.btn:active{
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(211, 47, 47, 0.2);
}

/* ===== RESPONSIVE DESIGN ===== */

/* ===== HEADER RESPONSYWNOŚĆ ===== */

/* Duże ekrany - pełny header */
@media (min-width: 1200px) {
  .header-bar {
    padding: 0 1rem;
    gap: 1rem;
  }
  
  .logo {
    max-height: 48px; /* 40px * 1.2 = 48px */
    margin: 18px 12px; /* Większy górny/dolny margines, mniejszy lewy/prawy */
  }
  
  .pwa-btn {
    padding: 10px 18px;
    font-size: 13px;
    min-height: 40px;
  }
  
  .month-label {
    font-size: 1.1rem;
  }
  
  .nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem; /* Powiększone strzałki */
  }
  
  #clock {
    font-size: 0.9rem;
  }
}

/* Średnie ekrany - kompaktowy header */
@media (max-width: 1199px) and (min-width: 900px) {
  .header-bar {
    padding: 0 0.75rem;
    gap: 0.75rem;
  }
  
  .logo {
    max-height: 41px; /* 34px * 1.2 = 41px */
    margin: 15px 10px; /* Większy górny/dolny margines, mniejszy lewy/prawy */
  }
  
  .pwa-btn {
    padding: 8px 14px;
    font-size: 11px;
    min-height: 36px;
  }
  
  .month-label {
    font-size: 0.95rem;
  }
  
  .nav-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  
  #clock {
    font-size: 0.85rem;
  }
  
  .header-right {
    justify-self: center; /* Wycentrowany zegar */
  }
}

/* Wąskie tablety - stopniowe ukrywanie */
@media (max-width: 899px) and (min-width: 700px) {
  .header-bar {
    padding: 0 0.5rem;
    gap: 0.5rem;
  }
  
  .logo {
    max-height: 36px; /* 30px * 1.2 = 36px */
    margin: 12px 8px; /* Większy górny/dolny margines, mniejszy lewy/prawy */
  }
  
  .month-label {
    font-size: 0.9rem;
  }
  
  .nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem; /* Powiększone strzałki */
  }
  
  #clock {
    font-size: 0.8rem;
  }
  
  .header-right {
    justify-self: center; /* Wycentrowany zegar */
  }
}

/* Bardzo wąskie ekrany - ukryj prawą stronę */
@media (max-width: 699px) and (min-width: 600px) {
  .header-bar {
    grid-template-columns: 1fr auto 1fr; /* Wycentrowany środkowy panel */
    padding: 0 0.4rem;
    gap: 0.4rem;
  }
  
  .logo {
    max-height: 31px; /* 26px * 1.2 = 31px */
    margin: 9px 6px; /* Większy górny/dolny margines, mniejszy lewy/prawy */
  }
  
  .month-label {
    font-size: 0.85rem;
  }
  
  .nav-btn {
    width: 34px;
    height: 34px;
    font-size: 1.1rem; /* Powiększone strzałki */
  }
  
  #clock {
    font-size: 0.75rem;
  }
  
  .header-right {
    justify-self: center; /* Wycentrowany zegar */
  }
}

/* Telefony - kompaktowy header z wszystkimi elementami */
@media (max-width: 599px) {
  .site-header {
    height: 70px; /* Zwiększona wysokość dla lepszych proporcji logo */
  }
  
  .header-bar {
    grid-template-columns: 1fr auto 1fr; /* Wycentrowany środkowy panel */
    padding: 0 0.3rem;
    gap: 0.2rem;
  }
  
  .header-left {
    display: flex !important; /* Pokazujemy logo i przycisk */
    align-items: center;
    gap: 0.3rem;
    justify-self: start;
  }
  
  .header-right {
    display: flex !important; /* Pokazujemy datę */
    align-items: center;
    justify-self: center;
  }
  
  .header-center {
    justify-self: center;
    gap: 0.5rem;
  }
  
  .logo {
    max-height: 29px; /* 24px * 1.2 = 29px */
    margin: 9px 6px; /* Większy górny/dolny margines, mniejszy lewy/prawy */
  }
  
  .month-label {
    font-size: 0.9rem;
    font-weight: 600;
  }
  
  .nav-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem; /* Powiększone strzałki */
  }
  
  #clock {
    font-size: 0.7rem;
  }
}

/* Bardzo małe telefony */
@media (max-width: 480px) {
  .site-header {
    height: 65px; /* Zwiększona wysokość dla lepszych proporcji logo */
  }
  
  .header-bar {
    padding: 0 0.25rem;
    gap: 0.15rem;
  }
  
  .header-left {
    gap: 0.2rem;
  }
  
  .header-center {
    gap: 0.4rem;
  }
  
  .logo {
    max-height: 26px; /* 22px * 1.2 = 26px */
    margin: 8px 5px; /* Większy górny/dolny margines, mniejszy lewy/prawy */
  }
  
  .month-label {
    font-size: 0.85rem;
  }
  
  .nav-btn {
    width: 30px;
    height: 30px;
    font-size: 0.9rem; /* Powiększone strzałki */
  }
  
  #clock {
    font-size: 0.65rem;
  }
}

/* Bardzo małe ekrany */
@media (max-width: 360px) {
  .site-header {
    height: 60px; /* Zwiększona wysokość dla lepszych proporcji logo */
  }
  
  .header-bar {
    padding: 0 0.1rem;
    gap: 0.1rem;
  }
  
  .header-left {
    gap: 0.15rem;
  }
  
  .header-center {
    gap: 0.3rem;
  }
  
  .logo {
    max-height: 24px; /* 20px * 1.2 = 24px */
    margin: 6px 4px; /* Większy górny/dolny margines, mniejszy lewy/prawy */
  }
  
  .pwa-btn {
    padding: 6px 10px;
    font-size: 10px;
    min-height: 32px;
    gap: 4px;
  }
  
  .pwa-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .month-label {
    font-size: 0.8rem;
  }
  
  .nav-btn {
    width: 28px;
    height: 28px;
    font-size: 0.8rem; /* Powiększone strzałki */
  }
  
  #clock {
    font-size: 0.6rem;
  }
}

/* Orientacja landscape na telefonach */
@media (max-width: 768px) and (orientation: landscape) {
  .site-header {
    height: 60px; /* Zwiększona wysokość dla lepszych proporcji logo */
  }
  
  .header-bar {
    padding: 0 0.5rem;
  }
  
  .month-label {
    font-size: 0.9rem;
  }
  
  .nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem; /* Powiększone strzałki */
  }
}

/* Tablet - średnie ekrany */
@media (max-width: 1024px) {
  .grid3 {
    grid-template-columns: minmax(0, 15%) minmax(0, 70%) minmax(0, 15%);
    gap: 0.75rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .table th, .table td {
    font-size: 12px;
    padding: 2px 3px;
    min-width: 0; /* Pozwala na zmniejszenie */
    max-width: none; /* Usuwamy ograniczenie szerokości */
    white-space: normal; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word; /* Zawijanie długich słów */
    word-break: break-word; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 10px;
  }
}

/* Tablet - małe ekrany - zachowujemy układ poziomy */
@media (max-width: 900px) {
  /* Zachowujemy układ poziomy - tylko dostosowujemy rozmiary */
  .grid3-vertical {
    gap: 0.5rem;
  }
  
  .main-panel {
    padding: 0; /* Usuwamy padding - tabela bezpośrednio na tle */
  }
  
  .panels-container {
    grid-template-columns: 1fr 1fr; /* Zawsze 2 kolumny obok siebie */
    gap: 0.5rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.75rem;
    min-height: 200px;
    min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
    height: auto; /* Wysokość dostosowuje się do zawartości */
    overflow: visible; /* Cała zawartość widoczna */
  }
  
  /* Dostosowanie tabeli do węższych ekranów */
  .table {
    font-size: 11px !important;
    max-width: 100% !important; /* Zapewniamy, że nie przekracza szerokości ekranu */
  }
  
  .table .col-emp {
    font-size: 10px !important;
    padding: 2px 3px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table .col-date,
  .table .col-day {
    font-size: 10px !important;
    padding: 2px 3px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table th, .table td {
    padding: 2px 3px !important;
    font-size: 10px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
    white-space: normal !important; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word !important; /* Zawijanie długich słów */
    word-break: break-word !important; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 9px !important;
    line-height: 1.0 !important;
  }
}

/* Mobile - duże telefony - zachowujemy układ poziomy */
@media (max-width: 768px) {
  .wrap {
    padding: 0; /* Usuwamy padding - zawartość ma się mieścić w 100% ekranu */
    margin: 0 auto;
  }
  
  /* Zachowujemy układ poziomy - tylko dostosowujemy rozmiary */
  .grid3-vertical {
    gap: 0.4rem;
  }
  
  .main-panel {
    padding: 0; /* Usuwamy padding - tabela bezpośrednio na tle */
  }
  
  .panels-container {
    grid-template-columns: 1fr 1fr; /* Zawsze 2 kolumny obok siebie */
    gap: 0.4rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.5rem;
    min-height: 180px;
    min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
    height: auto; /* Wysokość dostosowuje się do zawartości */
    overflow: visible; /* Cała zawartość widoczna */
  }
  
  /* Dostosowanie tabeli do telefonów */
  .table {
    font-size: 10px !important;
    max-width: 100% !important; /* Zapewniamy, że nie przekracza szerokości ekranu */
  }
  
  .table .col-emp {
    font-size: 9px !important;
    padding: 2px 2px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table .col-date,
  .table .col-day {
    font-size: 9px !important;
    padding: 2px 2px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table th, .table td {
    font-size: 9px !important;
    padding: 2px 2px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
    white-space: normal !important; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word !important; /* Zawijanie długich słów */
    word-break: break-word !important; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 8px !important;
    line-height: 1.0 !important;
  }
  
  .btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    min-height: 44px;
  }
  
  .stack .btn {
    height: 60px;
    font-size: 0.8rem;
  }
  
  .actions .btn {
    height: 40px;
    font-size: 0.75rem;
  }
}

/* Mobile - małe telefony - zachowujemy układ poziomy */
@media (max-width: 480px) {
  .wrap {
    padding: 0; /* Usuwamy padding - zawartość ma się mieścić w 100% ekranu */
    margin: 0 auto;
  }
  
  /* Zachowujemy układ poziomy - tylko dostosowujemy rozmiary */
  .grid3-vertical {
    gap: 0.3rem;
  }
  
  .main-panel {
    padding: 0; /* Usuwamy padding - tabela bezpośrednio na tle */
  }
  
  .panels-container {
    grid-template-columns: 1fr 1fr; /* Zawsze 2 kolumny obok siebie */
    gap: 0.3rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.4rem;
    min-height: 160px;
    min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
    height: auto; /* Wysokość dostosowuje się do zawartości */
    overflow: visible; /* Cała zawartość widoczna */
  }
  
  /* Dostosowanie tabeli do małych telefonów */
  .table {
    font-size: 9px !important;
    max-width: 100% !important; /* Zapewniamy, że nie przekracza szerokości ekranu */
  }
  
  .table .col-emp {
    font-size: 8px !important;
    padding: 1px 1px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table .col-date,
  .table .col-day {
    font-size: 8px !important;
    padding: 1px 1px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table th, .table td {
    font-size: 8px !important;
    padding: 1px 1px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
    white-space: normal !important; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word !important; /* Zawijanie długich słów */
    word-break: break-word !important; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 7px !important;
    line-height: 0.9 !important;
  }
  
  .btn {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    border-radius: 8px;
    min-height: 44px;
  }
  
  .stack .btn {
    height: 55px;
    font-size: 0.75rem;
  }
  
  .actions .btn {
    height: 40px;
    font-size: 0.7rem;
  }
  
  h2 {
    font-size: 0.95rem;
  }
  
  h3 {
    font-size: 0.85rem;
  }
}

/* Mobile - bardzo małe telefony - zachowujemy układ poziomy */
@media (max-width: 360px) {
  .wrap {
    padding: 0; /* Usuwamy padding - zawartość ma się mieścić w 100% ekranu */
    margin: 0 auto;
  }
  
  /* Zachowujemy układ poziomy - tylko dostosowujemy rozmiary */
  .grid3-vertical {
    gap: 0.2rem;
  }
  
  .main-panel {
    padding: 0; /* Usuwamy padding - tabela bezpośrednio na tle */
  }
  
  .panels-container {
    grid-template-columns: 1fr 1fr; /* Zawsze 2 kolumny obok siebie */
    gap: 0.2rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.3rem;
    min-height: 140px;
    min-width: 0; /* Pozwala na zmniejszenie poniżej zawartości */
    height: auto; /* Wysokość dostosowuje się do zawartości */
    overflow: visible; /* Cała zawartość widoczna */
  }
  
  /* Dostosowanie tabeli do bardzo małych telefonów */
  .table {
    font-size: 8px !important;
    max-width: 100% !important; /* Zapewniamy, że nie przekracza szerokości ekranu */
  }
  
  .table .col-emp {
    font-size: 7px !important;
    padding: 0.5px 0.5px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table .col-date,
  .table .col-day {
    font-size: 7px !important;
    padding: 0.5px 0.5px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
  }
  
  .table th, .table td {
    font-size: 7px !important;
    padding: 0.5px 0.5px !important;
    min-width: 0 !important; /* Pozwala na zmniejszenie */
    max-width: none !important; /* Usuwamy ograniczenie szerokości */
    white-space: normal !important; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word !important; /* Zawijanie długich słów */
    word-break: break-word !important; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 6px !important;
    line-height: 0.8 !important;
  }
  
  .btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 6px;
    min-height: 44px;
  }
  
  .stack .btn {
    height: 50px;
    font-size: 0.7rem;
  }
  
  .actions .btn {
    height: 40px;
    font-size: 0.65rem;
  }
}

/* Landscape orientation dla telefonów */
@media (max-width: 768px) and (orientation: landscape) {
  .grid3 {
    grid-template-columns: minmax(0, 20%) minmax(0, 60%) minmax(0, 20%);
    gap: 0.5rem;
  }
  
  .wrap {
    margin: 0 auto; /* Usunięty margines pionowy */
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .btn, .nav-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .table .slot {
    min-height: 44px;
  }
  
  .nav-btn {
    width: 44px;
    height: 44px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .table th, .table td {
    border-width: 0.5px;
    min-width: 0; /* Pozwala na zmniejszenie */
    max-width: none; /* Usuwamy ograniczenie szerokości */
    white-space: normal; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word; /* Zawijanie długich słów */
    word-break: break-word; /* Łamanie długich słów */
  }
  
  .card {
    border-width: 0.5px;
  }
}

/* ===== JAVASCRIPT RESPONSIVE CLASSES ===== */

/* Klasa dla widoku mobilnego */
body.mobile-view .grid3 {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

body.mobile-view .card {
  padding: 0.75rem;
}

body.mobile-view .table-wrap {
  overflow-x: hidden; /* Usuwamy poziomy scroll */
  -webkit-overflow-scrolling: touch;
}

body.mobile-view .table {
  min-width: 0; /* Pozwala na skalowanie */
  width: 100%; /* Zajmuje całą dostępną szerokość */
  max-width: 100%; /* Zapewniamy, że nie przekracza szerokości ekranu */
}

/* JavaScript responsive classes - header handled by CSS media queries */

/* Klasa dla widoku tablet */
body.tablet-view .grid3 {
  grid-template-columns: minmax(0, 15%) minmax(0, 70%) minmax(0, 15%);
  gap: 0.75rem;
}

body.tablet-view .card {
  padding: 1rem;
}

/* Klasa dla orientacji landscape na mobile */
body.landscape-mode .grid3 {
  grid-template-columns: minmax(0, 20%) minmax(0, 60%) minmax(0, 20%);
  gap: 0.5rem;
}

/* Landscape mode - header handled by CSS media queries */

body.landscape-mode .wrap {
  margin: 0 auto; /* Usunięty margines pionowy */
}

/* Animacje dla responsywności */
.grid3, .card, .table-wrap {
  transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Touch-friendly improvements dla JavaScript */
body.mobile-view .btn,
body.mobile-view .nav-btn {
  min-height: 44px;
  min-width: 44px;
}

body.mobile-view .table .slot {
  min-height: 44px;
}

/* Dodatkowe style dla responsywności tabeli */
@media (max-width: 768px) {
  .table-wrap {
    position: relative;
  }
  
  /* Usunięte czerwone gówno "przesuń w prawo" */
}

/* Poprawki dla bardzo małych ekranów */
@media (max-width: 360px) {
  
  .table th, .table td {
    font-size: 8px;
    padding: 0.5px;
    min-width: 0; /* Pozwala na zmniejszenie */
    max-width: none; /* Usuwamy ograniczenie szerokości */
    white-space: normal; /* Pozwala na zawijanie tekstu */
    word-wrap: break-word; /* Zawijanie długich słów */
    word-break: break-word; /* Łamanie długich słów */
  }
  
  .rot {
    font-size: 6px;
    line-height: 0.8;
  }
}

/* Ukryj elementy na bardzo małych ekranach - handled by main header media queries */

/* --- slot editor (inline overlay) - Spotify style --- */
.slot-editor{
  position:absolute; z-index:10; background:var(--card); border:1px solid var(--border);
  border-radius:8px; padding:8px; width:100px; display:none;
  box-shadow:0 8px 32px rgba(0,0,0,.4);
  /* backdrop-filter: blur(10px); - Wyłączone dla lepszej wydajności */
}

/* Slot editor w panelu bez karty */
.center-panel:not(.card) .slot-editor {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.slot-editor .row{display:flex; gap:6px; margin-bottom:6px}
.slot-editor .row:last-child{margin-bottom:0}
.slot-editor .opt{flex:1; padding:.35rem 0; border-radius:500px; border:none; background:var(--bg-secondary); color:var(--white); cursor:pointer;transition:all 0.2s; font-weight:var(--font-weight-medium)}
.slot-editor .opt:hover{
  background: var(--red); 
  border-color: var(--red); 
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}
.slot-editor input{width:100%; padding:.3rem .4rem; border-radius:8px; border:1px solid var(--border); background:var(--bg); color:var(--white)}
.slot-editor.show{display:block !important}

/* Klasa .show dla wszystkich elementów */
.show {
  display: block !important;
}

.show.flex {
  display: flex !important;
}

.show.inline-flex {
  display: inline-flex !important;
}

/* Responsywność slot editor */
@media (max-width: 768px) {
  .slot-editor {
    width: 120px;
    padding: 8px;
  }
  
  .slot-editor .opt {
    padding: 0.5rem 0;
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .slot-editor input {
    padding: 0.5rem;
    font-size: 16px;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .slot-editor {
    width: 100px;
    padding: 6px;
  }
  
  .slot-editor .opt {
    padding: 0.4rem 0;
    font-size: 13px;
    min-height: 40px;
  }
  
  .slot-editor input {
    padding: 0.4rem;
    font-size: 16px;
    min-height: 40px;
  }
}
/* swap compose inline under table */
.swap-compose{display:none; margin-top:.5rem; gap:.5rem}
.swap-compose.show{display:flex}
.swap-compose input{flex:1; min-width:0; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--white); padding:.35rem .5rem}

/* Swap compose w panelu bez karty */
.center-panel:not(.card) .swap-compose {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  margin-left: var(--card-pad);
  margin-right: var(--card-pad);
  margin-bottom: var(--card-pad);
}

/* --- Login Screen Styles --- */
.signin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: var(--bg);
}

.signin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 100%;
  text-align: center;
}

.signin-logo {
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signin-logo img {
  max-width: 200px;
  height: auto;
  display: block;
}

.signin-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.signin-subtitle {
  color: var(--fg);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.google-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: var(--red);
  color: var(--white);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
  border: none;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.google-signin-btn:hover {
  background: rgba(211, 47, 47, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(211, 47, 47, 0.4);
}

.google-signin-btn svg {
  width: 20px;
  height: 20px;
  margin-right: 12px;
}

.error-message {
  background: rgba(211, 47, 47, 0.05);
  color: var(--red);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid rgba(211, 47, 47, 0.2);
}

.info-message {
  color: var(--fg);
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive dla strony logowania */
@media (max-width: 768px) {
  .signin-container {
    padding: 1rem;
  }
  
  .signin-card {
    padding: 2rem 1.5rem;
    max-width: 400px;
  }
  
  .signin-logo img {
    max-width: 180px;
  }
  
  .signin-title {
    font-size: 1.6rem;
  }
  
  .signin-subtitle {
    font-size: 0.9rem;
  }
  
  .google-signin-btn {
    padding: 14px 20px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .signin-container {
    padding: 0.75rem;
  }
  
  .signin-card {
    padding: 1.5rem 1rem;
    max-width: 350px;
  }
  
  .signin-logo img {
    max-width: 160px;
  }
  
  .signin-title {
    font-size: 1.4rem;
  }
  
  .signin-subtitle {
    font-size: 0.85rem;
  }
  
  .google-signin-btn {
    padding: 12px 18px;
    font-size: 14px;
  }
  
  .google-signin-btn svg {
    width: 18px;
    height: 18px;
    margin-right: 10px;
  }
}

@media (max-width: 360px) {
  .signin-card {
    padding: 1.25rem 0.75rem;
    max-width: 320px;
  }
  
  .signin-logo img {
    max-width: 140px;
  }
  
  .signin-title {
    font-size: 1.3rem;
  }
  
  .google-signin-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* --- Ukrycie kursora tekstowego w grafiku --- */
.table .slot:focus {
  outline: none;       /* Brak outline przy focus */
}

.table th:focus,
.table td:focus,
.table .rot:focus,
.table .col-date:focus,
.table .col-day:focus,
.table .col-emp:focus {
  outline: none;       /* Brak outline przy focus */
}

/* --- Ukrycie kursora tekstowego na całej stronie --- */
/* Przyciski i elementy interaktywne */
.btn:hover,
.nav-btn:hover {
  cursor: pointer;  /* Kursor pointer dla przycisków */
}

/* --- Klasa .hidden dla ukrywania elementów --- */
.hidden {
  display: none !important;
}

/* --- Klasa .show ma wyższy priorytet niż .hidden --- */
.hidden.show {
  display: block !important;
}

.hidden.show.flex {
  display: flex !important;
}

.hidden.show.inline-flex {
  display: inline-flex !important;
}

/* --- Style dla strony offline --- */
.offline-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: var(--bg);
  text-align: center;
}

.offline-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.offline-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.offline-message {
  color: var(--fg);
  margin-bottom: 2rem;
  font-size: 1rem;
  line-height: 1.5;
  max-width: 400px;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--red);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.retry-btn:hover {
  background: rgba(211, 47, 47, 0.8);
  transform: translateY(-1px);
}

/* Responsive dla strony offline */
@media (max-width: 480px) {
  .offline-container {
    padding: 1rem;
  }
  
  .offline-icon {
    font-size: 3rem;
  }
  
  .offline-title {
    font-size: 1.3rem;
  }
  
  .offline-message {
    font-size: 0.9rem;
  }
}

/* --- Animacje edycji grafiku --- */
/* Czerwone pulsowanie podczas edycji */
.slot.editing {
  /* animation: pulse-red 1.5s ease-in-out infinite; - Wyłączone dla lepszej wydajności */
  background: var(--red) !important;
  color: var(--white) !important;
  border: 2px solid var(--red) !important;
  transition: background-color 0.05s ease, color 0.05s ease !important;
}

@keyframes pulse-red {
  0% {
    background-color: rgba(255, 0, 0, 0.05);
  }
  50% {
    background-color: rgba(255, 0, 0, 0.1);
  }
  100% {
    background-color: rgba(255, 0, 0, 0.05);
  }
}

/* Białe mryganie po zapisaniu */
.slot.saved {
  /* animation: flash-white 0.8s ease-in-out; - Wyłączone dla lepszej wydajności */
  background: var(--green) !important;
  color: var(--white) !important;
  border: 2px solid var(--green) !important;
}

@keyframes flash-white {
  0% {
    background-color: rgba(255, 255, 255, 0.1);
  }
  50% {
    background-color: rgba(255, 255, 255, 0.3);
  }
  100% {
    background-color: transparent;
  }
}

/* Czerwone mryganie po usunięciu */
.slot.deleted {
  /* animation: flash-red 0.8s ease-in-out; - Wyłączone dla lepszej wydajności */
  background: var(--red) !important;
  color: var(--white) !important;
  border: 2px solid var(--red) !important;
}

@keyframes flash-red {
  0% {
    background-color: rgba(255, 0, 0, 0.1);
  }
  50% {
    background-color: rgba(255, 0, 0, 0.3);
  }
  100% {
    background-color: transparent;
  }
}

/* --- Styl dla zaznaczonych komórek w wielokrotnym wyborze --- */
.slot.selected {
  background-color: rgba(255, 0, 0, 0.05) !important;  /* Czerwone tło */
  border: 1px solid rgba(255, 0, 0, 0.3) !important;  /* Czerwona ramka */
}

.slot.selected.editing {
  background-color: rgba(255, 0, 0, 0.05) !important;  /* Czerwone tło dla edytowanych */
  border: 1px solid rgba(255, 0, 0, 0.3) !important;  /* Czerwona ramka */
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .login-card {
    padding: 2rem 1.5rem;
  }
  
  .login-title {
    font-size: 2rem;
  }
  
  .login-btn {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }
}


/* Modal system - 70% screen width */
.emp-editor{
  position: fixed; 
  inset: 0; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  z-index: 1000;
  /* backdrop-filter: blur(8px); - Wyłączone dla lepszej wydajności */
  will-change: transform, opacity;
  transform: translateZ(0); /* Wymusza hardware acceleration */
}
.emp-editor.show{
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.emp-editor::before{
  content: ""; 
  position: absolute; 
  inset: 0; 
  background: rgba(0, 0, 0, 0.7);
  /* backdrop-filter: blur(4px); - Wyłączone dla lepszej wydajności */
}
.emp-editor > *{position: relative; z-index: 1;}

/* Modal container - 70% of viewport */
.emp-editor .emp-container{
  position: relative; 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 16px; 
  padding: 2rem;
  width: 70vw;
  height: 70vh;
  max-width: none;
  min-width: none;
  max-height: none;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.2s ease-out;
  will-change: transform, opacity;
  transform: translateZ(0); /* Hardware acceleration */
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0) translateZ(0);
  }
}

/* Modal header */
.emp-editor .emp-head{
  font-weight: 700; 
  margin-bottom: 1.5rem; 
  text-align: center; 
  color: var(--white);
  font-size: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1rem;
}

/* Modal content areas */
.emp-editor .emp-list{
  display: flex; 
  flex-direction: column; 
  gap: 0.5rem; 
  max-height: 50vh; 
  overflow: auto; 
  background: var(--bg-secondary); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  padding: 1rem;
  margin-bottom: 1rem;
}

.emp-editor .emp-add{
  display: flex; 
  gap: 0.75rem; 
  margin-top: 1rem;
  flex-wrap: wrap;
}

.emp-editor .emp-add input, 
.emp-editor .emp-add select, 
.emp-editor .emp-add textarea{
  flex: 1; 
  min-width: 200px; 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  background: var(--bg); 
  color: var(--white); 
  padding: 0.75rem 1rem;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.emp-editor .emp-add input:focus, 
.emp-editor .emp-add select:focus, 
.emp-editor .emp-add textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

/* Close button - better positioned */
.emp-editor .emp-close{
  position: absolute; 
  top: 20px; 
  right: 20px; 
  background: rgba(0, 0, 0, 0.6); 
  border: none; 
  color: var(--white); 
  font-size: 20px; 
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 2;
}

.emp-editor .emp-close:hover {
  background: var(--red);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
}

/* Click outside to close */
.emp-editor::before {
  cursor: pointer;
}

/* Dodatkowe style dla emp-add */
.emp-editor .emp-add-right {
  justify-content: flex-end;
}

.swap-clear-btn {
  display: none;
}

.swap-clear-btn.show {
  display: inline-flex !important;
}

.emp-row{
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  gap:.5rem; 
  border:1px solid var(--border); 
  border-radius:8px; 
  padding:.35rem .5rem;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.emp-row:hover {
  background: var(--card-hover);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.emp-row .meta{color:var(--muted); font-size:.85em}

/* Responsywność modali */
@media (max-width: 1024px) {
  .emp-editor .emp-container {
    width: 80vw;
    height: 80vh;
  }
}

@media (max-width: 768px) {
  .emp-editor .emp-container {
    width: 90vw;
    height: 85vh;
    padding: 1.5rem;
  }
  
  .emp-editor .emp-head {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  
  .emp-editor .emp-add {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .emp-editor .emp-add input,
  .emp-editor .emp-add select,
  .emp-editor .emp-add textarea {
    min-width: 100%;
    padding: 0.75rem;
    font-size: 16px; /* Zapobiega zoom na iOS */
  }
  
  .emp-editor .emp-close {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .emp-editor .emp-container {
    width: 95vw;
    height: 90vh;
    padding: 1rem;
  }
  
  .emp-editor .emp-head {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
  }
  
  .emp-editor .emp-add input,
  .emp-editor .emp-add select,
  .emp-editor .emp-add textarea {
    padding: 0.6rem;
    font-size: 16px;
  }
  
  .emp-editor .emp-close {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

/* Style dla akcji pracowników */
.emp-actions{display:flex; gap:.25rem}
.btn-edit{
  background: var(--red); 
  border-color: var(--red); 
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-edit:hover{
  background: rgba(211, 47, 47, 0.8); 
  border-color: var(--red);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(211, 47, 47, 0.3);
}
.btn-edit:active{
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(211, 47, 47, 0.2);
}

/* Style dla formularza edycji */
.emp-edit-form{margin-top:.5rem}
.emp-edit-actions{display:flex; gap:.5rem; margin-top:.5rem; justify-content:center}

/* Status indicators for swap requests */
.status-approved{color:var(--white); font-weight:600}
.status-rejected{color:var(--red); font-weight:600}
.status-pending{color:var(--gray); font-weight:600}

/* Comment styling for swap requests */
.swap-comment{
  color: var(--muted);
  font-size: 0.9em;
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(156, 163, 175, 0.1);
  border-radius: 6px;
  border-left: 3px solid var(--muted);
}
.comment-label{
  margin-right: 0.25rem;
}

/* Compose form styling */
.compose-section{
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.compose-section h4{
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.compose-actions{
  margin-top: 1.5rem;
  text-align: center;
}
.btn-primary{
  background: var(--red);
  border-color: var(--red);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-primary:hover{
  background: rgba(211, 47, 47, 0.8);
  border-color: var(--red);
}
textarea{
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* Dodatkowe style dla pól select i textarea */
select option {
  background: #111;
  color: #fff;
}

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
  transform: scale(1.02);
}

/* Usuń domyślne strzałki w select na WebKit */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 32px;
}

/* Style dla list rozwijanych w formularzu */
.compose-section select {
  min-width: 0;
  flex: 1;
}

.compose-section select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsywność dla panelu bez karty */
@media (max-width: 900px) {
  .center-panel:not(.card) {
    padding: 0.75rem;
    border-radius: 8px;
  }
  
  .center-panel:not(.card) .table-wrap {
    border-radius: 6px;
  }
  
  .center-panel:not(.card) .swap-compose {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.4rem;
  }
}

@media (max-width: 768px) {
  .center-panel:not(.card) {
    padding: 0.5rem;
    border-radius: 6px;
  }
  
  .center-panel:not(.card) .table-wrap {
    border-radius: 4px;
  }
  
  .center-panel:not(.card) .swap-compose {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.3rem;
  }
}

@media (max-width: 480px) {
  .center-panel:not(.card) {
    padding: 0.4rem;
    border-radius: 4px;
  }
  
  .center-panel:not(.card) .table-wrap {
    border-radius: 3px;
  }
  
  .center-panel:not(.card) .swap-compose {
    margin-left: 0.4rem;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
    padding: 0.25rem;
  }
}
