/* ============================================
   AXENDI - Pomocnik grafikowania
   Professional Dark Mode Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Axendi Brand Colors - Fixed */
  --purple: #BAB0FF;
  --coral: #FFBBAE;
  --yellow: #FDE5A9;
  --red: #FFB6B6;
  --green: #A4DBAC;
  --warning: #F6F58C;

  /* Spacing System */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Typography */
  --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --transition: 200ms ease;
}

/* Dark Mode Theme (default) */
:root,
[data-theme="dark"] {
  --bg-primary: #0A0B0D;
  --bg-secondary: #13151A;
  --bg-tertiary: #1C1F26;
  --bg-elevated: #252930;

  --text-primary: #E8E9ED;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  --border: #2A2D35;
  --border-light: #3A3D45;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Light Mode Theme */
[data-theme="light"] {
  --bg-primary: #F5F5F7;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F9FAFB;
  --bg-elevated: #FFFFFF;

  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;

  --border: #E5E7EB;
  --border-light: #D1D5DB;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Base Reset
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

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

::selection {
  background: var(--purple);
  color: var(--bg-primary);
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none !important;
}

/* ============================================
   Login Page
   ============================================ */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-4);
  background: var(--bg-primary);
}

.login-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.app-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--purple), var(--coral));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  font-size: 1.75rem;
  color: var(--bg-primary);
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-8);
}

.login-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9375rem;
  margin-bottom: var(--space-4);
  transition: border-color var(--transition);
}

.login-input:focus {
  outline: none;
  border-color: var(--purple);
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-btn {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--purple);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.login-btn:hover {
  opacity: 0.9;
}

.login-btn:active {
  opacity: 0.8;
}

/* ============================================
   Main Layout
   ============================================ */

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header-left .app-icon {
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
  margin: 0;
}

.app-title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.app-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  position: relative;
}

.version {
  display: inline-block;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: var(--space-2);
}

.images {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.images img {
  height: 40px;
  opacity: 0.9;
}

/* Logo Axendi w trybie ciemnym - białe */
:root .images img[src*="axendi"],
[data-theme="dark"] .images img[src*="axendi"] {
  filter: brightness(0) invert(1);
}

/* Logo Axendi w trybie jasnym - czarne (domyślne) */
[data-theme="light"] .images img[src*="axendi"] {
  filter: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.theme-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.125rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}

.theme-toggle:hover {
  background: var(--bg-elevated);
}

.btn {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-elevated);
}

.btn-primary {
  background: var(--purple);
  color: var(--bg-primary);
  border-color: var(--purple);
  font-weight: 600;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
}

.btn-success {
  background: var(--green);
  color: var(--bg-primary);
  border-color: var(--green);
  font-weight: 600;
}

.btn-success:hover {
  opacity: 0.9;
}

.logout-btn {
  padding: var(--space-2) var(--space-4);
  background: transparent;
  color: var(--red);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.logout-btn:hover {
  background: rgba(255, 182, 182, 0.1);
  border-color: var(--red);
}

/* ============================================
   Navigation Tabs
   ============================================ */

.tab-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.tab-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-6);
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-button {
  padding: var(--space-4) var(--space-5);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--text-primary);
}

.tab-button.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
  font-weight: 600;
}

.tab-content {
  flex: 1;
  padding: var(--space-4) var(--space-6);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ============================================
   Subtabs
   ============================================ */

.subtab-nav {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  margin-bottom: var(--space-6);
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
}

.subtab-nav::-webkit-scrollbar {
  display: none;
}

/* Top-level subtab navigation (under main tabs) */
.subtab-nav-top {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-6);
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex-wrap: wrap;
}

.subtab-nav-top::-webkit-scrollbar {
  height: 4px;
}

.subtab-nav-top::-webkit-scrollbar-track {
  background: transparent;
}

.subtab-nav-top::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.subtab-nav-top::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

