/* ========== Base ========== */
body {
  font-family: 'Segoe UI', sans-serif;
  background: #f4f6fa;
  margin: 0;
  padding: 0;
}
.container {
  max-width: 1400px;   /* was 1000px — adjust to your screen */
  margin: 20px auto;   /* keep vertical margin */
  padding: 0 24px;     /* left/right breathing room */
  
}

/* Top bar + back link (shared) */
.topbar {
  height: 72px;
  background: #0f172a;
  display: flex; align-items: center;
  padding: 0 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.brand .logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: #fff; color: #111827; display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.back { display:inline-block; margin: 16px 0 8px; color:#6366f1; text-decoration:none; }
.back:hover { text-decoration: underline; }

/* Cards (used on dashboard + wrappers) */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  margin-bottom: 20px;
  overflow: hidden;
  padding: 0; /* dashboard sections set their own padding */
}

/* ========== Dashboard (locations.html) ========== */
.dashboard-wrapper { padding: 0 8px; }

.card .header,
.card-header { /* support both .header and older .card-header */
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  color: white;
  padding: 16px 20px;
  font-size: 18px;
  font-weight: 700;
}

.card .body { padding: 16px 20px; }

.title { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.subtitle { font-size: 12px; opacity: .85; }

/* Metric blocks */
.metric { margin: 12px 0; }
.metric strong {
  display:block; font-size: 13px; color:#374151; margin-bottom: 4px;
}
.metric .metric-value { font-size: 16px; font-weight: 600; color:#111827; }
.metric .metric-value a { color:#2563eb; text-decoration:none; }
.metric .metric-value a:hover { text-decoration:underline; }

/* Badge score if you use it */
.badge-score {
  display:inline-grid; place-items:center;
  width: 42px; height: 42px; border-radius: 999px; color:#fff; font-weight:700;
}

/* Progress bar for composite score */
.progress {
  background:#e5e7eb; border-radius:8px; height:14px;
  overflow:hidden; margin: 8px 0 16px;
}
.progress .bar {
  background:#10b981; height:100%; width:0;
  transition: width .35s ease;
}

/* Pills & dots (coverage/eligibility) */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  background: #e5e7eb;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981; /* green by default */
  margin-right: 6px;
}

.dot.warn {
  background: #f59e0b; /* yellow */
}

.dot.err {
  background: #ef4444; /* red */
}


/* ========== Weekend page (location.html) ========== */
.card.detail { border-radius: 14px; box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.card.detail .header.gradient {
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  color:#fff; padding: 16px 20px; display:flex; align-items:center; justify-content:space-between;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.card.detail .title { font-size: 20px; font-weight: 700; }
.card.detail .subtitle { font-size: 12px; opacity: .9; }
.detail-body { padding:16px; }

.notice {
  background:#eef2ff; color:#3730a3; padding:10px 12px; border-radius:8px;
}

/* Section banners */
.banner { font-weight:700; padding:10px 12px; border-radius:8px; margin:8px 0 12px; }
.banner.future { background:#d1fae5; color:#065f46; }
.banner.current { background:#e0f2fe; color:#075985; }
.banner.historical { background:#fee2e2; color:#7f1d1d; }

/* Week sections */
.section { background:#fff; border:1px solid #e5e7eb; border-radius:10px; margin-bottom:16px; }
.section h3 { margin:0; padding:10px 12px; font-size:16px; border-bottom:1px solid #e5e7eb; }

/* Base table look used by weekend editor */
.table { width:100%; border-collapse:collapse; }
.table th, .table td { border:1px solid #e5e7eb; padding:10px; text-align:center; font-size:14px; }
.table th { background:#f8fafc; font-weight:700; }

/* ==== Compact inputs only on Weekend page ==== */
#weekend-sections .table input,
#weekend-sections .table select,
#weekend-sections .section button {
  height: 26px;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #cfd6ee;
  box-sizing: border-box;
}

/* Doctor dropdown (col 2) */
#weekend-sections .table td:nth-child(2) select {
  width: 80px;
}

/* Hours: two time inputs (col 3) */
#weekend-sections .table td:nth-child(3) { white-space: nowrap; }
#weekend-sections .table td:nth-child(3) input[type="time"] {
  width: 100px; display: inline-block;
}
#weekend-sections .table td:nth-child(3) input[type="time"] + input[type="time"] {
  margin-left: 6px;
}

/* Money inputs (Production / Collections, cols 4–5) */
#weekend-sections .table td:nth-child(4) input,
#weekend-sections .table td:nth-child(5) input {
  width: 80px; text-align: right;
}

/* Small numeric inputs (#New, <5★, Rating, Reviews — cols 6–9) */
#weekend-sections .table td:nth-child(6) input,
#weekend-sections .table td:nth-child(7) input,
#weekend-sections .table td:nth-child(8) input,
#weekend-sections .table td:nth-child(9) input {
  width: 50px; text-align:right;
}

/* Yes/No selects (cols 10–13) */
#weekend-sections .table td:nth-child(10) select,
#weekend-sections .table td:nth-child(11) select,
#weekend-sections .table td:nth-child(12) select,
#weekend-sections .table td:nth-child(13) select {
  width: 60px;
}

/* Issues (col 14) */
#weekend-sections .table td:nth-child(14) input {
  max-width: 200px; width: 100%;
}

/* Save button */
#weekend-sections .section button { padding: 4px 8px; }

a.back {
  display: inline-block;
  margin: 12px 0 20px 0;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;            /* gray-700 */
  background: #f3f4f6;       /* gray-100 */
  border-radius: 9999px;     /* full pill */
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

a.back:hover {
  background: #e5e7eb;       /* gray-200 */
  color: #111827;            /* gray-900 */
}


a.back.home::before {
  content: "🏠";
  margin-right: 6px;
}

/* Horizontal metric cards inside each location card */
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
}

.stat {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  letter-spacing: .2px;
  text-transform: none;
}

.stat .val {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

/* Responsive: collapse to 3 / 2 columns on narrower screens */
@media (max-width: 1200px) {
  .metrics { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}
@media (max-width: 800px) {
  .metrics { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

/* ===== Home page clickable cards ===== */
.home-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

@media (max-width: 1100px) {
  .home-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 680px) {
  .home-grid { grid-template-columns: 1fr; }
}

.home-card {
  display: block;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  color: #0f172a;
}

.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15,23,42,.10);
  border-color: #cfd6ee;
}

.home-card.primary {
  border-color: #a5b4fc;
  box-shadow: 0 12px 24px rgba(79,70,229,.12);
}

.home-card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 26px;
  background: #f1f5ff;
  color: #334155;
  margin-bottom: 10px;
}

.home-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #6366f1;
}

.home-card-desc {
  font-size: 14px;
  color: #64748b;
}

/* Menu button */
.menu-btn {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #fff;
  margin-left: auto;
  margin-right: 20px;
}

/* Slide-out panel */
.menu-panel {
  position: fixed;
  top: 0;
  right: -220px;
  width: 200px;
  height: 100%;
  background: #1e293b;
  color: #fff;
  padding: 20px;
  box-shadow: -2px 0 6px rgba(0,0,0,0.2);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1000;
}
.menu-panel a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.menu-panel.open {
  right: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;   /* spread brand on left, menu + logout on right */
  align-items: center;
  padding: 10px 40px;
  background: #1e293b;              /* dark blue/gray example */
}

.topbar .brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: white;
}

.menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

#logout-link {
  margin-left: 5px;  /* shift it a bit away from the ☰ menu */
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.left {
  display: flex;
  flex-direction: column;
}

.extra-text {
  font-size: 0.85rem;
  color: #ddd; /* softer color */
  margin-top: 2px;
}

.right {
  margin-left: auto;
}

/* Doctors filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0 16px;
}
.filter-bar label { font-size: 13px; color: #475569; font-weight: 700; }
.filter-bar select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
}
.filter-bar .btn {
  background: #6366f1; color: #fff; border: none; border-radius: 10px;
  padding: 8px 12px; cursor: pointer;
}
.filter-bar .btn:hover { background: #4f46e5; }
.filter-bar .btn.ghost {
  background: #eef2ff; color: #3730a3;
}
.filter-bar .btn.ghost:hover {
  background: #e0e7ff;
}

/* Collapsible banners */
.banner.collapsible {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.banner .caret {
  display: inline-block;
  transition: transform 0.2s ease;
}
.banner.open .caret {
  transform: rotate(90deg);
}

/* Group content container (what we toggle) */
.section-group .group-content {
  padding-top: 8px;
}

/* Quick-jump mini menu for future weeks */
.future-menu {
  padding: 6px 16px 0;
}
.future-menu ul {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.future-menu a {
  font-size: 13px;
  text-decoration: none;
  color: #1f6feb;
}
.future-menu a:hover {
  text-decoration: underline;
}

/* Keep save button layout tidy within each section */
.section-controls {
  padding: 8px 16px;
}

/* prevent hidden menu from blocking content */
.menu-panel { pointer-events: none; }
.menu-panel.open { pointer-events: auto; }

/* inputs inside the card metrics look like your app */
.metric input,
.metric select {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
}

/* Admin horizontal layout */
.admin-grid {
  display: grid;
  grid-template-columns: 420px 1fr;   /* left pane fixed-ish, right grows */
  gap: 16px;
  align-items: start;
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .admin-grid { grid-template-columns: 1fr; }  /* stack on narrow screens */
}

/* Tighter form look inside admin cards */
.admin-grid .card .metric {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}
.admin-grid .card .metric strong { margin: 0; }
.admin-grid .card .metric input,
.admin-grid .card .metric select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

/* link-ish button used in metric */
.linkish {
  border: none;
  background: none;
  padding: 0;
  color: #2563eb;
  font-weight: 700;
  cursor: pointer;
}
.linkish:hover { text-decoration: underline; }

.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 2000; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.45);
}
.modal-card {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(1000px, 92vw);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  color: #fff;
}
.modal-title { font-weight: 700; }
.modal-x {
  border: none; background: none; color: #fff; font-size: 22px; cursor: pointer;
}
.modal-body { padding: 12px 16px; background: #f8fafc; }

.stat.clickable {
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.stat.clickable:hover {
  background: #eef2ff;      /* light indigo bg */
  transform: translateY(-2px);
}
.modal.hidden { display:none; }

.multi-picker { position: relative; display: inline-block; }
.multi-picker .btn { min-width: 240px; text-align: left; }

.picker-panel {
  position: absolute; top: 40px; left: 0; z-index: 1000;
  width: 320px; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0,0,0,.08); padding: 10px; display: none;
}
.multi-picker.open .picker-panel { display: block; }
.picker-search { width: 100%; padding: 8px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; }
.options .opt { display: flex; align-items: center; gap: 8px; padding: 6px 4px; }
.options .opt input { transform: translateY(1px); }
.picker-actions { display: flex; justify-content: space-between; margin-top: 8px; }

/* ====== Pretty selects (base) ====== */
select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  border: 1px solid #cfd6ee;
  border-radius: 10px;
  padding: 8px 36px 8px 12px;         /* leave room for chevron */
  font-size: 14px;
  line-height: 1.2;
  color: #0f172a;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}
select:not([multiple]):hover {
  border-color: #94a3b8;
}
select:not([multiple]):focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.25);
}
select:disabled {
  color: #9ca3af;
  background-color: #f3f4f6;
  cursor: not-allowed;
}
/* Hide the default arrow in old IE/Edge */
select::-ms-expand { display: none; }

/* ====== Slimmer selects in the weekend tables ====== */
#weekend-sections .table select {
  height: 26px;
  padding: 2px 28px 2px 6px;
  font-size: 12px;
  border-radius: 6px;
  background-position: right 6px center;
  background-size: 12px 12px;
}

