/* =============================================
   PANELBUD — DESIGN SYSTEM & STYLES
   ============================================= */

/* --- Variables --- */
:root {
  --bg: #0F1923;
  --surface: #1A2535;
  --surface2: #1F2E42;
  --surface3: #243450;
  --accent: #F97316;
  --accent-hover: #EA6C0C;
  --accent-light: rgba(249,115,22,0.15);
  --text: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --success: #22C55E;
  --success-light: rgba(34,197,94,0.15);
  --warning: #EAB308;
  --warning-light: rgba(234,179,8,0.15);
  --danger: #EF4444;
  --danger-light: rgba(239,68,68,0.15);
  --info: #3B82F6;
  --info-light: rgba(59,130,246,0.15);
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --sidebar-w: 260px;
  --mobile-nav-h: 72px;
  --transition: 200ms ease-in-out;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --surface2: #F8FAFC;
  --surface3: #EFF3F8;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border: rgba(0,0,0,0.07);
  --border-strong: rgba(0,0,0,0.12);
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }
img { max-width: 100%; }
ul { list-style: none; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Typography --- */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
h4 { font-size: 0.95rem; font-weight: 600; }
p { line-height: 1.6; color: var(--text-secondary); }

/* =============================================
   LAYOUT
   ============================================= */
#app { min-height: 100dvh; }

.app-layout {
  display: flex;
  min-height: 100dvh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100dvh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-text { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.5px; }
.sidebar-logo-text span { color: var(--accent); }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item:hover { background: var(--border); color: var(--text); }
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--border); }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar.lg { width: 48px; height: 48px; font-size: 1.1rem; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.72rem; color: var(--text-secondary); }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Top header bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-bar-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 16px;
  width: min(320px, 40vw);
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.875rem;
  width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar svg { flex-shrink: 0; color: var(--text-muted); }

/* Page content */
.page-content {
  flex: 1;
  padding: 28px 28px 120px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0 8px;
  align-items: center;
  justify-content: space-around;
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item svg { transition: transform var(--transition); }
.mobile-nav-item.active svg { transform: scale(1.1); }
.mobile-nav-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* Mobile header */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  align-items: center;
  gap: 12px;
}
.mobile-header-logo { font-size: 1.1rem; font-weight: 800; flex: 1; }
.mobile-header-logo span { color: var(--accent); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(249,115,22,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface3); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { background: var(--border); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #16A34A; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(34,197,94,0.3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #DC2626; }
.btn-warning { background: var(--warning); color: #0F172A; }
.btn-lg { padding: 16px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.btn-icon.sm { width: 32px; height: 32px; }
.btn-icon.lg { width: 48px; height: 48px; border-radius: var(--radius); }

/* Ripple effect */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: ripple-anim 0.5s linear;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* =============================================
   FORMS & INPUTS
   ============================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.form-input, .form-select, .form-textarea {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  padding: 12px 14px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 100px; }
.form-input.error { border-color: var(--danger); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); }
.form-error { font-size: 0.78rem; color: var(--danger); }
.input-group { display: flex; gap: 0; }
.input-group .form-input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) {
  .form-row, .form-row.three { grid-template-columns: 1fr; }
}

/* Toggle switch */
.toggle-wrapper { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle {
  position: relative;
  width: 44px; height: 24px;
  background: var(--surface3);
  border-radius: 99px;
  border: 1.5px solid var(--border-strong);
  transition: background var(--transition);
  flex-shrink: 0;
  cursor: pointer;
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 1px; left: 1px;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.toggle.on::after { transform: translateX(20px); }
.toggle-label { font-size: 0.9rem; font-weight: 500; }

/* Checkbox */
.checkbox-wrapper { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition);
}
.checkbox.checked { background: var(--accent); border-color: var(--accent); }
.checkbox-label { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.checkbox-label a { color: var(--accent); }

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-strong); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}
.card-title { font-size: 1rem; font-weight: 700; }
.card-subtitle { font-size: 0.8rem; color: var(--text-secondary); }
.card-clickable { cursor: pointer; }
.card-clickable:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-light); }

