/* ==========================================================================
   CTT TASK TRACKER — ADVANCED CSS DESIGN SYSTEM (GLASSMORPHISM DARK EDITION)
   ========================================================================== */

/* SYSTEM PROJEKTOWY & ZMIENNE CSS (WERSJA JASNA - LIGHT GLASSMORPHISM) */
:root {
  /* Kolory tła i bazy (Light Theme) */
  --bg-deep: hsl(220, 35%, 93%);
  --bg-surface: hsl(220, 30%, 97%);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-bg-hover: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(99, 102, 241, 0.15);
  --glass-border-focus: rgba(124, 58, 237, 0.4);

  /* Kolory Akcentów (Vibrant Light accents) */
  --accent-primary: hsl(262, 80%, 52%);
  /* Fiolet */
  --accent-private: hsl(270, 70%, 55%);
  /* Purpura - Prywatny obszar */
  --accent-secondary: hsl(192, 85%, 40%);
  /* Błękit/Cyjan */
  --accent-success: hsl(142, 65%, 33%);
  /* Szmaragd (Zakończone) */
  --accent-warning: hsl(38, 92%, 40%);
  /* Bursztyn (Wstrzymane) */
  --accent-danger: hsl(350, 84%, 48%);
  /* Róż / Czerwień (Krytyczne) */
  --accent-info: hsl(217, 85%, 48%);
  /* Indygo */

  /* Kolory Statusów */
  --status-todo: hsl(45, 93%, 47%);
  /* Żółty */
  --status-in-progress: hsl(217, 85%, 52%);
  /* Niebieski */
  --status-on-hold: hsl(24, 95%, 53%);
  /* Pomarańczowy */
  --status-done: hsl(142, 70%, 45%);
  /* Zielony */
  --status-archived: hsl(220, 12%, 28%);
  /* Grafitowy / Czarny */


  /* Czcionki i kolory tekstu */
  --font-header: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-main: hsl(224, 56%, 16%);
  --text-muted: hsl(220, 16%, 36%);
  --text-dim: hsl(220, 12%, 52%);

  /* Cienie i zaokrąglenia */
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --shadow-glow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
  --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.85);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Dodatkowe zmienne dla ujednolicenia motywu jasnego */
  --glow-opacity: 0.25;
  --glow-opacity-minor: 0.15;
  --header-brand-gradient: linear-gradient(to right, var(--text-main) 40%, var(--accent-primary) 100%);
  --overlay-dark-bg: rgba(0, 0, 0, 0.04);
  --overlay-dark-bg-hover: rgba(0, 0, 0, 0.08);
  --overlay-light-bg: rgba(255, 255, 255, 0.4);
  --overlay-light-bg-hover: rgba(255, 255, 255, 0.6);
  --column-bg: rgba(255, 255, 255, 0.35);
  --column-bg-mobile: rgba(255, 255, 255, 0.2);
  --modal-backdrop: rgba(15, 23, 42, 0.25);
  --modal-header-bg: rgba(0, 0, 0, 0.02);
  --row-hover-bg: rgba(0, 0, 0, 0.015);
  --toggle-active-bg: rgba(255, 255, 255, 0.7);

  --project-badge-bg: rgba(255, 255, 255, 0.4);
  --project-badge-border: rgba(99, 102, 241, 0.1);

  --badge-low-bg: rgba(0, 0, 0, 0.04);
  --team-member-bg: rgba(255, 255, 255, 0.25);
  --stat-box-bg: rgba(255, 255, 255, 0.25);
  --progress-container-bg: rgba(0, 0, 0, 0.04);

  --calendar-picker-filter: none;

  --scrollbar-track: var(--bg-deep);
  --scrollbar-thumb: rgba(0, 0, 0, 0.08);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.15);

  --input-bg: rgba(255, 255, 255, 0.5);
  --input-bg-focus: rgba(255, 255, 255, 0.85);
}

/* SYSTEM PROJEKTOWY — DARK GLASSMORPHISM OVERRIDES */
body.dark-theme {
  /* Kolory tła i bazy (Dark Theme) */
  --bg-deep: hsl(222, 47%, 7%);
  --bg-surface: hsl(222, 35%, 12%);
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-bg-hover: rgba(30, 41, 59, 0.75);
  --glass-border: rgba(99, 102, 241, 0.22);
  --glass-border-focus: rgba(139, 92, 246, 0.5);

  /* Kolory Akcentów (Luminous accents for high contrast in dark mode) */
  --accent-primary: hsl(263, 90%, 65%);
  /* Jaśniejszy fiolet */
  --accent-private: hsl(270, 85%, 68%);
  /* Purpura - Prywatny obszar (Luminous) */
  --accent-secondary: hsl(192, 90%, 55%);
  /* Jaśniejszy cyjan */
  --accent-success: hsl(142, 75%, 45%);
  /* Szmaragd */
  --accent-warning: hsl(38, 95%, 55%);
  /* Bursztyn */
  --accent-danger: hsl(350, 90%, 60%);
  /* Róż / Czerwień */
  --accent-info: hsl(217, 90%, 60%);
  /* Indygo */

  /* Kolory Statusów */
  --status-todo: hsl(45, 93%, 55%);
  /* Żółty */
  --status-in-progress: hsl(217, 90%, 60%);
  /* Niebieski */
  --status-on-hold: hsl(24, 95%, 58%);
  /* Pomarańczowy */
  --status-done: hsl(142, 70%, 50%);
  /* Zielony */
  --status-archived: hsl(220, 15%, 45%);
  /* Grafitowy */

  /* Kolory tekstu */
  --text-main: hsl(210, 40%, 96%);
  --text-muted: hsl(215, 20%, 75%);
  --text-dim: hsl(217, 15%, 60%);

  /* Cienie i zaokrąglenia */
  --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.05);

  /* Dodatkowe zmienne zoptymalizowane pod kątem kontrastu w ciemności */
  --glow-opacity: 0.38;
  --glow-opacity-minor: 0.22;
  --header-brand-gradient: linear-gradient(to right, var(--text-main) 30%, var(--accent-primary) 100%);
  --overlay-dark-bg: rgba(255, 255, 255, 0.05);
  --overlay-dark-bg-hover: rgba(255, 255, 255, 0.09);
  --overlay-light-bg: rgba(15, 23, 42, 0.35);
  --overlay-light-bg-hover: rgba(15, 23, 42, 0.55);
  --column-bg: rgba(15, 23, 42, 0.45);
  --column-bg-mobile: rgba(15, 23, 42, 0.35);
  --modal-backdrop: rgba(2, 6, 23, 0.7);
  --modal-header-bg: rgba(255, 255, 255, 0.02);
  --row-hover-bg: rgba(255, 255, 255, 0.025);
  --toggle-active-bg: rgba(255, 255, 255, 0.12);

  --project-badge-bg: rgba(255, 255, 255, 0.06);
  --project-badge-border: rgba(99, 102, 241, 0.25);

  --badge-low-bg: rgba(255, 255, 255, 0.06);
  --team-member-bg: rgba(255, 255, 255, 0.07);
  --stat-box-bg: rgba(15, 23, 42, 0.4);
  --progress-container-bg: rgba(255, 255, 255, 0.08);

  --calendar-picker-filter: invert(0.9) hue-rotate(180deg);

  --scrollbar-thumb: rgba(255, 255, 255, 0.12);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.22);

  --input-bg: rgba(15, 23, 42, 0.45);
  --input-bg-focus: rgba(15, 23, 42, 0.65);
}

/* REGULACJA IKON W PRZYCISKU TOGGLE THEME */
body:not(.dark-theme) #btn-toggle-theme .icon-sun {
  display: none !important;
}

body.dark-theme #btn-toggle-theme .icon-moon {
  display: none !important;
}

/* RESET I USTAWIENIA BAZOWE */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  max-width: 100vw !important;
  overflow-x: hidden !important;
  width: 100% !important;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  padding-bottom: 2rem;
}

/* DYNAMICZNE ORBY W TLE (DYNAMIC GLOWS) */
.background-glows {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(140px);
  opacity: var(--glow-opacity);
}

.glow-1 {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  top: -10%;
  right: -10%;
  animation: floatGlow 15s infinite alternate ease-in-out;
}

.glow-2 {
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
  bottom: -5%;
  left: -5%;
  animation: floatGlow 18s infinite alternate-reverse ease-in-out;
}

.glow-3 {
  width: 35vw;
  height: 35vw;
  background: radial-gradient(circle, var(--accent-danger) 0%, transparent 70%);
  top: 40%;
  left: 30%;
  opacity: var(--glow-opacity-minor);
}

@keyframes floatGlow {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(5%, 8%) scale(1.1);
  }
}

/* INTERFEJS GLASSMORPHISM (SZKLANY PANEL) */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glow), var(--shadow-inset);
}

.glass-hover:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* UKŁAD APLIKACJI (CONTAINER) */
.app-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: calc(100vh - 2rem);
}

/* NAGŁÓWEK (HEADER) */
.app-header {
  position: relative;
  z-index: 10010;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1.5rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: nowrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}

.header-brand:hover {
  opacity: 0.92;
}

.header-brand:active {
  transform: scale(0.98);
}

.logo-container {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-light-bg);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-inset);
  transition: var(--transition-bounce);
}

.logo-container:hover {
  background: var(--overlay-light-bg-hover);
  transform: translateY(-1px);
}

.logo-img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

/* Przełączanie logo dla motywu jasnego i ciemnego */
.logo-dark {
  display: none !important;
}

body.dark-theme .logo-dark {
  display: block !important;
}

body.dark-theme .logo-light {
  display: none !important;
}

.header-brand h1 {
  font-family: var(--font-header);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--header-brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* KARTA SYNCHRONIZACJI MS 365 */
.sync-panel {
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: var(--transition-smooth);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  background-color: var(--text-dim);
}

.status-indicator.pulses {
  background-color: var(--accent-warning);
  box-shadow: 0 0 8px var(--accent-warning);
}

.status-indicator.synced {
  background-color: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
  animation: pulseGreen 2s infinite;
}

.status-indicator.local {
  background-color: var(--accent-info);
  box-shadow: 0 0 8px var(--accent-info);
}

@keyframes pulseGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.sync-details {
  display: flex;
  flex-direction: column;
}

.sync-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
}

.sync-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sync-actions {
  display: flex;
  gap: 0.5rem;
}

/* PRZYCISKI (BUTTONS) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-bounce);
  color: var(--text-main);
  background: transparent;
  outline: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, hsl(265, 80%, 55%) 100%);
  box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(147, 51, 234, 0.5);
  background: linear-gradient(135deg, hsl(265, 95%, 72%) 0%, var(--accent-primary) 100%);
  color: #ffffff !important;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-blue {
  background: linear-gradient(135deg, var(--accent-info) 0%, var(--accent-secondary) 100%);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
}

.btn-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, var(--accent-info) 0%, var(--accent-secondary) 100%);
  filter: brightness(1.1);
  color: #ffffff !important;
}

.btn-blue:active {
  transform: translateY(0);
}

.actions-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-icon-round {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  border-radius: var(--radius-full) !important;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-round svg {
  width: 20px !important;
  height: 20px !important;
}

.btn-secondary {
  background: var(--overlay-light-bg);
  border-color: var(--glass-border);
}

.btn-secondary:hover {
  background: var(--overlay-light-bg-hover);
  border-color: var(--glass-border-focus);
  transform: translateY(-1px);
}

.btn-tertiary {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn-tertiary:hover {
  background: var(--overlay-light-bg);
  color: var(--text-main);
}

.btn-danger-outline {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.05);
}

.btn-danger-outline:hover {
  background: var(--accent-danger);
  color: white;
  border-color: var(--accent-danger);
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-icon-only svg {
  width: 16px;
  height: 16px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-link:hover {
  color: var(--text-main);
  background: var(--overlay-light-bg);
}

/* WSKAŹNIKI DASHBOARDU (METRYKI/KPI) */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.kpi-card {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: var(--transition-smooth);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--glass-bg-hover);
}

.kpi-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--overlay-light-bg);
  border: 1px solid var(--glass-border);
}

.kpi-icon-wrapper svg {
  width: 18px;
  height: 18px;
}

