:root {
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --brand-soft: #eef2ff;
  --accent: #06b6d4;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f97316;
  --dark: #111827;
  --sidebar: #111827;
  --sidebar-card: #1f2937;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --soft-border: #e2e8f0;
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 15px 40px rgba(15, 23, 42, 0.1);
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #eef2f7;
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

/* =========================================
   APP LAYOUT
========================================= */

.app {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 30px;

  display: flex;
  flex-direction: column;

  min-width: 0;
}

.dashboard-cards {
  flex-shrink: 0;
}

@media (min-width: 769px) {
  .main-content,
  .page-content,
  .dashboard-main {
    margin-left: 320px;
  }

  .sidebar.collapsed ~ .main-content,
  .sidebar.collapsed ~ .page-content,
  .sidebar.collapsed ~ .dashboard-main {
    margin-left: 84px;
  }
}


#calendar {
  flex: 1;
  min-height: 0;
}

.fc {
  height: 100% !important;
}

.topbar {
  margin-bottom: 25px;
}

.topbar h1,
.page-header h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  gap: 16px;
}

.page-header p,
.muted {
  color: var(--muted);
}

/* =========================================
   SIDEBAR
========================================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 320px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  padding: 25px;
  color: white;
  background: linear-gradient(180deg, #111827, #1e1b4b);
  box-shadow: 8px 0 30px rgba(17, 24, 39, 0.18);
  transition: width 0.3s ease, padding 0.3s ease;
}

/* Desktop sidebar is fixed for all pages; page-specific scrolling is handled by .main-content. */

.sidebar.collapsed {
  width: 84px;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 35px;
}

.burger-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  backdrop-filter: blur(10px);
}

.logo-text {
  white-space: nowrap;
  font-size: 24px;
  font-weight: 800;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.sidebar-brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  height: 48px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.burger-btn {
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-top {
  justify-content: center;
  padding: 18px 0;
}

.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .auto-schedule-btn,
.sidebar.collapsed #jobsContainer,
.sidebar.collapsed #tasksContainer,
.sidebar.collapsed #personalContainer {
  display: none !important;
}

.sidebar.collapsed .sidebar-links {
  padding: 0;
  align-items: center;
}

.sidebar.collapsed .nav-link {
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0 auto 12px;
  justify-content: center;
  border-radius: 16px;
}

.sidebar.collapsed .nav-link i {
  margin: 0;
  font-size: 18px;
}


.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 35px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.08);
  padding: 15px;
  border-radius: 14px;
  color: white;
  text-decoration: none;
  transition: 0.2s;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.nav-link:hover,
.nav-link.active {
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.logout-btn {
  border: none;
  width: 100%;
  cursor: pointer;
  font: inherit;
}

.sidebar-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  margin-bottom: 14px;
}

.sidebar-section-title {
  font-size: 18px;
  font-weight: 700;
}

.small-plus-btn {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.job,
.task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  cursor: grab;
  backdrop-filter: blur(10px);
  transition: 0.2s;
}

.job:hover,
.task:hover {
  transform: translateY(-1px);
}

.job {
  border-left: 4px solid var(--brand);
}

.task {
  border-left: 4px solid var(--accent);
}

.sidebar-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}


.calendar-status {
  color: #ffffff;
  opacity: 0.9;
  font-size: 14px;
}

.calendar-status.active {
  color: var(--success);
}

.sidebar-complete-btn,
.sidebar-delete-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

.sidebar-complete-btn:hover {
  color: var(--success);
}

.sidebar-delete-btn:hover {
  color: var(--danger);
}

.urgent-item {
  border-left: 4px solid var(--danger) !important;
  box-shadow:
    0 0 0 1px rgba(239,68,68,0.15),
    0 8px 24px rgba(239,68,68,0.18);
  position: relative;
}

