/* =========================================================
   APPOINTMENTS DASHBOARD - READABLE LIGHT THEME (Inter)
   Keeps your existing classnames working:
   .topnav, .nav-shell, .brand, .nav-center, .app-wrap,
   .card, .muted, .rowbtn, .rowgrid, .pill-*, .modal-content, .divider, .kv
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root{
  --page-bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;

  --text: #1e293b;
  --muted: #64748b;

  --primary: #2563eb;
  --primary-2: #0b5ed7;

  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --radius: 16px;
  --radius-sm: 12px;

  --amber: #f59e0b;
  --amber-bg: #fff7ed;

  --green: #10b981;
  --green-bg: #ecfdf5;

  --red: #ef4444;
  --red-bg: #fef2f2;

  --cyan: #06b6d4;
  --cyan-bg: #ecfeff;
}

/* =========================
   BASE
   ========================= */
html, body{
  height: 100%;
}

body{
  background: var(--page-bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}

a{ color: inherit; }

.muted{ color: var(--muted) !important; }

/* =========================
   TOP NAV (uses your existing markup)
   ========================= */
.topnav{
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topnav-inner{
  padding-left: 0;
  padding-right: 0;
}

.nav-shell{
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand{
  display: inline-block;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--text) !important;
  text-decoration: none !important;
  font-weight: 600;
}

.brand:focus,
.brand:active{
  outline: none !important;
  box-shadow: none !important;
}

.navbar-toggler{
  margin-left: auto;
}

.navbar-collapse{
  width: 100%;
}

.nav-center .nav-link{
  color: rgba(30,41,59,.78);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
}

.nav-center .nav-link:hover{
  color: var(--text);
  background: rgba(37,99,235,.08);
}

.nav-center .nav-link.active{
  color: var(--primary) !important;
  background: rgba(37,99,235,.10);
  border: 1px solid rgba(37,99,235,.20);
}

/* Mobile collapsed menu: not giant buttons */
@media (max-width: 991.98px){
  .nav-shell{ flex-wrap: wrap; }
  .navbar-collapse{ margin-top: 8px; }

  .nav-center{
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    margin: 0;
    padding: 0;
  }

  .nav-center .nav-link{
    display: inline-flex;
    width: auto;
    padding: 6px 10px;
    background: transparent;
    border: 0;
  }

  .nav-center .nav-link.active{
    background: transparent !important;
    border: 0 !important;
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
  }
}

/* Desktop centering */
@media (min-width: 992px){
  .nav-shell{
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    align-items: center;
  }
  .navbar-collapse{
    display: block !important;
    width: auto;
  }
  .nav-center{
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
  }
  .nav-right-spacer{ display:none !important; }
}

/* =========================
   APP LAYOUT
   ========================= */
.app-wrap{
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-left: 12px;
  padding-right: 12px;
}

@media (min-width: 992px){
  .app-wrap{ max-width: 900px; }
  .rowbtn{ padding: 12px 14px; }
}
@media (min-width: 1200px){
  .app-wrap{ max-width: 1100px; }
}

.date-row .form-control{
  border: 2px solid var(--border);
  border-radius: 12px 0 0 12px;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
}

.date-row .input-group-text{
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  border-radius: 0 12px 12px 0;
}

/* =========================
   CARDS
   ========================= */
.card{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header{
  background: linear-gradient(135deg, #eaf2ff, #f8fbff);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding-top: 12px;
  padding-bottom: 12px;
}

.card-header .muted{ color: rgba(30,41,59,.60) !important; }

.card-body{
  padding: 16px;
}

/* =========================
   ROW BUTTONS
   ========================= */
.rowbtn{
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
  transition: transform .05s ease, box-shadow .15s ease, border-color .15s ease;
}

.rowbtn:hover{
  border-color: rgba(37,99,235,.25);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}

.rowbtn:active{
  transform: scale(0.998);
}

.rowgrid{
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto auto;
  gap: 2px 10px;
  align-items: start;
}

.rowgrid .closerName{
  grid-column: 1 / 2;
  font-weight: 600;
  color: var(--text);
}

.rowgrid .badgeWrap{
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  justify-self: end;
}

.rowgrid .custLine{
  grid-column: 1 / 3;
  color: rgba(30,41,59,.88);
  font-weight: 600;
  font-size: 13.5px;
}

.rowgrid .timeLine{
  grid-column: 1 / 3;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

.rowgrid .noteLine{
  grid-column: 1 / 3;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* little pieces inside noteLine */
.noteLabel{ font-weight: 600; color: rgba(30,41,59,.75); margin-right: 6px; }
.noteDash{ margin: 0 6px; color: rgba(100,116,139,.65); }
.noteResult{ font-weight: 600; color: rgba(30,41,59,.80); }
.notePrice{ font-weight: 600; color: rgba(30,41,59,.80); }
.noteText{ color: rgba(100,116,139,.95); }

/* =========================
   STATUS PILLS
   ========================= */
.pill{
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* default scheduled look */
.pill-scheduled{
  background: rgba(37,99,235,.10);
  color: var(--primary);
  border-color: rgba(37,99,235,.18);
}

/* rescheduled */
.pill-rescheduled{
  background: var(--cyan-bg);
  color: #0e7490;
  border-color: rgba(6,182,212,.30);
}

/* completed */
.pill-completed{
  background: var(--green-bg);
  color: #065f46;
  border-color: rgba(16,185,129,.25);
}

/* no show */
.pill-noshow{
  background: var(--red-bg);
  color: #991b1b;
  border-color: rgba(239,68,68,.25);
}

/* sold */
.pill-sold{
  background: var(--green-bg) !important;
  color: #065f46 !important;
  border-color: rgba(16,185,129,.30) !important;
}

/* =========================
   MODAL + MISC
   ========================= */
.divider{
  border-top: 1px dashed rgba(100,116,139,.35);
  margin: 12px 0;
}

.modal-content{
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.modal-header{
  background: linear-gradient(135deg, #eaf2ff, #f8fbff);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.btn-close{
  filter: none;
}

/* key-value */
.kv .k{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: rgba(100,116,139,.95);
  font-weight: 600;
}
.kv .v{
  font-size: 15px;
  color: var(--text);
}

/* Buttons to match theme */
.btn-outline-light{
  color: var(--primary);
  border: 2px solid var(--primary);
  font-weight: 600;
  border-radius: 12px;
  background: transparent;
}
.btn-outline-light:hover{
  background: var(--primary);
  color: #ffffff;
}

/* =========================
   LOADING SPINNER OVERLAY
   ========================= */
#loadingSpinner{
  backdrop-filter: blur(2px);
}

/* =========================
   DATERANGEPICKER polish
   ========================= */
/* Daterangepicker styling improvements */
.daterangepicker {
  background-color: #fff;
  border: 1px solid #ddd;
}
.daterangepicker td.active, 
.daterangepicker td.active:hover {
  background-color: #357ebd;
  color: #fff;
}
.daterangepicker .ranges li {
  color: #333;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
}
.daterangepicker .ranges li:hover {
  background-color: #e6e6e6;
}
.daterangepicker .ranges li.active {
  background-color: #357ebd;
  color: #fff;
}
.input-group-text {
  background-color: #357ebd;
  border-color: #357ebd;
  color: #fff;
}

/* Make the date control look like one clean rectangle (no rounded corners) */
.datepicker-group .form-control,
.datepicker-group .input-group-text{
  border-radius: 0 !important;
}

/* Remove the little inner rounding/overflow artifacts */
.datepicker-group{
  border-radius: 0 !important;
  overflow: hidden; /* prevents weird edge showing */
}

/* Remove rounding on the picker itself */
.daterangepicker{
  border-radius: 0 !important;
}

/* Optional: remove rounding from range buttons inside the picker */
.daterangepicker .ranges li{
  border-radius: 0 !important;
}

/* Make cursor clickable on the icon */
.datepicker-btn{
  cursor: pointer;
}

/* =========================
   SUMMARY TABLE (your new totals card)
   ========================= */
.summary-table th,
.summary-table td{
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.summary-table thead th{
  color: rgba(100,116,139,.95);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* =========================
   SUMMARY CARD header sizing (mobile-friendly)
   ========================= */

/* tighten the header padding a bit */
#summaryCard .card-header,
#oppStatusCard .card-header,
#sourceCard .card-header{
  padding-top: 10px;
  padding-bottom: 10px;
}

/* your title is using Bootstrap fs-5; override it */
#summaryCard .card-header .fs-5,
#oppStatusCard .card-header .fs-5,
#sourceCard .card-header .fs-5{
  font-size: 1rem !important;   /* was ~1.25rem */
  line-height: 1.15;
}

/* make the range label slightly smaller + cleaner */
#summaryRangeLabel,
#sourceRangeLabel{
  font-size: 0.85rem;
  line-height: 1.2;
}

/* OPTIONAL: keep the header from feeling huge on small screens */
@media (max-width: 420px){
  #summaryCard .card-header .fs-5,
  #sourceCard .card-header .fs-5{ font-size: 0.95rem !important; }
  #summaryRangeLabel,
  #sourceRangeLabel{ font-size: 0.8rem; }
}

/* =========================
   Table header (if you still think it's loud)
   ========================= */
.summary-table thead th{
  font-size: 11px;        /* was 12px */
  letter-spacing: .03em;  /* was .04em */
}

/* =========================
   LOADING SPINNER
   ========================= */
.loading-overlay{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(248,250,252,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.loading-overlay.active{
  opacity: 1;
  visibility: visible;
}

.spinner{
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =========================
   BADGE COLORS (Global)
   ========================= */
.badge.text-bg-primary {
  background-color: #0d6efd !important;
  color: white !important;
}

.badge.text-bg-success {
  background-color: #10b981 !important;
  color: white !important;
}

.badge.text-bg-warning {
  background-color: #f59e0b !important;
  color: white !important;
}

.badge.text-bg-secondary {
  background-color: #6c757d !important;
  color: white !important;
}

.badge.text-bg-danger {
  background-color: #ef4444 !important;
  color: white !important;
}

/* ===================================
   SIDEBAR NAVIGATION (App Shell)
   =================================== */

.app-shell {
  min-height: 100vh;
  background: var(--page-bg);
}

/* Desktop Sidebar */
@media (min-width: 993px) {
  .side-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    overflow-y: auto;
    padding: 14px 12px;
    border-right: 1px solid var(--border);
    background: #eff5ff;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .main-pane {
    margin-left: 280px;
    min-width: 0;
  }

  .topnav {
    display: none !important;
  }
}

.side-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.side-nav__brand {
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.side-nav__close {
  display: inline-flex;
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.side-nav__close:hover {
  background: #f1f5f9;
  transform: scale(1.1);
}

.side-nav__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 6px;
}

/* ===== Sidebar: unified styling ===== */

/* All sidebar links and titles have same base styling */
.side-link,
.side-group__title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 10px;
}

/* Links get interaction styles */
.side-link {
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

/* Group titles get spacing */
.side-group__title {
  margin-top: 6px;
  margin-bottom: 2px;
}

/* Sub links: just add indent */
.side-link--sub {
  padding-left: 22px;
}

/* Icons: same width for perfect alignment */
.side-link i,
.side-group__title i {
  width: 18px;
  text-align: center;
}

/* Hover state */
.side-link:hover {
  background: rgba(15, 23, 42, 0.06);
}

/* Active state */
.side-link.is-active,
.side-link.active {
  background: transparent;
  border-color: transparent;
  color: #2563eb;
}

.side-link.active i {
  color: #2563eb;
}

.side-nav__footer {
  margin-top: auto;
  padding: 10px 10px 6px;
}

.side-nav__hint {
  font-size: .82rem;
  color: var(--muted);
}

/* Mobile Topbar */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.menu-btn {
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
}

.menu-btn:hover {
  background: #f8fafc;
}

.mobile-topbar__title {
  font-weight: 900;
  color: var(--text);
}

/* Mobile Drawer */
@media (max-width: 992px) {
  .mobile-topbar {
    display: flex;
  }

  .side-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 290px;
    height: 100vh;
    background: #eff5ff;
    padding: 14px 12px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform .18s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,.18);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .side-nav.side-nav--open {
    transform: translateX(0);
  }

  .side-nav__close {
    display: inline-flex;
  }

  .topnav {
    display: none !important;
  }
}

/* ===================================
   FORECAST PAGE - Calendar & Lists
   =================================== */

/* Appointments list */
.appts-list { width: 100%; }

.appts-head {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr 0.9fr 1.2fr 2fr;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #dee2e6;
  color: #6c757d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.appt-row {
  border-bottom: 1px solid #dee2e6;
}

.contact-name-link {
  color: #0d6efd;
  text-decoration: none;
  font-weight: 500;
}

.contact-name-link:hover {
  text-decoration: underline;
}

.appt-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr 0.9fr 1.2fr 2fr;
  gap: 12px;
  padding: 12px 16px;
  align-items: start;
}

.appt-grid > .cell { min-width: 0; }
.appt-grid .cell:first-child { min-width: 0; }

.lead-result-note {
  grid-column: 1 / -1;
  max-width: 100%;
  white-space: normal;
  word-break: break-all;
  line-height: 1.6;
  font-size: 12px;
  color: #6c757d;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.lead-result-note:not(.d-none) {
  border-top: 1px dashed #dee2e6;
  margin-top: 8px;
  padding: 12px;
  background-color: #fcfcfc;
}

.lead-result-note strong {
  color: #334155;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.lead-result-note-mobile {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

.appt-mobile { padding: 12px 16px; }

.appt-mobile .mini {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef1f4;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 12px;
  font-size: 13px;
  line-height: 1.2rem;
  color: #6c757d;
}

.time-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #6c757d;
  line-height: 1.1;
}

.truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
  display: block;
}

.mono { font-variant-numeric: tabular-nums; }
.appt-mobile .k { font-weight: 700; color: #6c757d; }
.appt-mobile .v { color: #6c757d; }

/* Totals rows */
.totals-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.totals-kpi {
  font-size: 13px;
  color: #6c757d;
  white-space: nowrap;
}

.totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid #eef1f4;
  cursor: pointer;
}

.totals-row:first-child { border-top: 0; }
.totals-row:hover { background: #f8f9fa; }

.totals-label {
  font-weight: 600;
  color: #111827;
  min-width: 0;
}

.totals-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.totals-subrow {
  padding: 4px 16px 10px 34px;
  border-top: 0;
  cursor: default;
}

.totals-subrow:hover { background: transparent; }

.totals-subtext {
  font-size: 13px;
  color: #6c757d;
  font-weight: 600;
}

.badge-mode {
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 767.98px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kpi {
  border: 1px solid #eef1f4;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.kpi .label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #6c757d;
}

.kpi .value {
  margin-top: 6px;
  font-weight: 800;
  font-size: 22px;
  color: #111827;
}

/* Modal styling */
.status-group {
  margin-bottom: 24px;
}

.status-group:last-child {
  margin-bottom: 0;
}

.status-group-header {
  font-weight: 700;
  font-size: 14px;
  color: #111827;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-group-count {
  font-weight: 700;
  color: #6c757d;
  font-size: 13px;
}

.modal-appt-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background-color 0.15s;
}

.modal-appt-item:hover {
  background-color: #f9fafb;
}

.modal-appt-item:last-child {
  border-bottom: 0;
}

.modal-appt-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.modal-appt-details {
  font-size: 12px;
  color: #6c757d;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Owner filter dropdown */
.owner-filter-select {
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: border-color 0.15s;
}

.owner-filter-select:hover {
  border-color: #94a3b8;
}

.owner-filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

@media (max-width: 575.98px) {
  .owner-filter-select {
    font-size: 12px;
    max-width: 150px;
  }
}

/* Totals chips for status breakdown */
.totals-chips {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.totals-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #eef1f4;
  color: #334155;
  background: #fff;
  font-weight: 700;
}

/* JobNimbus Calendar */
.jn-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 767.98px) {
  .jn-summary {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

.jn-pill {
  border: 1px solid #eef1f4;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.jn-pill .k {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #6c757d;
}

.jn-pill .v {
  margin-top: 6px;
  font-weight: 900;
  font-size: 18px;
  color: #111827;
}

/* Calendar grid */
.jn-cal {
  border: 1px solid #eef1f4;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.jn-cal-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap: 0;
  border-bottom: 1px solid #eef1f4;
  background: #fafafa;
}

.jn-cal-head .h {
  padding: 10px 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #6c757d;
  border-right: 1px solid #eef1f4;
}

.jn-cal-head .h:last-child { border-right: 0; }

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

.jn-day {
  min-height: 94px;
  border-right: 1px solid #eef1f4;
  border-bottom: 1px solid #eef1f4;
  padding: 8px 10px;
  cursor: pointer;
  transition: background-color .12s ease;
}

.jn-day:hover { background: #f8fafc; }
.jn-day:nth-child(7n) { border-right: 0; }

.jn-day.is-empty {
  background: #fcfcfc;
  cursor: default;
}

.jn-day.is-empty:hover { background: #fcfcfc; }

.jn-day .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.jn-day .dnum {
  font-weight: 900;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.jn-day .wd {
  font-size: 11px;
  font-weight: 900;
  color: #94a3b8;
  text-transform: uppercase;
}

.jn-day .amt {
  margin-top: 8px;
  font-weight: 900;
  font-size: 16px;
  color: #0f172a;
}

.jn-day .meta {
  margin-top: 4px;
  font-size: 12px;
  color: #6c757d;
  font-weight: 700;
}

/* Weekday averages row */
.jn-weekday {
  display: grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap: 8px;
}

.jn-wd {
  border: 1px solid #eef1f4;
  border-radius: 12px;
  padding: 10px 10px;
  background: #fff;
}

.jn-wd .k {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #6c757d;
}

.jn-wd .v {
  margin-top: 6px;
  font-weight: 900;
  font-size: 16px;
  color: #111827;
}

.jn-wd .s {
  margin-top: 4px;
  font-size: 12px;
  color: #6c757d;
  font-weight: 700;
}

/* Day Details Modal stat pills */
.stat-pill {
  border: 1px solid #eef1f4;
  padding: 10px 12px;
  background: #fff;
}

.stat-pill .k {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #6c757d;
}

.stat-pill .v {
  margin-top: 4px;
  font-weight: 800;
  font-size: 18px;
  color: #111827;
}

/* Day modal job list styling */
#jnDayDealsList .modal-appt-item {
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f4;
  cursor: pointer;
  transition: background-color 0.15s;
}

#jnDayDealsList .modal-appt-item:hover {
  background: #f8fafc;
}

#jnDayDealsList .modal-appt-item:last-child {
  border-bottom: 0;
}

/* Raw JobNimbus status text */
#jnDayDealsList .jn-status {
  font-size: 12px;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 260px;
}

/* Highlight problem deals (sales issues/cancelled) */
#jnDayDealsList .modal-appt-item.deal-issue {
  background: #fff5f5;
  border-left: 4px solid #ef4444;
}

#jnDayDealsList .modal-appt-item.deal-issue:hover {
  background: #ffecec;
}

/* =========================
   Mobile-friendly Forecast
   ========================= */
@media (max-width: 576px){

  /* tighter page spacing */
  .app-wrap.container{
    margin-top: 1rem !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* card header controls wrap nicely */
  #jnCalCard .card-header .d-flex{
    gap: 10px !important;
  }
  #jnMonthLabel{
    min-width: 0 !important;
    flex: 1 1 auto;
    text-align: center;
    font-size: 14px;
  }

  /* SUMMARY pills: 2x2 grid on mobile */
  .jn-summary{
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .jn-pill{
    padding: 10px 10px !important;
    border-radius: 10px;
  }
  .jn-pill .k{
    font-size: 11px !important;
    letter-spacing: .02em;
  }
  .jn-pill .v{
    font-size: 16px !important;
    line-height: 1.15 !important;

    /* IMPORTANT: stop the gross number from breaking weird */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Calendar: smaller text but still tappable */
  .jn-cal-head .h{
    font-size: 10px !important;
    padding: 6px 0 !important;
  }

  /* Make each day a clean tap target */
  .jn-day{
    min-height: 74px !important;
    padding: 8px 6px !important;
  }
  .jn-day .dnum{
    font-size: 12px !important;
  }
  .jn-day .wd{
    font-size: 10px !important;
  }
  .jn-day .amt{
    font-size: 12px !important;
    margin-top: 4px !important;
  }
  .jn-day .meta{
    font-size: 10px !important;
  }

  /* Weekday averages: horizontal scroll cards */
  .jn-weekday{
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(140px, 1fr) !important;
    overflow-x: auto !important;
    gap: 10px !important;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .jn-weekday::-webkit-scrollbar{
    height: 6px;
  }

  /* Modal stat pills: 2 columns instead of 4 */
  #jnDayModal .modal-body .d-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* Modal list spacing for thumbs */
  #jnDayDealsList .modal-appt-item{
    padding: 14px 12px !important;
  }

  /* If your modal name line is too long */
  .modal-appt-name{
    font-size: 14px;
  }
  #jnDayDealsList .jn-status{
    max-width: 200px !important;
  }
}

/* Optional: better tap feedback everywhere */
.jn-day{
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.jn-day:active{
  transform: scale(0.99);
}
