/* Fas 1: vy-specifika regler flyttas hit stegvis */

/* CRM / Customers */
#customersView {
  padding: 0;
  background: #fafafa;
}

.crm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.crm-title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.crm-count-badge {
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
}

.crm-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-btn-primary {
  background: #1b4b8a;
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: Inter, sans-serif;
}

.crm-btn-secondary {
  background: #fff;
  color: #374151;
  border: 1.5px solid #d1d5db;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: Inter, sans-serif;
}

.crm-body-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.crm-sidenav {
  width: 200px;
  flex-shrink: 0;
  background: #f8f9fa;
  border-right: 1.5px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 20px 0 0;
  overflow-y: auto;
}

.crm-sidenav-title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  padding: 0 18px 2px;
  margin: 0;
}

.crm-sidenav-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: #b0b8c4;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 18px 6px;
  margin: 0;
}

.crm-sidenav-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 8px;
}

.crm-sidenav-item {
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  font-size: 13.5px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: Inter, sans-serif;
}

.crm-sidenav-item.active {
  background: #e4ebf8;
  color: #1b4b8a;
  font-weight: 700;
}

.crm-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.crm-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.crm-search-wrap {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.crm-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.crm-search {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  font-size: 13px;
  outline: none;
  font-family: Inter, sans-serif;
  color: #111827;
}

.crm-table-wrap {
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: Inter, sans-serif;
}

.crm-table thead th {
  background: #f9fafb;
  color: #6b7280;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.crm-table tbody td {
  padding: 11px 14px;
  color: #374151;
  vertical-align: middle;
}

.crm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 24px;
  color: #9ca3af;
  text-align: center;
}

.crm-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
  color: #6b7280;
}

/* CRM table row + hover actions */
.crm-row {
  cursor: pointer;
  transition: background 0.12s;
}
.crm-row:hover {
  background: #F9FAFB;
}
.crm-row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  justify-content: flex-end;
  transition: opacity 0.15s;
}
.crm-row:hover .crm-row-actions {
  opacity: 1;
}
.crm-row-action-btn {
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  color: #374151;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.crm-row-action-btn:hover {
  background: #E5E7EB;
}
.crm-row-action-btn.danger {
  color: #DC2626;
}
.crm-row-action-btn.danger:hover {
  background: #FEF2F2;
  border-color: #FECACA;
}

/* Customer avatar circle */
.crm-customer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

/* Toolbar filter + columns buttons */
.crm-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s, background 0.12s;
}
.crm-filter-btn:hover {
  border-color: #D1D5DB;
  background: #F9FAFB;
}
.crm-filter-btn.active {
  border-color: #1B4B8A;
  color: #1B4B8A;
  background: #EFF6FF;
}

/* Type filter pills */
.crm-type-pill {
  background: #F3F4F6;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}
.crm-type-pill.active {
  background: #1B4B8A;
  border-color: #1B4B8A;
  color: #fff;
}
.crm-type-pill:hover:not(.active) {
  background: #E5E7EB;
}

/* Sidebar divider */
.crm-sidenav-divider {
  border-top: 1px solid #F3F4F6;
  margin: 8px 0;
}

/* Pagination page size select */
.crm-page-size {
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}
.crm-page-btn {
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s;
}
.crm-page-btn:hover:not(:disabled) {
  background: #F3F4F6;
}
.crm-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.crm-pagination-info {
  flex: 1;
  font-size: 12px;
  color: #6B7280;
}

/* Offers / Jobs / Invoices generic view shell */
.bf-section-view {
  padding: 0;
  background: #f8f8f6;
  min-height: 100%;
}

.bf-page-head {
  padding: 28px 32px 0;
}

.bf-page-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.bf-page-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.5px;
}

.bf-pill-btn {
  background: #111;
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.bf-stats-row {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  display: flex;
  margin-bottom: 18px;
  overflow: hidden;
}

.bf-stat-card {
  flex: 1;
  padding: 18px 22px;
  text-align: center;
  border-right: 1px solid #e5e7eb;
}

.bf-stat-card:last-child {
  border-right: 0;
}

.bf-stat-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 6px;
  font-weight: 500;
}

.bf-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #111;
}

.bf-tabs {
  border-bottom: 1px solid #e5e7eb;
}

.bf-tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 4px;
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  border-bottom: 2.5px solid transparent;
  margin-right: 24px;
}

.bf-tab-btn.active {
  color: #111;
  border-bottom-color: #111;
}

.bf-page-body {
  padding: 16px 32px 40px;
}

.bf-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 20px 40px;
  text-align: center;
  color: #9ca3af;
  gap: 10px;
}

.bf-empty-state h3 {
  margin: 0;
  color: #111;
}

.bf-table-wrap {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  margin-top: 14px;
}

.bf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.bf-table thead th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1.5px solid #f3f4f6;
}

.bf-table tbody td {
  padding: 13px 14px;
  color: #111;
}

/* ══════════════════════════════════════════════════════════
   Customer Detail View  (cdet-)
   ══════════════════════════════════════════════════════════ */
#customerDetailView { padding: 0; background: #F7F8FA; }