/* Indywidualne kolory dla ikon KPI */
.val-all {
  color: var(--accent-info);
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

.val-progress {
  color: var(--accent-primary);
  background: rgba(147, 51, 234, 0.1);
  border-color: rgba(147, 51, 234, 0.2);
}

.val-done {
  color: var(--accent-success);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

.val-risk {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.val-overdue {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.kpi-data {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.kpi-value {
  font-family: var(--font-header);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.text-danger {
  color: var(--accent-danger) !important;
}

/* Pulsująca karta ryzyka */
.critical-pulse {
  position: relative;
}

.critical-pulse.active {
  border-color: rgba(239, 68, 68, 0.25);
  animation: borderAlertPulse 2.5s infinite;
}

@keyframes borderAlertPulse {
  0% {
    border-color: var(--glass-border);
  }

  50% {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
  }

  100% {
    border-color: var(--glass-border);
  }
}

/* Koło postępu SVG */
.progress-card {
  gap: 1rem;
}

.progress-ring-container {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring__circle {
  transition: stroke-dashoffset 0.6s ease;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-ring-percentage {
  position: absolute;
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

/* PASEK FILTRÓW I STEROWANIA */
.controls-bar {
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.controls-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.controls-top-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.controls-top-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex-grow: 1;
  justify-content: space-between;
}

.controls-bottom {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  border-top: 1px solid rgba(99, 102, 241, 0.08);
  padding-top: 1.2rem;
}

/* Wyszukiwarka */
.search-box {
  position: relative;
  min-width: 250px;
  flex-grow: 1;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-box input[type="text"] {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--overlay-dark-bg);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.search-box input[type="text"]:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.15);
  background: var(--overlay-dark-bg-hover);
}

/* Selecty w filtrach */
.filter-group {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  padding-left: 2.2rem !important;
}

.select-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.filter-group select {
  padding: 0.55rem 1.8rem 0.55rem 2.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--overlay-dark-bg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  appearance: none;
  min-width: 140px;
}

.filter-group select:focus,
.filter-group select:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.filter-group select option {
  background: var(--bg-surface);
  color: var(--text-main);
}

/* Jedna linia dla wyszukiwarki i wszystkich filtrów na pulpitach */
@media (min-width: 1024px) {
  .controls-bottom {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.8rem;
  }

  .search-box {
    max-width: 300px;
    min-width: 180px;
    flex-grow: 1;
    flex-shrink: 1;
  }

  .filter-group {
    flex-wrap: nowrap;
    flex-grow: 2;
    justify-content: flex-start;
    align-items: center;
    gap: 0.6rem;
  }

  .filter-group .select-wrapper {
    flex-grow: 1;
    flex-shrink: 1;
  }

  .filter-group select {
    min-width: 100px;
    width: 100%;
    padding: 0.55rem 1.4rem 0.55rem 1.8rem;
    font-size: 0.76rem;
  }
}

@media (min-width: 1366px) {
  .search-box {
    max-width: 360px;
  }

  .filter-group {
    gap: 0.8rem;
  }

  .filter-group select {
    min-width: 120px;
    padding: 0.55rem 1.6rem 0.55rem 2rem;
    font-size: 0.78rem;
  }
}

/* Przełącznik Widoków */
.view-toggle-group {
  display: flex;
  background: var(--overlay-dark-bg);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.btn-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.btn-toggle svg {
  width: 14px;
  height: 14px;
}

.btn-toggle.active {
  background: var(--toggle-active-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-inset);
}

.btn-toggle:hover:not(.active) {
  color: var(--text-main);
}

.hidden {
  display: none !important;
}

/* WIDOK TABLICY KANBAN */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.kanban-board>.kanban-column:nth-child(-n+3) {
  grid-column: span 2;
}

.kanban-board>.kanban-column:nth-child(n+4) {
  grid-column: span 3;
}

/* Grab handle cursor for headers */
.kanban-column .column-header {
  cursor: grab;
}

.kanban-column .column-header:active {
  cursor: grabbing;
}

/* Drag states */
.kanban-column.column-dragging {
  opacity: 0.45;
  border: 1px dashed var(--accent-primary) !important;
}

.kanban-column.column-drag-over-left {
  border-left: 2px solid var(--accent-primary) !important;
}

.kanban-column.column-drag-over-right {
  border-right: 2px solid var(--accent-primary) !important;
}

/* Disable transitions when dragging is active to improve performance in Safari */
body.dragging-active .kanban-column,
body.dragging-active .task-card,
body.dragging-active .task-card::before {
  transition: none !important;
}

@media (max-width: 1150px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }

  .kanban-board>.kanban-column {
    grid-column: auto !important;
  }
}

@media (max-width: 650px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }

  .kanban-board>.kanban-column {
    grid-column: auto !important;
  }
}

.kanban-column {
  background: var(--column-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 500px;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  transition: var(--transition-smooth);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.kanban-column.drag-over {
  background: rgba(147, 51, 234, 0.08);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.15);
}

/* Stylizacja scrollbara w kolumnie */
.kanban-column::-webkit-scrollbar {
  width: 4px;
}

.kanban-column::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}

.kanban-column::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: transparent;
  backdrop-filter: blur(10px);
  padding: 0.3rem 0;
  z-index: 5;
}

.column-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.column-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.col-todo {
  background-color: var(--status-todo);
  box-shadow: 0 0 6px var(--status-todo);
}

.col-in-progress {
  background-color: var(--status-in-progress);
  box-shadow: 0 0 6px var(--status-in-progress);
}

.col-on-hold {
  background-color: var(--status-on-hold);
  box-shadow: 0 0 6px var(--status-on-hold);
}

.col-done {
  background-color: var(--status-done);
  box-shadow: 0 0 6px var(--status-done);
}

.col-archived {
  background-color: var(--status-archived);
  box-shadow: 0 0 6px var(--status-archived);
}

.column-header h2 {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.task-count-badge {
  background: var(--overlay-light-bg);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 150px;
}

/* STYLE DLA ZWIJALNYCH KOLUMN KANBAN */
.kanban-column.collapsed {
  min-height: auto;
  max-height: fit-content;
}

.kanban-column.collapsed .column-cards {
  display: none !important;
}

.kanban-column .btn-toggle-column {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.kanban-column .btn-toggle-column:hover {
  background: var(--overlay-light-bg);
  color: var(--text-main);
}

.kanban-column .btn-toggle-column svg {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 16px;
  height: 16px;
}

/* KARTA ZADANIA (TASK CARD) */
.task-card {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-bounce);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Styl dla płynnego, sprzętowo akcelerowanego podglądu przeciągania w Safari */
.custom-drag-preview {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 100000 !important;
  pointer-events: none !important;
  /* Kliknięcia przechodzą przez podgląd do elementów pod spodem */
  opacity: 0.85 !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
  transform-origin: center center;
  transition: none !important;
  /* Całkowity brak animacji płynnych, pozycjonujemy natychmiast przez JS */
  will-change: transform;
}

/* Ukrycie domyślnej karty na tablicy w trakcie przeciągania */
.task-card.dragging {
  opacity: 0.35 !important;
  border: 2px dashed var(--accent-primary) !important;
  box-shadow: none !important;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: transparent;
  transition: var(--transition-smooth);
}

/* Nadawanie kolorów krawędzi karty na podstawie statusu ryzyka */
.task-card.risk-critical_risk::before {
  background: var(--accent-danger);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.task-card.risk-at_risk::before {
  background: var(--accent-warning);
}

.task-card.risk-on_track::before {
  background: var(--accent-success);
}

/* Karta z wyróżnieniem krytycznego ryzyka */
.task-card.risk-critical_risk {
  animation: cardPulseGlow 4s infinite ease-in-out;
}

@keyframes cardPulseGlow {
  0% {
    border-color: var(--glass-border);
  }

  50% {
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 4px 20px 0 rgba(239, 68, 68, 0.08);
  }

  100% {
    border-color: var(--glass-border);
  }
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.card-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

/* Kolory priorytetów (Przejście od jasnoniebieskiego do granatowego) */
.badge-prio-low {
  background: rgba(56, 189, 248, 0.12);
  color: hsl(199, 89%, 40%);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge-prio-medium,
.badge-prio-standard {
  background: rgba(14, 165, 233, 0.12);
  color: hsl(199, 89%, 33%);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-prio-high {
  background: rgba(37, 99, 235, 0.12);
  color: hsl(217, 85%, 38%);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-prio-critical {
  background: rgba(30, 58, 138, 0.15);
  color: hsl(224, 71%, 25%);
  border: 1px solid rgba(30, 58, 138, 0.3);
}

/* Kolory statusów ryzyka (Bezpieczne - zielony) */
.badge-risk-safe {
  background: rgba(16, 185, 129, 0.15);
  color: hsl(142, 70%, 30%);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-risk-monitored {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-risk-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Kolorowanie badge'y statusów w tabeli listy */
.badge-status-todo {
  background: rgba(234, 179, 8, 0.15) !important;
  color: hsl(45, 93%, 35%) !important;
  border: 1px solid rgba(234, 179, 8, 0.3) !important;
}

.badge-status-in_progress {
  background: rgba(37, 99, 235, 0.15) !important;
  color: hsl(217, 85%, 38%) !important;
  border: 1px solid rgba(37, 99, 235, 0.3) !important;
}

.badge-status-on_hold {
  background: rgba(249, 115, 22, 0.15) !important;
  color: hsl(24, 95%, 42%) !important;
  border: 1px solid rgba(249, 115, 22, 0.3) !important;
}

.badge-status-done {
  background: rgba(16, 185, 129, 0.15) !important;
  color: hsl(142, 70%, 30%) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.badge-status-archived {
  background: rgba(55, 65, 81, 0.15) !important;
  color: hsl(220, 10%, 30%) !important;
  border: 1px solid rgba(55, 65, 81, 0.3) !important;
}

.list-status-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding: 0.1rem 1.1rem 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.25rem center !important;
  background-size: 9px !important;
  min-width: 130px;
  width: 130px;
  height: 22px;
}

.list-status-select:hover {
  filter: brightness(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.list-status-select:focus {
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.3);
}

.list-status-select option {
  background: var(--bg-surface, #1a1a2e);
  color: var(--text-main, #e2e8f0);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  padding: 0.35rem 0.5rem;
}

/* Status-specific coloring for the select (reuses badge palette) */
select.badge-status-todo {
  background-color: rgba(234, 179, 8, 0.15) !important;
  color: hsl(45, 93%, 35%) !important;
  border: 1px solid rgba(234, 179, 8, 0.3) !important;
}

select.badge-status-in_progress {
  background-color: rgba(37, 99, 235, 0.15) !important;
  color: hsl(217, 85%, 38%) !important;
  border: 1px solid rgba(37, 99, 235, 0.3) !important;
}

select.badge-status-on_hold {
  background-color: rgba(249, 115, 22, 0.15) !important;
  color: hsl(24, 95%, 42%) !important;
  border: 1px solid rgba(249, 115, 22, 0.3) !important;
}

select.badge-status-done {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: hsl(142, 70%, 30%) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

select.badge-status-archived {
  background-color: rgba(55, 65, 81, 0.15) !important;
  color: hsl(220, 10%, 30%) !important;
  border: 1px solid rgba(55, 65, 81, 0.3) !important;
}

.list-prio-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding: 0.1rem 1.1rem 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.25rem center !important;
  background-size: 9px !important;
  min-width: 110px;
  width: 110px;
  height: 22px;
}

.list-prio-select:hover {
  filter: brightness(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.list-prio-select:focus {
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.3);
}

.list-prio-select option {
  background: var(--bg-surface, #1a1a2e);
  color: var(--text-main, #e2e8f0);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  padding: 0.35rem 0.5rem;
}

/* Kolorowanie dla selectów priorytetu */
select.badge-prio-low {
  background-color: rgba(56, 189, 248, 0.12) !important;
  color: hsl(199, 89%, 40%) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
}

select.badge-prio-medium,
select.badge-prio-standard {
  background-color: rgba(14, 165, 233, 0.12) !important;
  color: hsl(199, 89%, 33%) !important;
  border: 1px solid rgba(14, 165, 233, 0.2) !important;
}

select.badge-prio-high,
select.badge-prio-critical {
  background-color: rgba(37, 99, 235, 0.12) !important;
  color: hsl(217, 85%, 38%) !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
}

.list-risk-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  padding: 0.1rem 1.1rem 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.25rem center !important;
  background-size: 9px !important;
  min-width: 120px;
  width: 120px;
  height: 22px;
}

.list-risk-select:hover {
  filter: brightness(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.list-risk-select:focus {
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.3);
}

.list-risk-select option {
  background: var(--bg-surface, #1a1a2e);
  color: var(--text-main, #e2e8f0);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  padding: 0.35rem 0.5rem;
}

/* Kolorowanie dla selectów ryzyka */
select.badge-risk-safe {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: hsl(142, 70%, 30%) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

select.badge-risk-monitored {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: var(--accent-warning) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

select.badge-risk-danger {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: var(--accent-danger) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}


/* Blikająca kropka ryzyka */
.risk-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.risk-dot-critical_risk {
  background-color: var(--accent-danger);
  box-shadow: 0 0 6px var(--accent-danger);
  animation: blink 1.2s infinite;
}

.risk-dot-at_risk {
  background-color: var(--accent-warning);
  box-shadow: 0 0 6px var(--accent-warning);
}

@keyframes blink {
  0% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.3;
  }
}

.btn-card-menu {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-card-menu:hover {
  color: var(--text-main);
}

.btn-card-menu svg {
  width: 14px;
  height: 14px;
}

.task-card h3 {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  margin-top: 0.1rem;
}

.task-card p {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-project-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--project-badge-bg);
  border: 1px solid var(--project-badge-border);
  color: var(--accent-primary);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
  vertical-align: middle;
  transition: var(--transition-smooth);
}

.private-project-badge {
  background: hsla(38, 95%, 55%, 0.12) !important;
  border: 1px solid hsla(38, 95%, 55%, 0.3) !important;
  color: var(--accent-warning) !important;
}

.private-project-badge:hover {
  background: hsla(38, 95%, 55%, 0.2) !important;
  border-color: hsla(38, 95%, 55%, 0.45) !important;
}

.card-project-badge:hover {
  background: var(--overlay-light-bg-hover);
  border-color: var(--glass-border-focus);
}

.card-project-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--glass-border);
  padding-top: 0.4rem;
  margin-top: 0.1rem;
}

.card-due-date {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.card-due-date svg {
  width: 12px;
  height: 12px;
  color: var(--text-dim);
}

.card-due-date.overdue {
  color: var(--accent-danger);
}

.card-due-date.overdue svg {
  color: var(--accent-danger);
}

.card-due-date-inline {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.25rem;
  white-space: nowrap;
  display: inline-block;
}

.card-due-date-inline.overdue {
  color: var(--accent-danger);
  font-weight: 600;
}


/* Awatar */
.assignee-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Owalne awatary pigułkowe specyficzne dla widoku listy */
.assignee-avatar.oval-avatar {
  border-radius: 9999px !important;
  width: 32px !important;
  height: 18px !important;
  font-size: 0.65rem !important;
  line-height: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  padding: 0 4px !important;
  aspect-ratio: auto !important;
}

.project-group-header .assignee-avatar.oval-avatar {
  width: 36px !important;
  height: 20px !important;
  line-height: 20px !important;
  border-radius: 9999px !important;
}

/* Kolory awatarów */
.av-blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.av-purple {
  background: linear-gradient(135deg, #a855f7, #6b21a8);
}

.av-emerald {
  background: linear-gradient(135deg, #10b981, #047857);
}

.av-amber {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  color: black !important;
}

.av-rose {
  background: linear-gradient(135deg, #f43f5e, #be123c);
}

.av-indigo {
  background: linear-gradient(135deg, #6366f1, #3730a3);
}

/* Panel aktywnych użytkowników */
.active-users-panel {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  height: 42px;
}

.active-users-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  user-select: none;
  white-space: nowrap;
}

.pulse-green {
  width: 8px;
  height: 8px;
  background-color: var(--status-done);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulseGreenAnim 1.8s infinite;
}

@keyframes pulseGreenAnim {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.active-users-avatars {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.active-user-avatar-bubble {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffffff;
  margin-left: -6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
  cursor: pointer;
}

.active-user-avatar-bubble:first-child {
  margin-left: 0;
}

.active-user-avatar-bubble:hover {
  transform: translateY(-2px) scale(1.1);
  z-index: 10;
}

/* WIDOK LISTY COMPACT TABLE */
.list-board {
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  overflow: hidden;
}

.table-container {
  width: 100%;
  overflow-x: auto;
}

.tasks-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tasks-table th {
  padding: 0.5rem 0.65rem;
  font-family: var(--font-header);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--glass-border);
}

.tasks-table td {
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
}

.tasks-table tr:hover td {
  background: var(--row-hover-bg);
}

/* Szerokości kolumn w tabeli zadań */
.tasks-table th:nth-child(1),
.tasks-table td:nth-child(1) {
  min-width: 250px;
}

.tasks-table th:nth-child(2),
.tasks-table td:nth-child(2) {
  width: 160px;
  min-width: 160px;
}

.tasks-table th:nth-child(3),
.tasks-table td:nth-child(3) {
  width: 120px;
  min-width: 120px;
}

.tasks-table th:nth-child(4),
.tasks-table td:nth-child(4) {
  width: 130px;
  min-width: 130px;
}

.tasks-table th:nth-child(5),
.tasks-table td:nth-child(5) {
  width: 140px;
  min-width: 140px;
}

.tasks-table th:nth-child(6),
.tasks-table td:nth-child(6) {
  width: 115px;
  min-width: 115px;
}

.tasks-table th:nth-child(7),
.tasks-table td:nth-child(7) {
  width: 70px;
  min-width: 70px;
  text-align: right;
}

.tasks-table .task-title-cell {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-main);
}

.tasks-table .task-desc-cell {
  font-weight: normal;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 350px;
}

.tasks-table .member-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.member-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.text-right {
  text-align: right !important;
}

/* SORTOWANIE KOLUMN W TABELI */
.sortable-header,
.sortable-project-header {
  cursor: pointer;
  user-select: none;
  transition: var(--transition-smooth);
}

.sortable-header:hover,
.sortable-project-header:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main) !important;
}

.header-sort-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-indicator-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  opacity: 0.6;
  transition: var(--transition-smooth);
}

.sortable-header:hover .sort-indicator-icon,
.sortable-project-header:hover .sort-indicator-icon {
  opacity: 1;
  color: var(--accent-primary);
}

.sortable-header.sorted-active,
.sortable-project-header.sorted-active {
  color: var(--accent-primary) !important;
  border-bottom: 2px solid var(--accent-primary) !important;
}

.sortable-header.sorted-active .sort-indicator-icon,
.sortable-project-header.sorted-active .sort-indicator-icon {
  opacity: 1;
  color: var(--accent-primary) !important;
}

/* Dynamiczny pływający dropdown sortowania (Opaque) */
#sort-dropdown-menu {
  position: absolute;
  z-index: 10000;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  animation: fadeInDropdown 0.15s ease-out;
}

@keyframes fadeInDropdown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#sort-dropdown-menu button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 0.55rem 0.8rem;
  text-align: left;
  font-size: 0.82rem;
  font-family: var(--font-main);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  transition: var(--transition-smooth);
}

#sort-dropdown-menu button:hover {
  background: rgba(0, 0, 0, 0.05);
}

#sort-dropdown-menu button.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-primary);
  font-weight: 600;
}

#sort-dropdown-menu button .menu-icon-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

#sort-dropdown-menu button svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

#sort-dropdown-menu button.active svg {
  color: var(--accent-primary);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: var(--font-header);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: var(--text-main);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 350px;
}

.dialog-modal {
  margin: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: 0;
  max-width: 600px;
  width: 92%;
  max-height: 85vh;
  box-shadow: 0 20px 80px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  outline: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  /* Zapobieganie rozciąganiu pod pozycjonowaniem inset: 0 */
  height: -webkit-fit-content;
  height: -moz-fit-content;
  height: fit-content;
}

.dialog-modal[open] {
  /* Safari fix: Użycie block zamiast flex zapobiega ignorowaniu height: auto przez WebKit */
  display: block;
}

.dialog-modal::backdrop {
  background: var(--modal-backdrop);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.3s ease;
}

.modal-content {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
  width: 100%;
}

.modal-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--modal-header-bg);
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
}

.modal-header h2 {
  font-family: var(--font-header);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header h2 svg {
  color: var(--accent-primary);
  width: 20px;
  height: 20px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.btn-close-modal svg {
  width: 18px;
  height: 18px;
}

.modal-form {
  padding: 1rem 1.2rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}

/* Pola formularzy */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

label.required::after {
  content: ' *';
  color: var(--accent-danger);
}

input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  padding: 0.52rem 0.72rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: var(--transition-smooth);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.15);
  background: var(--input-bg-focus);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: var(--calendar-picker-filter);
  opacity: 0.65;
  transition: opacity var(--transition-smooth);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.input-helper {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.footer-actions-left:not(:has(> button:not(.hidden))) {
  display: none !important;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0;
  border-top: 1px solid var(--glass-border);
  padding: 0.8rem 1.2rem 1.2rem 1.2rem;
  flex-shrink: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--glass-bg, rgba(255, 255, 255, 0.7));
}

/* Ujednolicony styl przycisków w stopce (10% mniejsze, czcionka o 1pt mniejsza, identyczny kształt) */
.modal-footer .btn {
  font-size: 0.78rem !important;
  padding: 0.52rem 1.05rem !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.4 !important;
  border-width: 1px !important;
  border-style: solid !important;
  transition: all 0.2s ease !important;
}

/* Wariant: Primary (Zapisz zadanie) - Fioletowy */
.modal-footer .btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, hsl(265, 80%, 55%) 100%) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25) !important;
}

.modal-footer .btn-primary:hover {
  background: linear-gradient(135deg, hsl(260, 85%, 65%) 0%, hsl(265, 85%, 60%) 100%) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px) !important;
}

/* Wariant: Secondary i Tertiary (Zapisz jako szablon & Anuluj) - Tożsamy styl i jasnoszara kolorystyka outline */
.modal-footer .btn-secondary,
.modal-footer .btn-tertiary {
  background: var(--overlay-light-bg) !important;
  border-color: var(--glass-border) !important;
  color: var(--text-main) !important;
}

.modal-footer .btn-secondary:hover,
.modal-footer .btn-tertiary:hover {
  background: var(--overlay-light-bg-hover) !important;
  border-color: var(--glass-border-focus) !important;
  transform: translateY(-1px) !important;
}

/* Wariant: Danger (Usuń zadanie) - Czerwony outline/light fill */
.modal-footer .btn-danger-outline {
  background: rgba(239, 68, 68, 0.05) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: var(--accent-danger) !important;
}

.modal-footer .btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  transform: translateY(-1px) !important;
}

/* MODALE ZESPOŁU & PROJEKTÓW - ZASTĄPIONE PEŁNOEKRANOWYMI DASHBOARDAMI */

.team-list-section h3,
.team-add-section h3 {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.team-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.team-grid::-webkit-scrollbar {
  width: 4px;
}

.team-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
}

.team-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--team-member-bg);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.member-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.member-details {
  display: flex;
  flex-direction: column;
}

.member-title {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-main);
}

.member-role-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-remove-member {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-remove-member:hover {
  color: var(--accent-danger);
}

.btn-remove-member svg {
  width: 14px;
  height: 14px;
}

.btn-edit-member-item {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-edit-member-item:hover {
  color: var(--accent-primary);
}

.btn-edit-member-item svg {
  width: 14px;
  height: 14px;
}

.team-add-section {
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  align-self: start;
}

.add-member-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.full-width {
  width: 100% !important;
}

/* SEKCJA KOMENTARZY W ZADANIU */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.5rem;
  background: var(--overlay-dark-bg);
  padding: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.comments-list::-webkit-scrollbar {
  width: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
}

.comment-item {
  font-size: 0.75rem;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 0.5rem;
}

.comment-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}

.comment-author {
  font-weight: 600;
  color: var(--accent-secondary);
}

.comment-date {
  color: var(--text-dim);
  font-size: 0.68rem;
}

.comment-text {
  color: var(--text-main);
}

.add-comment-box {
  display: flex;
  gap: 0.5rem;
}

.add-comment-box input {
  flex-grow: 1;
}

/* STOPKA (FOOTER) */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  border-top: 1px solid var(--glass-border);
  margin-top: 2rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  gap: 1rem;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.separator {
  color: rgba(255, 255, 255, 0.05);
}

/* SYSTEM ANiMACJI DLA DYNAMICZNEGO RENDEROWANIA */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-card,
tr {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* RESPONSIVE SCROLLBARS FOR HTML */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
  border: 2px solid var(--scrollbar-track);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* ==========================================================================
   SEKCJA PROFILU PRACOWNIKA (ACTIVE EMPLOYEE PROFILE VIEW)
   ========================================================================== */
.active-profile-card {
  position: relative;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 0.5rem;
  overflow: hidden;
  animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Gradienty tła profilowego (glowing glow) na podstawie wybranego koloru */
.profile-card-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 300px;
  height: 300px;
  border-radius: var(--radius-full);
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  transition: var(--transition-smooth);
}

.av-glow-blue {
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
}

.av-glow-purple {
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
}

.av-glow-emerald {
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
}

.av-glow-amber {
  background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
}

.av-glow-rose {
  background: radial-gradient(circle, #f43f5e 0%, transparent 70%);
}

.av-glow-indigo {
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}

.profile-card-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
}

@media (max-width: 950px) {
  .profile-card-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
}

.profile-header-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 950px) {
  .profile-header-info {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

.profile-avatar {
  width: 80px;
  height: 80px;
  font-size: 2.2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), var(--shadow-inset);
  flex-shrink: 0;
}

.profile-meta-details {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.profile-meta-details h2 {
  font-family: var(--font-header);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.profile-role-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-secondary);
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.15);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

@media (max-width: 950px) {
  .profile-role-badge {
    align-self: center;
  }
}

.profile-contacts {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

@media (max-width: 950px) {
  .profile-contacts {
    justify-content: center;
  }
}

.profile-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-contact-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
}

.profile-contact-item a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.profile-contact-item a:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* Statystyki profilowe */
.profile-stats-grid {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

@media (max-width: 950px) {
  .profile-stats-grid {
    justify-content: center;
  }
}

.profile-stat-box {
  background: var(--stat-box-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  transition: var(--transition-bounce);
}

.profile-stat-box:hover {
  transform: translateY(-2px);
  background: var(--overlay-light-bg-hover);
  border-color: var(--glass-border-focus);
}

.profile-stat-val {
  font-family: var(--font-header);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.profile-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* Kolorystyka małych kafelków profilowych */
.profile-stat-box.box-todo {
  border-left: 2px solid var(--accent-info);
}

.profile-stat-box.box-progress {
  border-left: 2px solid var(--accent-primary);
}

.profile-stat-box.box-hold {
  border-left: 2px solid var(--accent-warning);
}

.profile-stat-box.box-done {
  border-left: 2px solid var(--accent-success);
}

/* Pasek postępu pracownika */
.profile-progress-box {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 200px;
  flex-grow: 1;
  max-width: 280px;
  margin-left: 0.5rem;
}

@media (max-width: 950px) {
  .profile-progress-box {
    max-width: 320px;
    margin-left: 0;
    width: 100%;
  }
}

.profile-progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--progress-container-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.profile-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-success) 100%);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.profile-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.profile-progress-text strong {
  color: var(--text-main);
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 950px) {
  .profile-actions {
    justify-content: center;
    width: 100%;
  }
}

/* Animacja dla przycisku Wyjdź */
#btn-exit-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-bounce);
  padding: 0.5rem 1rem;
}

#btn-exit-profile:hover {
  transform: translateY(-2px);
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-danger);
}

#btn-exit-profile:hover svg {
  transform: rotate(90deg);
  transition: transform 0.4s ease;
}

#btn-exit-profile svg {
  width: 14px;
  height: 14px;
  transition: transform 0.4s ease;
}

/* ==========================================================================
   SEKCJA DEDYKOWANA DLA URZĄDZEŃ MOBILNYCH (RWD MOBILE OVERRIDES)
   ========================================================================== */

/* Klasa ukrywająca na urządzeniach stacjonarnych */
.hidden-desktop {
  display: none !important;
}

/* Dostosowania dla tabletów i średnich ekranów (< 992px) */
@media (max-width: 992px) {
  .dashboard-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .progress-card {
    grid-column: span 2;
  }
}

/* Dostosowania dla mniejszych tabletów i dużych telefonów (< 768px) */
@media (max-width: 768px) {
  .app-container {
    padding: 1rem 1rem 0 1rem;
    gap: 1rem;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    text-align: center;
  }

  .header-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.8rem;
  }

  .header-brand {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .header-brand h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  .sync-panel {
    width: 100%;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    gap: 1rem;
  }

  .sync-status {
    gap: 0.6rem;
    text-align: left;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.8rem;
    gap: 0.8rem;
  }

  .controls-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.8rem;
  }

  .controls-top-left {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .controls-top-right {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
  }

  .controls-top-right .view-toggle-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.4rem !important;
    padding: 0.25rem !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-md) !important;
    height: 44px !important;
    justify-content: flex-start !important;
  }

  .controls-top-right .view-toggle-group::-webkit-scrollbar {
    display: none !important;
  }

  .controls-top-right .view-toggle-group .btn-toggle {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-size: 0.78rem !important;
    padding: 0.45rem 0.9rem !important;
    justify-content: center !important;
  }

  .actions-group {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
  }

  .actions-group .btn:not(.btn-icon-round) {
    flex: 1;
    height: 42px;
  }

  .controls-bottom {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.8rem;
    border-top: 1px solid rgba(99, 102, 241, 0.08);
    padding-top: 1rem;
  }

  .search-box {
    max-width: none;
    width: 100%;
  }

  .search-box input[type="text"] {
    padding: 0.75rem 1rem 0.75rem 2.4rem;
    /* większy padding dla wygody dotykowej */
    font-size: 0.9rem;
  }

  .filter-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    width: 100%;
  }

  .filter-group .select-wrapper {
    width: 100%;
  }

  .filter-group select {
    width: 100%;
    padding: 0.75rem 1.8rem 0.75rem 2.2rem;
    /* wygodniejsze selecty */
    font-size: 0.85rem;
    height: 42px;
  }

  /* Przycisk resetu zajmuje całą szerokość poniżej */
  #btn-reset-filters {
    grid-column: span 2;
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
  }

  .view-toggle-group {
    grid-column: span 2;
    justify-content: center;
    height: 40px;
  }

  .view-toggle-group .btn-toggle {
    flex: 1;
    justify-content: center;
    padding: 0.5rem;
  }

  .actions-group .btn:not(.btn-icon-round) {
    height: 42px;
    font-size: 0.9rem;
  }

  /* Stopka w układzie pionowym */
  .app-footer {
    flex-direction: column;
    text-align: center;
    gap: 1.2rem;
    padding: 1.5rem 0;
  }

  .footer-meta {
    justify-content: center;
    gap: 0.8rem;
  }
}

/* Optymalizacja dla małych smartfonów (< 650px) - Mobilny Kanban */
@media (max-width: 650px) {
  .hidden-desktop {
    display: flex !important;
  }

  /* Szklany panel nawigacji zakładek na mobilnym Kanbanie */
  .kanban-mobile-tabs {
    display: flex;
    padding: 0.3rem;
    border-radius: var(--radius-md);
    gap: 0.3rem;
    margin-bottom: 0.2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    box-shadow: var(--shadow-glow), var(--shadow-inset);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .mobile-tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0.6rem 0.2rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    transition: var(--transition-bounce);
    gap: 0.2rem;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-tab-btn.active {
    background: var(--toggle-active-bg);
    color: var(--text-main);
    box-shadow: var(--shadow-inset);
    border: 1px solid rgba(255, 255, 255, 0.04);
  }

  .mobile-tab-indicator {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    display: inline-block;
  }

  .mobile-tab-badge {
    font-size: 0.65rem;
    background: var(--overlay-light-bg);
    padding: 0.05rem 0.35rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
  }

  .mobile-tab-btn.active .mobile-tab-badge {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
  }

  /* Logika ukrywania/pokazywania kolumn na mobilce */
  .kanban-board {
    grid-template-columns: 1fr !important;
    gap: 0;
  }

  .kanban-column {
    display: none !important;
    /* Ukryj wszystkie kolumny domyślnie na komórkach */
    min-height: 400px;
    max-height: none;
    overflow-y: visible;
    padding: 0.8rem;
    background: var(--column-bg-mobile);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  /* Pokaż tylko aktywną kolumnę */
  .kanban-column.active-mobile {
    display: flex !important;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .column-header {
    display: none !important;
    /* Ukryj stary nagłówek kolumny na mobilce, bo zakładki załatwiają sprawę */
  }

  /* Optymalizacja dialogów/modali na wąskich ekranach */
  .dialog-modal {
    width: 96%;
    max-height: 92vh;
    border-radius: var(--radius-md);
  }

  .modal-content {
    max-height: 92vh;
  }

  .modal-header {
    padding: 0.8rem 1rem;
  }

  .modal-form {
    padding: 0.8rem;
    gap: 0.8rem;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.8rem;
  }

  .form-group.full-width {
    grid-column: auto;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.6rem;
    padding: 0.6rem 1rem 1rem 1rem;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .footer-actions-left,
  .footer-actions-right {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.6rem !important;
    margin-right: 0 !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    height: 42px !important;
  }

  /* Podgląd profilu pracownika na telefonach */
  .profile-card-content {
    padding: 0.5rem;
    gap: 1.2rem;
  }

  .profile-avatar {
    width: 68px;
    height: 68px;
    font-size: 1.8rem;
  }

  .profile-meta-details h2 {
    font-size: 1.3rem;
  }

  .profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    width: 100%;
  }

  .profile-stat-box {
    min-width: 0;
    padding: 0.5rem 0.8rem;
  }

  .profile-stat-val {
    font-size: 1.2rem;
  }

  .profile-progress-box {
    grid-column: span 2;
    max-width: none;
    margin-top: 0.4rem;
  }

  #btn-exit-profile {
    width: 100%;
    justify-content: center;
    height: 40px;
  }
}

/* Wersja dla najmniejszych ekranów (< 480px) */
@media (max-width: 480px) {
  .logo-container {
    height: 42px;
    padding: 4px 8px;
  }

  .header-brand h1 {
    font-size: 1.4rem;
  }

  .subtitle {
    font-size: 0.72rem;
  }

  .sync-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .sync-status {
    justify-content: center;
  }

  .sync-actions .btn {
    flex-grow: 1;
  }

  /* Kompaktowe KPI (Grid 2x2 z mniejszym rozmiarem kafelków) */
  .dashboard-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .kpi-card {
    padding: 0.7rem;
    gap: 0.6rem;
    border-radius: var(--radius-md);
  }

  .kpi-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
  }

  .kpi-icon-wrapper svg {
    width: 16px;
    height: 16px;
  }

  .kpi-value {
    font-size: 1.25rem;
  }

  .kpi-label {
    font-size: 0.72rem;
  }

  .progress-card {
    padding: 0.7rem 1rem;
    gap: 0.8rem;
  }

  .progress-ring-container {
    width: 50px;
    height: 50px;
  }

  .progress-ring {
    width: 50px;
    height: 50px;
  }

  /* skalowanie koła SVG na mniejszy wymiar */
  .progress-ring circle {
    r: 20px;
    cx: 25px;
    cy: 25px;
    stroke-width: 4;
  }

  .progress-ring-percentage {
    font-size: 0.8rem;
  }

  .filter-group {
    grid-template-columns: 1fr;
  }

  .filter-group .select-wrapper:last-of-type {
    grid-column: auto;
  }

  #btn-reset-filters {
    grid-column: auto;
  }

  .controls-top-right {
    grid-template-columns: 1fr;
  }

  .view-toggle-group {
    grid-column: auto;
  }
}

/* ==========================================================================
   SYSTEM LOGOWANIA I KONTROLI DOSTĘPÓW (SANDBOX ADDITIONS)
   ========================================================================== */

.hidden {
  display: none !important;
}

/* Ekran Logowania */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

.login-box {
  max-width: 450px;
  width: 100%;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 85px rgba(15, 23, 42, 0.08);
  text-align: center;
  transform: translateY(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
}

.login-logo-container {
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.login-logo {
  max-height: 100%;
  object-fit: contain;
}

.login-box h2 {
  font-family: var(--font-header);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: left;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 0.8rem;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.input-with-icon input {
  padding-left: 2.3rem;
}

.input-with-icon input:focus+.input-icon {
  color: var(--accent-primary);
}

.login-error-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  padding: 0.8rem;
  border-radius: var(--radius-md);
  color: var(--accent-danger);
  font-size: 0.78rem;
  line-height: 1.3;
}

.login-error-banner svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Formularze logowania i aktywacji */
.login-form-section {
  margin-top: 1.5rem;
  text-align: left;
  animation: fadeInForm 0.3s ease;
}

@keyframes fadeInForm {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-form-section input:focus {
  border-color: var(--accent-primary) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 0 15px rgba(147, 51, 234, 0.15);
}

.login-switch-link {
  font-size: 0.82rem;
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.login-switch-link:hover {
  color: var(--accent-secondary) !important;
  text-decoration: underline;
  text-shadow: 0 0 10px rgba(147, 51, 234, 0.3);
}

.btn-block {
  width: 100%;
}

.quick-user-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.7rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-main);
  text-align: left;
}

.quick-user-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
  transform: translateX(2px);
}

.quick-user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.quick-user-info .assignee-avatar {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.quick-user-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.quick-user-role {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.quick-user-badge {
  font-size: 0.62rem;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.quick-user-badge.admin-badge {
  background: rgba(147, 51, 234, 0.06);
  color: var(--accent-primary);
  border: 1px solid rgba(147, 51, 234, 0.12);
}

/* Menu użytkownika w nagłówku */
.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  margin-right: 0.5rem;
}

.user-menu-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-menu-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-menu-info .assignee-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.user-menu-details {
  display: flex;
  flex-direction: column;
}

.user-menu-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.user-menu-role {
  font-size: 0.65rem;
  color: var(--accent-primary);
  font-weight: 500;
}

/* Baner Trybu Tylko do Odczytu */
.readonly-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  color: #b45309;
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.readonly-banner svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #d97706;
}

/* Baner Ukończenia Po Terminie */
.completed-overdue-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.15);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  color: #f97316;
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.completed-overdue-banner svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #f97316;
}


/* Obsługa wyłączonych pól w Light Glassmorphism */
input:disabled,
select:disabled,
textarea:disabled {
  background: rgba(0, 0, 0, 0.015) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
  opacity: 0.8;
}

/* Shake Animation for Login Error */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-6px);
  }

  40%,
  80% {
    transform: translateX(6px);
  }
}

.login-shake {
  animation: shake 0.4s ease-in-out;
}

@media (max-width: 768px) {
  .user-menu {
    border-radius: var(--radius-lg);
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    margin-right: 0;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
  }

  .user-menu-info {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .user-menu-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    width: 100%;
    margin-top: 0.2rem;
    box-sizing: border-box;
  }

  .user-menu-actions button.btn-secondary {
    width: 100% !important;
    justify-content: center !important;
    height: 38px !important;
    font-size: 0.78rem !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .user-menu-actions button#btn-logout {
    grid-column: span 2;
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.15) !important;
    color: var(--accent-danger) !important;
  }

  .user-menu-actions button#btn-logout:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
  }
}