/* Stat card */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.stat-card-value {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
.stat-card-label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }
.stat-card-change {
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-card-change.up { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* Project card */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  animation: fadeInUp 0.3s ease-out both;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-light), var(--shadow-sm);
  transform: translateY(-2px);
}
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.project-card-name { font-size: 1rem; font-weight: 700; }
.project-card-address { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.project-progress { margin: 12px 0; }
.progress-bar {
  height: 6px;
  background: var(--surface3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }
.progress-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.progress-pct { font-size: 0.82rem; font-weight: 700; }
.project-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.project-workers { display: flex; align-items: center; gap: -4px; }
.project-workers .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.project-workers .avatar:first-child { margin-left: 0; }

/* =============================================
   BADGES & CHIPS
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-neutral { background: var(--surface3); color: var(--text-secondary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover, .chip.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

/* =============================================
   MODALS
   ============================================= */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}
#modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 0 24px 20px;
  display: flex; gap: 10px; justify-content: flex-end;
}

/* =============================================
   ALERTS & ATTENTION PANEL
   ============================================= */
.attention-panel {
  background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(249,115,22,0.06));
  border: 1px solid rgba(249,115,22,0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}
.attention-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.attention-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(249,115,22,0.1);
  cursor: pointer;
  transition: opacity var(--transition);
}
.attention-item:last-child { border-bottom: none; padding-bottom: 0; }
.attention-item:hover { opacity: 0.8; }
.attention-item-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.attention-item-text { flex: 1; font-size: 0.875rem; font-weight: 500; }
.attention-item-link { font-size: 0.8rem; color: var(--accent); font-weight: 600; white-space: nowrap; }

/* Alert bar */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 12px;
}
.alert-success { background: var(--success-light); border-left: 3px solid var(--success); }
.alert-warning { background: var(--warning-light); border-left: 3px solid var(--warning); }
.alert-danger { background: var(--danger-light); border-left: 3px solid var(--danger); }
.alert-info { background: var(--info-light); border-left: 3px solid var(--info); }

/* =============================================
   TABLES
   ============================================= */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border-strong); }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}
td {
  padding: 13px 14px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--surface2); }
td strong { color: var(--text); }

/* =============================================
   CHARTS — SVG-based
   ============================================= */
.chart-wrapper { position: relative; }
.chart-bar { transition: opacity var(--transition); cursor: pointer; }
.chart-bar:hover { opacity: 0.8; }
.chart-label { font-family: var(--font); fill: var(--text-muted); font-size: 11px; }
.chart-value { font-family: var(--font); fill: var(--text); font-size: 11px; font-weight: 600; }

/* =============================================
   TIMELINE / CALENDAR
   ============================================= */