.urgent-item::after {
  content: 'URGENT';
  position: absolute;
  top: -8px;
  right: 12px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: 0.08em;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .job,
.sidebar.collapsed .task,
.sidebar.collapsed .small-plus-btn {
  display: none;
}

/* =========================================
   BUTTONS / FORMS
========================================= */

.primary-btn,
.secondary-btn,
.danger-btn-small {
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.secondary-btn {
  background: #f3f4f6;
  color: #111827;
}

.danger-btn-small {
  background: var(--danger);
  color: white;
}

.primary-btn:hover,
.secondary-btn:hover,
.danger-btn-small:hover,
.small-plus-btn:hover {
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.inline-action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.compact-btn {
  padding: 13px 16px;
  white-space: nowrap;
}

.hidden-form-section {
  display: none;
}

.hidden-form-section.show {
  display: block;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-weight: 700;
  color: #374151;
}

.toggle-row input {
  width: 20px;
  height: 20px;
}

/* =========================================
   DASHBOARD CARDS
========================================= */

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
  align-items: stretch;
}

@media (max-width: 1200px) {
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
}

.card {
  background: white;
  border-radius: 22px;
  padding: 24px;
  border: 1px solid rgba(79, 70, 229, 0.08);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  transition: 0.2s;

  min-height: 140px;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card:hover {
  transform: translateY(-2px);
}

.card h3 {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card p {
  color: var(--brand-dark);
  font-size: 30px;
  font-weight: 800;
  margin-top: 10px;
}

/* =========================================
   CALENDAR
========================================= */

#calendar {
  background: white;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(79, 70, 229, 0.08);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.1);
  height: auto !important;
  overflow: hidden !important;
}

.fc {
  width: 100%;
}


.fc-timegrid-slot {
  height: 26px !important;
}

.fc-toolbar-title {
  font-size: 24px !important;
  font-weight: 800 !important;
}

.fc-button-primary {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  border-radius: 10px !important;
}

.fc-button-primary:hover {
  background: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
}

.fc-event {
  font-weight: 700;
  border-radius: 10px;
  border: none !important;
  padding: 4px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.fc-timegrid-event {
  border: none !important;
  border-radius: 14px !important;
  padding: 6px 8px !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  overflow: hidden;
}

.fc-timegrid-event-harness {
  margin-right: 2px;
}

.fc .fc-timegrid-now-indicator-line {
  border-top: 3px solid var(--danger) !important;
  z-index: 9999 !important;
}

.fc .fc-timegrid-now-indicator-arrow {
  border-color: var(--danger) !important;
  z-index: 9999 !important;
}

.calendar-event-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 2px 0;
}

.calendar-event-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.calendar-event-text strong {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.2px;
  color: white;
  margin-bottom: 4px;
  width: 100%;
}

.calendar-event-text span {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0.92;
  color: rgba(255,255,255,0.92);
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-delete-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.16);
  color: white;
  cursor: pointer;
  font-size: 10px;
  margin-top: 2px;
}

/* =========================================
   MODALS
========================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(6px);
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: white;
  width: 95%;
  max-width: 700px;
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 25px 80px rgba(15, 23, 42, 0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}

.modal-header h2 {
  font-size: 28px;
  font-weight: 800;
}

.modal-subtitle {
  color: var(--muted);
  margin-top: 4px;
}

.close-btn {
  background: #f3f4f6;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
}

.modern-modal label {
  display: block;
  margin-bottom: 8px;
  margin-top: 10px;
  font-weight: 700;
  color: #374151;
}

.modern-modal input,
.modern-modal textarea,
.modern-modal select {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f9fafb;
  margin-bottom: 10px;
  font-size: 15px;
}

.modern-modal textarea {
  min-height: 120px;
  resize: vertical;
}

.modern-modal input:focus,
.modern-modal textarea:focus,
.modern-modal select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.modal-section-title {
  margin-top: 15px;
  margin-bottom: 10px;
}

/* =========================================
   CUSTOMER PAGE
========================================= */

.customer-layout-new {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.customer-list-panel,
.customer-details-panel {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(79, 70, 229, 0.08);
}

.customer-card-new {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  background: #f9fafb;
  border: 1px solid var(--border);
  transition: 0.2s;
}

.customer-card-new:hover,
.customer-card-new.selected {
  background: var(--brand-soft);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.customer-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.details-card-new {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.details-header,
.site-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.details-actions,
.site-actions {
  display: flex;
  gap: 10px;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.details-grid div,
.notes-box,
.site-card,
.add-site-box {
  background: #f9fafb;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--border);
}

.map-frame {
  width: 100%;
  height: 260px;
  border: 0;
  border-radius: 18px;
  margin-top: 14px;
}

.add-site-box input {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: white;
  margin-bottom: 12px;
}

.empty-state {
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
}

.details-map-section {
  margin-top: 10px;
  margin-bottom: 16px;
}

.map-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

/* =========================================
   JOBS PAGE
========================================= */

.jobs-toolbar {
  display: grid;
  grid-template-columns: 1fr 220px 220px;
  gap: 16px;
  margin-bottom: 24px;
}

.jobs-toolbar input,
.jobs-toolbar select {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: white;
  font-size: 15px;
}

.jobs-section {
  margin-bottom: 28px;
}

.jobs-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.completed-section {
  margin-top: 50px;
  border-top: 1px solid rgba(15,23,42,0.08);
  padding-top: 20px;
}

.collapsible-header {
  cursor: pointer;
}

#completedJobsList.collapsed {
  display: none;
}

#completedChevron {
  transition: transform 0.25s ease;
}

#completedChevron.rotated {
  transform: rotate(-180deg);
}

.jobs-list,
#completedJobsList {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 14px;
}

.job-list-card {
  position: relative;

  background: #ffffff;

  border-radius: 28px;

  padding: 32px;

  margin-bottom: 28px;

  border: 1px solid #d6deea;

  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.08),
    0 2px 6px rgba(15, 23, 42, 0.04);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;

  cursor: pointer;

  overflow: hidden;
}

.job-list-card:hover {
  transform: translateY(-4px);

  border-color: rgba(79, 70, 229, 0.35);

  box-shadow:
    0 26px 46px rgba(15, 23, 42, 0.1),
    0 10px 22px rgba(79, 70, 229, 0.1);
}

.urgent-job-card::before {
  background: linear-gradient(180deg, var(--danger), var(--warning));
}

.completed-job-card {
  opacity: 0.92;
}