/* Styl panelów synchronizacji wymagających autoryzacji (ostrzeżenie w premium light glassmorphism) */
.sync-panel.requires-auth {
  cursor: pointer;
  border-color: rgba(217, 119, 6, 0.35) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(245, 158, 11, 0.04) 100%) !important;
  box-shadow: 0 8px 32px 0 rgba(245, 158, 11, 0.06), var(--shadow-inset);
  transition: var(--transition-smooth);
}

.sync-panel.requires-auth:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(245, 158, 11, 0.08) 100%) !important;
  border-color: rgba(217, 119, 6, 0.55) !important;
  box-shadow: 0 12px 40px 0 rgba(245, 158, 11, 0.12), var(--shadow-inset);
  transform: translateY(-1px);
}

.sync-panel.requires-auth:active {
  transform: translateY(0);
}

/* FIREBASE INTEGRATION ADDITIONS */
#firebase-config-textarea {
  transition: var(--transition-smooth);
}

#firebase-config-textarea:focus {
  border-color: var(--accent-primary) !important;
  background: var(--input-bg-focus) !important;
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.2);
}

#login-password {
  transition: var(--transition-smooth);
}

#login-password:focus {
  border-color: var(--accent-primary) !important;
  background: var(--input-bg-focus) !important;
  box-shadow: 0 0 12px rgba(147, 51, 234, 0.2);
}