.week-calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.week-calendar-header {
  display: grid;
  grid-template-columns: 140px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.week-header-cell {
  padding: 12px 8px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
}
.week-header-cell:last-child { border-right: none; }
.week-header-cell.today { color: var(--accent); }
.week-row {
  display: grid;
  grid-template-columns: 140px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.week-row:last-child { border-bottom: none; }
.week-worker-cell {
  padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
}
.week-day-cell {
  padding: 6px;
  border-right: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.week-day-cell:last-child { border-right: none; }
.week-project-chip {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 16px;
}
.empty-state-icon {
  width: 80px; height: 80px;
  background: var(--surface2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.empty-state p { font-size: 0.875rem; color: var(--text-secondary); max-width: 320px; }

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
#toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: slideInRight 0.25s ease-out;
  cursor: pointer;
}
.toast.removing { animation: slideOutRight 0.2s ease-in forwards; }
.toast-icon { flex-shrink: 0; }
.toast-text { flex: 1; }
.toast-title { font-size: 0.875rem; font-weight: 700; color: var(--text); }
.toast-msg { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

/* =============================================
   WELCOME SCREEN
   ============================================= */
.welcome-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.welcome-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.welcome-bg-grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(249,115,22,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(249,115,22,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(800px) rotateX(30deg);
  transform-origin: center top;
}
.welcome-bg-glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.12) 0%, transparent 70%);
  top: -200px; left: 50%;
  transform: translateX(-50%);
}
.welcome-bg-glow2 {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
  bottom: -100px; right: -100px;
}
.welcome-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  animation: fadeInUp 0.5s ease-out;
}
.welcome-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  text-align: center;
}
.welcome-logo-icon {
  width: 64px; height: 64px;
  background: var(--accent);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(249,115,22,0.4);
  animation: logoPulse 3s ease-in-out infinite;
}
.welcome-logo-text {
  text-align: left;
}
.welcome-logo-name {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
}
.welcome-logo-name span { color: var(--accent); }
.welcome-tagline {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.4;
}
.welcome-headline {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}
.welcome-sub {
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-size: 1rem;
  line-height: 1.6;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.welcome-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 4px 0;
}
.welcome-divider::before, .welcome-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.welcome-features {
  display: flex; gap: 24px; margin-top: 36px;
  flex-wrap: wrap; justify-content: center;
}
.welcome-feature {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--text-muted); font-weight: 500;
}
.welcome-feature-icon {
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.welcome-footer {
  position: absolute;
  bottom: 20px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(249,115,22,0.4); }
  50% { box-shadow: 0 8px 48px rgba(249,115,22,0.6); }
}

/* =============================================
   AUTH SCREENS
   ============================================= */
.auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  background: var(--bg);
}
.auth-bg-glow {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 5vw, 40px);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease-out;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
  text-decoration: none;
}
.auth-logo-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-name { font-size: 1.3rem; font-weight: 900; letter-spacing: -1px; }
.auth-logo-name span { color: var(--accent); }
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.auth-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 28px; line-height: 1.5; }
.auth-mode-switcher {
  display: flex;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}
.auth-mode-btn {
  flex: 1;
  padding: 9px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  color: var(--text-secondary);
}
.auth-mode-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.auth-back {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 20px;
  width: fit-content;
  transition: color var(--transition);
}
.auth-back:hover { color: var(--text); }

/* PIN input */
.pin-input-wrapper {
  display: flex; gap: 10px; justify-content: center;
  margin: 8px 0;
}
.pin-digit {
  width: 48px; height: 60px;
  background: var(--surface2);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
  -webkit-text-security: disc;
}
.pin-digit:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

/* =============================================
   ONBOARDING
   ============================================= */
.onboarding-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
}
.onboarding-progress {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 32px;
}
.onboarding-step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface3);
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  transition: all 0.3s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}
.onboarding-step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-light);
}
.onboarding-step-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.onboarding-step-line {
  flex: 1;
  height: 2px;
  background: var(--border-strong);
  transition: background 0.3s ease;
}
.onboarding-step-line.done { background: var(--success); }
.onboarding-step-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.onboarding-step-desc { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 24px; line-height: 1.5; }

/* Generated credentials display */
.credentials-box {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}
.credentials-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.credentials-row:last-child { border-bottom: none; }
.credentials-label { font-size: 0.78rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.credentials-value { font-size: 1rem; font-weight: 700; font-family: monospace; color: var(--accent); letter-spacing: 0.05em; }

/* =============================================
   DASHBOARD
   ============================================= */
.dashboard-greeting {
  margin-bottom: 24px;
}
.dashboard-greeting h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; }
.dashboard-greeting p { color: var(--text-secondary); margin-top: 4px; }
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 24px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.dashboard-grid.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
/* Pozwól kolumnom kurczyć się poniżej min-content (zapobiega grid blowout na mobile) */
.dashboard-grid > * { min-width: 0; }
.col-span-2 { grid-column: span 2; }

/* Quick actions (employee) */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-height: 110px;
  position: relative;
  overflow: hidden;
}
.quick-action-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.quick-action-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.quick-action-label { font-size: 0.82rem; font-weight: 700; color: var(--text); line-height: 1.3; }

