/* ============================================================
   TRUHLÁRNA APP - Hlavní styly
   ============================================================ */

:root {
  --wood-50: #fdf8f0;
  --wood-100: #f5ead6;
  --wood-200: #e8d5b0;
  --wood-300: #d4b882;
  --wood-400: #c49a5c;
  --wood-500: #a67c3d;
  --wood-600: #8b6332;
  --wood-700: #6e4d28;
  --wood-800: #553b1f;
  --wood-900: #3d2a16;

  --green-50: #ecfdf5;
  --green-100: #d1fae5;
  --green-500: #10b981;
  --green-600: #059669;
  --green-700: #047857;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;

  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --purple-50: #faf5ff;
  --purple-500: #a855f7;
  --purple-600: #9333ea;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--wood-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* --- Layout --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--wood-800) 0%, var(--wood-900) 100%);
  color: white;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 6px;
}

.sidebar-logo-img {
  width: 180px;
  height: auto;
  filter: invert(1);
  mix-blend-mode: screen;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.sidebar-header p {
  font-size: 12px;
  color: var(--wood-300);
  margin-top: 4px;
  text-align: center;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--wood-200);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: var(--amber-500);
  border-left-color: var(--amber-500);
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 11px;
  color: var(--wood-400);
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 28px 32px;
  min-height: 100vh;
}

/* --- Header --- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header h2 .header-icon {
  font-size: 28px;
}

/* --- Cards --- */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--gray-100);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
}

/* --- Stat Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.wood { background: var(--wood-100); }
.stat-icon.green { background: var(--green-100); }
.stat-icon.blue { background: var(--blue-100); }
.stat-icon.amber { background: var(--amber-100); }
.stat-icon.purple { background: var(--purple-50); }
.stat-icon.red { background: var(--red-100); }

.stat-info { flex: 1; }

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
  margin-top: 2px;
}

.stat-sub {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-primary {
  background: var(--wood-600);
  color: white;
}
.btn-primary:hover { background: var(--wood-700); }

.btn-success {
  background: var(--green-600);
  color: white;
}
.btn-success:hover { background: var(--green-700); }

.btn-danger {
  background: var(--red-500);
  color: white;
}
.btn-danger:hover { background: var(--red-600); }

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-icon {
  padding: 6px 8px;
}

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
}

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

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  font-weight: 600;
  border-bottom: 2px solid var(--gray-100);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

tr:hover td {
  background: var(--gray-50);
}

/* --- Badges/Tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-amber { background: var(--amber-100); color: var(--amber-600); }
.badge-red { background: var(--red-100); color: var(--red-600); }
.badge-blue { background: var(--blue-100); color: var(--blue-600); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-purple { background: var(--purple-50); color: var(--purple-600); }

/* --- Progress Bar --- */
.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-bar .fill.wood { background: linear-gradient(90deg, var(--wood-400), var(--wood-600)); }
.progress-bar .fill.green { background: linear-gradient(90deg, var(--green-500), var(--green-600)); }
.progress-bar .fill.amber { background: linear-gradient(90deg, var(--amber-500), var(--amber-600)); }
.progress-bar .fill.blue { background: linear-gradient(90deg, var(--blue-500), var(--blue-600)); }

/* --- XP Bar (special) --- */
.xp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.xp-bar {
  flex: 1;
  height: 12px;
  background: var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.xp-bar .fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--amber-500), var(--wood-500));
  transition: width 0.8s ease;
  position: relative;
}

.xp-bar .fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
}

.xp-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--wood-500);
  box-shadow: 0 0 0 3px rgba(166, 124, 61, 0.15);
}

select.form-control {
  appearance: none;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 32px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.25s;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
}
.modal-close:hover { background: var(--gray-200); }

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* --- Leaderboard --- */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: all 0.15s;
}

.leaderboard-item:hover {
  background: var(--gray-50);
}

.leaderboard-rank {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: white; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: white; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: white; }
.rank-other { background: var(--gray-100); color: var(--gray-600); }

.leaderboard-info { flex: 1; }

.leaderboard-name {
  font-weight: 600;
  font-size: 15px;
}

.leaderboard-details {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.leaderboard-xp {
  text-align: right;
}

.leaderboard-xp .xp-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--wood-600);
}

.leaderboard-xp .xp-unit {
  font-size: 12px;
  color: var(--gray-400);
}

/* --- Achievement Card --- */
.achievement-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
}

.achievement-card.earned {
  border-color: var(--amber-500);
  background: var(--amber-50);
}