.input-helper {
  line-height: 1.35;
  margin-top: 0.2rem;
}

/* ==========================================================================
   HIGH CONTRAST THEME FOR VISUALLY IMPAIRED USERS (WCAG 2.1 AAA COMPLIANT)
   ========================================================================== */

body.high-contrast {
  /* High contrast colors override */
  --bg-deep: #000000 !important;
  --bg-surface: #000000 !important;
  --glass-bg: #000000 !important;
  --glass-bg-hover: #111111 !important;
  --glass-border: #ffffff !important;
  --glass-border-focus: #ffff00 !important;

  --accent-primary: #ffff00 !important;
  /* Bright Yellow */
  --accent-secondary: #00ffff !important;
  /* Bright Cyan */
  --accent-success: #00ff00 !important;
  /* Bright Green */
  --accent-warning: #ffaa00 !important;
  /* Bright Orange */
  --accent-danger: #ff3333 !important;
  /* Bright Red */
  --accent-info: #00ffff !important;
  /* Bright Cyan */

  --text-main: #ffffff !important;
  --text-muted: #ffffff !important;
  --text-dim: #ffff00 !important;

  --glow-opacity: 0 !important;
  --glow-opacity-minor: 0 !important;
  --header-brand-gradient: none !important;
  --overlay-dark-bg: rgba(0, 0, 0, 0.8) !important;
  --overlay-dark-bg-hover: rgba(17, 17, 17, 0.9) !important;
  --overlay-light-bg: #000000 !important;
  --overlay-light-bg-hover: #111111 !important;
  --column-bg: #000000 !important;
  --column-bg-mobile: #000000 !important;
  --modal-backdrop: rgba(0, 0, 0, 0.95) !important;
  --modal-header-bg: #111111 !important;
  --row-hover-bg: #111111 !important;
  --toggle-active-bg: #ffff00 !important;

  --project-badge-bg: #000000 !important;
  --project-badge-border: #ffffff !important;

  --badge-low-bg: #000000 !important;
  --team-member-bg: #000000 !important;
  --stat-box-bg: #000000 !important;
  --progress-container-bg: #111111 !important;
  --input-bg: #000000 !important;
  --input-bg-focus: #000000 !important;

  /* Overall baseline font-size scale up */
  font-size: 17px !important;
}