.subtab-btn {
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.subtab-btn:hover {
  color: var(--text-primary);
  background: rgba(186, 176, 255, 0.08);
}

.subtab-btn.active {
  color: var(--purple);
  background: rgba(186, 176, 255, 0.15);
  font-weight: 700;
  border-bottom: 3px solid var(--purple);
}

.subtab-btn i {
  font-size: 0.9rem;
}

.subtab-content {
  position: relative;
}

.subtab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.subtab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   Cards & Grid
   ============================================ */

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-light);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.card-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple);
  font-size: 1.125rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

/* Single cards in tab-panel - consistent spacing */
.tab-panel > .card {
  margin-bottom: var(--space-6);
}

.tab-panel > .card:last-child {
  margin-bottom: 0;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  transition: border-color var(--transition);
}

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

.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: 'Courier New', monospace;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-8);
}

/* File Upload */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
  background: var(--bg-tertiary);
}

.file-upload-area:hover {
  border-color: var(--purple);
  background: var(--bg-elevated);
}

.upload-icon {
  font-size: 2.5rem;
  color: var(--purple);
  margin-bottom: var(--space-4);
  display: block;
}

.file-input {
  display: none;
}

/* ============================================
   Settings
   ============================================ */

.settings-panel {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

/* Collapsible sections */
.clickable {
  cursor: pointer;
  user-select: none;
}

.collapse-icon {
  transition: transform var(--transition);
  color: var(--text-secondary);
}

.collapse-icon.rotated {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible-content.active {
  max-height: 2000px;
}

/* Two-column parameters layout - sliders left, rest right */
.params-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.params-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .params-two-columns {
    grid-template-columns: 1fr;
  }
}

.setting-group {
  margin-bottom: var(--space-5);
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.setting-title i {
  color: var(--purple);
  width: 16px;
}

/* Slider */
.slider-container {
  margin: var(--space-3) 0;
}

.slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--purple);
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--purple);
  cursor: pointer;
  border: none;
}

.slider-value {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--purple);
  margin-top: var(--space-2);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  transition: var(--transition);
  border-radius: 12px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--bg-primary);
  transition: var(--transition);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: var(--purple);
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Time Format Toggle */
.time-format-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
}

.time-format-btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.time-format-btn.active {
  background: var(--purple);
  color: var(--bg-primary);
  font-weight: 600;
}

/* Format Buttons */
.format-buttons {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.format-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.format-btn.active {
  background: var(--purple);
  color: var(--bg-primary);
  border-color: var(--purple);
  font-weight: 600;
}

/* ============================================
   Alerts
   ============================================ */

.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.875rem;
}

.alert-info {
  background: rgba(186, 176, 255, 0.1);
  color: var(--text-primary);
}

.alert-success {
  background: rgba(164, 219, 172, 0.1);
  color: var(--text-primary);
}

.alert-error {
  background: rgba(255, 182, 182, 0.1);
  color: var(--text-primary);
}

.alert-warning {
  background: rgba(246, 245, 140, 0.1);
  color: var(--text-primary);
}

/* Notifications */
.notification-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1000;
  max-width: 400px;
}

.notification {
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.875rem;
}

.notification.success {
}

.notification.error {
}

.notification.warning {
}

