/* ═══════════════════════════════════════════════════════════════════════════
   BuildMyShift — Application Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #111827; background: #F9FAFB; line-height: 1.5; font-size: 14px;
}
a { color: #2563EB; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App Nav ── */
.app-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.97); backdrop-filter: blur(10px);
  border-bottom: 1px solid #E5E7EB; height: 56px;
}
.app-nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.app-back {
  font-size: 13px; font-weight: 500; color: #6B7280; text-decoration: none;
}
.app-back:hover { color: #111827; text-decoration: none; }
.app-wordmark {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700; color: #111827; text-decoration: none;
}
.app-wordmark:hover { text-decoration: none; }
.app-wordmark-icon {
  width: 28px; height: 28px; background: #2563EB; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; color: white;
}
/* ── Nav Right (Auth) ── */
.app-nav-right {
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
}
.nav-link {
  font-family: inherit; font-size: 13px; font-weight: 500; color: #6B7280;
  cursor: pointer; transition: color 0.15s; background: none; border: none;
  padding: 0; text-decoration: none;
}
.nav-link:hover { color: #111827; text-decoration: none; }
.nav-link-primary { color: #2563EB; font-weight: 600; }
.nav-link-primary:hover { color: #1D4ED8; }
.nav-link-dim { color: #9CA3AF; font-size: 12px; }
.nav-link-dim:hover { color: #6B7280; }
.nav-link-accent { color: #F59E0B; font-weight: 700; }
.nav-link-accent:hover { color: #D97706; }

/* ── Trial Banner ── */
.trial-banner { text-align: center; padding: 10px 16px; font-size: 14px; }
.trial-banner a { font-weight: 600; text-decoration: underline; }
.trial-active { background: #EFF6FF; color: #1E40AF; border-bottom: 1px solid #BFDBFE; }
.trial-active a { color: #1D4ED8; }
.trial-expired { background: #FEF3C7; color: #92400E; border-bottom: 1px solid #FDE68A; }
.trial-expired a { color: #B45309; }
.nav-separator { width: 1px; height: 16px; background: #E5E7EB; }
.nav-user-email {
  font-size: 12px; font-weight: 500; color: #9CA3AF;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: #fff; border-radius: 16px; padding: 32px;
  width: 100%; max-width: 420px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; font-size: 24px; color: #9CA3AF;
  cursor: pointer; line-height: 1;
}
.modal-close:hover { color: #374151; }
.auth-toggle-text {
  text-align: center; font-size: 13px; color: #6B7280; margin-top: 16px;
}
.auth-toggle-text a { font-weight: 600; }
.modal-card h2 + .auth-modal-sub { margin-top: -12px; }
.auth-modal-sub { font-size: 14px; color: #475569; line-height: 1.5; margin-bottom: 18px; }
.auth-hint { font-size: 12px; color: #9CA3AF; margin-top: 4px; }

/* Sections we scroll to must clear the sticky nav + step bar */
#results-section, #schedule-results, #tab-roster, #preset-grid { scroll-margin-top: 150px; }
@media (max-width: 768px) { #results-section, #schedule-results, #tab-roster, #preset-grid { scroll-margin-top: 120px; } }

/* ── Toast notices (replace browser alert popups) ── */
.toast-wrap {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 10001;
  display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px;
  font-size: 14px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: 1px solid; pointer-events: auto; animation: toastIn 0.2s ease-out;
  transition: opacity 0.25s, transform 0.25s;
}
.toast span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-info    { background: #EFF6FF; border-color: #BFDBFE; color: #1E3A8A; }
.toast-success { background: #F0FDF4; border-color: #BBF7D0; color: #14532D; }
.toast-warn    { background: #FFFBEB; border-color: #FDE68A; color: #78350F; }
.toast-error   { background: #FEF2F2; border-color: #FECACA; color: #7F1D1D; }
.toast-close { background: none; border: none; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; opacity: 0.6; padding: 0 2px; }
.toast-close:hover { opacity: 1; }
.toast-hide { opacity: 0; transform: translateY(-6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; transition: none; } }

/* ── Scenario List (Load Modal) ── */
.scenario-list { max-height: 360px; overflow-y: auto; }
.scenario-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border: 1px solid #E5E7EB; border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; transition: all 0.15s;
}
.scenario-item:hover { background: #F0F4FF; border-color: #93C5FD; }
.scenario-item-name { font-size: 14px; font-weight: 600; color: #111827; }
.scenario-item-date { font-size: 11px; color: #9CA3AF; }
.scenario-item-delete {
  background: none; border: none; font-size: 16px; color: #D1D5DB;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; line-height: 1;
}
.scenario-item-delete:hover { color: #EF4444; background: #FEF2F2; }
.scenario-empty { text-align: center; padding: 40px 20px; color: #9CA3AF; font-size: 14px; }

/* ── Import Drop Zone ── */
.import-drop-zone {
  border: 2px dashed #D1D5DB; border-radius: 12px; padding: 32px 20px;
  text-align: center; transition: border-color 0.2s, background 0.2s; cursor: pointer;
}
.import-drop-zone.dragover { border-color: #3B82F6; background: #EFF6FF; }
.import-drop-zone p { margin: 4px 0; font-size: 14px; color: #6B7280; }
.import-drop-icon { font-size: 32px; margin-bottom: 8px; }

/* ── Phone report upload ── */
.ci-card { border-color: #BFDBFE; }
.ci-title { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 4px; overflow-wrap: anywhere; }
.ci-intro { font-size: 14px; color: #475569; margin-bottom: 12px; }
.ci-drop { display: block; position: relative; padding: 24px 20px; }
.ci-drop strong { font-size: 14px; color: #1D4ED8; }
.ci-drop:focus-within { border-color: #2563EB; outline: 2px solid #BFDBFE; }
.ci-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ci-fineprint { font-size: 12px; color: #6B7280; margin-top: 8px; }
.ci-or { font-size: 13px; font-weight: 600; color: #374151; margin: 16px 0 8px; }
.ci-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.ci-head .btn { flex-shrink: 0; }
.ci-applied { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 14px; font-weight: 600; color: #14532D; }
.ci-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ci-metric { background: #F8FAFC; border: 1px solid #E5E7EB; border-radius: 10px; padding: 12px 14px; }
.ci-metric-label { font-size: 12px; color: #6B7280; }
.ci-metric-value { font-size: 20px; font-weight: 700; color: #111827; }
.ci-metric-sub { font-size: 12px; color: #6B7280; }
.ci-week-group { max-width: 280px; margin-bottom: 10px; }
.ci-method { font-size: 13px; color: #475569; margin: 10px 0 16px; }
.ci-chart-block { position: relative; margin-bottom: 16px; }
.ci-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ci-chart-title { font-size: 14px; font-weight: 600; color: #374151; }
.ci-legend { display: flex; gap: 14px; font-size: 12px; color: #52514E; }
.ci-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ci-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ci-past { background: #2563EB; }
.ci-future { background: #D97706; }
.ci-chart { display: flex; align-items: flex-end; gap: 2px; height: 170px; border-bottom: 1px solid #E5E7EB; }
.ci-bar-slot { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; }
.ci-bar-value { font-size: 11px; font-weight: 600; color: #374151; margin-bottom: 2px; white-space: nowrap; }
.ci-bar { width: 100%; max-width: 44px; border-radius: 4px 4px 0 0; min-height: 2px; }
.ci-bar-slot:hover .ci-bar, .ci-bar-slot:focus .ci-bar { filter: brightness(0.88); }
.ci-bar-slot:focus { outline: none; }
.ci-axis { display: flex; gap: 2px; margin-top: 4px; }
.ci-axis span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; color: #6B7280; white-space: nowrap; overflow: visible; }
.ci-tooltip { position: absolute; z-index: 5; background: #111827; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; transform: translate(-50%, -100%); }
.ci-notes { font-size: 13px; color: #475569; padding-left: 18px; margin-bottom: 14px; }
.ci-notes li { margin-bottom: 4px; }
.ci-details { margin-bottom: 16px; font-size: 13px; }
.ci-details summary { cursor: pointer; font-weight: 600; color: #2563EB; margin-bottom: 8px; }
.ci-mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.ci-mapping label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 3px; }
@media (max-width: 600px) {
  .ci-head, .ci-applied { flex-direction: column; align-items: stretch; }
}

/* ── Labor cost ── */
.labor-inputs .form-group { max-width: 280px; }
.labor-block:empty { display: none; }
.labor-block { margin: 16px 0; }
.labor-block .metrics-row { margin: 8px 0; }
.labor-block .metric-card-value { font-size: 24px; }
.labor-title { font-size: 15px; font-weight: 600; color: #374151; }
.labor-sub { font-size: 12px; color: #6B7280; margin-top: 2px; }
.labor-note { font-size: 13px; color: #475569; margin: 6px 0 12px; }
.labor-prompt { font-size: 13px; color: #475569; background: #F8FAFC; border: 1px solid #E5E7EB; border-radius: 10px; padding: 10px 14px; }
.labor-prompt a { font-weight: 600; cursor: pointer; }

/* ── Publish schedule ── */
.publish-privacy { margin: 0 0 12px; }
.publish-result { margin-top: 16px; }
.publish-result label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.publish-link-row { display: flex; gap: 8px; align-items: center; }
.publish-link-row .form-input { flex: 1; min-width: 0; }
.publish-list-wrap { margin-top: 16px; }
.publish-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; font-size: 13px; }
.publish-item-title { font-weight: 600; color: #111827; overflow-wrap: anywhere; }
.publish-item-week { color: #6B7280; font-size: 12px; }
.publish-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Shared schedule page ── */
.ss-page { max-width: 1000px; margin: 0 auto; padding: 20px 16px 48px; }
.ss-brand { font-size: 13px; font-weight: 700; color: #2563EB; margin-bottom: 18px; }
.ss-title { font-size: 24px; font-weight: 800; color: #111827; letter-spacing: -0.3px; overflow-wrap: anywhere; }
.ss-week { font-size: 14px; color: #6B7280; margin-bottom: 18px; }
.ss-picker { max-width: 320px; margin-bottom: 18px; }
.ss-picker label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.ss-team th:first-child, .ss-team td:first-child { position: sticky; left: 0; background: #fff; font-weight: 600; }
.ss-team td, .ss-team th { white-space: nowrap; }
.ss-off { color: #9CA3AF; }
.ss-shift { background: #fff; border: 1px solid #E5E7EB; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; display: flex; gap: 16px; }
.ss-shift-date { width: 72px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: #374151; }
.ss-shift-date span { display: block; font-weight: 400; color: #6B7280; font-size: 12px; }
.ss-shift-time { font-size: 17px; font-weight: 700; color: #111827; }
.ss-shift-extra { font-size: 13px; color: #6B7280; }
.ss-shift.is-off .ss-shift-time { font-size: 14px; font-weight: 500; color: #9CA3AF; }
.ss-actions { margin-bottom: 14px; }
.ss-updated { font-size: 12px; color: #9CA3AF; margin-top: 18px; }
.ss-error { text-align: center; padding: 48px 16px; color: #374151; }
.ss-made { font-size: 13px; color: #6B7280; margin-top: 28px; padding-top: 16px; border-top: 1px solid #E5E7EB; }
.ss-made a { font-weight: 600; }
@media print { .ss-picker, .ss-actions, .ss-made { display: none; } }
@media (max-width: 600px) {
  #publish-card .form-group { width: 100%; }
  .publish-link-row { flex-wrap: wrap; }
  .publish-link-row .form-input { flex-basis: 100%; }
  .publish-item { flex-direction: column; align-items: stretch; }
  .labor-inputs .form-group { max-width: none; }
}

/* ── Step Indicator ── */
.step-indicator { background: rgba(255,255,255,0.97); backdrop-filter: blur(10px); border-bottom: 1px solid #E5E7EB; padding: 12px 0; position: sticky; top: 56px; z-index: 99; pointer-events: none; }
.step-indicator-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 24px; pointer-events: none;
}
.step-item {
  display: flex; align-items: center; gap: 10px; flex: 1;
  padding: 8px 12px; border-radius: 10px; cursor: pointer; transition: background 0.15s;
  pointer-events: auto;
}
.step-item.active { background: #EFF6FF; }
.step-item.done { background: #F0FDF4; }
.step-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; background: #D1D5DB;
  flex-shrink: 0;
}
.step-item.active .step-icon { background: #2563EB; }
.step-item.done .step-icon { background: #16A34A; }
.step-item.done .step-icon::after { content: "\2713"; }
.step-label { font-size: 13px; font-weight: 600; color: #374151; }
.step-caption { font-size: 11px; color: #9CA3AF; }

/* ── Tab Navigation ── */
.tab-nav {
  background: #fff; border-bottom: 2px solid #E5E7EB;
  display: flex; max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.tab-btn {
  padding: 14px 20px; border: none; background: none;
  font-family: inherit; font-size: 14px; font-weight: 600; color: #6B7280;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s; white-space: nowrap;
}
.tab-btn:hover { color: #374151; }
.tab-btn.active { color: #2563EB; border-bottom-color: #2563EB; }

/* ── Tab Content ── */
.tab-content { display: none; padding: 24px 0 60px; }
.tab-content.active { display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Typography ── */
.page-title { font-size: 28px; font-weight: 800; color: #111827; margin-bottom: 8px; letter-spacing: -0.5px; }
.section-title { font-size: 20px; font-weight: 700; color: #111827; margin: 28px 0 8px; }
.subsection-title { font-size: 15px; font-weight: 600; color: #374151; margin: 20px 0 8px; }
.section-caption { font-size: 13px; color: #6B7280; margin-bottom: 12px; }

/* ── Cards ── */
.card {
  background: #fff; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 20px 24px; margin-bottom: 16px;
}
.info-card { background: #F8FAFC; border-color: #CBD5E1; }
.info-card h3 { font-size: 18px; font-weight: 700; color: #1E293B; margin-bottom: 8px; }
.info-card p { font-size: 14px; color: #475569; margin-bottom: 12px; }
.info-card ul { margin: 0; padding: 0 0 0 8px; list-style: none; }
.info-card li { font-size: 13px; color: #475569; line-height: 2; }

/* ── Banners ── */
.banner {
  padding: 10px 18px; border-radius: 0 8px 8px 0; margin: 16px 0;
  font-weight: 600; font-size: 14px; border-left: 4px solid;
}
.banner-blue { background: #EFF6FF; border-left-color: #3B82F6; color: #1E40AF; }
.banner-green { background: #F0FDF4; border-left-color: #22C55E; color: #14532D; }
.banner-yellow { background: #FFFBEB; border-left-color: #F59E0B; color: #78350F; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px; font-family: inherit; font-weight: 600;
  cursor: pointer; transition: all 0.15s; font-size: 14px; padding: 10px 20px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #2563EB; color: #fff; }
.btn-primary:hover { background: #1D4ED8; transform: translateY(-1px); }
.btn-outline { background: transparent; color: #374151; border: 1.5px solid #D1D5DB; }
.btn-outline:hover { border-color: #9CA3AF; color: #111827; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* ── Forms ── */
.form-row {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; align-items: flex-start;
}
.form-group { display: flex; flex-direction: column; gap: 4px; min-width: 140px; flex: 1; }
.form-label { font-size: 13px; font-weight: 600; color: #374151; }
label { font-size: 13px; font-weight: 600; color: #374151; }
.form-input, .form-select, .form-textarea {
  padding: 8px 12px; border: 1.5px solid #D1D5DB; border-radius: 8px;
  font-family: inherit; font-size: 14px; color: #111827; background: #fff;
  outline: none; transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #2563EB; }
.form-textarea { resize: vertical; }
.form-select { appearance: auto; }

/* ── Radio & Checkbox ── */
.radio-group { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.radio-label, .checkbox-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: #374151; cursor: pointer;
}

/* ── Day Inputs (7-column row) ── */
.day-inputs {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 12px;
}
.day-input-group { display: flex; flex-direction: column; gap: 4px; }
.day-input-group label { font-size: 12px; font-weight: 600; color: #6B7280; text-align: center; }
.day-input-group input {
  padding: 8px 6px; border: 1.5px solid #D1D5DB; border-radius: 8px;
  font-family: inherit; font-size: 14px; color: #111827; text-align: center;
  outline: none; width: 100%;
}
.day-input-group input:focus { border-color: #2563EB; }

/* ── Preset Grid ── */
.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.preset-btn {
  background: #fff; border: 1.5px solid #D1D5DB; border-radius: 12px;
  padding: 16px 12px; text-align: center; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.preset-btn:hover { border-color: #9CA3AF; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.preset-btn.active { border-color: #2563EB; background: #EFF6FF; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.preset-btn-name { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.preset-btn-desc { font-size: 12px; color: #6B7280; }
.preset-btn-hours { font-size: 11px; color: #9CA3AF; margin-top: 4px; }

/* ── Expander / Collapsible ── */
.expander { padding: 0; overflow: hidden; }
.expander-header {
  padding: 14px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 600; color: #374151; user-select: none;
}
.expander-header:hover { background: #F9FAFB; }
.expander-chevron { font-size: 12px; color: #9CA3AF; transition: transform 0.2s; }
.expander-header.expander-open .expander-chevron { transform: rotate(180deg); }
.expander-header.expander-open + .expander-body { display: block !important; }
.expander-body { padding: 0 20px 20px; }

/* ── Data Tables ── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; border: 1px solid #E5E7EB; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px; background: #fff;
}
.data-table th {
  background: #F9FAFB; padding: 10px 12px; text-align: left;
  font-weight: 600; color: #374151; border-bottom: 2px solid #E5E7EB;
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.data-table td {
  padding: 8px 12px; border-bottom: 1px solid #F3F4F6; white-space: nowrap;
}
.data-table tbody tr:nth-child(even) { background: #FAFBFC; }
.data-table tbody tr:hover { background: #F0F4FF; }

/* Editable cells */
.data-table td[contenteditable="true"] { cursor: text; }
.data-table td[contenteditable="true"]:focus {
  outline: 2px solid #2563EB; outline-offset: -2px; background: #EFF6FF;
}

/* ── Heatmap colors ── */
.heat-0 { background: #ffffff; color: #000000; }
.heat-1 { background: #FFFDE7; color: #000000; }
.heat-2 { background: #FFF59D; color: #000000; }
.heat-3 { background: #F9A825; color: #000000; }
.heat-4 { background: #E65100; color: #ffffff; }
.heat-5 { background: #B71C1C; color: #ffffff; }

/* ── Metrics ── */
.metrics-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.metric-card {
  flex: 1; min-width: 160px; background: #fff; border: 1px solid #E5E7EB;
  border-radius: 12px; padding: 16px 20px; text-align: center;
}
.metric-card-label { font-size: 12px; font-weight: 600; color: #6B7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.metric-card-value { font-size: 28px; font-weight: 800; color: #111827; letter-spacing: -0.5px; }
.metric-display { background: #F9FAFB; border-radius: 8px; padding: 8px 12px; }
.metric-value { font-size: 24px; font-weight: 700; color: #111827; }

/* ── Results tabs ── */
.results-tabs { display: flex; gap: 0; margin: 20px 0 16px; border-bottom: 2px solid #E5E7EB; }
.results-tab-btn {
  padding: 10px 18px; border: none; background: none; font-family: inherit;
  font-size: 13px; font-weight: 600; color: #6B7280; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s;
}
.results-tab-btn.active { color: #2563EB; border-bottom-color: #2563EB; }
.results-tab-content { display: none; }
.results-tab-content.active { display: block; }

/* ── Validation ── */
.validation-msg { font-size: 13px; margin-top: 4px; }
.validation-msg.success { color: #16A34A; }
.validation-msg.warning { color: #D97706; }
.validation-msg.error { color: #DC2626; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid #E5E7EB; margin: 24px 0; }

/* ── Checkbox Row ── */
.checkbox-row { display: flex; flex-wrap: wrap; gap: 16px; }

/* ── Loading Spinner ── */
.loading-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(2px);
  flex-direction: column; align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }
.spinner {
  width: 40px; height: 40px; border: 4px solid #E5E7EB;
  border-top-color: #2563EB; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 12px; font-size: 15px; font-weight: 600; color: #374151; }

/* ── Paste Data Layout ── */
.paste-layout {
  display: flex; gap: 16px; align-items: stretch;
}
.paste-textarea-wrap {
  flex: 1;
}
.paste-textarea-wrap textarea {
  width: 100%; height: 100%; min-height: 180px;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 12px; line-height: 1.5; resize: vertical;
  padding: 12px; border-radius: 8px;
}
.paste-actions {
  display: flex; flex-direction: column; gap: 10px; justify-content: flex-start;
  min-width: 180px;
}
.paste-actions .btn { white-space: nowrap; }

/* ── Export Link (subtle) ── */
.export-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; color: #9CA3AF;
  cursor: pointer; text-decoration: none; padding: 4px 0;
  transition: color 0.15s;
}
.export-link:hover { color: #374151; text-decoration: none; }
.export-link svg { width: 12px; height: 12px; fill: currentColor; }
.table-header-row {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px;
}

/* ── Coverage Chart (Schedule Builder) ── */
.coverage-chart-wrap {
  position: relative; background: #fff; border: 1px solid #E5E7EB;
  border-radius: 12px; padding: 16px; overflow-x: auto;
}
.coverage-chart-wrap svg text { font-family: 'Inter', sans-serif; }

/* ── Responsive ── */
@media (max-width: 768px) {
  /* Compact one-row step bar on phones (it is sticky, so it must stay short) */
  .step-indicator { padding: 8px 0; }
  .step-indicator-inner { flex-direction: row; gap: 6px; padding: 0 12px; }
  .step-item { gap: 6px; padding: 6px 8px; min-width: 0; }
  .step-caption { display: none; }
  .step-label { font-size: 11px; line-height: 1.25; }
  .step-icon { width: 24px; height: 24px; font-size: 12px; }
  .step-item.next-up::after { content: "Next \2192"; top: -8px; right: 4px; font-size: 10px; padding: 1px 6px; }
  /* Keep the top bar inside the screen */
  .app-nav-inner { padding: 0 12px; gap: 12px; }
  .app-back, .nav-user-email, .nav-separator { display: none; }
  .app-wordmark { font-size: 0; gap: 0; }
  .app-wordmark-icon { font-size: 14px; }
  .app-nav-right { gap: 14px; min-width: 0; flex-shrink: 1; overflow-x: auto; scrollbar-width: none; }
  .app-nav-right::-webkit-scrollbar { display: none; }
  .nav-link { white-space: nowrap; }
  .tab-nav { overflow-x: auto; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .day-inputs { grid-template-columns: repeat(4, 1fr); }
  .form-row { flex-direction: column; }
  .metrics-row { flex-direction: column; }
  .paste-layout { flex-direction: column; }
  .paste-actions { flex-direction: row; min-width: unset; }
}
@media (max-width: 480px) {
  .preset-grid { grid-template-columns: 1fr; }
  .day-inputs { grid-template-columns: repeat(3, 1fr); }
}


/* ── Next-step prompts (guide users from Calculate -> Schedule -> Roster) ── */
.next-step-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 14px 0 18px; padding: 16px 20px; border-radius: 12px;
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
  border: 2px solid #3B82F6;
  animation: nextStepPulse 2.4s ease-in-out 3;
}
.next-step-text { flex: 1 1 260px; min-width: 0; }
.next-step-title { font-size: 17px; font-weight: 700; color: #14532D; }
.next-step-sub { font-size: 14px; color: #475569; margin-top: 4px; }
.next-step-btn { flex: 0 0 auto; white-space: nowrap; }
.next-step-bar {
  position: sticky; bottom: 16px; z-index: 20; display: flex; justify-content: center;
  margin-top: 20px; pointer-events: none;
}
.next-step-bar .btn { pointer-events: auto; box-shadow: 0 6px 20px rgba(37, 99, 235, .35); }
@keyframes nextStepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, .35); }
  50% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
}
@media (prefers-reduced-motion: reduce) { .next-step-card { animation: none; } }
@media (max-width: 600px) { .next-step-btn { width: 100%; } }

/* Step 2 lights up after Calculate so people know to click it */
.step-item { position: relative; }
.step-item.next-up {
  background: #EFF6FF; box-shadow: 0 0 0 2px #2563EB;
  animation: nextStepPulse 1.8s ease-in-out infinite;
}
.step-item.next-up::after {
  content: "Click for next step \2192";
  position: absolute; top: -9px; right: 10px;
  background: #2563EB; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) { .step-item.next-up { animation: none; } }