.completed-job-card::before {
  background: linear-gradient(180deg, var(--success), #16a34a);
}

.job-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.job-card-info {
  min-width: 0;
  padding-left: 6px;
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.job-card-header h3 {
  font-size: 1.7rem;
  line-height: 1.1;
  margin-bottom: 14px;
  color: #0f172a;
}

.job-card-header p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  color: #64748b;
  font-size: 0.98rem;
  line-height: 1.5;
}

.job-card-header i {
  color: #6366f1;
  width: 18px;
}

.job-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-badge,
.priority-badge {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.status-new {
  background: #eef2ff;
  color: #3730a3;
}

.status-quoted {
  background: #fef3c7;
  color: #92400e;
}

.status-scheduled {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-in-progress {
  background: #cffafe;
  color: #0e7490;
}

.status-completed {
  background: #dcfce7;
  color: #166534;
}

.priority-urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.priority-normal {
  background: #eef2ff;
  color: #3730a3;
}

.priority-low {
  background: #f3f4f6;
  color: #374151;
}

.job-notes-box {
  margin-top: 18px;
  background: #f8fafc;
  border: 1px solid var(--soft-border);
  border-radius: 20px;
  padding: 20px;
  color: #475569;
  line-height: 1.65;
}

.job-card-photo-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.job-card-photo-preview {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.photo-more-badge {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.job-map-wrapper {
  width: 100%;
}

.job-card-map {
  width: 100%;
  height: 260px;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.job-list-meta {
  margin-top: 28px;
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}

.job-list-meta strong {
  display: block;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.job-list-meta p {
  color: #0f172a;
  font-weight: 700;
}

.job-list-actions {
  display: flex;
  gap: 12px;
}

/* =========================================
   JOB PHOTOS / LIGHTBOX
========================================= */

.job-photos-section {
  margin-top: 22px;
  margin-bottom: 18px;
}

.job-photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.upload-photo-btn {
  cursor: pointer;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.job-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.job-photo-wrapper {
  position: relative;
}

.job-photo-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 16px;
}

.delete-photo-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: white;
  cursor: pointer;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.photo-lightbox.show {
  display: flex;
}

.photo-lightbox img {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 18px;
  object-fit: contain;
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  border: none;
  color: white;
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  cursor: pointer;
}

.lightbox-close {
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
}

.lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}

.lightbox-arrow.left {
  left: 18px;
}

.lightbox-arrow.right {
  right: 18px;
}

/* =========================================
   LOGIN
========================================= */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111827, #4f46e5);
  padding: 20px;
}

.login-card {
  background: white;
  width: 100%;
  max-width: 430px;
  padding: 35px;
  border-radius: 28px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.25);
}

.login-card h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.login-card p {
  color: #6b7280;
  margin-bottom: 22px;
}

.login-card label {
  display: block;
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.login-card button {
  margin-top: 12px;
}

.auth-message {
  margin-top: 18px;
  color: var(--danger) !important;
  font-size: 14px;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .app {
    flex-direction: column;
  }

  .sidebar,
  .sidebar.collapsed {
    width: 100%;
  }

  .customer-layout-new,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .job-card-top {
    grid-template-columns: 1fr;
  }

  .job-map-wrapper {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .jobs-toolbar {
    grid-template-columns: 1fr;
  }

  .job-list-actions {
    flex-direction: column;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 20px;
  }

  .topbar h1,
  .page-header h1 {
    font-size: 28px;
  }

  .fc-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .fc-toolbar-title {
    font-size: 1.4rem !important;
  }

  .fc-button {
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
  }

  .fc-timegrid-event {
    border-radius: 14px !important;
    padding: 6px !important;
  }

  .calendar-event-content strong {
    font-size: 0.95rem;
  }

  .calendar-event-content span {
    font-size: 0.75rem;
  }

  .sidebar,
  .sidebar.collapsed {
    width: 100%;
    padding: 20px 18px;
  }

  .sidebar-top {
    margin-bottom: 18px;
  }

  .burger-btn {
    width: 52px;
    height: 52px;
    font-size: 22px;
    border-radius: 16px;
  }

  .sidebar:not(.collapsed) .sidebar-section-title,
  .sidebar:not(.collapsed) .sidebar-heading-row,
  .sidebar:not(.collapsed) #jobsContainer,
  .sidebar:not(.collapsed) #tasksContainer {
    display: block;
  }

  .sidebar.collapsed .sidebar-section-title,
  .sidebar.collapsed .sidebar-heading-row,
  .sidebar.collapsed #jobsContainer,
  .sidebar.collapsed #tasksContainer {
    display: none;
  }

  .sidebar.collapsed .sidebar-links {
    display: grid;
    gap: 12px;
    margin-top: 18px;
  }

  .sidebar.collapsed .nav-link {
    height: 54px;
    padding: 0 18px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    font-size: 15px;
    font-weight: 700;
  }

  .sidebar.collapsed .nav-link i {
    font-size: 21px;
    width: 28px;
    text-align: center;
  }

  .sidebar.collapsed .nav-link span {
    display: inline;
  }

  .sidebar.collapsed .nav-link.active {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.32);
  }

  .modal-box {
    padding: 22px;
    border-radius: 24px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions button {
    width: 100%;
  }

  .map-actions {
    flex-direction: column;
  }

  .job-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .job-badges {
    justify-content: flex-start;
  }

  .job-card-header h3 {
    font-size: 1.35rem;
  }

  .job-card-map {
    height: 220px;
  }

  .job-list-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

.customer-job-history {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #e5e7eb;
}

.history-section {
  margin-top: 18px;
}

.history-section h4 {
  margin-bottom: 10px;
  color: #374151;
}

.history-job-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.history-job-card strong {
  display: block;
  color: #0f172a;
  margin-bottom: 4px;
}

.history-job-card span {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.history-job-card.completed span {
  background: #dcfce7;
  color: #166534;
}

.history-job-card p {
  color: #64748b;
  margin-top: 4px;
}

.history-job-card {
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.history-job-card:hover {
  transform: translateY(-2px);

  box-shadow:
    0 10px 20px rgba(15,23,42,0.08);
}

.route-card {
  cursor: pointer;
}

.route-stop-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
}

.route-stop-card span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.route-stop-card strong {
  display: block;
  color: #0f172a;
  margin-bottom: 4px;
}

.route-stop-card p {
  color: #64748b;
  margin-bottom: 4px;
}

.route-stop-card small {
  color: #4f46e5;
  font-weight: 800;
}

.route-card {
  cursor: pointer;

  position: relative;

  overflow: hidden;

  background:
    linear-gradient(
      135deg,
      #4f46e5,
      #06b6d4
    );

  color: white;

  border: none;

  box-shadow:
    0 18px 40px rgba(79,70,229,0.28);
}

.route-card:hover {
  transform: translateY(-4px);
}

.route-card h3 {
  color: rgba(255,255,255,0.8);
}

.route-card p {
  color: white;
  font-size: 2rem;
}

.route-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.route-card-icon {
  width: 64px;
  height: 64px;

  border-radius: 20px;

  background: rgba(255,255,255,0.16);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.6rem;

  backdrop-filter: blur(10px);
}

.route-card-footer {
  margin-top: 18px;

  color: rgba(255,255,255,0.82);

  font-weight: 700;

  font-size: 0.95rem;
}

/* Month view event styling */
.fc-daygrid-event {
  background: linear-gradient(135deg, #4f46e5, #06b6d4) !important;
  color: white !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 6px 8px !important;
  margin: 3px 6px !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  font-weight: 800;
}

.fc-daygrid-event .fc-event-title {
  color: white !important;
  font-size: 12px;
}

.fc-daygrid-event-dot {
  display: none !important;
}

.job-voice-section {
  margin-top: 24px;
}

.job-voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.voice-note-card {
  position: relative;

  background: #f8fafc;

  border: 1px solid #e2e8f0;

  border-radius: 18px;

  padding: 14px;

  margin-bottom: 12px;
}

.voice-note-card audio {
  width: 100%;
}

#recordVoiceBtn.recording {
  background: #ef4444;
  color: white;
}

@keyframes pulseRecord {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.45); }
  70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.voice-note-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

.voice-note-info strong {
  display: block;
  color: #0f172a;
}

.voice-note-info small {
  color: #64748b;
}

.voice-note-card audio {
  width: 100%;
}

.voice-delete-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 800;
  cursor: pointer;
}

.voice-note-title {
  cursor: pointer;
  color: #0f172a;
}

.voice-note-title:hover {
  color: #4f46e5;
  text-decoration: underline;
}

.job-voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  background: #fef3c7;
  color: #92400e;

  padding: 8px 12px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 800;
}

.job-voice-badge i {
  color: #92400e;
}

/* =========================
   JOB SHEET FINAL OVERRIDE
========================= */

.ai-brief-card,
.jobsheet-section {
  max-width: 1100px;
}

.ai-brief-card {
  position: relative;

  background:
    linear-gradient(
      135deg,
      #312e81 0%,
      #4f46e5 45%,
      #06b6d4 100%
    );

  color: white;

  border-radius: 32px;

  padding: 34px;

  margin: 24px 0 32px;

  overflow: hidden;

  box-shadow:
    0 30px 70px rgba(79,70,229,0.28),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

.ai-brief-card::before {
  content: '';

  position: absolute;

  top: -120px;
  right: -120px;

  width: 280px;
  height: 280px;

  border-radius: 50%;

  background:
    radial-gradient(
      rgba(255,255,255,0.22),
      transparent 70%
    );

  pointer-events: none;
}

.ai-brief-header {
  display: flex;
  align-items: flex-start;
}

.ai-brief-header h2 {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.ai-brief-header p {
  font-size: 15px;
  color: rgba(255,255,255,0.78);
}

.ai-brief-meta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;

  margin-bottom: 18px;
}

.ai-brief-date,
.ai-brief-weather {
  background: rgba(255,255,255,0.14);

  backdrop-filter: blur(12px);

  border: 1px solid rgba(255,255,255,0.18);

  padding: 10px 14px;

  border-radius: 999px;

  font-size: 13px;
  font-weight: 700;
}

.ai-section-title {
  margin-top: 20px;
  margin-bottom: 10px;

  font-size: 14px;
  font-weight: 900;

  letter-spacing: 0.08em;

  color: rgba(255,255,255,0.9);

  text-transform: uppercase;
}


.ai-brief-header h2 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
}

.ai-brief-header p {
  color: rgba(255,255,255,0.85);
}

.ai-brief-content {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.ai-tip {
  background: rgba(255,255,255,0.12);

  backdrop-filter: blur(18px);

  border: 1px solid rgba(255,255,255,0.18);

  border-radius: 22px;

  padding: 18px 20px;

  display: flex;
  gap: 14px;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12);
}

.jobsheet-section {
  background: white;
  border-radius: 28px;
  padding: 26px;
  margin-bottom: 30px;
  box-shadow: 0 14px 34px rgba(15,23,42,0.07);
  border: 1px solid #e2e8f0;
}

.jobsheet-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.jobsheet-section-header h2 {
  font-size: 26px;
  font-weight: 900;
}

.jobsheet-section-header span {
  background: #eef2ff;
  color: #3730a3;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
}

.jobsheet-job-card {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 22px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 18px;
}

.jobsheet-time {
  font-size: 26px;
  font-weight: 900;
  color: #4f46e5;
}

.jobsheet-job-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.jobsheet-job-header h3 {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
}

.jobsheet-address,
.jobsheet-job-header p {
  color: #64748b;
}

.jobsheet-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.jobsheet-task-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .jobsheet-job-card {
    grid-template-columns: 1fr;
  }

  .jobsheet-actions button,
  .jobsheet-task-card button {
    width: 100%;
  }

  .jobsheet-task-card {
    flex-direction: column;
  }
}

/* Job Sheet same width as rest of app */
.ai-brief-card,
.jobsheet-section {
  width: 100%;
  max-width: none;
}

.jobsheet-map {
  width: 100%;
  height: 220px;
  border: 0;
  border-radius: 18px;
  margin: 12px 0 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

@media (max-width: 768px) {
  .jobsheet-map {
    height: 180px;
  }
}

.ai-brief-text {
  line-height: 1.7;
  font-size: 15px;
}

.ai-brief-text strong {
  display: block;
  margin-top: 12px;
}

.refresh-brief-btn {
  background: rgba(255,255,255,0.15);

  border: 1px solid rgba(255,255,255,0.18);

  color: white;

  padding: 12px 18px;

  border-radius: 16px;

  font-weight: 800;

  backdrop-filter: blur(12px);

  transition: all .2s ease;
}

.refresh-brief-btn:hover {
  transform: translateY(-2px);

  background: rgba(255,255,255,0.24);
}

.ai-brief-text {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ai-section-body {
  line-height: 1.65;
  font-size: 14px;
}

@media (max-width: 768px) {
  .ai-brief-text {
    grid-template-columns: 1fr;
  }
}

.ai-section-title {
  margin: 0 0 12px;
}

.ai-brief-text .ai-section-title {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px 18px 0 0;
  padding: 14px 16px;
}

.ai-brief-section {
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 22px;
  padding: 18px;
  backdrop-filter: blur(14px);
  min-height: 220px;
}



/* =========================
   OCCURRENCES
========================= */

#jobOccurrencesList {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.occurrence-card {
  position: relative;

  background: #f8fafc;

  border: 1px solid #dbe4f0;

  border-left: 5px solid #4f46e5;

  border-radius: 22px;

  padding: 20px;

  box-shadow:
    0 6px 18px rgba(15,23,42,0.04);
}

.occurrence-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 18px;
}

.occurrence-card-header strong {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.occurrence-card .danger-btn-small {
  width: 38px;
  height: 38px;

  padding: 0;

  border-radius: 12px;

  font-size: 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: none;
}

.occurrence-card .danger-btn-small:hover {
  transform: scale(1.04);
}

.occurrence-card .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.occurrence-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
}

@media (max-width: 768px) {
  .occurrence-card .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  html,
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    overflow: visible;
    display: block;
  }

  .main-content {
    height: auto;
    overflow: visible;
  }

  .sidebar {
    height: auto;
    overflow: visible;
  }

  #calendar {
    min-height: 700px;
  }
}