/* Disable transitions and animations in high contrast mode for user comfort */
body.high-contrast * {
  transition: none !important;
  animation: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Ensure strong borders on structural elements */
body.high-contrast header.app-header,
body.high-contrast .user-menu,
body.high-contrast .sync-panel,
body.high-contrast .kpi-card,
body.high-contrast .kanban-column,
body.high-contrast .task-card,
body.high-contrast .active-profile-card,
body.high-contrast .task-details-dialog,
body.high-contrast dialog,
body.high-contrast input,
body.high-contrast select,
body.high-contrast textarea,
body.high-contrast button {
  border: 2px solid #ffffff !important;
  border-radius: 4px !important;
  /* Standard rectangular elements are easier to perceive than round ones */
  background-color: #000000 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* Focus indicator override for keyboard navigation and screen interaction */
body.high-contrast :focus,
body.high-contrast :focus-visible,
body.high-contrast input:focus,
body.high-contrast select:focus,
body.high-contrast textarea:focus,
body.high-contrast button:focus {
  outline: 4px solid #ffff00 !important;
  outline-offset: 2px !important;
  border-color: #ffff00 !important;
  background-color: #000000 !important;
}

/* High contrast avatar styling */
body.high-contrast .assignee-avatar {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  border-radius: 4px !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}

body.high-contrast .assignee-avatar.active-avatar {
  border: 4px solid #ffff00 !important;
  background: #111111 !important;
}

/* Enhancing task text sizes and spacing */
body.high-contrast .task-title {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #ffff00 !important;
  /* High contrast yellow for main title */
  margin-bottom: 0.5rem !important;
}

body.high-contrast .task-desc {
  font-size: 1.05rem !important;
  line-height: 1.5 !important;
  color: #ffffff !important;
  margin-bottom: 0.5rem !important;
}

body.high-contrast .task-meta,
body.high-contrast .task-date,
body.high-contrast .task-comments-count {
  font-size: 0.95rem !important;
  color: #ffffff !important;
  font-weight: 500 !important;
}

body.high-contrast .task-project {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #00ffff !important;
  /* High contrast cyan for projects */
  border: 1px solid #00ffff !important;
  padding: 0.1rem 0.4rem !important;
  background: #000000 !important;
}

/* Status tags override */
body.high-contrast .priority-tag,
body.high-contrast .task-priority {
  border: 1px solid #ffffff !important;
  background: #000000 !important;
  color: #ffffff !important;
  font-size: 0.95rem !important;
  font-weight: bold !important;
  border-radius: 2px !important;
}

body.high-contrast .priority-tag.priority-krytyczny,
body.high-contrast .priority-tag.priority-wysoki,
body.high-contrast .task-card.priority-krytyczny,
body.high-contrast .task-card.priority-wysoki {
  border-color: #ff3333 !important;
  color: #ff3333 !important;
}

body.high-contrast .priority-tag.priority-średni {
  border-color: #ffaa00 !important;
  color: #ffaa00 !important;
}

body.high-contrast .priority-tag.priority-niski {
  border-color: #00ff00 !important;
  color: #00ff00 !important;
}

/* Custom button states */
body.high-contrast button:hover,
body.high-contrast .btn:hover {
  background-color: #111111 !important;
  border-color: #ffff00 !important;
  color: #ffff00 !important;
  text-decoration: underline !important;
}

body.high-contrast button:active,
body.high-contrast .btn:active {
  background-color: #ffff00 !important;
  color: #000000 !important;
}

/* Quick login avatars on welcome screen */
body.high-contrast .quick-login-user-card {
  border: 2px solid #ffffff !important;
  border-radius: 4px !important;
  background: #000000 !important;
  padding: 1rem !important;
}

body.high-contrast .quick-login-user-card:hover {
  border-color: #ffff00 !important;
  background: #111111 !important;
}

body.high-contrast .quick-login-user-name {
  font-size: 1.15rem !important;
  color: #ffffff !important;
  font-weight: bold !important;
}

body.high-contrast .quick-login-user-role {
  color: #ffff00 !important;
  font-size: 0.95rem !important;
}

/* Headings structure */
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4 {
  color: #ffff00 !important;
  font-weight: 800 !important;
}

/* Custom toggle buttons active states */
body.high-contrast #btn-toggle-accessibility.active-accessibility {
  background-color: #ffff00 !important;
  color: #000000 !important;
  border-color: #ffff00 !important;
}

/* Seeding / dialog notifications */
body.high-contrast .form-group label {
  color: #ffffff !important;
  font-size: 1.05rem !important;
  font-weight: bold !important;
}

body.high-contrast .input-helper {
  color: #ffff00 !important;
  font-size: 0.9rem !important;
}

/* Force body styling in high contrast */
body.high-contrast .badge-status-todo,
body.high-contrast .badge-status-in_progress,
body.high-contrast .badge-status-on_hold,
body.high-contrast .badge-status-done,
body.high-contrast .badge-status-archived {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

body.high-contrast {
  background-image: none !important;
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* Dostosowanie badge'y priorytetów i ryzyk w wysokim kontraście */
body.high-contrast .badge {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  font-weight: bold !important;
}

body.high-contrast .badge-prio-critical,
body.high-contrast .badge-risk-danger {
  border-color: #ff3333 !important;
  color: #ff3333 !important;
}

body.high-contrast .badge-prio-high,
body.high-contrast .badge-risk-monitored {
  border-color: #ffaa00 !important;
  color: #ffaa00 !important;
}

body.high-contrast .badge-prio-medium,
body.high-contrast .badge-prio-standard {
  border-color: #5555ff !important;
  color: #5555ff !important;
}

body.high-contrast .badge-prio-low,
body.high-contrast .badge-risk-safe {
  border-color: #00ff00 !important;
  color: #00ff00 !important;
}

/* High contrast overrides for sorting dropdown */
body.high-contrast #sort-dropdown-menu {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
  box-shadow: none !important;
}

body.high-contrast #sort-dropdown-menu button {
  color: #ffffff !important;
}

body.high-contrast #sort-dropdown-menu button:hover {
  background: #111111 !important;
  border: 1px solid #ffff00 !important;
  color: #ffff00 !important;
}