.cdet-back-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 24px 0; background: transparent;
}
.cdet-back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: #6B7280;
  font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 6px 10px; border-radius: 6px;
  font-family: 'Inter', sans-serif; transition: all 0.15s;
}
.cdet-back-btn:hover { background: #E5E7EB; color: #111827; }

.cdet-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 12px 24px 0; background: transparent;
  flex-wrap: wrap; gap: 12px;
}
.cdet-name {
  font-size: 28px; font-weight: 800; color: #111827; margin: 0; line-height: 1.2;
}
.cdet-type-tag {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 600; margin-top: 4px;
}
.cdet-quick-btns {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cdet-quick-btn {
  display: flex; align-items: center; gap: 6px;
  background: white; border: 1.5px solid #D1D5DB;
  padding: 8px 14px; border-radius: 20px; font-size: 13px;
  font-weight: 600; cursor: pointer; color: #374151;
  font-family: 'Inter', sans-serif; transition: all 0.15s; white-space: nowrap;
}
.cdet-quick-btn:hover { background: #F3F4F6; border-color: #9CA3AF; }
.cdet-quick-btn.primary { background: #1B4B8A; color: white; border-color: #1B4B8A; }
.cdet-quick-btn.primary:hover { background: #163d72; }

.cdet-tabs {
  display: flex; align-items: center;
  padding: 16px 24px 0; border-bottom: 1px solid #E5E7EB;
  background: transparent; overflow-x: auto;
}
.cdet-tab {
  background: none; border: none; border-bottom: 2.5px solid transparent;
  padding: 8px 16px 10px; font-size: 13.5px; font-weight: 600;
  color: #6B7280; cursor: pointer; white-space: nowrap;
  font-family: 'Inter', sans-serif; transition: color 0.15s;
  margin-bottom: -1px;
}
.cdet-tab:hover { color: #374151; }
.cdet-tab.active { color: #1B4B8A; border-bottom-color: #1B4B8A; }

.cdet-body { padding: 20px 24px 32px; }
.cdet-2col {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 20px; align-items: start;
}
@media (max-width: 900px) { .cdet-2col { grid-template-columns: 1fr; } }

.cdet-module {
  background: white; border: 1px solid #E5E7EB;
  border-radius: 10px; overflow: hidden; margin-bottom: 16px;
}
/* Map module: no overflow:hidden — Leaflet tiles get clipped by border-radius in Chrome */
.cdet-module-map {
  overflow: visible !important;
  /* Keep visual border-radius but let Leaflet render freely */
  border-radius: 10px;
}
.cdet-module-map #cdetMap {
  height: 260px !important;
  width: 100%;
  border-radius: 10px 10px 0 0;
  /* Clip ONLY the map corners, not the tiles themselves */
  overflow: hidden;
  position: relative;
  z-index: 0;
}
.cdet-module-header {
  padding: 12px 16px; border-bottom: 1px solid #F3F4F6;
  display: flex; align-items: center; justify-content: space-between;
}
.cdet-module-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #9CA3AF;
}
.cdet-module-body { padding: 16px; }

.cdet-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid #F3F4F6; font-size: 13px;
}
.cdet-summary-row:last-child { border-bottom: none; padding-bottom: 0; }
.cdet-summary-row .label { color: #6B7280; }
.cdet-summary-row .val { font-weight: 700; color: #111827; }
.cdet-summary-row.highlight .val { color: #059669; font-size: 15px; }
.cdet-summary-row.warn .val { color: #DC2626; }

.cdet-contact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid #F9FAFB; font-size: 13px;
}
.cdet-contact-item:last-child { border-bottom: none; }
.cdet-contact-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.cdet-contact-item a { color: #1B4B8A; text-decoration: none; font-weight: 500; }
.cdet-contact-item a:hover { text-decoration: underline; }

#cdetMap { height: 260px; width: 100%; }

.cdet-addr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #EFF6FF; color: #1B4B8A; border: 1px solid #BFDBFE;
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
  margin-bottom: 8px;
}
.cdet-addr-line { font-size: 14px; color: #374151; line-height: 1.6; font-weight: 500; }

.cdet-activity-item {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid #F3F4F6; font-size: 13px;
}
.cdet-activity-item:last-child { border-bottom: none; }
.cdet-activity-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #D1D5DB;
  margin-top: 5px; flex-shrink: 0;
}
.cdet-activity-dot.blue  { background: #3B82F6; }
.cdet-activity-dot.green { background: #10B981; }

.cdet-subtable {
  width: 100%; border-collapse: collapse; font-size: 13px;
  font-family: 'Inter', sans-serif;
}
.cdet-subtable thead th {
  background: #F9FAFB; color: #6B7280; font-weight: 600;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 10px 14px; text-align: left; border-bottom: 1px solid #E5E7EB;
}
.cdet-subtable tbody tr { border-bottom: 1px solid #F3F4F6; cursor: pointer; transition: background 0.1s; }
.cdet-subtable tbody tr:hover { background: #F8FAFF; }
.cdet-subtable tbody td { padding: 11px 14px; color: #374151; vertical-align: middle; }

.cdet-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 56px 24px; text-align: center;
}
.cdet-empty-icon { font-size: 48px; opacity: 0.35; }
.cdet-empty-title { font-size: 15px; font-weight: 700; color: #374151; }
.cdet-empty-sub { font-size: 13px; color: #9CA3AF; max-width: 260px; line-height: 1.6; }

/* ── Jobs view — dashboard palette (match pages/dashboard.html) ───────────── */
#jobsView.jobs-dash-view {
  background: #efede8;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

#jobsView.jobs-dash-view .bf-page-head {
  background: transparent;
  padding: 8px 16px 0;
  flex-shrink: 0;
}

#jobsView.jobs-dash-view .bf-page-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #111827;
  font-family: 'Inter', sans-serif;
}

#jobsView.jobs-dash-view .bf-stats-row {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

#jobsView.jobs-dash-view .bf-stat-label {
  color: #9ca3af;
}

#jobsView.jobs-dash-view .bf-stat-value {
  color: #111827;
}

#jobsView.jobs-dash-view .bf-tabs {
  border-bottom-color: #e5e7eb;
}
#jobsView.jobs-dash-view .bf-page-body {
  padding: 0 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#jobsView.jobs-dash-view .bf-tab-btn.active {
  color: #111827;
  border-bottom-color: #1b4b8a;
}

#jobsView.jobs-dash-view .bf-pill-btn {
  background: #1b4b8a;
  color: #fff;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

#jobsView.jobs-dash-view .bf-pill-btn:hover {
  background: #163a6e;
}

.jobs-dash-btn-primary {
  background: #1b4b8a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.jobs-dash-btn-primary:hover {
  background: #163a6e;
}

/* ── Jobs: month calendar (inside dashboard-style cards) ─────────────────── */
#jobsView.jobs-dash-view .jobs-cal-wrap {
  margin-top: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  /* Fill viewport: topbar 56px + tabs ~47px + body padding 16px + 3px buffer */
  height: calc(100vh - 122px);
  display: flex;
  flex-direction: column;
}

.jobs-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.jobs-cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.jobs-cal-nav-btn {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #374151;
  transition: background 0.12s, border-color 0.12s;
}

.jobs-cal-nav-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.jobs-cal-nav-today {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 14px;
  height: 40px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #374151;
  font-family: 'Inter', sans-serif;
}

.jobs-cal-nav-today:hover {
  background: #f3f4f6;
}

.jobs-cal-title {
  margin: 0 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.2px;
  font-family: 'Inter', sans-serif;
}

.jobs-cal-add {
  flex-shrink: 0;
}

.jobs-cal-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  background: #fff;
  flex: 1;
  min-height: 0;
}

.jobs-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  min-width: 720px;
  background: #fff;
}

.jobs-cal-weekday {
  background: #fafafa;
  padding: 11px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Inter', sans-serif;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #f3f4f6;
}

.jobs-cal-weekday:nth-child(7) {
  border-right: none;
}

.jobs-cal-weekday.jobs-cal-weekend {
  color: #9ca3af;
}

.jobs-cal-day {
  min-height: 132px;
  background: #fff;
  padding: 7px 8px 9px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  cursor: pointer;
  transition: background 0.14s, box-shadow 0.14s;
  border-bottom: 1px solid #f3f4f6;
  border-right: 1px solid #f3f4f6;
}

.jobs-cal-day:nth-child(7n) {
  border-right: none;
}

/* Dagar utan uppdrag: lätt hover */
.jobs-cal-day:hover:not([class*="--tone-"]) {
  background: #f9fafb;
}

/* Dagar med uppdrag: ren solid bakgrund per status */
#jobsView.jobs-dash-view .jobs-cal-day--tone-active   { background: #F0FDF4; }
#jobsView.jobs-dash-view .jobs-cal-day--tone-planned  { background: #F8FAFF; }
#jobsView.jobs-dash-view .jobs-cal-day--tone-done     { background: #EFF6FF; }
#jobsView.jobs-dash-view .jobs-cal-day--tone-invoiced { background: #FFFBEB; }

#jobsView.jobs-dash-view .jobs-cal-day[class*="--tone-"]:hover { filter: brightness(0.97); background-image: none; }

/* Dagar utanför månaden: helt tomma, ingen kursor, ingen hover */
.jobs-cal-day--muted {
  background: #F9FAFB;
  cursor: default;
  pointer-events: none;
}
.jobs-cal-day--muted .jobs-cal-daynum { display: none; }
.jobs-cal-day--muted .jobs-cal-day-body { display: none; }
.jobs-cal-day--muted:hover { background: #F9FAFB; }

/* Dagens datum */
.jobs-cal-day--today {
  background: #EFF6FF;
  box-shadow: inset 0 0 0 2px #3B82F6;
}
.jobs-cal-day--today .jobs-cal-daynum {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  color: #1B4B8A;
  font-weight: 800;
}
#jobsView.jobs-dash-view .jobs-cal-day--today.jobs-cal-day--tone-active   { background: #DCFCE7; box-shadow: inset 0 0 0 2px #1B4B8A; }
#jobsView.jobs-dash-view .jobs-cal-day--today.jobs-cal-day--tone-planned  { background: #EFF6FF; box-shadow: inset 0 0 0 2px #1B4B8A; }
#jobsView.jobs-dash-view .jobs-cal-day--today.jobs-cal-day--tone-done     { background: #DBEAFE; box-shadow: inset 0 0 0 2px #1B4B8A; }
#jobsView.jobs-dash-view .jobs-cal-day--today.jobs-cal-day--tone-invoiced { background: #FEF3C7; box-shadow: inset 0 0 0 2px #1B4B8A; }

.jobs-cal-daynum {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}

.jobs-cal-day-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  max-height: 104px;
  padding-right: 1px;
}

/* Start-chip: titel + datumspann, ren solid */
.jobs-cal-chip--full {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--bd);
  border-left: 3px solid var(--fg);
  background: var(--bg);
  color: #111827;
  cursor: pointer;
  line-height: 1.25;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  text-align: left;
}

.jobs-cal-chip-title {
  font-size: 11px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jobs-cal-chip-range {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.01em;
}

/* Mellanliggande dagar: tunn solid färgbar */
.jobs-cal-chip--mid {
  padding: 0;
  height: 20px;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.jobs-cal-mid-line {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--fg);
  opacity: 0.35;
}

/* Sista dagen: kompakt med slutdatum */
.jobs-cal-chip--end {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
  padding: 4px 8px 5px;
  border-radius: 0 6px 6px 0;
  border: 1px solid var(--bd);
  border-left: none;
  background: var(--bg);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  text-align: left;
}

.jobs-cal-chip-end-cap {
  font-size: 12px;
  color: var(--fg);
  font-weight: 700;
  flex-shrink: 0;
}

.jobs-cal-chip-end-text {
  font-size: 10px;
  font-weight: 700;
  color: #111827;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jobs-cal-chip-end-meta {
  width: 100%;
  font-size: 9px;
  font-weight: 600;
  color: #6b7280;
  margin-top: 1px;
}

.jobs-cal-chip--full:hover,
.jobs-cal-chip--mid:hover,
.jobs-cal-chip--end:hover {
  filter: brightness(0.97);
}

.jobs-cal-more {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  padding: 2px 0 0 2px;
  font-family: 'Inter', sans-serif;
}

.jobs-cal-undated {
  margin-top: 0;
  padding: 16px 18px 18px;
  background: #fff;
  border: none;
  border-top: 1px solid #e5e7eb;
  border-radius: 0;
}

.jobs-cal-undated-head {
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}

.jobs-cal-undated-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jobs-cal-undated-chip {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--bd);
  border-left: 3px solid var(--st);
  background: var(--bg);
  color: #111827;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: filter 0.1s;
}

.jobs-cal-undated-chip:hover {
  filter: brightness(0.98);
}

/* ─── Premium month-chip (jm-chip) ─────────────────────────────────────── */
.jm-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px 3px 4px;
  margin-bottom: 2px;
  border-radius: 6px;
  background: linear-gradient(135deg, #F1F5F9 0%, #E8F0EC 100%);
  border-left: 3px solid var(--acc, #1B4B8A);
  cursor: pointer;
  transition: filter 0.12s, transform 0.1s;
  overflow: hidden;
  min-height: 22px;
}
.jm-chip:hover { filter: brightness(0.93); transform: translateX(1px); }
.jm-chip--mid  { opacity: 0.72; }
.jm-chip--end  { border-left-color: transparent; border-right: 3px solid var(--acc, #1B4B8A); }

/* ── Filled (dark green) chip — single-day job with start_time ── */
.jm-chip--filled {
  background: #1B4D23;
  border-left-color: #145218;
  color: #fff;
}
.jm-chip--filled .jm-chip-avatar {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.jm-chip--filled .jm-chip-time  { color: rgba(255,255,255,0.85); font-weight: 600; }
.jm-chip--filled .jm-chip-cust  { color: #fff; font-weight: 700; }
.jm-chip--filled .jm-chip-jobname { color: rgba(255,255,255,0.75); }
.jm-chip--filled .jm-chip-sep   { color: rgba(255,255,255,0.4); }

.jm-chip-avatar {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1E293B;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
}

/* Chip label: wraps time + customer + job name inline */
.jm-chip-label {
  display: flex;
  align-items: baseline;
  gap: 3px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.jm-chip-time {
  font-size: 10px;
  font-weight: 700;
  color: #374151;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.jm-chip-cust {
  font-size: 10px;
  font-weight: 700;
  color: #1E293B;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jm-chip-jobname {
  font-size: 10px;
  font-weight: 500;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jm-chip-sep {
  font-size: 10px;
  color: #D1D5DB;
  flex-shrink: 0;
}

/* Legacy — kept for any remaining usage */
.jm-chip-name {
  font-size: 10px;
  font-weight: 700;
  color: #1E293B;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Today number — handled by .jm-day-today .jm-daynum in the new grid section */
.jm-today-num { /* legacy stub — kept for compatibility */ }

/* Visit count badge */
.jm-visit-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: 20px;
  background: #3B82F6;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}

/* ─── Filter pills bar ──────────────────────────────────────────────────── */
.jm-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 0;
  flex-wrap: wrap;
}
.jm-filter-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #E5E7EB;
  background: #fff;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #374151;
  transition: border-color 0.15s, background 0.15s;
}
.jm-filter-pill:hover { border-color: #9CA3AF; background: #F9FAFB; }
.jm-filter-label { font-weight: 600; color: #111827; }
.jm-filter-sep   { color: #D1D5DB; margin: 0 1px; }
.jm-filter-val   { color: #6B7280; font-weight: 400; }

/* ─── New month grid (week-row + absolute spanning bars) ───────────────── */
/* ═══════════════════════════════════════════════════════════════════════════
   JOBBER-STYLE MONTH CALENDAR
   Cell ≈ 196 px tall · Bar ≈ 20 px · Full-week bar spans 100% grid width
   ═══════════════════════════════════════════════════════════════════════════ */
.jm-month-grid {
  min-width: 840px;
  background: #F0F0F0;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  border-top: 1px solid #E2E4E6;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Weekday header ─────────────────────────────────────────────────────── */
.jm-month-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  background: #fff;
  border-bottom: 1px solid #E2E4E6;
  padding: 4px 0;
}
.jm-month-weekday {
  padding: 8px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #9CA3AF;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: none; /* no vertical dividers in header */
}
.jm-month-weekday:last-child { border-right: none; }
.jm-weekend-head { color: #C8CDD6; }

/* Today's column label — blue pill */
.jm-weekday-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #5383C3;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 13px;
  letter-spacing: 0.03em;
}

/* ── Week row ───────────────────────────────────────────────────────────── */
.jm-week-row {
  position: relative;
  flex: 1;           /* each row shares available height equally by default */
}

/* Outer rows (1, 2, 5, 6) — shorter share */
.jm-week-row--outer {
  flex: 0.65;
}
.jm-week-row--outer .jm-day-cell {
  min-height: 72px;
}

/* Inner rows (3, 4) — full share */
.jm-week-row--inner {
  flex: 1;
}
.jm-week-row--inner .jm-day-cell {
  min-height: 110px;
}

/* ── Day cells row ──────────────────────────────────────────────────────── */
.jm-days-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  grid-auto-rows: 1fr;  /* single implicit row fills 100% of week row */
  height: 100%;
}

/* ── Individual day cell ────────────────────────────────────────────────── */
.jm-day-cell {
  min-height: 110px;
  background: #FFFFFF;
  padding: 8px 10px 6px;
  cursor: pointer;
  transition: background 0.12s;
  vertical-align: top;
  border-bottom: 1px solid #D8D8D8;
  border-right: 1px solid #D8D8D8;
}
.jm-day-cell:nth-child(7n) { border-right: none; }
.jm-day-cell:hover:not(.jm-day-muted) { background: #F5FAF7; }

/* Previous / next month cells — clickable, muted */
.jm-day-muted {
  background: #F0F0F0;
  cursor: pointer;
}
.jm-day-muted:hover { background: #E9E9E9; }
.jm-day-muted .jm-daynum { color: #BBBBBB; }

/* Weekend tint */
.jm-day-weekend:not(.jm-day-muted) { background: #FAFAFA; }

/* Today */
.jm-day-today { background: #FFFFFF; }
.jm-day-today:hover { background: #F5FAF7; }

/* ── Date number ────────────────────────────────────────────────────────── */
.jm-daynum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 13px;
  font-weight: 600;
  color: #333333;
  line-height: 1;
  border-radius: 50%;
  margin-bottom: 2px;
}
.jm-day-today .jm-daynum {
  background: #5383C3;
  color: #fff;
  font-weight: 700;
}
/* Keep today-num span consistent when used */
.jm-today-num {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

/* ── Bars overlay ───────────────────────────────────────────────────────── */
.jm-bars-layer {
  position: absolute;
  top: 42px;   /* padding (10px) + date number (26px) + gap (6px) */
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ══ Spanning event bar (Jobber-style ≈ 20 px tall) ═══════════════════════ */
.jm-bar {
  position: absolute;
  height: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 6px;
  border-radius: 4px;
  background: #E9F2E6;
  border-left: 3px solid #7DB87A;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  z-index: 1;
  pointer-events: all;
}
/* Hover */
.jm-bar--hover,
.jm-bar--hover.jm-bar--cont-left,
.jm-bar--hover.jm-bar--cont-right {
  background: #D4EAD0;
  border-left-color: #5A9E56;
  box-shadow: 0 2px 8px rgba(93,160,88,0.2);
  transform: translateY(-1px);
  z-index: 5;
}

/* ── Filled (dark green) bar — single-day job with start_time ── */
.jm-bar--filled {
  background: #1B4D23;
  border-left-color: #145218;
  height: 34px;
  padding: 0 10px 0 7px;
  align-items: center;
  border-radius: 6px;
}
.jm-bar--filled:hover,
.jm-bar--filled.jm-bar--hover {
  background: #1a5c24 !important;
  border-left-color: #0f3d18 !important;
  box-shadow: 0 2px 8px rgba(27,77,35,0.35);
  transform: translateY(-1px);
  z-index: 5;
}
.jm-bar--filled .jm-bar-avatar {
  background: rgba(255,255,255,0.22);
  color: #fff;
  width: 20px;
  height: 20px;
  font-size: 10px;
}
.jm-bar--filled .jm-bar-time    { color: rgba(255,255,255,0.8);  font-size: 12px; }
.jm-bar--filled .jm-bar-name    { color: #fff; font-weight: 700; font-size: 12px; }
.jm-bar--filled .jm-bar-sep     { color: rgba(255,255,255,0.4);  font-size: 12px; }
.jm-bar--filled .jm-bar-jobname { color: rgba(255,255,255,0.75); font-size: 12px; }

/* Separator between customer and job name */
.jm-bar-sep {
  font-size: 11px;
  color: #7A9A7A;
  flex-shrink: 0;
}

/* Job name text (shown on filled bars) */
.jm-bar-jobname {
  font-size: 11px;
  font-weight: 500;
  color: #3C483C;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Continuation — square the clipped edge */
.jm-bar--cont-left  { border-left: none; border-radius: 0 4px 4px 0; }
.jm-bar--cont-right { border-radius: 4px 0 0 4px; }
.jm-bar--cont-left.jm-bar--cont-right { border-radius: 0; }

/* Extra employee count badge (+N) */
.jm-bar-extra {
  flex-shrink: 0;
  height: 15px;
  padding: 0 4px;
  border-radius: 7px;
  background: rgba(0,0,0,0.15);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1px;
  letter-spacing: -0.2px;
}
.jm-bar--filled .jm-bar-extra {
  background: rgba(255,255,255,0.25);
}

/* Avatar circle */
.jm-bar-avatar {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2A3F44;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Time label (HH:MM) inside bar */
.jm-bar-time {
  font-size: 11px;
  font-weight: 700;
  color: #3C483C;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

/* Customer name label */
.jm-bar-name {
  font-size: 11px;
  font-weight: 600;
  color: #3C483C;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── View-switcher tabs (Month / Vecka / Dag) ─────────────────────────── */
.jobs-cal-view-tabs {
  display: flex;
  gap: 2px;
  background: #F3F4F6;
  border-radius: 8px;
  padding: 3px;
}
.cal-view-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: 'Inter', sans-serif;
}
.cal-view-btn:hover { background: #E5E7EB; color: #111827; }
.cal-view-btn.cal-view-active {
  background: #fff;
  color: #111827;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}

/* ─── Week / Day calendar container (no CSS grid columns) ──────────────── */
.jobs-cal-grid-plain {
  width: 100%;
  overflow: hidden;
}

/* ─── Week / Day wrapper ────────────────────────────────────────────────── */
.jcal-wrap {
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

/* Day-header row */
.jcal-header {
  display: flex;
  border-bottom: 1px solid #E5E7EB;
  background: #F9FAFB;
}
.jcal-day-head {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-right: 1px solid #E5E7EB;
  gap: 2px;
}
.jcal-day-head:last-child { border-right: none; }
.jcal-day-head-single { flex: 1; }
.jcal-today-head { background: #EFF6FF; }
.jcal-head-name {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9CA3AF;
}
.jcal-head-num {
  font-size: 20px;
  font-weight: 600;
  color: #374151;
  line-height: 1;
}
.jcal-head-today {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1B4B8A;
  color: #fff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

/* Gutter (time labels column) */
.jcal-gutter {
  flex-shrink: 0;
  border-right: 1px solid #E5E7EB;
}

/* All-day bar row */
.jcal-allday-row {
  display: flex;
  border-bottom: 1px solid #E5E7EB;
  background: #FAFAFA;
  position: relative;
}
.jcal-allday-label {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 6px 8px 6px 4px;
  font-size: 10px;
  font-weight: 500;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.jcal-allday-area {
  flex: 1;
  position: relative;
  min-height: 28px;
}

/* All-day spanning bar chips */
.jcal-allday-chip {
  position: absolute;
  top: 0;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: filter 0.1s;
  background: var(--bg, #1B4B8A);
}
.jcal-allday-chip:hover { filter: brightness(1.1); }

/* Pill chips in day view all-day section */
.jcal-allday-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 8px;
  flex: 1;
}
.jcal-allday-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  background: var(--bg, #1B4B8A);
  transition: filter 0.1s;
  white-space: nowrap;
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
}
.jcal-allday-pill:hover { filter: brightness(1.1); }

/* Time grid */
.jcal-time-grid { display: flex; flex-direction: column; }
.jcal-time-row {
  display: flex;
  border-bottom: 1px solid #F3F4F6;
  min-height: 40px;
}
.jcal-time-row:last-child { border-bottom: none; }
.jcal-time-label {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4px 8px 4px 4px;
  font-size: 11px;
  color: #9CA3AF;
  font-weight: 400;
  margin-top: -6px;
}

/* Day cells inside time rows */
.jcal-day-cells {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.jcal-day-single { grid-template-columns: 1fr; }
.jcal-cell {
  border-right: 1px solid #F3F4F6;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.1s;
}
.jcal-cell:last-child { border-right: none; }
.jcal-cell:hover { background: #F0F9FF; }
.jcal-cell-today { background: #F0F6FF; }
.jcal-cell-today:hover { background: #E0EDFF; }

/* ═══════════════════════════════════════════════════════════════════════════
   JOBBER-STYLE CREATE JOB MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Job Edit Modal (wide, 2-column Jobber-style) ───────────────────────── */
.je-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 1060px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  animation: jmSlideUp 0.2s ease;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

.je-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid #F3F4F6;
  flex-shrink: 0;
}

.je-header-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}

.je-body {
  flex: 1;
  overflow-y: auto;
}

.je-section {
  padding: 20px 24px;
  border-bottom: 1px solid #F3F4F6;
}

.je-two-col {
  display: grid;
  grid-template-columns: 55% 1fr;
  gap: 32px;
}

.je-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 14px;
}

/* Job details (right column) */
.je-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
}
.je-detail-label { color: #6B7280; min-width: 62px; flex-shrink: 0; }
.je-detail-val   { color: #059669; font-weight: 600; line-height: 1.4; }

/* Team chips with remove ×  */
.je-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 20px;
  padding: 4px 6px 4px 4px;
  font-size: 13px;
  font-weight: 500;
  color: #1D4E1A;
}
.je-chip-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #059669;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.je-chip-x {
  background: none; border: none;
  color: #6B7280; cursor: pointer;
  font-size: 13px; padding: 0 2px;
  line-height: 1;
}
.je-chip-x:hover { color: #EF4444; }

/* Assign button */
/* Checkbox label row */
.je-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  user-select: none;
}
.je-check-label:hover { color: #111827; }

.je-assign-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 12px; font-weight: 600;
  color: #374151;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.je-assign-btn:hover { background: #F9FAFB; }

/* Line items table */
.je-li-header {
  display: grid;
  grid-template-columns: 1fr 72px 100px 100px 36px;
  gap: 8px;
  padding: 8px 12px;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  font-size: 11px;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.je-li-row {
  display: grid;
  grid-template-columns: 1fr 72px 100px 100px 36px;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #F3F4F6;
  align-items: center;
}
.je-li-row:last-child { border-bottom: none; }
.je-li-name { font-size: 13px; font-weight: 500; color: #111827; }
.je-li-input {
  width: 100%; height: 34px;
  padding: 0 8px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: 13px;
  color: #111827;
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
  outline: none;
  text-align: right;
}
.je-li-input:focus { border-color: #6EE7B7; }
.je-li-total { font-size: 13px; font-weight: 600; color: #374151; text-align: right; }
.je-li-del {
  background: none; border: none;
  color: #D1D5DB; cursor: pointer;
  font-size: 16px; padding: 4px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.je-li-del:hover { color: #EF4444; background: #FEF2F2; }

/* Footer */
/* ─── Select jobs to invoice modal ──────────────────────────────────────── */
#jobInvoiceSelectModal { z-index: 1200; }

.jis-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.20), 0 4px 16px rgba(0,0,0,0.08);
  animation: jmSlideUp 0.18s ease;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}
.jis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #F3F4F6;
  flex-shrink: 0;
}
.jis-title { margin:0; font-size:18px; font-weight:700; color:#111827; }
.jis-table-wrap { flex:1; overflow-y:auto; padding: 16px 24px; }
.jis-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  overflow: hidden;
}
.jis-table thead tr {
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
}
.jis-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}
.jis-table td {
  padding: 14px 14px;
  font-size: 13px;
  color: #374151;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
}
.jis-table tbody tr:last-child td { border-bottom: none; }
.jis-table tbody tr:hover td { background: #F9FAFB; }
.jis-row-cb { width:18px; height:18px; accent-color:#059669; cursor:pointer; }
.jis-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.jis-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.jis-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid #F3F4F6;
  flex-shrink: 0;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* ─── Complete Job dialog ────────────────────────────────────────────────── */
/* Complete dialog sits above the detail popup */
#jobCompleteModal { z-index: 1100; }

.jco-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.20), 0 4px 16px rgba(0,0,0,0.08);
  animation: jmSlideUp 0.18s ease;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}
.jco-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 22px 20px;
  border-bottom: 1px solid #F3F4F6;
}
.jco-header-pre {
  font-size: 13px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.jco-header-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}
.jco-options {
  padding: 8px 0 12px;
}
.jco-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 22px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  transition: background 0.12s;
  border-radius: 0;
}
.jco-option:hover { background: #F9FAFB; }
.jco-option:hover .jco-option-arrow path { stroke: #9CA3AF; }
.jco-option:active { background: #F0FDF4; }
.jco-option-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: #F0FDF4;
  color: #059669;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.jco-option-icon--muted { background: #F3F4F6; color: #6B7280; }
.jco-option-body { flex: 1; min-width: 0; }
.jco-option-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}
.jco-option-desc { font-size: 12px; color: #9CA3AF; line-height: 1.4; }
.jco-option-arrow { flex-shrink: 0; transition: transform 0.1s; }
.jco-option:hover .jco-option-arrow { transform: translateX(2px); }
/* ─────────────────────────────────────────────────────────────────────────── */

/* ─── Tjänster & material picker ────────────────────────────────────────── */
.je-picker-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.08);
  animation: jmSlideUp 0.18s ease;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}
.je-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #F3F4F6;
  flex-shrink: 0;
}
.je-picker-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #F3F4F6;
  flex-shrink: 0;
  background: #FAFAFA;
}
.je-picker-search-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: #111827;
  font-family: 'Inter', sans-serif;
  outline: none;
}
.je-picker-search-input::placeholder { color: #9CA3AF; }
.je-picker-list {
  flex: 1;
  overflow-y: auto;
}
.je-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid #F9FAFB;
  transition: background 0.1s;
}
.je-picker-row:hover { background: #F0FDF4; }
.je-picker-row:last-child { border-bottom: none; }
.je-picker-row-left { flex: 1; min-width: 0; }
.je-picker-row-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}
.je-picker-row-meta { font-size: 12px; color: #9CA3AF; }
.je-picker-row-price {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
  margin-left: 16px;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* Unsaved-changes warning */
.je-changed-warning {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 7px 11px;
  animation: jeFadeIn 0.2s ease;
}
@keyframes jeFadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

.je-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid #F3F4F6;
  flex-shrink: 0;
  background: #fff;
}
.je-btn {
  height: 40px; padding: 0 20px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, transform 0.1s;
}
.je-btn:active { transform: scale(0.98); }
.je-btn-delete { background: none; color: #EF4444; border: 1.5px solid #FCA5A5; }
.je-btn-delete:hover { background: #FEF2F2; }
.je-btn-cancel { background: #F3F4F6; color: #374151; border: 1.5px solid #E5E7EB; }
.je-btn-cancel:hover { background: #E5E7EB; }
.je-btn-save   { background: #16A34A; color: #fff; padding: 0 28px; }
.je-btn-save:hover { background: #15803D; }

@media (max-width: 640px) {
  .je-two-col { grid-template-columns: 1fr; gap: 20px; }
  .je-modal    { max-height: 95vh; border-radius: 12px; }
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* Backdrop */
.jm-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.32);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: jmFadeIn 0.18s ease;
  overflow-y: auto;          /* Bakdroppen scrollar vid liten skärm */
  padding: 20px;
  box-sizing: border-box;
}
.jm-backdrop.active { display: flex; }
@keyframes jmFadeIn { from { opacity:0; } to { opacity:1; } }

/* Modal card */
.jm-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 0 0 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  animation: jmSlideUp 0.2s ease;
  font-family: 'Inter', sans-serif;
}
@keyframes jmSlideUp {
  from { transform: translateY(12px) scale(0.98); opacity:0; }
  to   { transform: translateY(0)    scale(1);    opacity:1; }
}

/* Top bar: handle + close */
.jm-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 4px;
}
.jm-modal-handle-icon {
  font-size: 18px;
  color: #D1D5DB;
  letter-spacing: 2px;
}
.jm-modal-x {
  background: none;
  border: none;
  font-size: 16px;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.1s, background 0.1s;
}
.jm-modal-x:hover { color: #111; background: #F3F4F6; }

/* Type tabs */
.jm-modal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 18px 12px;
  border-bottom: 1px solid #F3F4F6;
}
.jm-modal-tab {
  padding: 7px 16px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: #9CA3AF;
  cursor: pointer;
  transition: all 0.12s;
  font-family: 'Inter', sans-serif;
}
.jm-modal-tab:hover { color: #374151; background: #F9FAF9; }
.jm-modal-tab--active {
  background: #F0FDF4;
  border-color: #6EE7B7;
  color: #059669;
}

/* Section spacing */
.jm-modal-section {
  padding: 12px 18px;
}

/* Generic modal input */
.jm-minput {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.jm-minput:focus {
  border-color: #6EE7B7;
  box-shadow: 0 0 0 3px rgba(110,231,183,0.18);
}
.jm-minput::placeholder { color: #9CA3AF; }
.jm-minput--search { padding-left: 14px; }
.jm-minput--sm { height: 38px; font-size: 13px; margin-bottom: 6px; }
.jm-minput--time {
  width: auto;
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  text-align: center;
}

/* Client search dropdown */
.jm-client-search-wrap { position: relative; }
.jm-client-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  z-index: 10;
  overflow: hidden;
}
.jm-client-create-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid #F3F4F6;
  font-size: 14px;
  font-weight: 600;
  color: #059669;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  transition: background 0.1s;
}
.jm-client-create-btn:hover { background: #F0FDF4; }
/* ─── Customer picker modal ───────────────────────────────────────────────── */
.jm-custpicker-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  height: 82vh;
  max-height: 720px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 72px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.08);
  animation: jmSlideUp 0.2s ease;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

/* Header */
.jm-custpicker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  flex-shrink: 0;
}
.jm-custpicker-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

/* Search + "eller" + button row */
.jm-custpicker-searchrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 16px;
  flex-shrink: 0;
}
.jm-custpicker-searchbox {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  padding: 0 14px;
  height: 44px;
  background: #fff;
  transition: border-color 0.15s;
}
.jm-custpicker-searchbox:focus-within {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}
.jm-custpicker-searchicon { width: 18px; height: 18px; flex-shrink: 0; }
.jm-custpicker-searchbox input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #111827;
  font-family: 'Inter', sans-serif;
  background: transparent;
}
.jm-custpicker-searchbox input::placeholder { color: #9CA3AF; }

.jm-custpicker-or {
  font-size: 13px;
  color: #9CA3AF;
  flex-shrink: 0;
}
.jm-custpicker-newbtn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 18px;
  background: #1B5E20;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
  white-space: nowrap;
}
.jm-custpicker-newbtn:hover { background: #145218; }

/* Results list */
.jm-picker-list {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid #F3F4F6;
}
.jm-picker-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 24px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #F9FAFB;
}
.jm-picker-item:hover { background: #F9FAFB; }
.jm-picker-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.jm-picker-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.jm-picker-item-sub {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 2px;
}

/* Empty state */
.jm-picker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  min-height: 200px;
  color: #6B7280;
  font-size: 14px;
  padding: 40px 20px;
}
.jm-picker-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
}
.jm-picker-empty-btn {
  padding: 10px 22px;
  border: 1.5px solid #E5E7EB;
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.1s;
}
.jm-picker-empty-btn:hover { background: #F9FAFB; }

/* Inline create form */
.jm-picker-createform {
  border-top: 1px solid #F3F4F6;
  padding: 20px 24px 22px;
  flex-shrink: 0;
  background: #FAFAFA;
}
.jm-picker-createform-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.jm-client-list { max-height: 180px; overflow-y: auto; }
.jm-client-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #111827;
  transition: background 0.1s;
}
.jm-client-item:hover { background: #F9FAFB; }
.jm-client-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #1E293B;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Action buttons row */
.jm-action-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jm-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  transition: background 0.1s, border-color 0.1s;
}
.jm-action-btn:hover { background: #F9FAFB; border-color: #D1D5DB; }

/* Employee chips */
.jm-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}
.jm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  background: #F3F4F6;
  border: 1.5px solid #E5E7EB;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  font-family: 'Inter', sans-serif;
}
.jm-chip-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #1E293B;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jm-chip-x {
  background: none;
  border: none;
  padding: 0 0 0 4px;
  font-size: 13px;
  color: #9CA3AF;
  cursor: pointer;
  line-height: 1;
}
.jm-chip-x:hover { color: #374151; }

/* Assign dropdown */
.jm-assign-drop {
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 8px;
  background: #fff;
  padding: 8px;
}
.jm-emp-list { max-height: 160px; overflow-y: auto; }
.jm-emp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #111827;
  transition: background 0.1s;
}
.jm-emp-item:hover { background: #F9FAFB; }
.jm-emp-item--selected { background: #F0FDF4; }
.jm-emp-check { margin-left: auto; color: #059669; font-size: 14px; }

/* Date / time grid */
.jm-dt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 10px;
  align-items: start;
}
.jm-mlabel {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.jm-time-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.jm-time-dash { color: #9CA3AF; font-size: 14px; flex-shrink: 0; }
.jm-time-clear {
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
}
.jm-time-clear:hover { color: #374151; background: #F3F4F6; }
.jm-anytime-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 13px;
  color: #6B7280;
  cursor: pointer;
}

/* Availability toggle row */
.jm-avail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid #F3F4F6;
}
.jm-avail-label { font-size: 14px; color: #374151; font-weight: 500; }
.jm-toggle { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.jm-toggle input { opacity: 0; width: 0; height: 0; }
.jm-toggle-track {
  position: absolute; inset: 0;
  background: #D1D5DB;
  border-radius: 999px;
  transition: background 0.2s;
}
.jm-toggle input:checked + .jm-toggle-track { background: #10B981; }
.jm-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.jm-toggle input:checked + .jm-toggle-track .jm-toggle-thumb { transform: translateX(18px); }

/* Footer */
.jm-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px 6px;
  border-top: 1px solid #F3F4F6;
}
.jm-mfooter-btn {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, transform 0.1s;
}
.jm-mfooter-btn:active { transform: scale(0.98); }
.jm-mfooter-btn--sec {
  background: #F3F4F6;
  color: #374151;
  border: 1.5px solid #E5E7EB;
}
.jm-mfooter-btn--sec:hover { background: #E5E7EB; }
.jm-mfooter-btn--pri {
  background: #16A34A;
  color: #fff;
  flex: 1.4;
}
.jm-mfooter-btn--pri:hover { background: #15803D; }

/* ─── Create new client modal ─────────────────────────────────────────────── */
.jm-createclient-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 580px;
  /* Ingen max-height — låt innehållet bestämma höjden, backdrop hanterar scroll */
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 72px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.08);
  animation: jmSlideUp 0.2s ease;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}
.jm-createclient-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 14px;
  border-bottom: 1px solid #F3F4F6;
  flex-shrink: 0;
}
.jm-createclient-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}
.jm-createclient-body {
  padding: 0 24px;
  /* Ingen overflow — allt ska synas */
}
.jm-createclient-section {
  padding: 14px 0;
  border-bottom: 1px solid #F3F4F6;
}
.jm-createclient-section:last-child { border-bottom: none; }
.jm-createclient-section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.jm-cc-name-row {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 8px;
}
.jm-cc-title-sel {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px !important;
  cursor: pointer;
}
.jm-cc-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  user-select: none;
}
.jm-cc-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #16A34A;
  flex-shrink: 0;
  cursor: pointer;
}
/* Toggle switch for SMS */
.jm-cc-toggle-row { gap: 12px; }
.jm-cc-toggle-wrap { display: flex; align-items: center; }
.jm-cc-toggle-input { display: none; }
.jm-cc-toggle-track {
  width: 42px;
  height: 24px;
  background: #D1D5DB;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  display: block;
  flex-shrink: 0;
}
.jm-cc-toggle-input:checked + .jm-cc-toggle-track { background: #16A34A; }
.jm-cc-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.jm-cc-toggle-input:checked ~ .jm-cc-toggle-track .jm-cc-toggle-thumb,
.jm-cc-toggle-input:checked + .jm-cc-toggle-track .jm-cc-toggle-thumb { left: 21px; }
.jm-createclient-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #F3F4F6;
  flex-shrink: 0;
}