/* =========================
   DESKTOP DASHBOARD LAYOUT
========================= */

@media (min-width: 769px) {
  body.dashboard-page {
    height: 100%;
    overflow: hidden;
  }

  body.dashboard-page .app {
    height: 100vh;
    display: flex;
    overflow: hidden;
  }

body.dashboard-page .sidebar {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

  body.dashboard-page .main-content {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px 22px;
    min-width: 0;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .dashboard-cards {
    flex-shrink: 0;
    gap: 12px;
    margin-bottom: 12px;
  }

  .card {
    min-height: 86px;
    padding: 14px 16px;
  }

  .card p {
    font-size: 23px;
    margin-top: 4px;
  }

  #calendar {
    flex: 1;
    min-height: 0;
    height: auto !important;
    padding: 14px;
    overflow: hidden !important;
  }

  .fc {
    height: 100% !important;
  }

}

.jobsheet-page .main-content {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
}

/* Removed duplicate desktop sidebar overrides. */


/* =========================
   MOBILE SIDEBAR FINAL FIX
========================= */

@media (max-width: 768px) {

  .sidebar,
  .sidebar.collapsed {
    width: 100% !important;
    padding: 20px 18px;
  }

  /* Burger CLOSED */
  .sidebar.collapsed .sidebar-links {
    display: none !important;
  }

  /* Burger OPEN */
  .sidebar:not(.collapsed) .sidebar-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    margin-top: 18px;
  }

  /* Always hide dashboard jobs/tasks on mobile */
  .sidebar-heading-row,
  .sidebar-section-title,
  .small-plus-btn,
  #jobsContainer,
  #tasksContainer,
  .job,
  .task {
    display: none !important;
  }

  .sidebar:not(.collapsed) .nav-link span {
    display: inline !important;
  }

  .sidebar:not(.collapsed) .nav-link {
    display: flex !important;
    align-items: center;
    gap: 14px;
  }
}