/* Material request item */
.request-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.request-item:last-child { border-bottom: none; }
.request-info { flex: 1; min-width: 0; }
.request-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.request-meta { font-size: 0.77rem; color: var(--text-secondary); }
.request-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

/* Invoice item */
.invoice-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.invoice-item:last-child { border-bottom: none; }
.invoice-info { flex: 1; min-width: 0; }
.invoice-name { font-size: 0.875rem; font-weight: 600; }
.invoice-meta { font-size: 0.77rem; color: var(--text-secondary); margin-top: 2px; }
.invoice-amount { font-size: 1rem; font-weight: 800; color: var(--text); text-align: right; white-space: nowrap; }
.invoice-amount.overdue { color: var(--danger); }

/* =============================================
   PAGE HEADERS
   ============================================= */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header-left {}
.page-header h2 { font-size: 1.5rem; font-weight: 800; }
.page-header p { color: var(--text-secondary); font-size: 0.875rem; margin-top: 4px; }
.page-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 20px;
}

/* =============================================
   SETTINGS PAGE
   ============================================= */
.settings-section { margin-bottom: 32px; }
.settings-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.settings-item:last-child { border-bottom: none; }
.settings-item-info { flex: 1; min-width: 0; }
.settings-item-name { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.settings-item-desc { font-size: 0.8rem; color: var(--text-secondary); }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(120%); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-fade-up { animation: fadeInUp 0.35s ease-out both; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
.spin { animation: spin 1s linear infinite; }

/* View transition */
.view-enter {
  animation: fadeInUp 0.2s ease-out;
}

/* =============================================
   UTILITY
   ============================================= */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-mono { font-family: monospace; }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.1rem; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.section-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 24px 0 16px;
}
.section-divider::before, .section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* =============================================
   RESPONSIVE — MOBILE
   ============================================= */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding-bottom: var(--mobile-nav-h); }
  .mobile-nav { display: flex; }
  .mobile-header { display: flex; }
  .top-bar { display: none; }

  /* KPI: tylko rozmiar tekstu/ikony (układ siatki = jedna reguła globalna) */
  .stat-card-icon  { width: 36px; height: 36px; flex-shrink: 0; }
  .stat-card-value { font-size: 1.4rem; letter-spacing: -0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat-card-label { font-size: 0.73rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid.three { grid-template-columns: minmax(0, 1fr); }
  .col-span-2 { grid-column: span 1; }

  .page-content { padding: 16px 16px 100px; }
  .page-header { flex-direction: column; gap: 12px; }
  .page-header-actions { width: 100%; }

  /* Schedule: hide table, show mobile cards */
  .week-calendar-desktop { display: none !important; }
  .week-cards-mobile     { display: block !important; }

  /* Card text truncation */
  .project-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .project-card-header { overflow: hidden; }

  /* Prevent content overflow */
  .card { overflow: hidden; }
  .request-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

  /* POPRAWKA 6 — Invoice items: vertical layout on mobile */
  .invoice-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 0;
  }
  .invoice-info { width: 100%; }
  .invoice-name { white-space: normal; overflow: hidden; font-size: 0.875rem; }
  .invoice-amount { font-size: 1rem; font-weight: 800; text-align: left; align-self: flex-start; }

  /* Invoice full-list table: horizontal scroll */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Tables: prevent overflow */
  table { min-width: 480px; }

  #toast-container { top: auto; bottom: 90px; right: 12px; left: 12px; }
  .toast { min-width: unset; max-width: unset; }

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

  /* Buttons in flex rows — allow wrap */
  .btn-row { flex-wrap: wrap; }
}

/* Mobile schedule cards: hidden on desktop */
.week-calendar-desktop { display: block; }
.week-cards-mobile     { display: none; }

@media (max-width: 480px) {
  .quick-actions { gap: 10px; }
  .quick-action-btn { min-height: 90px; padding: 14px 8px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px; }
  .onboarding-card { padding: 24px 20px; }
  .pin-digit { width: 42px; height: 54px; font-size: 1.2rem; }
}