/* ============================================
   Modals
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  margin: var(--space-4);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-2);
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--red);
}

/* ============================================
   Results & Analysis
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--purple);
  margin-bottom: var(--space-2);
  text-shadow: 0 2px 4px rgba(186, 176, 255, 0.2);
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.day-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.day-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.coverage-stats {
  background: var(--bg-tertiary);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 100px;
}

.shift-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}

.shift-person {
  font-weight: 500;
  color: var(--text-primary);
}

.shift-details {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.shift-time {
  font-family: 'Courier New', monospace;
  background: var(--bg-elevated);
  color: var(--purple);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
}

.shift-hours {
  background: var(--green);
  color: var(--bg-primary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.coverage-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: var(--space-2) 0;
}

.coverage-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.coverage-percentage {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--purple);
  margin-top: var(--space-1);
}

/* ============================================
   Tables
   ============================================ */

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: var(--space-5) 0;
}

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

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr {
  background: var(--bg-secondary);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   Help Panel
   ============================================ */

.help-panel {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: var(--space-4) 0;
}

.help-panel h4 {
  color: var(--purple);
  margin-bottom: var(--space-4);
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.help-panel ul {
  margin-left: var(--space-5);
  line-height: 1.7;
}

.help-panel li {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}

/* ============================================
   Loading & Spinners
   ============================================ */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  flex-direction: column;
  gap: var(--space-4);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.algorithm-status {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}

.algorithm-status h4 {
  color: var(--green);
  margin-bottom: var(--space-3);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.algorithm-steps {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
  background: var(--bg-elevated);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
}

/* ============================================
   Timeline Charts
   ============================================ */

.timeline-chart {
  display: flex;
  gap: 2px;
  padding: var(--space-6) var(--space-4);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  margin: var(--space-4) 0;
  overflow-x: auto;
  min-height: 200px;
  align-items: flex-end;
}

.timeline-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
}

.timeline-time {
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  transform: rotate(-45deg);
  white-space: nowrap;
  font-weight: 500;
}

.timeline-bars {
  position: relative;
  height: 120px;
  width: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
}

.timeline-required {
  background: var(--border-light);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
}

.timeline-assigned {
  border-radius: 0 0 2px 2px;
  min-height: 4px;
}

.timeline-assigned.success {
  background: var(--green);
}

.timeline-assigned.warning {
  background: var(--warning);
}

.timeline-assigned.error {
  background: var(--red);
}

.timeline-values {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-2);
  font-size: 0.625rem;
  font-weight: 600;
}

.required-value {
  color: var(--text-muted);
}

.assigned-value {
  color: var(--purple);
}

.timeline-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

/* ============================================
   Settings Dropdown
   ============================================ */

.settings-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: var(--space-6);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1000;
}

.settings-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.settings-dropdown-header h3 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.settings-dropdown-header h3 i {
  color: var(--purple);
}

.close-dropdown-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-dropdown-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.settings-dropdown-content {
  padding: var(--space-5);
}

