/* =====================================================
   zakazky.cleanexcentrum.sk — Main Stylesheet
   Dark theme, DM Sans + Space Mono
   ===================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --bg:      #0f1117;
  --bg2:     #181b24;
  --bg3:     #1e222d;
  --bg4:     #262b38;
  --text:    #e8eaf0;
  --text2:   #9ea3b5;
  --text3:   #636880;
  --accent:  #4f8cff;
  --green:   #34d399;
  --orange:  #fb923c;
  --red:     #f87171;
  --purple:  #a78bfa;
  --yellow:  #fbbf24;
  --border:  rgba(255,255,255,0.06);
  --shadow:  0 4px 24px rgba(0,0,0,0.4);
  --radius:  10px;
  --sidebar-w: 240px;
  --topbar-h:  56px;
  --transition: 0.18s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

img { display: block; max-width: 100%; }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 50;
  gap: 1rem;
}

.content {
  padding: 1.75rem 1.5rem;
  flex: 1;
}

/* ---------- Sidebar ---------- */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.logo-icon { font-size: 1.4rem; }
.logo-text { color: var(--text); }

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--text2);
  font-size: 0.93rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.nav-item:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.nav-item.active { background: rgba(79,140,255,0.13); color: var(--accent); }

.nav-icon {
  width: 17px; height: 17px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

.sidebar-footer {
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text3);
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 6px;
  color: var(--text3);
  transition: color var(--transition), background var(--transition);
}

.btn-logout:hover { color: var(--red); background: rgba(248,113,113,0.1); text-decoration: none; }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ---------- Topbar ---------- */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border-radius: 6px;
  color: var(--text2);
}

.hamburger:hover { background: var(--bg3); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition), opacity var(--transition);
  cursor: pointer;
  border: none;
  line-height: 1.4;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover  { background: #3a78f5; }

.btn-ghost    { background: var(--bg3); color: var(--text2); }
.btn-ghost:hover    { background: var(--bg4); color: var(--text); }

.btn-danger   { background: rgba(248,113,113,.15); color: var(--red); }
.btn-danger:hover   { background: rgba(248,113,113,.25); }

.btn-success  { background: rgba(52,211,153,.15); color: var(--green); }
.btn-success:hover  { background: rgba(52,211,153,.25); }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

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

.card-body {
  padding: 0 0 0.5rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Stats Cards ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text2);
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.stat-value {
  font-family: 'Space Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 0.35rem;
}

.stat-up   { color: var(--green); }
.stat-down { color: var(--red); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue   { background: rgba(79,140,255,.15); color: var(--accent); }
.badge-purple { background: rgba(167,139,250,.15); color: var(--purple); }
.badge-orange { background: rgba(251,146,60,.15);  color: var(--orange); }
.badge-green  { background: rgba(52,211,153,.15);  color: var(--green); }
.badge-red    { background: rgba(248,113,113,.15); color: var(--red); }
.badge-gray   { background: var(--bg3); color: var(--text3); }

.badge-admin       { background: rgba(251,191,36,.15); color: var(--yellow); }
.badge-dispecer    { background: rgba(167,139,250,.15); color: var(--purple); }
.badge-zamestnanec { background: rgba(79,140,255,.15);  color: var(--accent); }

/* Priority dot */
.priority-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-normalni { background: var(--green); }
.priority-urgentni { background: var(--red); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

thead th:hover { color: var(--text2); }
thead th.sort-asc::after  { content: ' ↑'; }
thead th.sort-desc::after { content: ' ↓'; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }

tbody td {
  padding: 0.75rem 1rem;
  color: var(--text);
  vertical-align: middle;
}

/* ---------- Forms ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.form-row .form-group { flex: 1; min-width: 120px; }

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
}

.required { color: var(--red); }

.form-input {
  background: var(--bg3);
  border: 1px solid var(--bg4);
  border-radius: 7px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color var(--transition);
  width: 100%;
}

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

.form-input::placeholder { color: var(--text3); }

.form-input.error { border-color: var(--red); }

.form-error {
  font-size: 0.78rem;
  color: var(--red);
}

select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* Color picker wrapper */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.color-preview {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 2px solid var(--bg4);
  flex-shrink: 0;
}
.color-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.color-swatch:hover, .color-swatch.selected { transform: scale(1.2); border-color: var(--text); }

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg4);
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text2);
  left: 3px; top: 3px;
  transition: transform var(--transition), background var(--transition);
}
.toggle input:checked + .toggle-slider { background: rgba(79,140,255,.3); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: var(--accent); }
.toggle-label { font-size: 0.875rem; color: var(--text2); }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title { font-size: 1.05rem; font-weight: 700; }

.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--bg3); color: var(--text); }

.modal-body {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 9px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
  min-width: 240px;
  max-width: 360px;
}

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

.toast-success { background: rgba(52,211,153,.2); border: 1px solid var(--green); color: var(--green); }
.toast-error   { background: rgba(248,113,113,.2); border: 1px solid var(--red);  color: var(--red);  }
.toast-info    { background: rgba(79,140,255,.2);  border: 1px solid var(--accent); color: var(--accent); }

