/* ============================================================
   HDH Company Planner – Jobbplanerare för företag
   ============================================================ */

:root {
  --planner-ui-primary: var(--arv-forest, #16231E);
  --planner-ui-primary-hover: var(--arv-forest-hover, #1B2A24);
}

/* ---------- Bas / Reset ---------- */
.planner-page {
  background: var(--arv-offwhite, #F2EFE9);
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--arv-soft-black, #0F1112);
}

/* ---------- Hero / Header ---------- */
.planner-hero {
  background: linear-gradient(135deg, var(--arv-forest, #16231E) 0%, var(--arv-forest-hover, #1B2A24) 100%);
  color: var(--arv-offwhite, #F2EFE9);
  padding: 2rem 2rem 1.5rem;
}

.planner-hero-inner {
  max-width: var(--arv-shell-max, 1600px);
  margin: 0 auto;
}

.planner-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.planner-hero-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.planner-hero-title h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}

.planner-hero-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.planner-hero-subtitle {
  opacity: 0.85;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.planner-hero-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-hero-primary {
  background: #F2EFE9;
  color: var(--planner-ui-primary, #16231E);
}
.btn-hero-primary:hover {
  background: #EAE6DF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-hero-outline {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.35);
}
.btn-hero-outline:hover {
  background: rgba(255,255,255,0.25);
}

.btn-hero-ghost {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(255,255,255,0.25);
}
.btn-hero-ghost:hover {
  background: rgba(255,255,255,0.1);
}

/* ---------- Veckonavigering + Vyväljare ---------- */
.planner-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 0.6rem 1rem;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.week-nav-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.week-nav-btn:hover { background: rgba(255,255,255,0.35); }

.week-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  min-width: 160px;
  text-align: center;
}

.week-today-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.week-today-btn:hover { background: rgba(255,255,255,0.35); }

.view-toggle {
  display: flex;
  gap: 0.25rem;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 0.2rem;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s;
}
.view-toggle-btn.active {
  background: #F2EFE9;
  color: var(--planner-ui-primary, #16231E);
}
.view-toggle-btn:not(.active):hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ---------- Huvudinnehåll ---------- */
.planner-body {
  max-width: none;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

/* ---------- Resurskalender ---------- */
.resource-calendar {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
}

.resource-header {
  display: grid;
  background: #F2EFE9;
  border-bottom: 2px solid rgba(199, 204, 209, 0.65);
  position: sticky;
  top: 0;
  z-index: 10;
}

.resource-header-cell {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--planner-ui-primary-hover, #1B2A24);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.resource-header-cell.employee-col {
  text-align: left;
  padding-left: 1rem;
  color: #374151;
}

.resource-header-cell.today-col {
  background: var(--planner-ui-primary, #16231E);
  color: #fff;
  font-weight: 700;
  border-top: 3px solid #16231E;
}
.resource-header-cell.today-col small { color: rgba(242, 239, 233, 0.72); }

/* Idag-pill – visas i dag-headrar i alla vyer */
.today-pill {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.resource-row {
  display: grid;
  border-bottom: 1px solid rgba(199, 204, 209, 0.45);
  min-height: 72px;
  transition: background 0.1s;
}
.resource-row:last-child { border-bottom: none; }
.resource-row:hover { background: #F2EFE9; }

.resource-row.unassigned-row {
  background: #fafafa;
}

.resource-employee-cell {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border-right: 2px solid rgba(199, 204, 209, 0.45);
}

.employee-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
}

.employee-avatar.has-photo,
.gantt-bar-avatar.has-photo,
.chip-avatar.has-photo,
.pov-avatar.has-photo,
.pg-avatar.has-photo {
  background: #e2e8f0 !important;
  padding: 0;
}

.employee-avatar.has-photo img,
.gantt-bar-avatar.has-photo img,
.chip-avatar.has-photo img,
.pov-avatar.has-photo img,
.pg-avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.employee-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0F1112;
  line-height: 1.3;
}

.employee-role {
  font-size: 0.73rem;
  color: #9ca3af;
  margin-top: 1px;
}

.resource-day-cell {
  padding: 0.4rem;
  border-right: 1px solid rgba(199, 204, 209, 0.45);
  vertical-align: top;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  cursor: pointer;
  transition: background 0.1s;
}
.resource-day-cell:last-child { border-right: none; }
.resource-day-cell:hover { background: #EAE6DF; }

.resource-day-cell.today-col {
  background: #E8EDE9;
  border-left: 2px solid #818cf8;
  border-right: 2px solid #818cf8;
}
.resource-day-cell.today-col:hover { background: #D4DDD7; }

.resource-header-cell.weekend-col,
.resource-day-cell.weekend-col {
  background: #f5f5f5;
  cursor: default;
  pointer-events: none;
}
.resource-header-cell.weekend-col {
  color: #bbb;
  font-size: 0.75rem;
}

/* ---------- Jobb-kort (resurskalender) ---------- */
.job-chip {
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  border-left: 3px solid transparent;
  line-height: 1.3;
  word-break: break-word;
}

.job-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.job-chip-time {
  font-size: 0.68rem;
  opacity: 0.75;
  display: block;
  margin-top: 1px;
}

.job-chip-title {
  display: block;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Status-färger */
.job-chip[data-status="planned"]      { background: #E8EDE9; border-color: #16231E; color: #16231E; }
.job-chip[data-status="in_progress"]  { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.job-chip[data-status="completed"]    { background: #d1fae5; border-color: #10b981; color: #065f46; }
.job-chip[data-status="cancelled"]    { background: #f3f4f6; border-color: #9ca3af; color: #6b7280; text-decoration: line-through; }

/* Kategori-ikon */
.job-chip[data-category="internal"]::before  { content: "🏠 "; }
.job-chip[data-category="absence"]::before   { content: "🏖️ "; }
.job-chip[data-category="other"]::before     { content: "📌 "; }

/* ---------- Listvy ---------- */
.list-view { display: flex; flex-direction: column; gap: 1.25rem; }

.list-day-group {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}

.list-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #F2EFE9;
  border-bottom: 1px solid rgba(199, 204, 209, 0.65);
}

.list-day-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
}

.list-day-label.today { color: #16231E; }

.list-day-group:has(.list-day-label.today) .list-day-header {
  background: #E8EDE9;
  border-left: 4px solid var(--planner-ui-primary, #16231E);
  border-bottom: 1px solid rgba(242, 239, 233, 0.72);
}

.today-pill-list {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  background: var(--planner-ui-primary, #16231E);
  color: #fff;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: middle;
}

.list-day-date {
  font-size: 0.8rem;
  color: #9ca3af;
}

.list-day-count {
  background: #E8EDE9;
  color: var(--planner-ui-primary, #16231E);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.list-job-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.1s;
}
.list-job-row:last-child { border-bottom: none; }
.list-job-row:hover { background: #F2EFE9; }

.list-job-color-bar {
  width: 4px;
  height: 2.5rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.list-job-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  min-width: 5rem;
  flex-shrink: 0;
}

.list-job-info { flex: 1; min-width: 0; }

.list-job-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0F1112;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-job-meta {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 2px;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.list-job-meta i { margin-right: 2px; }

.list-job-employee {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.list-job-employee-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
}

.list-job-employee-name {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}

.list-job-status-badge {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  flex-shrink: 0;
}

.status-planned    { background: #E8EDE9; color: #16231E; }
.status-in_progress { background: #fef3c7; color: #92400e; }
.status-completed  { background: #d1fae5; color: #065f46; }
.status-cancelled  { background: #f3f4f6; color: #6b7280; }

/* Tomt-tillstånd */
.list-day-empty {
  padding: 1.25rem;
  text-align: center;
  color: #d1d5db;
  font-size: 0.85rem;
}

/* "Lägg till jobb i dag"-knapp per dag */
.list-day-add-btn {
  width: 100%;
  padding: 0.6rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: all 0.15s;
}
.list-day-add-btn:hover { color: var(--planner-ui-primary, #16231E); background: #F2EFE9; }

/* ---------- Tomt hela veckan ---------- */
.empty-week {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 14px;
  padding: 4rem 2rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.empty-week-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-week h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.5rem;
}

.empty-week p {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ---------- Statistik-rad ---------- */
.planner-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-card-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0F1112;
  line-height: 1;
}

.stat-card-label {
  font-size: 0.78rem;
  color: #9ca3af;
  font-weight: 500;
}

.stat-card-sub {
  font-size: 0.73rem;
  color: var(--planner-ui-primary-hover, #1B2A24);
  font-weight: 600;
}

/* ---------- Modal -- generell ---------- */
.planner-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.15s ease;
}

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

.planner-modal {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

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

.planner-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(199, 204, 209, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.planner-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0F1112;
}

.planner-modal-close {
  background: #f3f4f6;
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 1rem;
  transition: all 0.15s;
}
.planner-modal-close:hover { background: #e5e7eb; color: #0F1112; }

.planner-modal-body {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

.planner-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(199, 204, 209, 0.45);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--arv-offwhite-card, #FBFaf7);
}

/* ---------- Form-element ---------- */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.form-label span.optional {
  color: #9ca3af;
  font-weight: 400;
  font-size: 0.75rem;
}

.form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #0F1112;
  background: var(--arv-offwhite-card, #FBFaf7);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--planner-ui-primary-hover, #1B2A24);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-control::placeholder { color: #c4c4cc; }

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

/* Kategori-knappar */
.category-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.category-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: #6b7280;
}

.category-btn:hover { border-color: var(--planner-ui-primary-hover, #1B2A24); color: #16231E; }
.category-btn.active { border-color: var(--planner-ui-primary-hover, #1B2A24); background: #E8EDE9; color: #16231E; }

/* Status-knappar */
.status-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.status-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: #6b7280;
}
.status-btn.active-planned    { border-color: #16231E; background: #E8EDE9; color: #16231E; }
.status-btn.active-in_progress { border-color: #f59e0b; background: #fef3c7; color: #92400e; }
.status-btn.active-completed  { border-color: #10b981; background: #d1fae5; color: #065f46; }
.status-btn.active-cancelled  { border-color: #9ca3af; background: #f3f4f6; color: #6b7280; }

/* Employee select med färgprick */
.employee-select-wrapper {
  position: relative;
}

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

.employee-select-dot {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  pointer-events: none;
  transition: background 0.1s;
}

/* Färgväljare */
.color-picker-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.15s;
  flex-shrink: 0;
}

.color-swatch.selected {
  border-color: #0F1112;
  transform: scale(1.15);
}

/* ---------- Knappar (modaler) ---------- */
.btn-save {
  background: var(--planner-ui-primary, #16231E);
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.4); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-cancel {
  background: #f3f4f6;
  color: #374151;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-cancel:hover { background: #e5e7eb; }

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-right: auto;
}
.btn-danger:hover { background: #fecaca; }

/* ---------- Personalhanteringspanel (slide-in) ---------- */
.staff-panel-backdrop {
  position: fixed;
  inset: 0;
  top: 60px; /* under headern */
  background: rgba(0,0,0,0.3);
  z-index: 900;
  animation: fadeIn 0.15s ease;
}

.staff-panel {
  position: fixed;
  top: 60px; /* under headern */
  right: 0;
  bottom: 0;
  width: min(420px, 95vw);
  background: var(--arv-offwhite-card, #FBFaf7);
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
  z-index: 901;
  display: flex;
  flex-direction: column;
  animation: slideFromRight 0.25s ease;
}

@keyframes slideFromRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.staff-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(199, 204, 209, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--planner-ui-primary, #16231E);
  color: #fff;
}

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

.staff-panel-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s;
}
.staff-panel-close:hover { background: rgba(255,255,255,0.35); }

.staff-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.staff-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.staff-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: #f9fafb;
  border: 1.5px solid rgba(199, 204, 209, 0.45);
  transition: border-color 0.15s;
}
.staff-item:hover { border-color: rgba(242, 239, 233, 0.72); }

.staff-item-info { flex: 1; min-width: 0; }

.staff-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0F1112;
}

.staff-item-role {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 1px;
}

.staff-item-actions {
  display: flex;
  gap: 0.4rem;
}

.staff-action-btn {
  background: #f3f4f6;
  border: none;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #6b7280;
  transition: all 0.15s;
}
.staff-action-btn:hover { background: #e5e7eb; color: #0F1112; }
.staff-action-btn.delete-btn:hover { background: #fee2e2; color: #dc2626; }

.add-staff-form {
  background: #F2EFE9;
  border-radius: 12px;
  border: 1.5px dashed rgba(242, 239, 233, 0.72);
  padding: 1.1rem;
}

.add-staff-form h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #16231E;
  margin: 0 0 0.9rem;
}

.empty-staff {
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
  font-size: 0.875rem;
}

/* ---------- Laddningsindikator ---------- */
.planner-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  gap: 0.75rem;
  color: #9ca3af;
  font-size: 0.95rem;
}

.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2.5px solid #e5e7eb;
  border-top-color: var(--planner-ui-primary-hover, #1B2A24);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------- Toast-meddelanden ---------- */
.planner-toast {
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  background: #0F1112;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 2000;
  animation: slideUp 0.2s ease;
  max-width: 320px;
}

.planner-toast.success { background: #059669; }
.planner-toast.error   { background: #dc2626; }

/* ---------- Responsivitet ---------- */
@media (max-width: 900px) {
  .resource-calendar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .planner-hero-top { flex-direction: column; }
  .planner-hero-actions { flex-direction: row; flex-wrap: wrap; }
  .planner-hero-title h1 { font-size: 1.4rem; }

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

@media (max-width: 600px) {
  .planner-hero { padding: 1.25rem 1rem 1rem; }
  .planner-body { padding: 1rem 0.75rem 5rem; }
  .form-row { grid-template-columns: 1fr; }
  .planner-stats { grid-template-columns: 1fr 1fr; }

  .list-job-row { gap: 0.5rem; }
  .list-job-time { min-width: 3.5rem; font-size: 0.75rem; }
  .list-job-employee { display: none; }
}

/* ============================================================
   HERO-KONTROLLER (gantt-period, arbetstid, kapacitetsknapp)
   ============================================================ */
.gantt-period-selector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
}

.gantt-period-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.75);
  margin-right: 0.15rem;
}

.gantt-period-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.85);
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.gantt-period-btn:hover,
.gantt-period-btn.active {
  background: rgba(255,255,255,0.25);
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}

.hours-per-day-ctrl {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.8rem;
}

.hours-per-day-ctrl input {
  width: 2.8rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 5px;
  padding: 0.15rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
}
.hours-per-day-ctrl input::-webkit-inner-spin-button { display: none; }

.capacity-toggle-hero-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.capacity-toggle-hero-btn:hover { background: rgba(255,255,255,0.25); }

/* ============================================================
   KAPACITETSPANEL
   ============================================================ */
#capacityPanel {
  max-width: none;
  margin: 1rem auto 0;
}

.capacity-panel {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 1rem;
}

.capacity-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.capacity-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.capacity-close-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: color 0.15s;
}
.capacity-close-btn:hover { color: #374151; }

.capacity-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.capacity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.capacity-table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}

.cap-name-col { min-width: 160px; }
.cap-week-col { min-width: 100px; text-align: center; }

.cap-name-cell {
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

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

.cap-name-cell small { color: #9ca3af; font-size: 0.72rem; margin-left: 0.2rem; }

.cap-cell {
  padding: 0.5rem 0.75rem;
  text-align: center;
  vertical-align: middle;
  border-left: 1px solid #f3f4f6;
  position: relative;
}

.cap-bar-wrap {
  height: 6px;
  background: #f3f4f6;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.3rem;
  position: relative;
}

.cap-bar-presence {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: #22c55e;
  border-radius: 3px;
  transition: width 0.3s;
}

.cap-bar-absence {
  position: absolute;
  right: 0; top: 0;
  height: 100%;
  background: #d1d5db;
  border-radius: 3px;
}

.cap-busy  .cap-bar-presence { background: #f59e0b; }
.cap-overloaded .cap-bar-presence { background: #ef4444; }

.cap-hours {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  color: #374151;
}

.cap-pct {
  font-size: 0.7rem;
  color: #9ca3af;
}

.capacity-table tbody tr:hover td { background: #f9fafb; }

/* ============================================================
   GANTT-VY
   ============================================================ */
.gantt-wrap {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  max-width: 100%;
}

/* Varje rad: namn-kolumn + track */
.gantt-header-row,
.gantt-day-header-row,
.gantt-row {
  display: flex;
  width: 100%;
  min-width: 700px;
}

/* Fast namn-kolumn */
.gantt-name-col-header {
  flex-shrink: 0;
  width: 180px;
  min-width: 180px;
  background: #f8fafc;
  border-bottom: 2px solid #e5e7eb;
  border-right: 2px solid #e5e7eb;
  padding: 0.6rem 0.75rem;
  font-weight: 700;
  font-size: 0.8rem;
  color: #374151;
  position: sticky;
  left: 0;
  z-index: 3;
}

.gantt-name-col-sub {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0;
}

/* Track-header (flex container med vecko/dag labels) */
.gantt-track-header {
  flex: 1;
  display: flex;
  min-width: 0;
}

.gantt-week-label {
  flex-shrink: 0;
  background: #f8fafc;
  border-bottom: 2px solid #e5e7eb;
  border-left: 2px solid #e5e7eb;
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--planner-ui-primary, #16231E);
  white-space: nowrap;
  overflow: hidden;
}

.gantt-week-label small {
  font-weight: 400;
  color: #9ca3af;
  margin-left: 0.2rem;
}

.gantt-day-cell-header {
  flex-shrink: 0;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  border-left: 1px solid #f3f4f6;
  padding: 0.3rem 0.1rem;
  text-align: center;
  font-size: 0.7rem;
  color: #9ca3af;
}

.gantt-day-cell-header.gantt-today-col {
  background: var(--planner-ui-primary, #16231E);
  color: #fff;
  font-weight: 700;
  border-top: 3px solid #16231E;
}

.gantt-day-cell-header.gantt-week-start { border-left: 2px solid #e5e7eb; }
.gantt-day-cell-header.gantt-weekend-col { background: #f3f4f6; color: #c0c4cd; }
.gantt-day-short { display: block; font-size: 0.62rem; }
.gantt-day-num   { display: block; font-size: 0.78rem; font-weight: 600; }

/* Rad */
.gantt-row { border-bottom: 1px solid #f3f4f6; }
.gantt-row:hover .gantt-track { background: #fafafa; }

.gantt-name-cell {
  flex-shrink: 0;
  width: 180px;
  min-width: 180px;
  background: var(--arv-offwhite-card, #FBFaf7);
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-right: 2px solid #f1f5f9;
  position: sticky;
  left: 0;
  z-index: 2;
  min-height: 52px;
}

.gantt-emp-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}

.gantt-emp-info small { font-size: 0.7rem; color: #9ca3af; font-weight: 400; }

/* Track – relativ container med bakgrundsceller och bars */
.gantt-track {
  flex: 1;
  position: relative;
  min-height: 52px;
  min-width: 0;
}

/* Bakgrundsceller (absolut positionerade) */
.gantt-bg-cell {
  position: absolute;
  top: 0; bottom: 0;
  cursor: pointer;
  border-left: 1px solid #f3f4f6;
  transition: background 0.1s;
  box-sizing: border-box;
}

.gantt-bg-cell:hover           { background: #f5f3ff; }
.gantt-bg-cell.gantt-today-col {
  background: #E8EDE9;
  border-left: 2px solid #818cf8;
  border-right: 2px solid #818cf8;
}
.gantt-bg-cell.gantt-week-start { border-left: 2px solid #e5e7eb; }
.gantt-bg-cell.gantt-drop-target { background: #ddd6fe !important; }
.gantt-bg-cell.gantt-weekend-col { background: #f5f5f7; pointer-events: none; }
.gantt-bg-cell.gantt-weekend-col:hover { background: #f5f5f7; }

/* Bars — --gantt-lane sätter vertikal stapling vid överlapp */
.gantt-bar {
  position: absolute;
  top: calc(6px + (var(--gantt-lane, 0) * 34px));
  transform: none;
  height: 28px;
  border-radius: 6px;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  overflow: hidden;
  transition: box-shadow 0.15s, opacity 0.15s;
  min-width: 4px;
  opacity: 0.93;
  z-index: 2;
  box-sizing: border-box;
}

.gantt-bar:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  opacity: 1;
  z-index: 5;
}

.gantt-bar.gantt-bar-dragging {
  opacity: 0.5;
  cursor: grabbing;
  z-index: 20;
}

/* Fortsättnings-segment (vecka 2, 3...) – ingen drag-cursor, inga padding */
.gantt-bar.gantt-bar-cont {
  cursor: pointer;
  padding: 0;
}

/* Delad bit inom en dag (före/efter krock) */
.gantt-bar.gantt-bar-partial {
  min-width: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.16);
}

.gantt-bar-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.gantt-bar-avatars {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}

.gantt-bar-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
  overflow: hidden;
}

/* ============================================================
   TIDSBOKNINGSVY
   ============================================================ */
.timegrid-wrap {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.timegrid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.timegrid thead th {
  padding: 0.6rem 0.5rem;
  background: #f8fafc;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}

.tg-name-col  { min-width: 150px; text-align: left; border-right: 2px solid #e5e7eb; }
.tg-day-col   { min-width: 80px; text-align: center; }
.tg-total-col { min-width: 70px; text-align: center; background: #f9fafb; border-left: 2px solid #e5e7eb; }

.tg-day-name  { display: block; font-size: 0.7rem; color: #9ca3af; }
.tg-day-date  { display: block; font-size: 0.82rem; font-weight: 700; color: #374151; }

.tg-day-col.tg-today {
  background: var(--planner-ui-primary, #16231E) !important;
  color: #fff !important;
  font-weight: 700;
  border-top: 3px solid #16231E;
}
.tg-day-col.tg-today .tg-day-name,
.tg-day-col.tg-today .tg-day-date { color: #fff !important; }

.tg-day-cell.tg-today {
  background: #E8EDE9 !important;
  border-left: 2px solid #818cf8;
  border-right: 2px solid #818cf8;
}

.tg-row:hover td { background: #fafafa; }

.tg-name-cell {
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-right: 2px solid #e5e7eb;
  border-bottom: 1px solid #f3f4f6;
}

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

.tg-emp-name { font-weight: 600; color: #374151; display: block; font-size: 0.8rem; }
.tg-emp-role { font-size: 0.7rem; color: #9ca3af; display: block; }

.tg-day-cell {
  padding: 0.5rem 0.4rem;
  text-align: center;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  border-left: 1px solid #f3f4f6;
  min-width: 72px;
  position: relative;
  transition: background 0.1s;
}

.tg-day-cell:hover { background: #f5f3ff !important; }

.tg-day-col.tg-weekend,
.tg-day-cell.tg-weekend {
  background: #f5f5f5;
  cursor: default;
  pointer-events: none;
  color: #bbb;
}

.tg-has-data { background: #f0fdf4; }

.tg-pres-hours {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: #059669;
}

.tg-abs-hours {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.1rem;
}

.tg-empty-cell {
  color: #d1d5db;
  font-size: 1rem;
  font-weight: 300;
}

/* Timegrid – ny layout med jobb-rader */
.tg-job-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}
.tg-job-name {
  flex: 1;
  font-size: 0.72rem;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.tg-job-name:hover { color: #2563eb; text-decoration: underline; }
.tg-hours-btn {
  background: #D4DDD7;
  color: #16231E;
  border: none;
  border-radius: 4px;
  font-size: 0.70rem;
  font-weight: 600;
  padding: 1px 5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.tg-hours-btn:hover { background: rgba(242, 239, 233, 0.72); }
.tg-hours-btn.override {
  background: #fef3c7;
  color: #92400e;
}
.tg-hours-btn.override:hover { background: #fde68a; }
.tg-new-btn {
  background: transparent;
  border: 1.5px dashed #d1d5db;
  border-radius: 6px;
  color: #9ca3af;
  font-size: 1rem;
  width: 100%;
  min-height: 28px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.tg-new-btn:hover { border-color: #6b7280; color: #374151; }

/* ---- Gantt resize handle ---- */
.gantt-bar-resize {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: ew-resize;
  border-radius: 0 6px 6px 0;
  background: rgba(255,255,255,0.20);
  transition: background 0.15s;
  z-index: 2;
}
.gantt-bar-resize:hover,
.gantt-bar:hover .gantt-bar-resize {
  background: rgba(255,255,255,0.55);
}
/* Vänster-handle: ändrar startdatum */
.gantt-bar-resize-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: ew-resize;
  border-radius: 6px 0 0 6px;
  background: rgba(255,255,255,0.20);
  transition: background 0.15s;
  z-index: 2;
}
.gantt-bar-resize-left:hover,
.gantt-bar:hover .gantt-bar-resize-left {
  background: rgba(255,255,255,0.55);
}
.gantt-bar.resizing {
  opacity: 0.85;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.6);
  z-index: 10;
}
/* Ghost-bar som följer musen vid flytt */
#ganttMoveGhost {
  position: fixed !important;
  pointer-events: none;
  cursor: grabbing !important;
  display: flex;
  align-items: center;
  padding: 0 6px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/* Markera "grab"-cursor på baren (utom resize-handles) */
.gantt-bar:not(.gantt-bar-cont) {
  cursor: grab;
}
.gantt-bar:not(.gantt-bar-cont):active {
  cursor: grabbing;
}
/* Tooltip vid resize/drag */
.gantt-resize-tooltip {
  position: fixed;
  display: none;
  background: #1e1b4b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 9999;
}

/* ---- Resursvy chip – timknapp ---- */
.chip-hours-btn {
  background: #D4DDD7;
  color: #16231E;
  border: none;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  margin-left: auto;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.chip-hours-btn:hover { background: rgba(242, 239, 233, 0.72); }
.chip-hours-btn.override { background: #fef3c7; color: #92400e; }
.chip-hours-btn.override:hover { background: #fde68a; }
.job-chip { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.job-chip-title { flex: 1; min-width: 0; }

/* ---- Day Log Popup ---- */
.day-log-popup {
  position: fixed;
  z-index: 9999;
  background: var(--arv-offwhite-card, #FBFaf7);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  min-width: 200px;
  max-width: 240px;
  padding: 0;
  overflow: hidden;
}
.dlp-header {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
}
.dlp-title { font-weight: 600; font-size: 0.82rem; color: #0F1112; flex: 1; }
.dlp-date  { font-size: 0.75rem; color: #64748b; }
.dlp-close {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #94a3b8;
  padding: 0 2px;
  line-height: 1;
}
.dlp-close:hover { color: #0F1112; }
.dlp-job {
  padding: 6px 12px;
  font-size: 0.78rem;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dlp-body {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
}
.dlp-input {
  width: 80px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  padding: 4px 8px;
}
.dlp-unit { font-size: 0.78rem; color: #64748b; }
.dlp-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}
.dlp-save-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  cursor: pointer;
}
.dlp-save-btn:hover { background: #1d4ed8; }
.dlp-reset-btn {
  background: transparent;
  color: #64748b;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.78rem;
  padding: 5px 10px;
  cursor: pointer;
}
.dlp-reset-btn:hover { background: #f1f5f9; }

/* ---- Import-knapp i jobbmodalens header ---- */
.planner-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.planner-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.jm-import-btn {
  background: transparent;
  border: 1.5px solid #D4DDD7;
  color: var(--planner-ui-primary, #16231E);
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.jm-import-btn:hover { background: #E8EDE9; border-color: #C7CCD1; }
.jm-import-btn i { margin-right: 4px; }

.jm-weekend-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  padding: 6px 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #92400e;
}
.jm-weekend-warn i { color: #f59e0b; flex-shrink: 0; }

.jm-hours-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.jm-hours-label-row .form-label { margin-bottom: 0; }

.jm-replan-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #16a34a;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.jm-replan-btn:hover { background: #dcfce7; border-color: #4ade80; }
.jm-replan-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.jm-replan-btn i { font-size: 0.72rem; }

/* ---- Offertväljare (quote picker) ---- */
.quote-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.quote-picker {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}
.qp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(199, 204, 209, 0.45);
  background: #f8fafc;
}
.qp-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0F1112;
}
.qp-title i { color: var(--planner-ui-primary, #16231E); margin-right: 6px; }
.qp-close {
  background: #e5e7eb;
  border: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qp-close:hover { background: #d1d5db; color: #111; }
.qp-filters {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(199, 204, 209, 0.45);
  background: var(--arv-offwhite-card, #FBFaf7);
}
.qp-filter-btn {
  background: #f3f4f6;
  border: none;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #6b7280;
  padding: 4px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.qp-filter-btn:hover { background: #e5e7eb; color: #0F1112; }
.qp-filter-btn.active { background: var(--planner-ui-primary, #16231E); color: #fff; }
.qp-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.qp-loading {
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
}
.qp-empty {
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
}
.qp-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.12s;
}
.qp-item:hover { background: #f0f4ff; }
.qp-item:last-child { border-bottom: none; }
.qp-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qp-item-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: #0F1112;
  flex: 1;
}
.qp-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: #64748b;
}
.qp-item-meta i { margin-right: 3px; opacity: 0.6; }
.qp-meta-amount {
  margin-left: auto;
  font-weight: 600;
  color: #0F1112;
}
/* Status-badges */
.qp-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.qp-won    { background: #dcfce7; color: #15803d; }
.qp-sent   { background: #fef9c3; color: #854d0e; }
.qp-draft  { background: #f3f4f6; color: #6b7280; }
.qp-lost   { background: #fee2e2; color: #dc2626; }

.tg-total-cell {
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-weight: 700;
  border-bottom: 1px solid #f3f4f6;
  border-left: 2px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.82rem;
  color: #374151;
}

.tg-ok   { color: #059669; }
.tg-over { color: #dc2626; }

.tg-sum-row td {
  background: #f8fafc;
  border-top: 2px solid #e5e7eb;
  font-weight: 700;
  color: #374151;
}

.tg-sum-cell { font-size: 0.78rem; }

/* ============================================================
   MULTI-PERSON CHECKBOXAR
   ============================================================ */
.emp-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.4rem;
}

.emp-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: #374151;
  transition: background 0.1s;
  user-select: none;
}

.emp-checkbox-label:hover  { background: #f5f3ff; }
.emp-checkbox-label.checked { background: #E8EDE9; font-weight: 600; color: var(--planner-ui-primary, #16231E); }

.emp-checkbox-label input[type="checkbox"] {
  accent-color: var(--planner-ui-primary, #16231E);
  width: 14px; height: 14px;
  cursor: pointer;
}

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

.emp-checkbox-label small { color: #9ca3af; font-weight: 400; font-size: 0.75rem; }

/* Chip-avatarer i resurskalender */
.chip-avatars {
  display: flex;
  gap: 1px;
  margin-top: 0.1rem;
}

.chip-avatar {
  width: 14px; height: 14px;
  border-radius: 50%;
  font-size: 0.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.6);
  overflow: hidden;
}

/* ============================================================
   TIMFÖRDELNINGSDIALOG
   ============================================================ */
.hours-split-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.15s ease;
}

.hours-split-box {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 16px;
  padding: 1.75rem 1.5rem 1.25rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.2s ease;
}

.hours-split-icon {
  width: 2.75rem;
  height: 2.75rem;
  background: #E8EDE9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--planner-ui-primary, #16231E);
  margin-bottom: 1rem;
}

.hours-split-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem;
}

.hours-split-desc {
  font-size: 0.87rem;
  color: #6b7280;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.hours-split-desc strong { color: #111827; }

.hours-split-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.hours-split-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
  position: relative;
}

.hours-split-btn:hover {
  border-color: var(--planner-ui-primary-hover, #1B2A24);
  background: #f5f3ff;
}

.hours-split-btn.selected {
  border-color: var(--planner-ui-primary-hover, #1B2A24);
  background: #E8EDE9;
}

.hours-split-btn-icon {
  width: 2rem;
  height: 2rem;
  background: var(--arv-offwhite-card, #FBFaf7);
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--planner-ui-primary-hover, #1B2A24);
  flex-shrink: 0;
}

.hours-split-btn-text {
  flex: 1;
  min-width: 0;
}

.hours-split-btn-text strong {
  display: block;
  font-size: 0.87rem;
  font-weight: 700;
  color: #111827;
}

.hours-split-btn-text span {
  font-size: 0.78rem;
  color: #9ca3af;
}

.hours-split-badge {
  flex-shrink: 0;
  background: #0F1112;
  color: #fff;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.hours-split-manual-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.83rem;
  color: #6b7280;
  flex-wrap: wrap;
}

.hours-split-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Överlapp-dialog (återanvänder hours-split-layout) */
.overlap-dialog-box .overlap-pair-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.overlap-dialog-box .overlap-pair-list li {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  color: #374151;
}

.overlap-pair-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: #111827;
}

.overlap-arrow {
  color: #9ca3af;
  font-weight: 500;
}

.overlap-after {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: #059669;
  font-weight: 600;
}

.overlap-cap-list .overlap-cap-line {
  background: #fff7ed !important;
  border-color: #fdba74 !important;
  color: #9a3412;
}

.day-emp-capacity {
  margin-left: auto;
  margin-right: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #16231E;
  background: #D4DDD7;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
}

.day-emp-capacity.is-over {
  background: #fee2e2;
  color: #b91c1c;
}

.day-breaks-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem 0.65rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.day-break-chip {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  background: var(--arv-offwhite-card, #FBFaf7);
  border: 1px dashed #cbd5e1;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.day-break-chip i {
  margin-right: 0.25rem;
  opacity: 0.75;
}

.jm-day-focus-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.85rem;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a5f;
  font-size: 0.84rem;
  line-height: 1.35;
}

.jm-day-focus-banner i {
  margin-top: 0.15rem;
  color: #2563eb;
}

.emp-checkbox-label.is-locked {
  opacity: 0.72;
  cursor: default;
}

.emp-checkbox-label.is-focus-emp {
  outline: 1px solid #93c5fd;
  background: #f0f9ff;
}

.jm-day-clear-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.jm-day-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.jm-day-clear-btn:hover {
  background: #fee2e2;
}

.jm-day-clear-btn.jm-day-clear-all {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #b45309;
}

.jm-day-clear-btn.jm-day-clear-all:hover {
  background: #fef3c7;
}

.jm-break-total-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 12rem;
}

.jm-break-total-row .jm-break-total {
  flex: 1;
}

.jm-break-unit {
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
}

.overlap-totals {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.overlap-hint {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

/* ============================================================
   UTSKRIFT / PDF
   ============================================================ */
/* Generell print-städning (kompletteras av pg-* blocket nedan när #printArea används) */
@media print {
  body { background: #fff !important; }
  #header-placeholder,
  #footer-placeholder,
  footer,
  header,
  .company-mobile-nav,
  .planner-hero-actions,
  .view-toggle,
  .week-nav-btn,
  .week-today-btn,
  .list-day-add-btn,
  .staff-panel,
  .staff-panel-backdrop,
  .planner-modal-backdrop,
  .planner-stats { display: none !important; }
}

/* ============================================================
   PROJEKTVY (.pov-*)
   ============================================================ */

.pov-wrap {
  background: var(--arv-offwhite-card, #FBFaf7);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 100%;
}

/* Header-rader och job-rader: fast vänster + flex höger */
.pov-header-row,
.pov-day-header-row,
.pov-row {
  display: flex;
  width: 100%;
  min-width: 700px;
}

/* Fast vänster panel – fyra kolumner */
.pov-left-header,
.pov-left-cell {
  display: flex;
  flex-shrink: 0;
  width: 420px;
  min-width: 420px;
  background: #f8fafc;
  border-right: 2px solid #e5e7eb;
  position: sticky;
  left: 0;
  z-index: 3;
}

.pov-left-cell {
  background: var(--arv-offwhite-card, #FBFaf7);
  cursor: pointer;
  transition: background 0.12s;
}
.pov-row:hover .pov-left-cell {
  background: #f5f7ff;
}

.pov-left-sub {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

/* Kolumn-bredd inuti vänster panel */
.pov-col-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0F1112;
  overflow: hidden;
  border-bottom: 1px solid #f3f4f6;
}
.pov-left-header .pov-col-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  padding: 0.55rem 0.6rem;
}

.pov-col-start,
.pov-col-days {
  flex-shrink: 0;
  width: 68px;
  display: flex;
  align-items: center;
  padding: 0 0.4rem;
  font-size: 0.75rem;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
  border-left: 1px solid #f0f0f0;
  white-space: nowrap;
}
.pov-left-header .pov-col-start,
.pov-left-header .pov-col-days {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  padding: 0.55rem 0.4rem;
}

.pov-col-res {
  flex-shrink: 0;
  width: 72px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid #f3f4f6;
  border-left: 1px solid #f0f0f0;
}
.pov-left-header .pov-col-res {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  padding: 0.55rem 0.4rem;
}

/* Titel-hjälpelement */
.pov-cat-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.pov-job-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini-avatarer i resursskolumnen */
.pov-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  overflow: hidden;
}
.pov-avatar-unassigned {
  background: #d1d5db;
  color: #6b7280;
}
.pov-more {
  font-size: 0.68rem;
  color: #9ca3af;
  font-weight: 600;
  margin-left: 2px;
}

/* Track (gantt-spåret till höger) */
.pov-track {
  flex: 1;
  position: relative;
  height: 44px;
  overflow: visible;
  background: var(--arv-offwhite-card, #FBFaf7);
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}
.pov-row:hover .pov-track {
  background: #fafafa;
}

/* Track-header (vecko/dag labels) */
.pov-track-header {
  flex: 1;
  display: flex;
  min-width: 0;
}

/* Tom-tillstånd */
.pov-empty {
  padding: 3rem 2rem;
  text-align: center;
  color: #9ca3af;
}
.pov-empty h3 { color: #374151; margin-bottom: 0.25rem; }
.pov-empty p  { font-size: 0.875rem; }

/* ============================================================
   PRINT GANTT – #printArea (pg-*)  väggvänlig schemagrafik
   ============================================================ */

.pg-wrap {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  color: #111;
  background: var(--arv-offwhite-card, #FBFaf7);
  padding: 0;
}

.pg-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2.5px solid #16231E;
}
.pg-header-left { min-width: 0; }
.pg-header-title {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #16231E;
  line-height: 1.1;
}
.pg-header-period {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: #5C6560;
}
.pg-header-right {
  text-align: right;
  flex-shrink: 0;
}
.pg-header-weeks {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #16231E;
}
.pg-printed {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #64748b;
}

.pg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.pg-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #0F1112;
}
.pg-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pg-gantt {
  width: 100%;
  border: 1.5px solid #16231E;
  border-radius: 4px;
  overflow: hidden;
}

.pg-week-header-row,
.pg-day-header-row,
.pg-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.pg-name-cell {
  flex: 0 0 118px;
  min-width: 118px;
  max-width: 118px;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  border-right: 1.5px solid #16231E;
  background: #f8fafc;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pg-emp-name { font-size: 11px; font-weight: 700; color: #16231E; line-height: 1.2; }
.pg-emp-role { font-size: 9px; color: #64748b; }

.pg-track-header {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.pg-week-label {
  flex-shrink: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #16231E;
  padding: 4px 0 3px;
  border-right: 1.5px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  background: #e2e8f0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  overflow: hidden;
}
.pg-wn    { display: block; letter-spacing: 0.02em; }
.pg-wdate { display: block; font-size: 9px; font-weight: 500; color: #475569; }

.pg-day-header-row { border-bottom: 1.5px solid #94a3b8; }
.pg-day-cell-header {
  flex-shrink: 0;
  text-align: center;
  font-size: 9px;
  padding: 3px 0;
  border-right: 1px solid #e2e8f0;
  color: #5C6560;
  background: #f1f5f9;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pg-day-cell-header .pg-day-short { display: block; font-weight: 700; text-transform: uppercase; font-size: 8px; }
.pg-day-cell-header .pg-day-num   { display: block; font-size: 11px; font-weight: 700; color: #16231E; }
.pg-day-cell-header.pg-today {
  background: #16231E;
  color: #fff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pg-day-cell-header.pg-today .pg-day-num { color: #fff; }
.pg-day-cell-header.pg-week-start { border-left: 2px solid #16231E; }

.pg-row {
  border-bottom: 1px solid #cbd5e1;
  min-height: 36px;
}
.pg-row:last-child { border-bottom: none; }

.pg-track {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 36px;
}

.pg-bg-cell {
  position: absolute;
  top: 0; bottom: 0;
  border-right: 1px solid #e2e8f0;
}
.pg-bg-cell.pg-today-bg {
  background: #f1f5f9;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pg-bg-cell.pg-week-start-bg { border-left: 2px solid #94a3b8; }

.pg-bar {
  position: absolute;
  top: 5px;
  bottom: 5px;
  min-width: 2px;
  display: flex;
  align-items: center;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pg-bar.pg-bar-cont { opacity: 0.92; }
.pg-bar-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pg-capacity {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1.5px solid #cbd5e1;
  break-inside: avoid;
  page-break-inside: avoid;
}
.pg-cap-title {
  font-size: 11px;
  font-weight: 800;
  color: #16231E;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pg-cap-table { width: 100%; }
.pg-cap-head,
.pg-cap-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  padding: 3px 0;
}
.pg-cap-head { font-size: 9px; font-weight: 700; color: #64748b; text-transform: uppercase; }
.pg-cap-name {
  flex: 0 0 118px;
  font-size: 11px;
  font-weight: 700;
  color: #16231E;
  display: flex;
  align-items: center;
  gap: 5px;
}
.pg-cap-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pg-cap-cell {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  color: #5C6560;
  text-align: center;
  position: relative;
  font-weight: 600;
}
.pg-cap-bar {
  height: 5px;
  border-radius: 2px;
  margin: 0 auto 2px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pg-cap-val   { font-size: 10px; }
.pg-cap-empty { color: #cbd5e1; font-weight: 400; }

.pg-footer-note {
  margin-top: 8px;
  font-size: 9px;
  color: #94a3b8;
  text-align: right;
}

/* ============================================================
   @media print – bara schemagrafik (ingen webbchrome)
   ============================================================ */
@media print {
  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Dölj allt utom utskriftsytan — inkl. header/footer/nav */
  body > *:not(#printArea) {
    display: none !important;
  }

  #header-placeholder,
  #footer-placeholder,
  footer,
  header,
  .site-footer,
  .company-mobile-nav,
  .planner-hero,
  .planner-body,
  .planner-stats,
  .planner-toast,
  .staff-panel,
  .staff-panel-backdrop,
  .planner-modal-backdrop,
  .hours-split-backdrop {
    display: none !important;
  }

  #printArea {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  .pg-wrap {
    padding: 0;
  }

  .pg-week-label,
  .pg-day-cell-header,
  .pg-day-cell-header.pg-today,
  .pg-name-cell,
  .pg-bg-cell.pg-today-bg,
  .pg-bar,
  .pg-cap-bar,
  .pg-cap-dot,
  .pg-avatar,
  .pg-legend-swatch {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .pg-row,
  .pg-cap-row,
  .pg-capacity,
  .pg-gantt {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Contain Gantt scroll to wrap */
.planner-main,
.planner-content,
#plannerApp {
  max-width: 100%;
  overflow-x: hidden;
}

/* Mobile/tablet Gantt densitet */
@media (max-width: 1023px) {
  .gantt-wrap::before {
    content: "Svep horisontellt för tidslinje";
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 0.5rem 0.75rem 0;
  }

  .gantt-name-col-header,
  .gantt-name-cell {
    width: 140px;
    min-width: 140px;
  }

  .gantt-header-row,
  .gantt-day-header-row,
  .gantt-row {
    min-width: 560px;
  }

  .pov-left-header,
  .pov-left-cell {
    width: min(280px, 55vw);
    min-width: 200px;
  }

  .pov-header-row,
  .pov-day-header-row,
  .pov-row {
    min-width: 520px;
  }
}

@media (max-width: 767px) {
  .gantt-name-col-header,
  .gantt-name-cell {
    width: 112px;
    min-width: 112px;
    font-size: 0.7rem;
    padding: 0.45rem 0.5rem;
  }

  .gantt-header-row,
  .gantt-day-header-row,
  .gantt-row {
    min-width: 480px;
  }
}

/* ============================================================
   MOBIL JOBBPLANERARE — dagvy, personfilter, grid-puts
   (desktop ≥768px oförändrad)
   ============================================================ */

/* Dag-knapp endast mobil för företagsvy; anställd behåller Dag + Vecka på desktop */
@media (min-width: 768px) {
  body:not(.planner-employee-mode) .view-toggle-btn[data-view="day"] {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .planner-hero {
    padding: 0.85rem 0.85rem 0.75rem !important;
  }

  .planner-hero-subtitle {
    display: none;
  }

  .planner-hero-top {
    margin-bottom: 0.65rem;
    gap: 0.5rem;
  }

  .planner-hero-title h1 {
    font-size: 1.2rem !important;
  }

  .planner-hero-icon {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .planner-hero-actions .btn-hero-ghost {
    display: none;
  }

  .planner-nav-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .week-label {
    min-width: 0;
    font-size: 0.85rem;
  }

  .view-toggle {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding-bottom: 0.15rem;
  }

  .view-toggle-btn {
    flex: 0 0 auto;
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
  }

  .view-toggle-btn--desktop {
    display: none !important;
  }

  .planner-body {
    padding: 0.75rem 0.75rem 5.5rem !important;
  }

  .planner-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    margin-bottom: 0.75rem !important;
  }

  .stat-card {
    padding: 0.65rem 0.75rem !important;
  }

  .stat-card-value {
    font-size: 1.15rem !important;
  }

  /* ---- Personfilter ---- */
  .planner-employee-filter {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 0.65rem;
    margin: 0 0 0.25rem;
    scrollbar-width: none;
  }

  .planner-employee-filter::-webkit-scrollbar {
    display: none;
  }

  .planner-emp-chip {
    flex: 0 0 auto;
    border: 1px solid #e2e8f0;
    background: var(--arv-offwhite-card, #FBFaf7);
    color: #5C6560;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    min-height: 40px;
    cursor: pointer;
  }

  .planner-emp-chip.active {
    background: #16231E;
    border-color: #16231E;
    color: #fff;
  }

  .planner-emp-chip[style*="--emp-color"].active {
    background: var(--emp-color, #16231E);
    border-color: var(--emp-color, #16231E);
  }

  /* ---- Dagvy ---- */
  .day-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .day-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--arv-offwhite-card, #FBFaf7);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
  }

  .day-view-header.is-today {
    border-color: #cbd5e1;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  }

  .day-view-weekday {
    font-size: 1.05rem;
    font-weight: 700;
    color: #16231E;
    line-height: 1.2;
  }

  .day-view-date {
    font-size: 0.8125rem;
    color: #64748b;
    margin-top: 0.15rem;
  }

  .day-view-add {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #16231E;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-weight: 600;
    font-size: 0.875rem;
    min-height: 40px;
    cursor: pointer;
  }

  .day-emp-group {
    background: var(--arv-offwhite-card, #FBFaf7);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .day-emp-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .day-emp-meta {
    flex: 1;
    min-width: 0;
  }

  .day-emp-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #16231E;
  }

  .day-emp-role {
    font-size: 0.75rem;
    color: #94a3b8;
  }

  .day-emp-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
  }

  .day-emp-empty {
    font-size: 0.875rem;
    color: #94a3b8;
    padding: 0.35rem 0.15rem;
  }

  .day-emp-add {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #475569;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    min-height: 40px;
  }

  .day-job-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--job-color, #16231E);
    border-radius: 10px;
    background: var(--arv-offwhite-card, #FBFaf7);
    padding: 0.7rem 0.75rem;
    cursor: pointer;
  }

  .day-job-card:active {
    background: #f8fafc;
  }

  .day-job-title {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #16231E;
    line-height: 1.3;
  }

  .day-job-meta {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.35;
  }

  .day-job-side {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
  }

  .day-job-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #5C6560;
    white-space: nowrap;
  }

  .day-job-hours {
    font-size: 0.7rem;
    color: #64748b;
  }

  .day-job-status {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #64748b;
  }

  .day-view-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--arv-offwhite-card, #FBFaf7);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    color: #64748b;
  }

  .day-view-empty .btn-save {
    margin-top: 0.75rem;
  }

  /* ---- Resursgrid puts ---- */
  .resource-calendar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .resource-header,
  .resource-row {
    min-width: max-content;
  }

  .resource-employee-cell,
  .resource-header-cell.employee-col {
    position: sticky;
    left: 0;
    z-index: 4;
    background: var(--arv-offwhite-card, #FBFaf7);
    min-width: 7.5rem;
    max-width: 7.5rem;
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.06);
  }

  .resource-header-cell.employee-col {
    z-index: 5;
    background: #F2EFE9;
  }

  .employee-name {
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 4.5rem;
  }

  .employee-role {
    display: none;
  }

  .resource-day-cell {
    min-width: 7.5rem;
  }

  .job-chip {
    padding: 0.3rem 0.35rem;
  }

  .job-chip-title {
    font-size: 0.7rem;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .job-chip-time {
    font-size: 0.65rem;
  }

  .chip-avatars,
  .job-chip[data-category="internal"]::before,
  .job-chip[data-category="absence"]::before,
  .job-chip[data-category="other"]::before {
    display: none !important;
  }

  #capacityPanel {
    display: none !important;
  }
}

/* ============================================================
   Anställd (company_employee) — mobil-first read-only
   ============================================================ */
.planner-employee-mode .planner-hero {
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.planner-hero-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.planner-employee-identity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 48%;
  flex-shrink: 1;
  padding: 0.3rem 0.45rem 0.3rem 0.3rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.planner-employee-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--arv-offwhite-card, #FBFaf7);
  flex-shrink: 0;
  display: block;
}

.planner-employee-logo.is-broken {
  display: none !important;
}

.planner-employee-logo-fallback {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.planner-employee-identity-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.planner-employee-identity-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-employee-identity-company {
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 767px) {
  .planner-employee-mode .planner-hero-top > div:first-child {
    width: 100%;
  }

  .planner-employee-mode .planner-hero-title h1 {
    font-size: 1.15rem !important;
  }

  .planner-employee-identity {
    max-width: 52%;
  }

  .planner-employee-logo,
  .planner-employee-logo-fallback {
    width: 32px;
    height: 32px;
  }
}

.planner-employee-mode .company-mobile-bottom-nav,
.planner-employee-mode #companyMoreMenu {
  display: none !important;
}

.planner-employee-mode.company-mobile-nav-active {
  padding-bottom: 0 !important;
}

.planner-employee-mode #plannerStats {
  display: none !important;
}

.planner-employee-mode footer,
.planner-employee-mode #footer-placeholder {
  display: none !important;
}

.employee-readonly-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: #e0f2fe;
  color: #0c4a6e;
  font-size: 0.8rem;
  font-weight: 600;
}

.employee-readonly-banner-text {
  min-width: 0;
  line-height: 1.3;
}

.employee-profile-btn {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  border: none;
  border-radius: 10px;
  background: #16231E;
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.planner-employee-mode .day-job-card {
  min-height: 72px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.65rem;
}

/* ---- Anställd: mobil veckovy ---- */
.emp-week {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.emp-week-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--arv-offwhite-card, #FBFaf7);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.emp-week-summary-title {
  font-size: 1rem;
  font-weight: 700;
  color: #16231E;
  line-height: 1.2;
}

.emp-week-summary-range {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: #64748b;
}

.emp-week-summary-stats {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.emp-week-stat {
  min-width: 3.25rem;
  text-align: center;
  background: #f8fafc;
  border-radius: 10px;
  padding: 0.4rem 0.45rem;
}

.emp-week-stat strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #16231E;
  line-height: 1.1;
}

.emp-week-stat span {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.emp-week-strip {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.4rem;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.emp-week-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  min-height: 56px;
  padding: 0.35rem 0.1rem 0.3rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #5C6560;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.emp-week-pill:active {
  background: #e2e8f0;
}

.emp-week-pill-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.01em;
  line-height: 1;
}

.emp-week-pill-date {
  font-size: 0.95rem;
  font-weight: 700;
  color: #16231E;
  line-height: 1.15;
}

.emp-week-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
  margin-top: 0.1rem;
}

.emp-week-pill.has-jobs .emp-week-pill-dot {
  background: #16231E;
}

.emp-week-pill.is-today {
  background: #16231E;
  color: #fff;
}

.emp-week-pill.is-today .emp-week-pill-name,
.emp-week-pill.is-today .emp-week-pill-date {
  color: #fff;
}

.emp-week-pill.is-today .emp-week-pill-dot {
  background: #93c5fd;
}

.emp-week-pill.is-active:not(.is-today) {
  background: #e2e8f0;
}

.emp-week-pill.is-weekend:not(.is-today) .emp-week-pill-date {
  color: #64748b;
}

.emp-week-days {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.emp-week-day {
  background: var(--arv-offwhite-card, #FBFaf7);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.emp-week-day.is-flash {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.emp-week-day.is-today {
  border-color: #cbd5e1;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.emp-week-day.is-empty {
  background: #f8fafc;
}

.emp-week-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
}

.emp-week-day.has-jobs .emp-week-day-head {
  border-bottom: 1px solid #f1f5f9;
  background: var(--arv-offwhite-card, #FBFaf7);
}

.emp-week-day-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  min-width: 0;
}

.emp-week-day-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #16231E;
}

.emp-week-day-date {
  font-size: 0.78rem;
  color: #64748b;
}

.emp-week-today-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #16231E;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.emp-week-day-meta {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.emp-week-day.is-empty .emp-week-day-meta {
  color: #94a3b8;
  font-weight: 500;
}

.emp-week-day-jobs {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem 0.7rem;
}

.emp-week-job {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 0.65rem;
  align-items: start;
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 0.7rem 0.7rem 0.7rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: var(--arv-offwhite-card, #FBFaf7);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.emp-week-job:active {
  background: #f8fafc;
}

.emp-week-job-bar {
  width: 4px;
  align-self: stretch;
  border-radius: 999px;
  background: var(--job-color, #64748b);
}

.emp-week-job-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.emp-week-job-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #16231E;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.emp-week-job-place {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emp-week-job-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  padding-top: 0.05rem;
}

.emp-week-job-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: #5C6560;
  white-space: nowrap;
}

.emp-week-job-hours {
  font-size: 0.7rem;
  color: #64748b;
}

.emp-week-empty {
  text-align: center;
  padding: 1.25rem 1rem;
  background: var(--arv-offwhite-card, #FBFaf7);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  color: #64748b;
}

.emp-week-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: #16231E;
  margin-bottom: 0.35rem;
}

.emp-week-empty p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

@media (max-width: 767px) {
  .planner-employee-mode .view-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0.25rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
  }

  .planner-employee-mode .view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 44px;
    width: 100%;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
  }

  .planner-employee-mode .planner-body {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)) !important;
  }

  .planner-employee-mode .planner-nav-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .planner-employee-mode .week-nav {
    width: 100%;
    justify-content: space-between;
  }

  .planner-employee-mode .week-nav-btn,
  .planner-employee-mode .week-today-btn {
    min-height: 40px;
    min-width: 40px;
  }

  .planner-employee-mode .employee-readonly-banner {
    flex-wrap: nowrap;
  }
}

/* ---- Anställd desktop (≥768): bredare layout + Dag/Vecka-flikar ---- */
@media (min-width: 768px) {
  .planner-employee-mode .planner-hero {
    padding: 1.5rem 2rem 1.25rem;
  }

  .planner-employee-mode .planner-hero-title h1 {
    font-size: 1.65rem;
  }

  .planner-employee-mode .planner-nav-bar {
    flex-wrap: nowrap;
    align-items: center;
    gap: 1rem;
  }

  .planner-employee-mode .view-toggle {
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
    gap: 0.25rem;
    padding: 0.2rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
  }

  .planner-employee-mode .view-toggle-btn[data-view="day"],
  .planner-employee-mode .view-toggle-btn[data-view="list"] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    min-width: 7.5rem;
    width: auto;
    padding: 0.45rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
  }

  .planner-employee-mode .planner-body {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
  }

  .planner-employee-mode .employee-readonly-banner {
    max-width: var(--arv-shell-max, 1600px);
    margin-left: auto;
    margin-right: auto;
  }

  .planner-employee-mode .day-view {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .planner-employee-mode .day-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--arv-offwhite-card, #FBFaf7);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.15rem;
  }

  .planner-employee-mode .day-view-header.is-today {
    border-color: #cbd5e1;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  }

  .planner-employee-mode .day-view-weekday {
    font-size: 1.15rem;
    font-weight: 700;
    color: #16231E;
    line-height: 1.2;
  }

  .planner-employee-mode .day-view-date {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.15rem;
  }

  .planner-employee-mode .day-emp-group {
    background: var(--arv-offwhite-card, #FBFaf7);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .planner-employee-mode .day-job-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    text-align: left;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--job-color, #16231E);
    border-radius: 12px;
    background: var(--arv-offwhite-card, #FBFaf7);
    padding: 0.9rem 1rem;
    cursor: pointer;
    min-height: 72px;
  }

  .planner-employee-mode .day-job-card:hover {
    background: #f8fafc;
  }

  .planner-employee-mode .day-job-title {
    font-weight: 700;
    font-size: 1rem;
    color: #16231E;
    line-height: 1.3;
  }

  .planner-employee-mode .day-job-meta {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.35;
  }

  .planner-employee-mode .day-job-side {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
  }

  .planner-employee-mode .day-job-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5C6560;
    white-space: nowrap;
  }

  .planner-employee-mode .day-job-hours {
    font-size: 0.75rem;
    color: #64748b;
  }

  .planner-employee-mode .day-job-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #64748b;
  }

  .planner-employee-mode .day-view-empty {
    text-align: center;
    padding: 2rem 1.25rem;
    background: var(--arv-offwhite-card, #FBFaf7);
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    color: #64748b;
  }

  .planner-employee-mode .emp-week {
    max-width: none;
  }

  .planner-employee-mode .emp-week-strip {
    position: static;
  }

  .planner-employee-mode .planner-employee-identity {
    max-width: 280px;
  }
}

.employee-detail-sheet {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  border-radius: 16px 16px 0 0;
}

@media (max-width: 767px) {
  .planner-modal-backdrop.employee-sheet {
    align-items: flex-end;
    padding: 0;
  }
  .employee-detail-sheet {
    max-height: 92vh;
    overflow: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.employee-detail-dl {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.employee-detail-dl div {
  display: grid;
  gap: 0.2rem;
}

.employee-detail-dl dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.employee-detail-dl dd {
  margin: 0;
  font-size: 1rem;
  color: #16231E;
  word-break: break-word;
}

.employee-detail-status {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
}

.employee-marking-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label copy"
    "value copy";
  gap: 0.15rem 0.75rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.employee-marking-card.is-empty {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.employee-marking-label {
  grid-area: label;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #92400e;
}

.employee-marking-card.is-empty .employee-marking-label {
  color: #64748b;
}

.employee-marking-value {
  grid-area: value;
  font-size: 1.05rem;
  font-weight: 700;
  color: #16231E;
  word-break: break-word;
  line-height: 1.3;
}

.employee-marking-card.is-empty .employee-marking-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
}

.employee-marking-copy {
  grid-area: copy;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: #16231E;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.employee-marking-copy:active {
  opacity: 0.88;
}

.employee-profile-name {
  font-weight: 700;
  margin: 0 0 1rem;
}

.emp-photo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.emp-photo-preview {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 999px;
  background: #16231E;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.35rem;
  overflow: hidden;
}

.emp-photo-preview.has-photo {
  background: #e2e8f0;
}

.emp-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.emp-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.emp-photo-btn {
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: var(--arv-offwhite-card, #FBFaf7);
  color: #16231E;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.emp-photo-btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.emp-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.emp-field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.emp-field input {
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1rem;
}

.employee-profile-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.25rem 0 0;
}

.planner-employee-mode .planner-modal-footer .btn-save {
  min-height: 48px;
  flex: 1;
}

/* ---- Anställd: tidregistrering ---- */
.emp-day-time-strip {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  background: #EEF2EF;
  border: 1px solid rgba(47, 93, 80, 0.18);
  color: #5C6560;
  font-size: 0.88rem;
  font-weight: 500;
  animation: empTimeFadeIn 0.35s ease;
}

.emp-day-time-strip.has-time {
  background: #E7F0EC;
  color: #16231E;
}

.emp-day-time-strip strong {
  font-weight: 800;
  color: #2F5D50;
}

.planner-employee-mode .day-job-card.is-time-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.planner-employee-mode .day-job-card.is-time-card:active {
  transform: scale(0.985);
}

.day-job-time-cta,
.emp-week-job-time-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 0.45rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #16231E;
  color: #F2EFE9;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.day-job-time-cta.has-time,
.emp-week-job-time-cta.has-time {
  background: #E7F0EC;
  color: #2F5D50;
  border: 1px solid rgba(47, 93, 80, 0.25);
}

.emp-week-job-time-cta {
  margin-top: 0.35rem;
  width: fit-content;
}

.emp-time-sheet {
  max-width: 520px;
}

.emp-time-sheet-head h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.emp-time-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2F5D50;
}

.emp-time-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
  color: #5C6560;
}

.emp-time-job-meta a {
  color: #2F5D50;
  font-weight: 600;
  text-decoration: none;
}

.emp-time-job-meta .employee-detail-status {
  margin: 0;
}

.emp-time-composer {
  padding: 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #FBFAF7 0%, #F4F1EA 100%);
  border: 1px solid rgba(199, 204, 209, 0.85);
  margin-bottom: 1.1rem;
  animation: empTimeSlideUp 0.28s ease;
}

.emp-time-date-row,
.emp-time-hours-row {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.emp-time-date-row label,
.emp-time-hours-row label,
.emp-time-note-label,
.emp-time-presets-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #5C6560;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.emp-time-note-label span {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}

.emp-time-date-row input,
.emp-time-hours-row input,
#empTimeNote {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #16231E;
  background: #fff;
}

.emp-time-hours-row input {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
}

.emp-time-presets-label {
  margin: 0 0 0.4rem;
}

.emp-time-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.emp-time-preset {
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  color: #16231E;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.emp-time-preset:active {
  transform: scale(0.96);
}

.emp-time-preset.is-active {
  background: #16231E;
  border-color: #16231E;
  color: #F2EFE9;
}

.emp-time-hint {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.emp-time-mintid-link {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}
.emp-time-mintid-link a {
  color: #2f5d50;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.emp-time-list-wrap {
  margin-bottom: 0.5rem;
}

.emp-time-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.emp-time-list-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #16231E;
}

.emp-time-day-total {
  font-size: 0.85rem;
  font-weight: 800;
  color: #2F5D50;
}

.emp-time-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.emp-time-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  animation: empTimeFadeIn 0.3s ease;
}

.emp-time-item-main {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.emp-time-item-main strong {
  font-size: 1.05rem;
  color: #16231E;
}

.emp-time-item-status {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
}

.emp-time-item-status.is-approved {
  color: #2F5D50;
}

.emp-time-item-status.is-rejected {
  color: #9B2C2C;
}

.emp-time-item-note {
  font-size: 0.82rem;
  color: #64748b;
  word-break: break-word;
}

.emp-time-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
}

.emp-time-item-btn {
  min-height: 34px;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #16231E;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.emp-time-item-btn.is-danger {
  color: #9B2C2C;
  border-color: #f2c6c6;
  background: #fff8f8;
}

.emp-time-item-locked {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  padding-top: 0.2rem;
}

.emp-time-list-empty,
.emp-time-list-loading {
  padding: 0.85rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
  border: 1px dashed #e2e8f0;
  border-radius: 12px;
  background: #fafaf8;
}

.emp-time-more-details {
  margin-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.65rem;
}

.emp-time-more-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: #5C6560;
}

.emp-time-more-details p {
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
  color: #16231E;
  line-height: 1.45;
  font-size: 0.92rem;
}

.emp-time-sheet-footer {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
}

.emp-time-sheet-footer .btn-cancel[hidden] {
  display: none !important;
}

.emp-time-save {
  flex: 1;
  min-height: 52px !important;
  font-size: 1.02rem !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  background: #2F5D50 !important;
  border-color: #2F5D50 !important;
}

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

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

@media (max-width: 420px) {
  .emp-time-presets {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.3rem;
  }
  .emp-time-preset {
    font-size: 0.82rem;
    padding: 0.35rem 0.15rem;
  }
}