.achievement-card.locked {
  opacity: 0.55;
}

.achievement-icon {
  font-size: 32px;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
}

.achievement-info { flex: 1; }

.achievement-name {
  font-weight: 600;
  font-size: 14px;
}

.achievement-desc {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.achievement-reward {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-600);
  white-space: nowrap;
}

/* --- Profile Card --- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
}

.profile-avatar {
  font-size: 52px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wood-100);
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-info { flex: 1; }

.profile-name {
  font-size: 22px;
  font-weight: 700;
}

.profile-level {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-top: 4px;
}

.profile-level .level-name {
  font-weight: 600;
}

/* --- Attendance Calendar --- */
.attendance-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.att-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  padding: 4px;
}

.att-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  border: 1px solid transparent;
  min-height: 44px;
}

.att-day:hover { border-color: var(--gray-300); }
.att-day.empty { cursor: default; }
.att-day.present { background: var(--green-100); color: var(--green-700); }
.att-day.absent { background: var(--red-100); color: var(--red-600); }
.att-day.vacation { background: var(--blue-100); color: var(--blue-600); }
.att-day.today { border: 2px solid var(--wood-500); font-weight: 700; }
.att-day.weekend { background: var(--gray-50); color: var(--gray-400); cursor: default; }

.att-day .day-num { font-size: 14px; font-weight: 600; }
.att-day .day-status { font-size: 10px; }

/* --- Grid layouts --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* --- Notification Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--gray-800);
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  z-index: 2000;
  animation: slideInUp 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
}

.toast.success { background: var(--green-600); }
.toast.warning { background: var(--amber-600); }
.toast.error { background: var(--red-600); }
.toast.achievement {
  background: linear-gradient(135deg, var(--amber-500), var(--wood-600));
  font-size: 15px;
  padding: 18px 24px;
}

.toast .toast-icon { font-size: 22px; }

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Star rating --- */
.star-rating {
  display: inline-flex;
  gap: 2px;
}

.star-rating .star {
  font-size: 16px;
  cursor: pointer;
  color: var(--gray-300);
  transition: color 0.1s;
}

.star-rating .star.filled { color: var(--amber-500); }
.star-rating .star:hover { color: var(--amber-400); }

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 15px;
}

/* --- Reward log --- */
.reward-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.reward-item:last-child { border-bottom: none; }

.reward-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.reward-info { flex: 1; }
.reward-desc { font-size: 14px; font-weight: 500; }
.reward-date { font-size: 12px; color: var(--gray-400); }
.reward-amount { font-size: 16px; font-weight: 700; color: var(--green-600); }

/* --- Category tags --- */
.cat-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

/* --- Chart container --- */
.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

/* --- Mobile toggle --- */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--wood-700);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 20px;
  cursor: pointer;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: 56px;
  }

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

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* --- Role Badges --- */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.role-badge.admin {
  background: linear-gradient(135deg, var(--amber-500), var(--wood-600));
  color: white;
}

.role-badge.employee {
  background: var(--blue-100);
  color: var(--blue-600);
}

/* --- Storage Warning --- */
.storage-warning {
  padding: 8px 12px;
  background: var(--amber-50);
  border: 1px solid var(--amber-500);
  border-radius: var(--radius-sm);
  color: var(--amber-600);
  font-size: 13px;
  font-weight: 600;
}

/* --- Attachment Items --- */
.attachment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all 0.15s;
}

.attachment-item:hover {
  border-color: var(--wood-300);
  background: var(--wood-50);
}

/* --- Login Screen --- */
.login-container {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
}

.login-logo {
  font-size: 72px;
  margin-bottom: 12px;
}

/* --- Wide Modal Override --- */
.modal.modal-wide {
  max-width: 700px;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--gray-500); }
.hidden { display: none !important; }

/* --- Phase Timeline --- */
.phase-timeline {
  position: relative;
  padding: 0;
}

.phase-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  padding: 10px 0;
}

.phase-step:last-child { padding-bottom: 0; }

.phase-connector {
  position: absolute;
  left: 17px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.phase-step:first-child .phase-connector { top: 50%; }
.phase-step:last-child .phase-connector { bottom: 50%; }

.phase-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  z-index: 1;
  border: 2px solid var(--gray-200);
  background: white;
  color: var(--gray-400);
  transition: all 0.2s;
}

.phase-done .phase-dot {
  background: var(--green-600);
  border-color: var(--green-600);
  color: white;
  font-size: 14px;
}