/* ---------- Employee Chips ---------- */
.employee-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.emp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: opacity var(--transition), border-color var(--transition);
  opacity: 0.45;
  color: #fff;
}

.emp-chip.selected { opacity: 1; border-color: rgba(255,255,255,0.3); }

/* ---------- Employee Avatar ---------- */
.emp-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ---------- Calendar ---------- */
.calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.calendar-nav button {
  width: 32px; height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  background: var(--bg3);
  transition: background var(--transition), color var(--transition);
}
.calendar-nav button:hover { background: var(--bg4); color: var(--text); }

.calendar-title {
  font-size: 1rem;
  font-weight: 700;
  min-width: 160px;
  text-align: center;
}

.view-tabs {
  display: flex;
  background: var(--bg3);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.view-tab {
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text3);
  transition: background var(--transition), color var(--transition);
}
.view-tab.active { background: var(--bg2); color: var(--text); }

.emp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.emp-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.emp-filter-btn:hover { color: var(--text); background: var(--bg4); }
.emp-filter-btn.active { border-color: currentColor; }

.emp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Month grid */
.cal-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.cal-header-cell {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  min-height: 100px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.4rem;
  background: var(--bg);
  cursor: pointer;
  transition: background var(--transition);
  overflow: hidden;
}

.cal-day:nth-child(7n)   { border-right: none; }
.cal-day:hover           { background: var(--bg2); }
.cal-day.today           { background: rgba(79,140,255,0.06); }
.cal-day.other-month .cal-day-num { color: var(--text3); }
.cal-day.today .cal-day-num       { color: var(--accent); font-weight: 700; }

.cal-day-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 0.25rem;
}

.cal-event {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity var(--transition);
}
.cal-event:hover { opacity: 0.85; }

.cal-more {
  font-size: 0.7rem;
  color: var(--text3);
  padding: 0.1rem 0.3rem;
  cursor: pointer;
}

/* Week view */
.week-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
}

.week-header-row {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.week-header-gutter { border-right: 1px solid var(--border); }
.week-header-cell {
  padding: 0.5rem 0.4rem;
  text-align: center;
  font-weight: 600;
  color: var(--text2);
  border-right: 1px solid var(--border);
}
.week-header-cell.today { color: var(--accent); }

.week-body {
  display: flex;
  overflow-y: auto;
  max-height: calc(100vh - 260px);
  position: relative;
}

.week-time-col {
  width: 52px;
  flex-shrink: 0;
  position: relative;
  background: var(--bg2);
  border-right: 1px solid var(--border);
}
.week-hour-label {
  position: absolute;
  right: 6px;
  font-size: 0.68rem;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
  transform: translateY(-50%);
  white-space: nowrap;
}

.week-day-col {
  flex: 1;
  position: relative;
  border-right: 1px solid var(--border);
  transition: background var(--transition);
}
.week-day-col:last-child { border-right: none; }
.week-day-col:hover { cursor: crosshair; }

.week-hover-slot {
  position: absolute;
  left: 2px; right: 2px;
  border-radius: 4px;
  background: rgba(79, 140, 255, 0.1);
  border: 1px dashed rgba(79, 140, 255, 0.45);
  pointer-events: none;
  z-index: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-family: 'Space Mono', monospace;
  color: rgba(79, 140, 255, 0.85);
}

.week-hour-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px solid var(--border);
  pointer-events: none;
}

.week-event {
  position: absolute;
  left: 2px; right: 2px;
  border-radius: 5px;
  padding: 3px 5px;
  overflow: hidden;
  color: #fff;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: filter var(--transition);
  z-index: 1;
}
.week-event:hover { filter: brightness(1.15); }
.week-event-time {
  font-size: 0.68rem;
  opacity: 0.85;
  font-family: 'Space Mono', monospace;
  flex-shrink: 0;
}
.week-event-title {
  font-size: 0.78rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* List view */
.list-view-day { margin-bottom: 1.25rem; }
.list-view-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.list-event {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: background var(--transition);
}
.list-event:hover { background: var(--bg3); }

.list-event-bar { width: 4px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.list-event-time { font-family: 'Space Mono', monospace; font-size: 0.78rem; color: var(--text2); min-width: 60px; }
.list-event-title { font-weight: 600; flex: 1; }
.list-event-client { font-size: 0.8rem; color: var(--text2); }

/* ---------- Dashboard ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  align-items: start;
}

.job-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.job-list-item:last-child { border-bottom: none; }
.job-list-item:hover { background: var(--bg3); }

.job-color-bar { width: 4px; border-radius: 2px; align-self: stretch; min-height: 40px; flex-shrink: 0; }

.job-info { flex: 1; min-width: 0; }
.job-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.15rem; }
.job-meta  { font-size: 0.78rem; color: var(--text2); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.job-time  { font-family: 'Space Mono', monospace; font-size: 0.78rem; color: var(--text3); white-space: nowrap; }

.emp-activity-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.emp-activity-item:last-child { border-bottom: none; }
.emp-activity-info { flex: 1; min-width: 0; }
.emp-activity-name { font-weight: 600; font-size: 0.875rem; }
.emp-activity-sub  { font-size: 0.78rem; color: var(--text2); }

/* ---------- Employee Cards ---------- */
.employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.emp-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color var(--transition);
}

.emp-card:hover { border-color: rgba(255,255,255,0.12); }

.emp-card-header { display: flex; align-items: center; gap: 0.75rem; }
.emp-card-name { font-weight: 700; font-size: 0.95rem; }
.emp-card-spec { font-size: 0.8rem; color: var(--text3); }
.emp-card-meta { font-size: 0.82rem; color: var(--text2); display: flex; flex-direction: column; gap: 0.2rem; }
.emp-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

/* Inactive overlay */
.emp-card.inactive { opacity: 0.55; }

/* ---------- Client Cards ---------- */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.client-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color var(--transition);
}
.client-card:hover { border-color: rgba(255,255,255,0.12); }