/* Keep the doctor column narrow but readable (bump from 80px if it truncates) */
#weekend-sections .table td:nth-child(2) select {
  min-width: 120px;   /* was 80px; adjust to taste */
}

/* ====== Filters look like nice pills ====== */
.filter-bar select {
  border-radius: 9999px;
  background-color: #f8fafc;
  padding: 8px 36px 8px 14px;
  font-weight: 600;
}

/* ====== Admin form selects match inputs cleanly ====== */
.admin-grid .card .metric select {
  padding: 10px 36px 10px 12px;
  border-radius: 10px;
}

/* Optional: error state utility */
select.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.15);
}

/* ========== Select normalization (all pages) ========== */
select {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;                /* helps center the text */
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff;
  border: 1px solid #cfd6ee;
  border-radius: 10px;
  padding: 8px 36px 8px 12px;      /* room for chevron */
  color: #0f172a;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  height: 38px;                    /* align with typical text inputs */
}
select:hover { border-color: #94a3b8; }
select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.25);
  background-color: #eef2ff;   /* subtle indigo tint when focused */
}
select:disabled {
  color: #9ca3af;
  background-color: #f3f4f6;
  cursor: not-allowed;
}
/* Hide legacy arrow (old IE/Edge) */
select::-ms-expand { display: none; }