.phase-done .phase-connector { background: var(--green-500); }

.phase-current .phase-dot {
  background: var(--amber-500);
  border-color: var(--amber-500);
  color: white;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  animation: phasePulse 2s infinite;
}

.phase-current .phase-connector {
  background: linear-gradient(to bottom, var(--green-500), var(--gray-200));
}

@keyframes phasePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.1); }
}

.phase-content {
  flex: 1;
  min-width: 0;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.phase-icon { font-size: 18px; }

.phase-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-800);
}

.phase-pending .phase-name { color: var(--gray-400); }
.phase-done .phase-name { color: var(--green-700); }
.phase-current .phase-name { color: var(--amber-600); }

.phase-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-500);
}

.phase-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-500);
  font-style: italic;
  background: var(--gray-50);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--wood-300);
}

.phase-actions { margin-top: 6px; }

/* --- Mini Phase Progress (orders table) --- */
.mini-phase-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.mini-phase-bar {
  flex: 1;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  min-width: 50px;
  max-width: 80px;
}

.mini-phase-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green-500), var(--green-600));
  transition: width 0.3s;
}

.mini-phase-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-400);
  white-space: nowrap;
}

/* --- Logo je nyní jako obrázek v sidebar-logo ---  */

.login-elephant {
  margin-bottom: 12px;
  display: inline-block;
  animation: elephantFloat 3s ease-in-out infinite;
}

@keyframes elephantFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* --- Activity Feed --- */
.activity-feed {
  max-height: 340px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.feed-item:last-child { border-bottom: none; }

.feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.feed-content { flex: 1; min-width: 0; }

.feed-text {
  color: var(--gray-700);
  line-height: 1.4;
}

.feed-text strong { color: var(--gray-900); }
.feed-text em { font-style: normal; color: var(--wood-600); }

.feed-time {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* --- Gantt Chart --- */
.gantt-container {
  position: relative;
}

.gantt-header, .gantt-row {
  display: flex;
  align-items: stretch;
}

.gantt-label-col {
  width: 130px;
  flex-shrink: 0;
  padding: 6px 8px;
  font-size: 12px;
  border-right: 1px solid var(--gray-200);
}

.gantt-header .gantt-label-col {
  font-weight: 700;
  color: var(--gray-500);
  font-size: 11px;
  text-transform: uppercase;
}

.gantt-order-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-order-meta {
  font-size: 10px;
  color: var(--gray-400);
}

.gantt-timeline {
  flex: 1;
  display: flex;
  position: relative;
  min-height: 36px;
}

.gantt-header .gantt-timeline {
  min-height: 44px;
}

.gantt-day-header {
  text-align: center;
  font-size: 10px;
  color: var(--gray-500);
  border-right: 1px solid var(--gray-100);
  padding: 2px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gantt-day-header.gantt-today {
  background: rgba(245, 158, 11, 0.1);
  font-weight: 700;
  color: var(--amber-600);
}

.gantt-day-header.gantt-weekend {
  background: var(--gray-50);
  color: var(--gray-300);
}

.gantt-month {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-400);
  letter-spacing: 0.5px;
}

.gantt-day-num {
  font-size: 11px;
  font-weight: 600;
}

.gantt-row {
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s;
}

.gantt-row:hover {
  background: var(--gray-50);
}

.gantt-row .gantt-timeline {
  position: relative;
  align-items: center;
}

.gantt-bar {
  position: absolute;
  height: 22px;
  border-radius: 4px;
  top: 50%;
  transform: translateY(-50%);
  overflow: hidden;
  display: flex;
  align-items: center;
  min-width: 20px;
}

.gantt-bar-progress {
  background: var(--amber-100);
  border: 1px solid var(--amber-500);
}

.gantt-bar-done {
  background: var(--green-100);
  border: 1px solid var(--green-500);
}

.gantt-bar-late {
  background: var(--red-100);
  border: 1px solid var(--red-500);
}

.gantt-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
}

.gantt-bar-progress .gantt-bar-fill { background: rgba(245, 158, 11, 0.3); }
.gantt-bar-done .gantt-bar-fill { background: rgba(16, 185, 129, 0.3); }
.gantt-bar-late .gantt-bar-fill { background: rgba(239, 68, 68, 0.3); }

.gantt-bar-text {
  position: relative;
  z-index: 1;
  font-size: 9px;
  font-weight: 700;
  color: var(--gray-700);
  padding: 0 6px;
  white-space: nowrap;
}

.gantt-deadline {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: var(--red-500);
  z-index: 2;
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--amber-500);
  z-index: 3;
  opacity: 0.6;
}