.client-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.35rem; }
.client-meta { font-size: 0.82rem; color: var(--text2); display: flex; flex-direction: column; gap: 0.2rem; }
.client-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.85rem; }

/* ---------- Filter bar (jobs) ---------- */
.filter-bar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { color: var(--text); background: var(--bg4); }
.filter-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(79,140,255,0.1); }

/* ---------- Date / Time Pickers ---------- */
.picker-wrap {
  position: relative;
}

.picker-wrap .form-input {
  padding-right: 2.2rem;
  cursor: pointer;
}

.picker-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}
.picker-btn:hover { color: var(--accent); }

/* Floating popup shared */
.picker-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 300;
  background: var(--bg2);
  border: 1px solid var(--bg4);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: modalIn 0.15s ease;
  user-select: none;
}

/* ---- Date picker ---- */
.dp-popup { width: 272px; }

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.dp-title {
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.dp-nav {
  display: flex;
  gap: 0.25rem;
}

.dp-nav button {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  background: var(--bg3);
  transition: background var(--transition), color var(--transition);
  font-size: 0.9rem;
}
.dp-nav button:hover { background: var(--bg4); color: var(--text); }

.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0.4rem 0.5rem 0.1rem;
}

.dp-weekday {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  padding: 0.2rem 0;
}

.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0.1rem 0.5rem 0.5rem;
  gap: 2px;
}

.dp-day {
  text-align: center;
  padding: 0.3rem 0;
  border-radius: 6px;
  font-size: 0.83rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: var(--text);
}

.dp-day:hover         { background: var(--bg3); }
.dp-day.other-month   { color: var(--text3); }
.dp-day.today         { color: var(--accent); font-weight: 700; }
.dp-day.selected      { background: var(--accent); color: #fff; font-weight: 700; }
.dp-day.selected:hover{ background: var(--accent); }

/* ---- Time picker ---- */
.tp-popup {
  width: 180px;
  padding: 0.5rem;
}

.tp-label {
  display: flex;
  justify-content: space-around;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.tp-cols {
  display: flex;
  gap: 0.4rem;
}

.tp-col {
  flex: 1;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) transparent;
}

.tp-col::-webkit-scrollbar { width: 4px; }
.tp-col::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }

.tp-item {
  text-align: center;
  padding: 0.35rem 0;
  border-radius: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: var(--text2);
}

.tp-item:hover    { background: var(--bg3); color: var(--text); }
.tp-item.selected { background: var(--accent); color: #fff; }

.tp-confirm {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.4rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background var(--transition);
}
.tp-confirm:hover { background: #3a78f5; }

/* ---------- Utility ---------- */
.text-muted  { color: var(--text2); }
.text-mono   { font-family: 'Space Mono', monospace; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text3);
  font-size: 0.9rem;
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--bg4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login Page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.login-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo-icon { font-size: 2.5rem; }
.login-logo-name { font-size: 1.1rem; font-weight: 700; margin-top: 0.4rem; }
.login-logo-sub  { font-size: 0.82rem; color: var(--text3); }

.login-box .form-group { margin-bottom: 1rem; }
.login-box .btn-primary { width: 100%; justify-content: center; padding: 0.65rem; }

.login-error {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: var(--red);
  margin-bottom: 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }

  .main-wrapper { margin-left: 0; }

  .hamburger { display: flex; }

  .content { padding: 1rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

  .cal-day { min-height: 60px; }

  .cal-event .cal-event-title { display: none; }

  .week-header-row { grid-template-columns: 40px repeat(7, 1fr); }
  .week-time-col { width: 40px; }

  table { font-size: 0.82rem; }
  thead th, tbody td { padding: 0.6rem 0.75rem; }

  .employees-grid, .clients-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 1rem; }
  .modal { border-radius: 12px 12px 0 0; margin-top: auto; max-height: 95vh; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
}