body.high-contrast #sort-dropdown-menu button.active {
  background: #000000 !important;
  border: 1px solid #00ff00 !important;
  color: #00ff00 !important;
}

body.high-contrast #sort-dropdown-menu button svg {
  color: #ffffff !important;
}

body.high-contrast #sort-dropdown-menu button:hover svg {
  color: #ffff00 !important;
}

body.high-contrast #sort-dropdown-menu button.active svg {
  color: #00ff00 !important;
}

/* --- SPERSONALIZOWANE WIDOKI DOMYŚLNE --- */
#btn-save-default-view,
#btn-load-default-view {
  transition: var(--transition-smooth);
}

#btn-save-default-view:hover {
  border-color: var(--accent-primary) !important;
  background: rgba(124, 58, 237, 0.08) !important;
  color: var(--accent-primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

#btn-load-default-view:hover {
  border-color: var(--accent-warning) !important;
  background: rgba(245, 158, 11, 0.08) !important;
  color: var(--accent-warning) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

/* Dostosowanie dla trybu wysokiego kontrastu (Accessibility Mode) */
body.high-contrast #btn-save-default-view:hover,
body.high-contrast #btn-load-default-view:hover {
  border: 2px solid #ffff00 !important;
  background: #000000 !important;
  color: #ffff00 !important;
  transform: none !important;
  box-shadow: none !important;
}


/* --- PRYWATNY OBSZAR ZADAŃ (PRIVATE BOARD) --- */

/* Przełącznik Obszarów */
#board-toggle-wrapper {
  transition: var(--transition-smooth);
}

/* Wyróżnienie kart prywatnych na tablicy Kanban */
.task-card.private-task {
  transition: var(--transition-bounce), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.task-card.private-task:hover {
  box-shadow: 0 8px 32px 0 rgba(147, 51, 234, 0.18), var(--shadow-inset) !important;
  border-color: var(--accent-private) !important;
}

/* Wyróżnienie wierszy prywatnych w widoku kompaktowym (liście) */
.tasks-table tr.private-task td:first-child {
  transition: border-left var(--transition-smooth);
}

.tasks-table tr.private-task:hover td {
  background: rgba(147, 51, 234, 0.04) !important;
}

body.dark-theme .tasks-table tr.private-task:hover td {
  background: rgba(168, 85, 247, 0.06) !important;
}

/* Szklany Checkbox/Przełącznik w Formularzu */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.2rem;
  transition: var(--transition-smooth);
}

.checkbox-container:hover {
  color: var(--text-main);
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.custom-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: var(--overlay-dark-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.custom-switch::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  top: 2px;
  left: 2px;
  transition: var(--transition-smooth);
}

.checkbox-container input:checked~.custom-switch {
  background: var(--accent-private);
  border-color: var(--accent-private);
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.35);
}

.checkbox-container input:checked~.custom-switch::after {
  transform: translateX(16px);
  background: #ffffff;
}

.checkbox-container:hover input:not(:checked)~.custom-switch::after {
  background: var(--text-muted);
}

/* Ograniczenia i ikona kłódki */
.private-lock-icon {
  animation: lockNudge 0.3s ease-in-out;
}

@keyframes lockNudge {
  0% {
    transform: scale(0.8);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

/* Usprawnienie responsywności kontrolera */
@media (max-width: 768px) {
  #board-toggle-wrapper {
    width: 100%;
    justify-content: space-around;
  }
}

/* Usprawnienia trybu wysokiego kontrastu (Accessibility Mode) */
body.high-contrast #board-toggle-wrapper {
  border: 2px solid #ffffff !important;
}

body.high-contrast .btn-toggle.active {
  background: #ffff00 !important;
  color: #000000 !important;
  border: 1px solid #ffff00 !important;
}

body.high-contrast .task-card.private-task {
  border: 2px solid #ffffff !important;
}

body.high-contrast .task-card.private-task .private-lock-icon {
  color: #ffff00 !important;
}

body.high-contrast .tasks-table tr.private-task td:first-child {}

body.high-contrast .tasks-table tr.private-task:hover td {
  background: #000000 !important;
}

body.high-contrast .custom-switch {
  border: 2px solid #ffffff !important;
  background: #000000 !important;
}

body.high-contrast .custom-switch::after {
  background: #ffffff !important;
}

body.high-contrast .checkbox-container input:checked~.custom-switch {
  background: #ffff00 !important;
  border-color: #ffff00 !important;
}

body.high-contrast .checkbox-container input:checked~.custom-switch::after {
  background: #000000 !important;
}

/* ==========================================================================
   SUBTASKS & CHECKLIST MODULE
   ========================================================================== */

/* Pasek postępu na karcie Kanban */
.card-subtasks-progress {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.card-subtasks-progress-bar-bg {
  flex-grow: 1;
  height: 4px;
  background: var(--overlay-light-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.card-subtasks-progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-subtasks-count {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 600;
  white-space: nowrap;
}

.card-subtasks-count svg {
  width: 10px;
  height: 10px;
}

/* Sekcja wewnątrz modalu zadania */
#task-subtasks-section {
  border-top: 1px solid var(--glass-border);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

#task-subtasks-section label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

#task-subtasks-section label svg {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
}

/* Pasek postępu w modale */
.subtasks-progress-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--overlay-light-bg);
  border: 1px solid var(--glass-border);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
}

.subtasks-progress-bar-bg {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.subtasks-progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subtasks-progress-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-primary);
  white-space: nowrap;
}

/* Lista podzadań */
.subtasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.subtask-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  transition: background 0.2s, border-color 0.2s;
}

.subtask-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Customowy checkbox dla podzadań */
.subtask-checkbox-wrapper {
  position: relative;
  display: flex !important;
  align-items: center !important;
  cursor: pointer;
  margin-bottom: 0 !important;
  user-select: none;
  font-weight: 400 !important;
  font-size: 0.8rem !important;
  flex-grow: 1;
}

.subtask-checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.subtask-custom-checkbox {
  position: relative;
  display: inline-block;
  height: 16px;
  width: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  transition: all 0.2s;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.subtask-checkbox-wrapper:hover input [type="checkbox"]~.subtask-custom-checkbox {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border-focus);
}

.subtask-checkbox-wrapper input[type="checkbox"]:checked~.subtask-custom-checkbox {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.subtask-custom-checkbox::after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.subtask-checkbox-wrapper input:checked~.subtask-custom-checkbox::after {
  display: block;
}

.subtask-text {
  color: var(--text-main);
  transition: opacity 0.3s, text-decoration 0.3s, color 0.3s;
}

.subtask-done .subtask-text {
  text-decoration: line-through;
  opacity: 0.5;
  color: var(--text-dim);
}

.btn-delete-subtask {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-delete-subtask:hover {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

.btn-delete-subtask svg {
  width: 12px;
  height: 12px;
}

/* Panel dodawania podzadania */
.add-subtask-box {
  display: flex;
  gap: 0.5rem;
}

.add-subtask-box input {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  color: var(--text-main);
  font-size: 0.78rem;
  transition: border-color 0.2s, background 0.2s;
}

.add-subtask-box input:focus {
  outline: none;
  border-color: var(--glass-border-focus);
  background: rgba(255, 255, 255, 0.08);
}

.add-subtask-box input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Accessibility / High Contrast enhancements */
body.high-contrast .subtask-custom-checkbox {
  border: 2px solid #ffffff !important;
}

body.high-contrast .subtask-checkbox-wrapper input[type="checkbox"]:checked~.subtask-custom-checkbox {
  background: #ffff00 !important;
  border-color: #ffff00 !important;
}

body.high-contrast .subtask-checkbox-wrapper input:checked~.subtask-custom-checkbox::after {
  border-color: #000000 !important;
}

body.high-contrast .subtask-item {
  border: 2px solid #ffffff !important;
}

body.high-contrast .subtasks-progress-bar-bg {
  border: 1px solid #ffffff !important;
}

body.high-contrast .subtasks-progress-bar-fill {
  background: #ffff00 !important;
}

body.high-contrast .subtasks-progress-text {
  color: #ffff00 !important;
}

body.high-contrast .card-subtasks-progress-bar-bg {
  border: 1px solid #ffffff !important;
}

body.high-contrast .card-subtasks-progress-bar-fill {
  background: #ffff00 !important;
}

body.high-contrast .btn-delete-subtask:hover {
  background: #ff0000 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   RAPORTY NA SPOTKANIA ZESPOŁU (MEETING MINUTES)
   ========================================================================== */
.report-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.report-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
}

.report-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

.report-table tbody tr {
  transition: background-color 0.2s ease;
}

.report-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.report-badge-status {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.report-badge-status.todo {
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.3);
}

.report-badge-status.in_progress {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.report-badge-status.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.report-badge-status.done {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.report-badge-risk {
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-block;
}

.report-badge-risk.high {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.report-badge-risk.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.report-badge-risk.low {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.report-badge-project {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-comment-box {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--accent-primary);
  padding: 0.4rem 0.6rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.report-comment-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.report-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.3rem;
}

.report-progress-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
}

/* Styl dla wyboru filtrów raportów - zapobieganie nakładaniu się ikon */
.report-filters-grid .select-wrapper select {
  width: 100%;
  padding: 0.55rem 1.8rem 0.55rem 2.2rem !important;
  /* Wystarczające lewe dopełnienie dla ikony */
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--glass-border) !important;
  background: var(--overlay-dark-bg) !important;
  color: var(--text-main) !important;
  font-family: var(--font-body) !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  outline: none !important;
  cursor: pointer !important;
  transition: var(--transition-smooth) !important;
  appearance: none !important;
  box-sizing: border-box !important;
}

.report-filters-grid .select-wrapper select:focus,
.report-filters-grid .select-wrapper select:hover {
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--text-main) !important;
}

.report-filters-grid select option {
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
}

/* Klasa dla elementów widocznych wyłącznie podczas drukowania */
.print-only {
  display: none !important;
}

/* @media print */
@media print {

  /* Ukryj całe standardowe UI trackera i tło podświetleń */
  body>*:not(#report-print-area) {
    display: none !important;
  }

  #report-print-area,
  .print-only {
    display: block !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: 'Inter', sans-serif !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Gwarancja doskonałej widoczności tekstu przy druku (zabezpieczenie przed ciemnymi motywami i Dark Readerem) */
  #report-print-area * {
    color: #334155 !important;
    background: transparent !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #report-print-area h1 {
    color: #4f46e5 !important;
  }

  #report-print-area h2 {
    color: #312e81 !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }

  #report-print-area table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  #report-print-area tr {
    border-bottom: 1px solid #cbd5e1 !important;
  }

  #report-print-area th {
    color: #0f172a !important;
    background-color: #f1f5f9 !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #94a3b8 !important;
  }

  #report-print-area td.task-title {
    color: #0f172a !important;
    font-weight: 600 !important;
  }

  #report-print-area td.task-lp {
    color: #64748b !important;
  }

  #report-print-area td.task-comment,
  #report-print-area td.task-comment * {
    color: #475569 !important;
  }

  #report-print-area .print-risk-critical {
    color: #dc2626 !important;
    font-weight: bold !important;
  }

  #report-print-area .print-risk-at-risk {
    color: #d97706 !important;
    font-weight: bold !important;
  }

  #report-print-area .print-risk-safe {
    color: #16a34a !important;
    font-weight: bold !important;
  }

  #report-print-area .print-overdue {
    color: #dc2626 !important;
    font-weight: bold !important;
  }
}

/* ==========================================================================
   WYKRES GANTTA (GANTT CHART VIEW ADDITIONS - v=29)
   ========================================================================== */

.gantt-board {
  padding: 1.5rem;
  margin-top: 1.5rem;
  overflow: hidden;
}

.gantt-container {
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-height: 400px;
}

/* Sidebar z listą zadań po lewej */
.gantt-sidebar {
  width: 320px;
  min-width: 320px;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  z-index: 10;
}

.gantt-sidebar-header {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 1.2rem;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  border-bottom: 2px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.1);
}

.gantt-sidebar-body {
  display: flex;
  flex-direction: column;
}