/* ========== Align selects with inputs inside tables (weekend page) ========== */
#weekend-sections .table select,
#weekend-sections .table input {
  vertical-align: middle;          /* consistent vertical alignment */
}

/* Compact table selects & inputs to match your narrow rows */
#weekend-sections .table select {
  height: 26px;                    /* compact height */
  padding: 2px 28px 2px 6px;       /* keep chevron space */
  font-size: 12px;
  border-radius: 6px;
  background-position: right 6px center;
  background-size: 12px 12px;
}

/* Keep doctor column readable but tight */
#weekend-sections .table td:nth-child(2) select {
  min-width: 120px;
}

/* Time inputs next to selects should match height */
#weekend-sections .table input[type="time"] {
  height: 26px;
  line-height: 26px;
  padding: 2px 6px;
  box-sizing: border-box;
}

/* ========== Admin form selects: match input height exactly ========== */
.admin-grid .card .metric select {
  height: 40px;                    /* pairs with your 10px padding inputs */
  padding: 8px 36px 8px 12px;
  font-size: 14px;
  border-radius: 10px;
}

/* Filter bar selects styled as pills, keep arrow centered */
.filter-bar select {
  height: 38px;
  padding: 8px 36px 8px 14px;
  border-radius: 9999px;
  background-color: #f8fafc;
  background-position: right 10px center;
}