.gantt-body {
  position: relative;
}

/* ============================================================
   ONBOARDING WIZARD
   ============================================================ */
.ob-progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
}
.ob-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--wood-400), var(--wood-600));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.ob-steps {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--gray-400);
}
.ob-steps span {
  transition: color 0.3s;
}
.ob-steps .ob-active {
  color: var(--wood-600);
  font-weight: 700;
}
.ob-steps .ob-done {
  color: var(--green-600);
  font-weight: 600;
}

/* ============================================================
   BACKUP BANNER
   ============================================================ */
.backup-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--amber-50, #fffbeb);
  border: 1px solid var(--amber-200, #fde68a);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray-700);
  flex-wrap: wrap;
}
.backup-banner .btn {
  white-space: nowrap;
}

/* ============================================================
   ŘÍDÍCÍ DASHBOARD
   ============================================================ */

/* Date range presets */
.dash-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dash-presets .btn { font-size: 12px; padding: 5px 12px; }

/* KPI Grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.dash-kpi {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: box-shadow 0.15s;
}
.dash-kpi:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.dash-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--wood-800);
  line-height: 1.2;
}
.dash-kpi-unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
}
.dash-kpi-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
  font-weight: 500;
}
.dash-kpi-sub {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 600;
}

/* Dashboard panels */
.dash-panel {
  overflow: hidden;
}

/* Alert items (bottlenecks) */
.dash-alert {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  line-height: 1.4;
  transition: background 0.15s;
}
.dash-alert:last-child { border-bottom: none; }
.dash-alert:hover { background: var(--gray-50); }
.dash-alert-critical {
  border-left: 3px solid var(--red-500);
  background: var(--red-50);
}
.dash-alert-warning {
  border-left: 3px solid var(--amber-400, #fbbf24);
  background: var(--amber-50, #fffbeb);
}
.dash-alert-info {
  border-left: 3px solid var(--blue-500);
  background: var(--blue-50);
}

/* Recommendation items */
.dash-rec {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
}
.dash-rec:last-child { border-bottom: none; }
.dash-rec:hover { background: var(--gray-50); }
.dash-rec-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.dash-rec-body { flex: 1; min-width: 0; }
.dash-rec-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-800);
  margin-bottom: 2px;
}
.dash-rec-text {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.4;
}

/* Deadline table colors */
.deadline-overdue td:first-child { border-left: 3px solid var(--red-500); }
.deadline-critical td:first-child { border-left: 3px solid var(--amber-400, #fbbf24); }
.deadline-warning td:first-child { border-left: 3px solid var(--amber-200, #fde68a); }

/* Dashboard team table */
.dash-team-table td, .dash-deadlines-table td { font-size: 13px; padding: 8px 10px; }
.dash-team-table th, .dash-deadlines-table th { font-size: 12px; padding: 8px 10px; white-space: nowrap; }

/* Widget config panel */
.dash-config label:hover {
  background: var(--wood-200) !important;
}
.dash-config input[type="checkbox"] {
  accent-color: var(--wood-500);
}

/* Badge variants */
.badge-amber {
  background: var(--amber-50, #fffbeb);
  color: #b45309;
  border: 1px solid var(--amber-200, #fde68a);
}

/* Responsive dashboard */
@media (max-width: 900px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Financial grid */
.dash-fin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-100);
}
.dash-fin-item {
  padding: 12px 14px;
  background: var(--white);
}
.dash-fin-label {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 2px;
}
.dash-fin-value {
  font-size: 16px;
  font-weight: 700;
}
.dash-fin-highlight {
  background: var(--wood-50);
}

/* Capacity bar */
.capacity-bar-wrap {
  height: 10px;
  background: var(--gray-200);
  border-radius: 5px;
  overflow: hidden;
}
.capacity-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}

/* Mini progress (reusable) */
.mini-progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.mini-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
  background: var(--green-500);
}

@media (max-width: 900px) {
  .dash-fin-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dash-kpi { padding: 10px; }
  .dash-kpi-value { font-size: 20px; }
  .dash-presets { gap: 4px; }
  .dash-presets .btn { padding: 4px 8px; font-size: 11px; }
  .dash-presets input[type="date"] { width: 110px !important; }
  .dash-fin-grid { grid-template-columns: 1fr 1fr; }
  .dash-fin-value { font-size: 14px; }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--wood-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