.gantt-sidebar-task {
  height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 1.2rem;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.2s;
  cursor: pointer;
}

.gantt-sidebar-task:hover {
  background: var(--glass-bg-hover);
}

.gantt-sidebar-project-header {
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 1.2rem;
  border-bottom: 1px solid var(--glass-border);
  box-sizing: border-box;
}

.gantt-project-header-row {
  height: 32px;
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--glass-border);
  box-sizing: border-box;
}

.gantt-sidebar-task-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.gantt-sidebar-task-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.05rem;
}

.gantt-sidebar-task-project {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-sidebar-task-assignee {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gantt-sidebar-task-progress {
  font-size: 0.62rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Oś czasu (Timeline) po prawej */
.gantt-timeline-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  position: relative;
  scrollbar-width: thin;
}

.gantt-timeline-wrapper:hover {
  z-index: 15;
}

.gantt-timeline-wrapper::-webkit-scrollbar {
  height: 8px;
}

.gantt-timeline-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.gantt-timeline-wrapper::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
}

.gantt-timeline-months {
  height: 32px;
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid var(--glass-border);
}

.gantt-month-header {
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-main);
  border-right: 1px solid var(--glass-border);
  height: 100%;
  white-space: nowrap;
  box-sizing: border-box;
}

.gantt-timeline-days {
  height: 38px;
  display: flex;
  background: rgba(0, 0, 0, 0.08);
  border-bottom: 2px solid var(--glass-border);
}

.gantt-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 45px;
  min-width: 45px;
  height: 100%;
  border-right: 1px solid var(--glass-border);
  box-sizing: border-box;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.gantt-day-num {
  font-weight: 700;
  color: var(--text-main);
}

.gantt-day-name {
  font-size: 0.6rem;
  opacity: 0.7;
}

/* Wyróżnienie weekendów w nagłówku */
.gantt-day-header.gantt-weekend-header {
  background: rgba(0, 0, 0, 0.12);
}

.gantt-timeline-body {
  display: flex;
  flex-direction: column;
}

.gantt-row {
  height: 38px;
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--glass-border);
  box-sizing: border-box;
}

.gantt-row:hover {
  background: rgba(255, 255, 255, 0.01);
  z-index: 50;
}

.gantt-day-gridline {
  width: 45px;
  min-width: 45px;
  height: 100%;
  border-right: 1px solid var(--glass-border);
  box-sizing: border-box;
  pointer-events: none;
}

/* Wiersze weekendowe w tle */
.gantt-day-gridline.gantt-weekend {
  background: rgba(0, 0, 0, 0.04);
}

body.dark-theme .gantt-day-gridline.gantt-weekend {
  background: rgba(0, 0, 0, 0.18);
}

/* Paski Gantta (Timeline Bars) */
.gantt-bar-wrapper {
  position: absolute;
  top: 7px;
  height: 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  overflow: visible;
  /* Aby tooltip był widoczny */
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gantt-bar-wrapper:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  z-index: 5;
}

/* Gradienty statusów zadań */
.gantt-bar-wrapper.todo {
  background: linear-gradient(135deg, hsl(45, 93%, 47%), hsl(35, 90%, 45%));
  color: #fff;
}

.gantt-bar-wrapper.in_progress {
  background: linear-gradient(135deg, hsl(217, 85%, 52%), hsl(207, 80%, 48%));
  color: #fff;
}

.gantt-bar-wrapper.on_hold {
  background: linear-gradient(135deg, hsl(24, 95%, 53%), hsl(14, 90%, 48%));
  color: #fff;
}

.gantt-bar-wrapper.done {
  background: linear-gradient(135deg, hsl(142, 70%, 45%), hsl(132, 65%, 40%));
  color: #fff;
}

.gantt-bar-wrapper.archived {
  background: linear-gradient(135deg, hsl(220, 12%, 35%), hsl(220, 10%, 30%));
  color: #fff;
}

/* Zadanie prywatne na osi czasu */
.gantt-bar-wrapper.private-task {
  border: 2px solid var(--accent-private) !important;
}

/* Wskaźnik postępu checklisty wewnątrz paska */
.gantt-bar-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  pointer-events: none;
  z-index: 1;
}

.gantt-bar-content {
  font-size: 0.68rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  z-index: 2;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Szklane Tooltipy (CSS Tooltip) */
.gantt-tooltip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1.4;
  text-shadow: none;
}

body.dark-theme .gantt-tooltip {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--glass-border);
}

.gantt-bar-wrapper:hover .gantt-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Pozycjonowanie dymka w dół dla pierwszego wiersza (first-child), by uniknąć obcinania przez nagłówki */
.gantt-row:first-child .gantt-tooltip {
  bottom: auto;
  top: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
}

.gantt-row:first-child .gantt-bar-wrapper:hover .gantt-tooltip {
  transform: translateX(-50%) translateY(0);
}

.gantt-tooltip-title {
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.1rem;
  color: #fff;
}

.gantt-tooltip-row {
  display: flex;
  gap: 0.5rem;
}

.gantt-tooltip-label {
  opacity: 0.6;
}

/* Kamienie milowe na wykresie Gantta */
.gantt-milestone-marker-wrapper {
  position: absolute;
  width: 10px;
  height: 10px;
  z-index: 5;
  cursor: pointer;
}

.gantt-milestone-marker {
  width: 10px;
  height: 10px;
  background: #c084fc; /* fioletowy */
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 1px;
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(192, 132, 252, 0.6);
  transition: transform 0.2s, background-color 0.2s;
}

.gantt-milestone-marker.done {
  background: #10b981; /* zielony */
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.gantt-milestone-marker-wrapper:hover .gantt-milestone-marker {
  transform: rotate(45deg) scale(1.25);
}

.gantt-milestone-marker-wrapper:hover .gantt-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.gantt-row:first-child .gantt-milestone-marker-wrapper:hover .gantt-tooltip {
  transform: translateX(-50%) translateY(0);
}

/* Wydruk wykresu Gantta */
@media print {
  .gantt-board {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .gantt-container {
    background: transparent !important;
    border: 1px solid #000 !important;
    backdrop-filter: none !important;
    overflow: visible !important;
  }

  .gantt-sidebar {
    border-right: 1px solid #000 !important;
    background: transparent !important;
  }

  .gantt-sidebar-header,
  .gantt-timeline-months,
  .gantt-timeline-days {
    background: #f0f0f0 !important;
    color: #000 !important;
    border-color: #000 !important;
  }

  .gantt-sidebar-task {
    border-bottom: 1px solid #000 !important;
    background: transparent !important;
  }

  .gantt-row {
    border-bottom: 1px solid #000 !important;
    background: transparent !important;
  }

  .gantt-day-gridline {
    border-right: 1px solid #e0e0e0 !important;
  }

  .gantt-day-gridline.gantt-weekend {
    background: #f5f5f5 !important;
  }

  .gantt-bar-wrapper {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }

  .gantt-bar-wrapper.todo {
    background: #fef08a !important;
    color: #000 !important;
  }

  .gantt-bar-wrapper.in_progress {
    background: #bfdbfe !important;
    color: #000 !important;
  }

  .gantt-bar-wrapper.on_hold {
    background: #fed7aa !important;
    color: #000 !important;
  }

  .gantt-bar-wrapper.done {
    background: #bbf7d0 !important;
    color: #000 !important;
  }

  .gantt-bar-wrapper.archived {
    background: #e2e8f0 !important;
    color: #000 !important;
  }

  .gantt-bar-progress {
    background: rgba(0, 0, 0, 0.15) !important;
  }
}

/* ==========================================================================
   WIDOK ABSENCJI (EMPLOYEE ABSENCE CALENDAR)
   ========================================================================== */

.absences-board {
  padding: 1.5rem;
  margin-top: 1rem;
  border-radius: var(--radius-lg);
  min-height: calc(100vh - 250px);
}

.absences-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .absences-container {
    grid-template-columns: 1fr;
  }
}

/* Panel formularza */
.absences-form-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.absences-form-panel h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.absence-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.absence-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.absence-form label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.absence-form select,
.absence-form input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  color: var(--text-main);
  font-size: 0.82rem;
  width: 100%;
}

.absence-form select:focus,
.absence-form input:focus {
  border-color: var(--accent-color);
  outline: none;
}

/* Panel harmonogramu i osi czasu */
.absences-timeline-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.absences-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.absences-timeline-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.absences-navigation {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.absences-navigation .month-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  min-width: 110px;
  text-align: center;
}

/* Harmonogram - Grid Timeline */
.absences-grid-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.05);
}

/* Scrollbar dla osi czasu */
.absences-grid-wrapper::-webkit-scrollbar {
  height: 14px;
  /* Zwiększona wysokość, znacznie łatwiej uchwycić */
}

.absences-grid-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 6px;
}

.absences-grid-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 8px;
}

body.dark-theme .absences-grid-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border: 3px solid transparent;
  background-clip: padding-box;
}

.absences-grid-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 85, 52, 0.7);
  /* Podświetlenie akcentem przy najechaniu! */
  border: 3px solid transparent;
  background-clip: padding-box;
}

/* Wyróżnienie pierwszego dnia miesiąca (Dzielniki miesięcy) */
.absences-timeline-day.month-first-day {
  border-left: 2px solid rgba(217, 85, 52, 0.4) !important;
}

.absences-timeline-cell.cell-month-first-day {
  border-left: 2px solid rgba(217, 85, 52, 0.3) !important;
}

.absences-grid-container {
  display: flex;
  position: relative;
  min-width: max-content;
}

/* Sidebar z pracownikami (Sticky mask) */
.absences-grid-sidebar {
  position: sticky;
  left: 0;
  width: 200px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--glass-border);
  z-index: 10;
  flex-shrink: 0;
}

body.dark-theme .absences-grid-sidebar {
  background: rgba(22, 22, 35, 0.98);
}

.grid-sidebar-header {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
}

.absences-sidebar-member {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Oś czasu z dniami i blokami */
.absences-grid-timeline {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  position: relative;
}

.grid-timeline-header {
  height: 40px;
  display: flex;
  border-bottom: 1px solid var(--glass-border);
}

.absences-timeline-day {
  width: 36px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--text-muted);
}

body.dark-theme .absences-timeline-day {
  border-right-color: rgba(255, 255, 255, 0.02);
}

.absences-timeline-day.weekend {
  background: rgba(0, 0, 0, 0.15);
  color: hsl(0, 85%, 65%);
}

.absences-timeline-day.today {
  background: rgba(217, 85, 52, 0.15);
  color: var(--accent-color);
  font-weight: 700;
}

.grid-timeline-body {
  position: relative;
}

.absences-timeline-row {
  height: 48px;
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--glass-border);
}

.absences-timeline-cell {
  width: 36px;
  height: 100%;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.absences-timeline-cell.weekend {
  background: rgba(0, 0, 0, 0.08);
}

.absences-timeline-cell.today {
  background: rgba(217, 85, 52, 0.04);
  border-right-color: rgba(217, 85, 52, 0.15);
}

/* Kolorowe szklane bloki absencji */
.absence-block {
  position: absolute;
  top: 8px;
  bottom: 8px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.absence-block:hover {
  transform: scaleY(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  z-index: 5;
}

/* Klasy typów absencji */
.abs-vacation {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #22c55e;
}

body.dark-theme .abs-vacation {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(34, 197, 94, 0.08));
  color: #4ade80;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
}

.abs-sick {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

body.dark-theme .abs-sick {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.08));
  color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

.abs-delegation {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

body.dark-theme .abs-delegation {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.08));
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.abs-childcare {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #a855f7;
}

body.dark-theme .abs-childcare {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(168, 85, 247, 0.08));
  color: #c084fc;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.15);
}

/* Wskaźnik i badge kolizji absencji */
.collision-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.15));
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

body.dark-theme .collision-badge {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.05));
  color: #f87171;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.15);
}

/* Wyróżnienie karty Kanban w kolizji */
.task-card.collision-alert {
  border-left: 4px solid #ef4444 !important;
}

/* Wyróżnienie wiersza listy w kolizji */
.list-row-collision td:first-child {
  border-left: 4px solid #ef4444 !important;
}

/* Wykluczenie podświetlenia hover dla wierszy nagłówków grup projektów */
.tasks-table tr.project-group-header:hover td {
  background: inherit !important;
}