/* If any table cells look off, center their content vertically */
.table th, .table td { vertical-align: middle; }

.menu-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.menu-close-btn:hover {
  background: rgba(255,255,255,0.1);
}

.multi-picker .picker-panel { display:none; }
.multi-picker.open .picker-panel { display:block; }


/* Bigger provider location picker */
/* Allow stuff inside the Providers card to overflow */
#panel-prov .card {
  overflow: visible;
}

/* The multi-picker wrapper anchors the overlay */
#provLocPicker {
  position: relative;
}

/* The dropdown panel floats over the card */
#provLocPanel {
  position: absolute;
  top: 46px;          /* just below the "Select locations" button */
  left: 0;
  right: 0;
  max-height: 70vh;   /* big, relative to viewport */
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
  padding: 10px;
  z-index: 1000;
  display: none;      /* default hidden */
}

/* When picker is open, show the panel */
#provLocPicker.open #provLocPanel {
  display: block;
}

/* Big scroll area inside */
#provLocOptions {
  max-height: 60vh;
  overflow-y: auto;
}

/* Make the provider locations picker a fullscreen-ish overlay */
#provLocPanel {
  position: fixed;                  /* ignore all containers */
  top: 80px;                        /* distance from top of viewport */
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 90vw);          /* nice central width */
  max-height: 70vh;                 /* tall, but not full screen */
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
  padding: 12px;
  z-index: 3000;                    /* above cards, menus, etc. */
  display: none;                    /* hidden by default */
}

/* When open, show it */
#provLocPicker.open #provLocPanel {
  display: block;
}

/* Tall scrollable options list inside the panel */
#provLocOptions {
  max-height: 60vh;
  overflow-y: auto;
}

/* Grid of stats inside each location card */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;      /* row gap / column gap */
}

/* Optional: tighten stat card spacing if needed */
.metrics-grid .stat {
  padding: 8px 10px;
}

/* Mobile: stack them if screen is narrow */
@media (max-width: 800px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

/* keep it sane on smaller screens */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* Center metrics INSIDE each card */
.card .metrics-grid {
  margin: 0 auto;            /* center inside card */
  justify-content: center;
}