.settings-section {
  margin-bottom: var(--space-5);
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.settings-section-header i {
  color: var(--purple);
  font-size: 1rem;
}

.settings-section-header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================
   Color Picker - Hidden in fixed theme
   ============================================ */

.color-picker-container,
.color-picker-trigger,
.color-picker-dropdown {
  display: none !important;
}

/* ============================================
   Responsive Design
   ============================================ */

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

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .header-left {
    flex-direction: column;
    align-items: flex-start;
  }

  .images {
    display: none;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .tab-content {
    padding: var(--space-4);
  }

  .day-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .shift-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .format-buttons {
    flex-direction: column;
  }

  .format-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .login-form {
    padding: var(--space-6);
  }

  .app-title h1 {
    font-size: 1rem;
  }

  .tab-button {
    padding: var(--space-3) var(--space-4);
    font-size: 0.8125rem;
  }

  .timeline-chart {
    padding: var(--space-4) var(--space-2);
  }

  .timeline-bar {
    min-width: 30px;
  }

  .timeline-bars {
    width: 20px;
    height: 80px;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  body {
    background: white;
    color: black;
  }

  .header,
  .tab-nav,
  .notification-container,
  .header-actions {
    display: none;
  }

  .tab-content {
    padding: 0;
  }

  .card,
  .day-card {
    break-inside: avoid;
    border-color: #ccc;
  }
}

/* ============================================
   Timeline & Analysis Cards
   ============================================ */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.time-analysis-card,
.chart-card,
.recommendations-card {
  height: 100%;
}

.time-slots {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.time-slot {
  background: var(--bg-elevated);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
}

.time-slot.high {
  border-color: var(--purple);
  background: rgba(186, 176, 255, 0.2);
}

.time-slot.medium {
  border-color: var(--coral);
  background: rgba(255, 187, 174, 0.2);
}

.time-slot.low {
  border-color: var(--yellow);
  background: rgba(253, 229, 169, 0.2);
}

.slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.slot-header h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.demand-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.demand-badge.high {
  background: var(--purple);
  color: var(--bg-primary);
  font-weight: 700;
}

.demand-badge.medium {
  background: var(--coral);
  color: var(--bg-primary);
  font-weight: 700;
}

.demand-badge.low {
  background: var(--yellow);
  color: #0A0B0D;
  font-weight: 700;
}

.slot-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.slot-stats .stat {
  text-align: center;
}

.slot-stats .stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.slot-stats .stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.recommendation {
  background: var(--bg-elevated);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
}

.recommendation.high {
  border-color: var(--red);
  background: rgba(255, 182, 182, 0.05);
}

.recommendation.medium {
  border-color: var(--coral);
  background: rgba(255, 187, 174, 0.05);
}

.recommendation.low {
  border-color: var(--yellow);
  background: rgba(253, 229, 169, 0.05);
}

.rec-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.rec-header i {
  color: var(--purple);
  font-size: 1.25rem;
}

.rec-header h5 {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.priority-badge {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-badge.high {
  background: var(--red);
  color: var(--bg-primary);
}

.priority-badge.medium {
  background: var(--coral);
  color: var(--bg-primary);
}

.priority-badge.low {
  background: var(--yellow);
  color: var(--bg-primary);
}

.recommendation p {
  margin: 0 0 var(--space-3);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.rec-action,
.rec-impact {
  font-size: 0.8rem;
  margin-top: var(--space-2);
  color: var(--text-secondary);
}

.rec-action strong,
.rec-impact strong {
  color: var(--purple);
  font-weight: 600;
}

/* ============================================
   Hourly Analysis & Filters
   ============================================ */

.hourly-filters {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.filter-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--purple);
}

.filter-btn.active {
  background: var(--purple);
  color: var(--bg-primary);
  border-color: var(--purple);
}

.sortable-table th {
  cursor: pointer;
  user-select: none;
}

.sortable-table th:hover {
  background: var(--bg-elevated);
}

.sortable-table th i {
  margin-left: var(--space-2);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.coverage-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.coverage-fill {
  height: 100%;
  transition: width var(--transition);
  border-radius: var(--radius-sm);
}

.coverage-fill.high {
  background: var(--green);
}

.coverage-fill.medium {
  background: var(--yellow);
}

.coverage-fill.low {
  background: var(--red);
}

.coverage-fill.excellent {
  background: rgba(59, 130, 246, 0.85);
}

.coverage-fill.good {
  background: rgba(164, 219, 172, 0.85);
}

.coverage-fill.warning {
  background: rgba(253, 229, 169, 0.85);
}

.coverage-fill.critical {
  background: rgba(255, 182, 182, 0.85);
}

.coverage-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 40px;
  text-align: right;
}

.stress-meter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
}

.stress-level {
  height: 8px;
  border-radius: var(--radius-sm);
  transition: width var(--transition);
}

.stress-meter span {
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 35px;
}

.people-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.people-badge {
  padding: var(--space-1) var(--space-2);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.heatmap-grid {
  display: grid;
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
  overflow-x: auto;
}

.heatmap-cell {
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.heatmap-cell:hover {
  transform: scale(1.1);
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.heatmap-label {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
}

/* ============================================
   Interactive Coverage Chart
   ============================================ */

.interactive-chart {
  width: 100%;
  margin-top: var(--space-4);
}

.chart-container {
  position: relative;
  min-height: 300px;
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 250px;
  padding: var(--space-4) 0;
  border-bottom: 2px solid var(--border);
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  min-width: 20px;
}

.chart-bar {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}

.chart-bar.required {
  background: var(--coral);
  opacity: 0.6;
}

.chart-bar.assigned {
  background: var(--purple);
}

/* Coverage classes for chart bars - higher specificity */
.chart-bar.assigned.excellent {
  background: rgba(59, 130, 246, 0.85) !important;
}

.chart-bar.assigned.good {
  background: rgba(164, 219, 172, 0.85) !important;
}

.chart-bar.assigned.warning {
  background: rgba(253, 229, 169, 0.85) !important;
}

.chart-bar.assigned.critical {
  background: rgba(255, 182, 182, 0.85) !important;
}

.chart-bar.excellent {
  background: rgba(59, 130, 246, 0.8);
}

.chart-bar.good {
  background: rgba(164, 219, 172, 0.8);
}

.chart-bar.warning {
  background: rgba(253, 229, 169, 0.8);
}

.chart-bar.critical {
  background: rgba(255, 182, 182, 0.8);
}

.chart-bar:hover {
  opacity: 1;
  transform: scaleY(1.05);
}

.bar-tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.chart-bar:hover .bar-tooltip {
  opacity: 1;
}

.chart-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: var(--space-2);
  font-weight: 500;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  justify-content: center;
  flex-wrap: wrap;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
}

.chart-legend-color {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
}

/* ============================================
   Heatmap Container
   ============================================ */

.heatmap-container {
  margin-top: var(--space-4);
}

/* ============================================
   Advanced Analysis
   ============================================ */

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-6);
}

.conflict-card {
  height: 100%;
}

.conflict-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.conflict-section h5 {
  margin: 0 0 var(--space-3);
  color: var(--text-primary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.conflict-section h5 i {
  color: var(--purple);
}

.conflict-item {
  background: var(--bg-tertiary);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  border: 2px solid var(--border);
}

.conflict-item.critical {
  border-color: var(--red);
  background: rgba(255, 182, 182, 0.05);
}

.conflict-item.high {
  border-color: var(--coral);
  background: rgba(255, 187, 174, 0.05);
}

.conflict-item.medium {
  border-color: var(--yellow);
  background: rgba(253, 229, 169, 0.05);
}

.conflict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.conflict-header strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.severity-badge {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.severity-badge.critical {
  background: var(--red);
  color: var(--bg-primary);
}

.severity-badge.high {
  background: var(--coral);
  color: var(--bg-primary);
}

.severity-badge.medium {
  background: var(--yellow);
  color: var(--bg-primary);
}

.severity-badge.low {
  background: var(--green);
  color: var(--bg-primary);
}

.conflict-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   Performance Metrics
   ============================================ */

.performance-metrics {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.person-performance {
  background: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.person-performance:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.person-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.person-header strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.performance-score {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
}

.performance-score.excellent {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 2px solid #3b82f6;
}

.performance-score.good {
  background: rgba(164, 219, 172, 0.2);
  color: var(--green);
  border: 2px solid var(--green);
}

.performance-score.warning {
  background: rgba(253, 229, 169, 0.2);
  color: #d97706;
  border: 2px solid var(--yellow);
}

.performance-score.critical {
  background: rgba(255, 182, 182, 0.2);
  color: var(--red);
  border: 2px solid var(--red);
}

.person-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.person-metrics .metric {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.person-metrics .metric i {
  color: var(--purple);
  width: 16px;
}

.person-metrics .metric span {
  color: var(--text-primary);
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: var(--space-2);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--coral));
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}

.flexibility-bar {
  width: 100%;
  height: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--space-3);
  position: relative;
  display: flex;
  align-items: center;
}

.flexibility-bar span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.flexibility-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--coral));
  border-radius: var(--radius-md);
  transition: width 0.5s ease;
  position: relative;
}

.metric-card {
  height: 100%;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple);
  margin: var(--space-3) 0;
}

.metric-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.metric-breakdown {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: 0.875rem;
}

/* ============================================
   Workload Analysis
   ============================================ */

.workload-analysis {
  padding: var(--space-4) 0;
}

.stats-grid {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg-tertiary);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.workload-chart {
  margin-top: var(--space-4);
}

/* ============================================
   Worker Analysis
   ============================================ */

.person-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.worker-card {
  transition: all var(--transition);
}

.worker-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.worker-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  font-size: 0.85rem;
}

.worker-stat-item {
  background: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

.worker-stat-label {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.worker-stat-label i {
  color: var(--purple);
}

.worker-stat-value {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.worker-summary-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.worker-summary-footer i {
  margin-right: var(--space-1);
}

.breakdown-label {
  color: var(--text-secondary);
}

.breakdown-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================
   Weekday Analysis (Analiza według dnia)
   ============================================ */

.weekday-analysis {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.weekday-item {
  display: grid;
  grid-template-columns: 100px 1fr 60px;
  align-items: center;
  gap: var(--space-3);
}

.weekday-name {
  font-weight: 600;
  color: var(--text-primary);
}

.weekday-bar {
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.weekday-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--coral));
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}

.weekday-value {
  text-align: right;
  font-weight: 600;
  color: var(--purple);
}

/* ============================================
   Time of Day Analysis
   ============================================ */

.timeofday-radar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.radar-item {
  background: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  text-align: center;
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.radar-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.radar-item.high {
  border-color: var(--red);
  background: rgba(255, 182, 182, 0.05);
}

.radar-item.medium {
  border-color: var(--yellow);
  background: rgba(253, 229, 169, 0.05);
}

.radar-item.low {
  border-color: var(--green);
  background: rgba(164, 219, 172, 0.05);
}

.radar-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.radar-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--purple);
  margin: var(--space-2) 0;
}

.radar-demand {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   Pattern Analysis
   ============================================ */

.pattern-item {
  margin-bottom: var(--space-6);
}

.pattern-item h5 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
  font-size: 1rem;
}

.pattern-item h5 i {
  color: var(--purple);
}

/* ============================================
   Heatmap Visualization
   ============================================ */

.heatmap-container {
  background: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-2);
  min-width: 600px;
}

.heatmap-axis-y {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 40px;
}

.heatmap-axis-y .axis-label {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.heatmap-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.heatmap-axis-x {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.heatmap-axis-x .axis-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 600;
}

.heatmap-cells {
  display: grid;
  grid-template-columns: repeat(96, 1fr);
  gap: 2px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: 100px repeat(auto-fit, minmax(40px, 1fr));
  gap: 2px;
}

.heatmap-label {
  display: flex;
  align-items: center;
  padding: var(--space-2);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.heatmap-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  min-width: 10px;
  min-height: 30px;
}

.heatmap-cell:hover {
  transform: scale(1.1);
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.heatmap-cell.empty,
.heatmap-cell.heat-none {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.heatmap-cell.low {
  background: rgba(164, 219, 172, 0.3);
  color: var(--green);
}

.heatmap-cell.medium {
  background: rgba(253, 229, 169, 0.3);
  color: var(--yellow);
}

.heatmap-cell.high {
  background: rgba(186, 176, 255, 0.3);
  color: var(--purple);
}

.heatmap-cell.critical {
  background: rgba(255, 182, 182, 0.3);
  color: var(--red);
}

/* Heat intensity classes for heatmap cells */
.heatmap-cell.heat-excellent {
  background: rgba(59, 130, 246, 0.8);
  color: var(--bg-primary);
}

.heatmap-cell.heat-good {
  background: rgba(164, 219, 172, 0.6);
  color: var(--bg-primary);
}

.heatmap-cell.heat-warning {
  background: rgba(253, 229, 169, 0.6);
  color: var(--bg-primary);
}

.heatmap-cell.heat-critical {
  background: rgba(255, 182, 182, 0.6);
  color: var(--bg-primary);
}

.heatmap-cell.heat-none {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.heatmap-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.heatmap-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
}

.heatmap-legend .legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.heatmap-legend .legend-color {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
}

.heatmap-legend-color {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
}

/* ============================================
   Team Performance Analysis
   ============================================ */

.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}

.performance-card {
  background: var(--bg-tertiary);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.performance-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.performance-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.performance-metric-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.performance-metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--purple);
}

.performance-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: var(--space-2);
}

.performance-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--coral));
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}

@media (max-width: 768px) {
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .performance-grid {
    grid-template-columns: 1fr;
  }

  .heatmap-row {
    grid-template-columns: 80px repeat(auto-fit, minmax(30px, 1fr));
  }

  .weekday-item {
    grid-template-columns: 80px 1fr 50px;
  }
}