/* =========================
   TASKS PAGE CARD FINAL
========================= */

body.tasks-page .job-card-header {
  display: block !important;
  margin-bottom: 18px;
}

body.tasks-page .job-card-header h3 {
  margin-bottom: 12px !important;
}

body.tasks-page .job-badges {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body.tasks-page .priority-badge {
  margin: 0 !important;
}

body.tasks-page .status-badge {
  display: none !important;
}

/* =========================
   TASK CATEGORY BADGES
========================= */

.task-category-badge {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.category-admin {
  background: #e0e7ff;
  color: #3730a3;
}

.category-quote {
  background: #fef3c7;
  color: #92400e;
}

.category-call {
  background: #cffafe;
  color: #155e75;
}

.category-reminder {
  background: #fee2e2;
  color: #991b1b;
}

.category-finance {
  background: #dcfce7;
  color: #166534;
}

.category-personal {
  background: #f3f4f6;
  color: #374151;
}

@media (max-width: 768px) {
  #calendar {
    height: auto !important;
    min-height: 1200px !important;
    overflow: visible !important;
  }

  .fc {
    height: auto !important;
  }

  .fc-view-harness {
    height: auto !important;
    min-height: 1200px !important;
  }

  .fc-scroller,
  .fc-scroller-liquid-absolute {
    overflow: visible !important;
    height: auto !important;
    position: relative !important;
  }
}

.calendar-status-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: #94a3b8;
  cursor: pointer;
  font-size: 15px;
  transition: 0.2s ease;
}