/* NOWY PEŁNOEKRANOWY ZARZĄDCA PROJEKTÓW (DASHBOARD) */
.projects-board {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 360px;
  gap: 1.5rem;
  padding: 1.5rem !important;
  border-radius: var(--radius-lg);
  min-height: 580px;
  box-sizing: border-box;
}

.projects-list-panel {
  display: flex;
  flex-direction: column;
}

.projects-form-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  height: fit-content;
  position: sticky;
  top: 1.5rem;
}

/* Szklane paski postępu zadań projektu */
.project-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1024px) {
  .projects-board {
    grid-template-columns: 1fr;
  }

  .projects-form-panel {
    position: static;
  }
}

/* NOWY PEŁNOEKRANOWY ZARZĄDCA ZESPOŁEM (DASHBOARD) */
.team-board {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 360px;
  gap: 1.5rem;
  padding: 1.5rem !important;
  border-radius: var(--radius-lg);
  min-height: 580px;
  box-sizing: border-box;
}

.team-board.single-column {
  grid-template-columns: 1fr;
}

.team-list-panel {
  display: flex;
  flex-direction: column;
}

.team-board .team-add-section {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  height: fit-content;
  position: sticky;
  top: 1.5rem;
}

@media (max-width: 1024px) {
  .team-board {
    grid-template-columns: 1fr !important;
  }

  .team-board .team-add-section {
    position: static;
  }
}

/* HISTORIA ZMIAN (CHANGELOG TIMELINE) */
.timeline {
  margin-top: 1rem;
}

.timeline-item {
  transition: all 0.25s ease;
}

.timeline-card {
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.timeline-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.05) !important;
}

body.dark-theme .timeline-card:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.diff-old {
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.diff-new {
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.timeline-container {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.timeline-container::-webkit-scrollbar {
  width: 5px;
}

.timeline-container::-webkit-scrollbar-track {
  background: transparent;
}

.timeline-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

.timeline-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Globalne ujednolicenie kontrastu dla opcji select w motywie ciemnym i jasnym */
select option {
  background-color: var(--bg-surface) !important;
  color: var(--text-main) !important;
}

/* --- PANEL POWIADOMIENIA O AKTUALIZACJI (GLASSMORPHISM PREMIUM) --- */
.update-toast-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 400px;
  max-width: calc(100vw - 48px);
  padding: 16px;
  padding-bottom: 22px;
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 10px 40px rgba(0, 229, 255, 0.18), 0 0 15px rgba(0, 229, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(100px) scale(0.95);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
  overflow: hidden;
}

.update-toast-banner.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.update-toast-content {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.update-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  flex-shrink: 0;
  border: 1px solid rgba(0, 229, 255, 0.25);
  animation: updateGlowPulse 2s infinite alternate;
}

.update-toast-text {
  flex-grow: 1;
}

.update-toast-text h4 {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.update-toast-text p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

#update-countdown-text {
  font-weight: 700;
  color: #00e5ff;
  font-variant-numeric: tabular-nums;
}

.update-toast-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-update-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 114, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-update-refresh:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 114, 255, 0.45);
  filter: brightness(1.1);
}

.btn-update-refresh:active {
  transform: translateY(0);
}

.update-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.update-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00e5ff, #0072ff);
  transform-origin: left;
  transition: transform 1s linear;
}

@keyframes updateGlowPulse {
  0% {
    box-shadow: 0 0 5px rgba(0, 229, 255, 0.2);
    border-color: rgba(0, 229, 255, 0.2);
  }

  100% {
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
    border-color: rgba(0, 229, 255, 0.5);
  }
}

@media (max-width: 480px) {
  .update-toast-banner {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

/* --- KOLAPSE I ANIMACJE PROJEKTÓW (COLLAPSE SYSTEM PREMIUM) --- */
.project-group-header {
  transition: background-color 0.2s ease;
}

.project-group-header:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Interaktywne nagłówki Gantta */
.gantt-sidebar-project-header {
  transition: all 0.2s ease;
}

.gantt-sidebar-project-header:hover,
.gantt-project-header-row:hover {
  filter: brightness(1.15);
  background: rgba(255, 255, 255, 0.04) !important;
}

.gantt-sidebar-project-header i[data-lucide="chevron-down"],
.gantt-sidebar-project-header i[data-lucide="chevron-right"],
.project-group-header i[data-lucide="chevron-down"],
.project-group-header i[data-lucide="chevron-right"] {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Participant Badges in Project Modal */
.project-participant-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  height: 24px;
  box-sizing: border-box;
  cursor: default;
  transition: all 0.2s ease;
}

.project-participant-badge .remove-participant-btn {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.65);
  font-weight: bold;
  margin-left: 2px;
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.2s;
}

.project-participant-badge .remove-participant-btn:hover {
  color: #ef4444 !important;
}

/* --- CTT OPERATIONS DASHBOARD (KPI SYSTEM PREMIUM) --- */

.dashboard-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  transition: all 0.25s ease;
  border-bottom: 2px solid transparent;
}

.tab-btn i {
  width: 15px;
  height: 15px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(147, 51, 234, 0.3);
}

.tab-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tab-content.hidden {
  display: none !important;
}

/* Wykres Kołowy (Donut Chart) */
.donut-svg-wrapper svg {
  transform: rotate(-90deg);
}

.donut-slice {
  fill: none;
  stroke-width: 14;
  transition: stroke-width 0.25s ease, filter 0.25s ease;
  cursor: pointer;
}

.donut-slice:hover {
  stroke-width: 18;
  filter: drop-shadow(0 0 4px currentColor);
}

.kpi-chart-legend {
  padding-left: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
  cursor: default;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
}

.legend-item:hover .legend-left {
  color: var(--text-main);
}

.legend-count {
  font-weight: 700;
  color: var(--text-main);
}

/* --- ZESPÓŁ - LISTA OBCIĄŻENIA (HORIZONTAL WORKLOAD BARS) --- */
.workload-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.workload-segment {
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.workload-segment:hover {
  opacity: 0.9;
  filter: brightness(1.15) drop-shadow(0 0 3px rgba(255, 255, 255, 0.1));
}

/* --- TABELA PROJEKTÓW (COMPACT HEALTH LEDGER) --- */
.kpi-projects-table {
  width: 100%;
  border-collapse: collapse;
}

.kpi-projects-table th {
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
}

.kpi-projects-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.kpi-projects-tr {
  background: transparent;
}

.kpi-projects-tr:hover {
  background: rgba(255, 255, 255, 0.02) !important;
}

.mini-alert-pill {
  transition: transform 0.15s ease, filter 0.15s ease;
  cursor: default;
}

.mini-alert-pill:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Kolory statusu projektu */
.proj-status-ok {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.proj-status-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.proj-status-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- ASYSTENT AI DIGEST (BRIEFING) --- */
.ai-digest-pulse {
  animation: pulsePurple 2.5s infinite;
}

@keyframes pulsePurple {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.8);
  }

  70% {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(168, 85, 247, 0);
  }

  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* CUSTOM PREMIUM TOOLTIPS */
.custom-tooltip-container {
  position: relative;
}

.custom-tooltip {
  visibility: hidden;
  position: absolute;
  bottom: 130%;
  /* Position above the hovered element */
  left: 0;
  /* Align to the left edge of the button to prevent left-side overflow */
  transform: none;
  background-color: rgba(30, 27, 75, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md, 6px);
  width: max-content;
  min-width: 260px;
  /* Wider tooltip */
  max-width: 450px;
  /* Wider tooltip max limit */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  white-space: pre-line;
  font-size: 0.72rem;
  line-height: 1.4;
}

.custom-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  /* At the bottom of the tooltip */
  left: 22px;
  /* Align arrow with the button center */
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(30, 27, 75, 0.95) transparent transparent transparent;
}

.custom-tooltip-container:hover .custom-tooltip {
  visibility: visible;
  opacity: 1;
}

/* ==========================================================================
   HOMEPAGE / DASHBOARD WIDGETS (WIDOK START)
   ========================================================================== */
.home-board {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  overflow-y: auto;
  min-height: calc(100vh - 200px);
}

.home-board.hidden {
  display: none !important;
}

.home-welcome-header {
  margin-bottom: 0.5rem;
}

.home-welcome-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.home-welcome-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.home-grid {
  display: grid;
  /* Zmieniamy z 3 na 6 kolumn, by łatwiej dzielić ułamki (1/3 i 1/2) */
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.home-widget {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  /* Domyślnie każdy widget zajmuje 1/3 szerokości (2 z 6 kolumn) */
  grid-column: span 2;
}

/* Alert styles for critical widgets */
.home-widget.widget-overdue {
  border-left: 4px solid var(--accent-danger);
}

.home-widget.widget-upcoming {
  border-left: 4px solid var(--accent-warning);
}

.home-widget.widget-notepad {
  /* Notatnik zajmuje teraz równe 50% szerokości (3 z 6 kolumn) */
  grid-column: span 3;
}

.home-widget.widget-ai-agent {
  /* Nowy Agent AI zajmuje drugie 50% szerokości */
  grid-column: span 3;
}

/* --- RESPONSYWNOŚĆ DLA WIDOKU START --- */
@media (max-width: 1200px) {

  /* Na mniejszych ekranach (np. małe laptopy) notatnik może być za wąski - wymuszamy układ pionowy wewnątrz niego */
  .notepad-split-container {
    flex-direction: column;
  }

  .notepad-list-area {
    border-left: none;
    border-top: 1px solid var(--glass-border);
    padding-left: 0;
    padding-top: 1.5rem;
    max-height: 200px;
  }
}

@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: repeat(4, 1fr);
    /* 4 kolumny dla tabletów */
  }

  .home-widget {
    grid-column: span 2;
    /* Główne widgety po 50% */
  }

  .home-widget.widget-notepad,
  .home-widget.widget-ai-agent {
    grid-column: 1 / -1;
    /* Notatnik i AI na pełną szerokość 100% pod spodem */
  }
}

@media (max-width: 768px) {
  .home-grid {
    grid-template-columns: 1fr;
    /* 1 kolumna na telefony */
  }

  .home-widget,
  .home-widget.widget-notepad,
  .home-widget.widget-ai-agent {
    grid-column: span 1;
  }
}

/* Mini Card inside Widgets */
.home-mini-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: var(--overlay-dark-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.home-mini-task:hover {
  background: var(--overlay-dark-bg-hover);
  border-color: var(--glass-border-focus);
}

.home-mini-task-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.home-mini-task-title {
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-mini-task-project {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.home-mini-task-project svg {
  width: 10px;
  height: 10px;
}

.home-mini-task-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.home-mini-task-date {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.home-mini-task-date.overdue {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.home-mini-task-date.upcoming {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Empty states */
.home-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  gap: 0.5rem;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
}

.home-empty-state svg {
  width: 24px;
  height: 24px;
  opacity: 0.3;
}

/* ==========================================================================
   ROZBUDOWANY NOTATNIK W CHMURZE SPLIT
   ========================================================================== */
.notepad-split-container {
  display: flex;
  gap: 1.5rem;
  min-height: 260px;
}

.notepad-edit-area {
  flex: 2.2;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notepad-list-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 1px solid var(--glass-border);
  padding-left: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.note-title-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.note-title-input:focus {
  border-color: var(--glass-border-focus);
}

.notepad-textarea {
  width: 100%;
  flex: 1;
  min-height: 180px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.notepad-textarea:focus {
  border-color: var(--glass-border-focus);
}

.notepad-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.notepad-action-buttons {
  display: flex;
  gap: 0.5rem;
}

.notepad-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.notepad-status {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.notepad-status svg {
  width: 12px;
  height: 12px;
}

/* Lista notatek po prawej */
.notepad-list-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
  letter-spacing: 0.5px;
}

.notepad-list-items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.notepad-list-item {
  padding: 0.35rem 0.55rem;
  background: var(--overlay-dark-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.notepad-list-item:hover {
  background: var(--overlay-dark-bg-hover);
  border-color: var(--glass-border-focus);
}

.notepad-list-item.active {
  background: var(--toggle-active-bg);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.notepad-list-item-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.notepad-list-item-date {
  font-size: 0.62rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .notepad-split-container {
    flex-direction: column;
  }

  .notepad-list-area {
    border-left: none;
    border-top: 1px solid var(--glass-border);
    padding-left: 0;
    padding-top: 1.5rem;
    max-height: 200px;
  }
}