/* Extra-small phones (390px and below) */
@media (max-width: 390px) {
  /* Spacing */
  .page-content { padding: 10px 10px 96px; }
  .card { padding: 12px 10px; }

  /* KPI tiles — tylko padding/rozmiar (układ = jedna reguła globalna) */
  .stat-card { padding: 10px 8px; gap: 3px; }
  .stat-card-icon { width: 30px; height: 30px; margin-bottom: 0; }
  .stat-card-value { font-size: 1.25rem; }
  .stat-card-label { font-size: 0.68rem; }

  /* Bottom nav */
  .mobile-nav { padding: 0 2px; }
  .mobile-nav-item { padding: 8px 2px 6px; min-width: 0; flex: 1; }
  .mobile-nav-item span { font-size: 0.6rem; }
  .mobile-nav-item svg { width: 20px; height: 20px; }

  /* Project cards */
  .project-card { padding: 12px 10px; }
  .project-card-name { font-size: 0.88rem; }
  .project-card-address { font-size: 0.72rem; }
  .proj-stage-badge { font-size: 0.62rem !important; padding: 2px 6px !important; }

  /* Employee cards */
  .employee-card { padding: 12px 10px; }

  /* Requests */
  .request-name { max-width: 140px; font-size: 0.82rem; }
  .request-actions { gap: 4px; }

  /* Invoice items */
  .invoice-amount { font-size: 0.95rem; }

  /* Page header */
  .page-header h1, .page-header .page-title { font-size: 1.1rem; }
  .page-header-actions .btn { font-size: 0.78rem; padding: 6px 10px; }

  /* Auth screens */
  .auth-card { padding: 20px 16px; }
  .onboarding-card { padding: 20px 16px; }
  .pin-digit { width: 40px; height: 50px; font-size: 1.1rem; }

  /* Employee action grid */
  .emp-actions-grid { gap: 6px; }
  .emp-action-card { min-height: 105px; padding: 12px 6px 10px; }
  .emp-action-icon { width: 44px; height: 44px; }
  .emp-action-label { font-size: 0.74rem; }
  .emp-action-sub { font-size: 0.62rem; }

  /* Czas pracy buttons */
  .btn { font-size: 0.82rem; }
  .btn-sm { font-size: 0.72rem; }

  /* Chat */
  .czat-input-row { gap: 6px; }
  .czat-input { font-size: 0.85rem; }

  /* Form fields — min 16px to prevent iOS auto-zoom */
  input, select, textarea { font-size: 1rem !important; }
  .form-group label { font-size: 0.8rem; }
}

@media (min-width: 1200px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

@media (min-width: 1400px) {
  .page-content { padding: 32px 40px 40px; }
}

/* =============================================
   EMPLOYEE DASHBOARD
   ============================================= */

/* Siatka 3 dużych przycisków akcji */
.emp-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Karta przycisku akcji pracownika */
.emp-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 10px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-height: 130px;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.emp-action-card:hover,
.emp-action-card:active {
  border-color: var(--card-accent, var(--accent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-accent, var(--accent)) 20%, transparent),
              0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.emp-action-card:active { transform: scale(0.97); }

.emp-action-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}
.emp-action-card:hover .emp-action-icon { transform: scale(1.08); }

.emp-action-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.emp-action-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Na małym ekranie jeszcze większe dotykowe cele */
@media (max-width: 400px) {
  .emp-actions-grid { gap: 8px; }
  .emp-action-card  { min-height: 115px; padding: 16px 6px 12px; }
  .emp-action-icon  { width: 50px; height: 50px; }
  .emp-action-label { font-size: 0.78rem; }
  .emp-action-sub   { font-size: 0.65rem; }
}

/* =============================================
   PRINT — Invoice styles
   ============================================= */
@media print {
  .sidebar, .mobile-nav, .mobile-header, .top-bar, #toast-container { display: none !important; }
  .main-content { margin: 0; }
  .invoice-print { font-family: Arial, sans-serif; color: #000; }
}