.calendar-status-btn.active {
  color: #22c55e;
}

.calendar-status-btn:hover {
  transform: scale(1.1);
}

.sidebar .sidebar-item-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
}

.sidebar .sidebar-item-top > span {
  flex: 1 !important;
  min-width: 0 !important;
}

.sidebar .sidebar-icons {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0px !important;
  margin-left: 0 !important;
  margin-right: -4px !important;
  flex-shrink: 0 !important;
}

.sidebar .calendar-status-btn,
.sidebar .sidebar-complete-btn,
.sidebar .sidebar-delete-btn {
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  font-size: 13px !important;
  line-height: 1 !important;
}

.sidebar .sidebar-item-top > span {
  min-width: 0 !important;
  padding-right: 0 !important;
}

.sidebar .sidebar-icons button {
  transform: scale(0.82);
}

.ai-brief-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-weight: 800;
}

.ai-brief-date,
.ai-brief-weather {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 10px 14px;
  border-radius: 14px;
}

.ai-brief-text br + br {
  display: block;
  content: "";
  margin-bottom: 10px;
}

.ai-section-title {
  font-size: 20px;
  font-weight: 800;
  margin-top: 24px;
  margin-bottom: 14px;
  opacity: 0.95;
}

.add-note-btn,
.convert-note-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.add-note-btn {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
  margin-top: 8px;
  margin-bottom: 14px;
}

.convert-note-btn {
  width: 100%;
  justify-content: center;
  background: linear-gradient(
    135deg,
    #86efac,
    #4ade80
  );
  color: #14532d;
  margin: 12px 0;
  box-shadow: 0 8px 18px rgba(74, 222, 128, 0.15);
}

.job-note-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}

.job-note-card textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.5;
  background: white;
}

.modal-section-header {
  margin-top: 18px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-section-header label {
  font-weight: 800;
  font-size: 16px;
}

.convert-note-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.note-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.note-toolbar button {
  border: 1px solid #dbe3ef;
  background: white;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.note-toolbar button:hover {
  background: #f1f5f9;
}

.job-note-editor {
  background: white;
  border-radius: 14px;
  min-height: 180px;
}

.job-note-editor .ql-editor {
  min-height: 180px;
  font-size: 15px;
  line-height: 1.55;
}

.job-note-card .ql-toolbar {
  border-radius: 14px 14px 0 0;
  background: #f8fafc;
}

.job-note-card .ql-container {
  border-radius: 0 0 14px 14px;
}

.job-note-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}

.job-note-editor {
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  overflow: hidden;
}

.job-note-editor .ql-toolbar {
  background: #f8fafc;
  border: none;
  border-bottom: 1px solid #e2e8f0;
}

.job-note-editor .ql-container {
  border: none;
}

.job-note-editor .ql-editor {
  min-height: 190px;
  font-size: 15px;
  line-height: 1.6;
}

.note-delete-btn {
  margin-top: 12px;
}

.main-note-card {
  margin-bottom: 26px;
}

.job-notes-preview ol,
.job-notes-preview ul {
  padding-left: 28px;
  margin-left: 0;
}

.job-notes-preview li {
  padding-left: 4px;
}

@media (max-width: 768px) {

  .job-notes-preview ol,
  .job-notes-preview ul {
    padding-left: 28px;
    margin-left: 16px;
  }

  .job-notes-preview li {
    padding-left: 6px;
  }

}

.create-task-btn {

  margin-left: 10px;

  border: none;

  border-radius: 999px;

  background: #eef6ff;

  color: #2563eb;

  font-size: 12px;

  font-weight: 700;

  padding: 4px 10px;

  cursor: pointer;
}

.create-task-btn:hover {
  background: #dbeafe;
}

.note-task-actions,
.additional-note-task-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.create-task-btn {
  border: none;
  border-radius: 12px;
  background: #eef6ff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}

.create-task-btn:hover {
  background: #dbeafe;
}

.auto-schedule-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.auto-schedule-card strong {
  font-size: 15px;
  color: #0f172a;
}

.auto-schedule-card p {
  margin: 4px 0;
  color: #64748b;
}

.auto-schedule-card input {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
}

.auto-schedule-btn {
  padding: 8px 14px;
  font-size: 14px;
  min-height: 34px;
  border-radius: 14px;
}
.auto-schedule-btn i {
  margin-right: 6px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.account-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.account-row,
.integration-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #eef2f7;
  padding: 12px 0;
}

.integration-row p {
  margin: 4px 0 0;
  color: #64748b;
}

.danger-zone {
  border-color: #fecaca;
}

@media (max-width: 768px) {
  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-row,
  .integration-row {
    flex-direction: column;
  }
}

.scheduler-preview {
  margin-top: 18px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.scheduler-preview h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.scheduler-preview p {
  margin: 4px 0;
  color: #475569;
}


.dashboard-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  margin-bottom: 24px;
  padding: 26px;

  border-radius: 24px;

  background:
    linear-gradient(135deg, rgba(37,99,235,.12), rgba(14,165,233,.08)),
    #ffffff;

  box-shadow: 0 18px 40px rgba(15,23,42,.08);
  border: 1px solid rgba(148,163,184,.25);
}

.welcome-eyebrow {
  margin: 0 0 6px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.dashboard-welcome h1 {
  margin: 0;
  font-size: 30px;
  color: #0f172a;
  letter-spacing: -0.6px;
}

.welcome-subtitle {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 15px;
}

.ai-summary-pill {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 12px 16px;
  border-radius: 999px;

  background: #0f172a;
  color: white;

  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-summary-pill i {
  color: #38bdf8;
}

@media (max-width: 768px) {
  .dashboard-welcome {
    flex-direction: column;
    align-items: flex-start;
  }
}

.collapsible-heading{
    cursor:pointer;
    user-select:none;

    display:flex;
    align-items:center;
    gap:8px;
}

.collapsible-heading i{
    font-size:12px;
    transition:transform .25s ease;
}

.collapsible-heading.collapsed i{
    transform:rotate(-90deg);
}

.sidebar-section-wrapper{
    overflow:hidden;
    max-height:2000px;
    transition:max-height .3s ease;
}

.sidebar-section-wrapper.collapsed{
    max-height:0;
}

.personal {
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 14px 12px;
  margin-bottom: 10px;

  border-left: 4px solid #10b981;
  color: white;

  cursor: pointer;
  transition: .2s ease;
}

.personal:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.personal .sidebar-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.personal .sidebar-item-top span {
  flex: 1;
  font-size: 14px;
  line-height: 1.3;
}

.personal .sidebar-delete-btn,
.personal .calendar-status-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
}

.personal-calendar-btn {
  color: #10b981 !important;
}

.personal-calendar-btn i {
  color: #10b981 !important;
}

.completed-calendar-event {
  opacity: 0.55;
  filter: grayscale(0.25);
}


/* =========================
   CLEANED LAYOUT FIXES
========================= */

@media (min-width: 769px) {
  .main-content {
    margin-left: 320px;
    width: calc(100% - 320px);
    transition: margin-left .25s ease, width .25s ease;
  }

  body.sidebar-collapsed .main-content {
    margin-left: 84px;
    width: calc(100% - 84px);
  }
}

@media (max-width: 768px) {
  .app {
    display: block;
  }

  .sidebar {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    padding: 18px !important;
  }

  .sidebar.collapsed {
    width: 100% !important;
    height: auto !important;
    padding: 18px !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 18px !important;
  }

  body.sidebar-collapsed .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .dashboard-welcome {
    padding: 20px;
    margin-bottom: 18px;
  }

  .dashboard-welcome h1 {
    font-size: 24px;
  }

  .ai-summary-pill {
    width: 100%;
    justify-content: center;
  }

  .dashboard-cards {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  #calendar {
    padding: 12px;
    border-radius: 18px;
    min-height: 900px;
  }

  .fc-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
  }
}


.mobile-nav {
  display: none;
}

@media (max-width: 768px) {

  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;

    height: 66px;

    display: flex;
    align-items: center;
    justify-content: space-around;

    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(14px);

    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 22px;

    box-shadow: 0 18px 40px rgba(15,23,42,0.35);

    z-index: 9999;
  }

  .mobile-nav a {
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    color: rgba(255,255,255,0.65);
    text-decoration: none;

    font-size: 11px;
    font-weight: 700;
  }

  .mobile-nav a i {
    font-size: 16px;
  }

  .mobile-nav a.active {
    color: white;
  }

  .mobile-nav a.active i {
    color: #38bdf8;
  }

  .sidebar {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-bottom: 96px !important;
  }

  .mobile-nav a {
  flex: 1;
  min-width: 0;
  font-size: 10px;
}

@media (max-width:768px) {
  .burger-btn {
    display: none !important;
  }
}
}

.jobsheet-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
}

.jobsheet-actions button {
  min-width: 120px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.jobsheet-actions .primary-btn {
  color: #fff;
}

.jobsheet-actions .primary-btn i,
.jobsheet-actions .primary-btn span {
  color: #fff;
}

.delete-task-btn {
  background: #ef4444;
  color: white;
}

.delete-task-btn:hover {
  background: #dc2626;
}

.policy-card {
  max-width: 900px;
  line-height: 1.7;
}

.policy-card h2 {
  margin-top: 28px;
  margin-bottom: 10px;
}

.policy-card h3 {
  margin-top: 18px;
  margin-bottom: 8px;
}

.policy-card p {
  color: #475569;
}

.policy-card .modal-actions {
  margin-top: 32px;
}

.legal-page {
  min-height: 100vh;
  background: #f8fafc;
  padding: 40px 20px;
}

.legal-content {
  max-width: 900px;
  margin: 0 auto;
}

.legal-card {
  background: white;
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.legal-card h1 {
  margin-bottom: 8px;
}

.legal-card h2 {
  margin-top: 28px;
}

.legal-card p {
  color: #475569;
  line-height: 1.7;
}

.legal-actions {
  margin-top: 32px;
}

/* =========================
   LEGAL PAGES
========================= */

.legal-page {
  min-height: 100vh;
  padding: 40px 20px;

  background:
    linear-gradient(
      135deg,
      #0f172a,
      #1e3a8a
    );

  display: flex;
  justify-content: center;
}

.legal-content {
  width: 100%;
  max-width: 1000px;
}

.legal-card {
  background: white;

  border-radius: 28px;

  padding: 40px;

  box-shadow:
    0 20px 60px rgba(15,23,42,.18);

  border: 1px solid rgba(255,255,255,.2);
}

.legal-card h1 {
  margin-bottom: 8px;
}

.legal-card h2 {
  margin-top: 30px;
  margin-bottom: 10px;

  color: #0f172a;
}

.legal-card h3 {
  margin-top: 18px;
  margin-bottom: 8px;

  color: #334155;
}

.legal-card p {
  color: #475569;
  line-height: 1.7;
}

.legal-actions {
  margin-top: 32px;
}

@media (max-width: 768px) {

  .legal-page {
    padding: 20px;
  }

  .legal-card {
    padding: 24px;
  }

}

.legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.legal-links a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
}

.legal-links a:hover {
  text-decoration: underline;
}

.legal-links {
  text-align: center;
}

.legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

.legal-links a,
.legal-links span {
  font-size: 14px;
  color: #4f46e5;
  font-weight: 600;
}

.legal-links a {
  text-decoration: none;
}

.legal-links a:hover {
  text-decoration: underline;
}

.auth-links {
  width: 100%;
  text-align: center;
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.working-hours-row {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.profile-info {
  margin-bottom: 20px;
}

.coming-soon-badge {
  background: #eef2ff;
  color: #4f46e5;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.settings-card {
  height: 100%;
}

.account-footer {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin-top: 24px;
}

.settings-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.legal-account-card {
  grid-column: 1 / -1;
}

.account-card .secondary-btn,
.account-card .primary-btn,
.account-card .danger-btn-small {
  margin-right: 10px;
  margin-bottom: 10px;
}

.account-footer {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin-top: 28px;
  padding-bottom: 24px;
}

.account-card .primary-btn,
.account-card .secondary-btn {
  margin-top: 12px;
}

.pac-container {
  z-index: 2147483647 !important;
}

#customerMiniModal,
#siteMiniModal {
  z-index: 2000;
}

#customerMiniModal .modal-box,
#siteMiniModal .modal-box {
  z-index: 2001;
}

body.calendar-dragging,
body.calendar-dragging * {
  touch-action: none !important;
  overscroll-behavior: none !important;
}

body.calendar-dragging {
  overflow: hidden !important;
}

.mobile-calendar-choice {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.mobile-calendar-choice-box {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 18px 18px 0 0;
  padding: 18px;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.25);
}

.mobile-calendar-choice-box h3 {
  margin: 0 0 14px;
}

.mobile-calendar-choice-box button {
  width: 100%;
  padding: 14px;
  margin-top: 10px;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}

@media (max-width: 768px) {

  .modern-modal {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }

  .modal-actions {
    margin-bottom: calc(90px + env(safe-area-inset-bottom));
  }

}

/* AI BRIEF FINAL LAYOUT */

.ai-brief-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.ai-brief-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ai-brief-content {
  margin-top: 24px;
}

.ai-tip {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  display: block;
}

.ai-tip > i {
  display: none;
}

.ai-brief-text {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.ai-brief-section {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 24px;
  padding: 20px;
  backdrop-filter: blur(16px);
  min-height: 220px;
}

.ai-section-title {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  font-weight: 900;
  letter-spacing: .06em;
}

.ai-section-body {
  line-height: 1.7;
  font-size: 14px;
}

@media (max-width: 900px) {
  .ai-brief-text {
    grid-template-columns: 1fr;
  }
}

.ai-brief-section:last-child {
  grid-column: 1 / -1;
  min-height: 150px;
}

.ai-brief-header {
  margin-bottom: 18px;
}

.ai-brief-content {
  margin-top: 18px;
}

.ai-brief-section {
  min-height: 190px;
}

.ai-section-title {
  margin-bottom: 18px;
}
