/* GeneralFlow Pro - global styles
   Identity: industrial workforce-control. Deep slate-navy structure with a
   safety-amber accent (the color of hi-vis vests / control panels). Grotesk
   display for headers, clean system body. */

:root {
  --navy-900: #0F1B2D;
  --navy-800: #16243A;
  --navy-700: #1E3A5F;
  --navy-600: #2B4C73;
  --slate-100: #EEF2F7;
  --slate-200: #DDE4EC;
  --slate-400: #93A4B8;
  --amber: #F5A623;
  --amber-dark: #D4881A;
  --green: #10B981;
  --red: #EF4444;
  --white: #FFFFFF;
  --text: #1A2536;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 27, 45, 0.12), 0 1px 2px rgba(15, 27, 45, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--slate-100);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  padding: 9px 16px;
  transition: all 0.15s;
}
button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.btn-primary { background: var(--navy-700); color: var(--white); font-weight: 500; }
.btn-primary:hover { background: var(--navy-800); }
.btn-accent { background: var(--amber); color: var(--navy-900); font-weight: 600; }
.btn-accent:hover { background: var(--amber-dark); }
.btn-ghost { background: transparent; color: var(--navy-700); border: 1px solid var(--slate-200); }
.btn-ghost:hover { background: var(--slate-100); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  width: 100%;
  background: var(--white);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(43, 76, 115, 0.12);
}
label { display: block; font-size: 12px; font-weight: 600; color: var(--slate-400);
        margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px;
  background: var(--navy-900);
  color: var(--slate-100);
  display: flex; flex-direction: column;
  position: fixed; height: 100vh; overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  font-size: 18px; font-weight: 700; color: var(--white);
  display: flex; align-items: center; gap: 9px;
  border-bottom: 1px solid var(--navy-700);
}
.sidebar-brand .mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--amber); display: grid; place-items: center;
  color: var(--navy-900); font-weight: 800; font-size: 15px;
}
.nav { padding: 10px 0; flex: 1; }
.nav-item {
  display: block; padding: 10px 20px; color: var(--slate-400);
  text-decoration: none; font-size: 14px; border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--navy-800); color: var(--slate-100); }
.nav-item.active {
  background: var(--navy-800); color: var(--white);
  border-left-color: var(--amber); font-weight: 500;
}

.main { flex: 1; margin-left: 232px; }
.topbar {
  height: 60px; background: var(--white); border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 19px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.lang-toggle { display: flex; border: 1px solid var(--slate-200); border-radius: var(--radius); overflow: hidden; }
.lang-toggle button { border-radius: 0; padding: 6px 12px; background: var(--white); color: var(--slate-400); }
.lang-toggle button.active { background: var(--navy-700); color: var(--white); }

.content { padding: 28px; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 20px; border: 1px solid var(--slate-200); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 18px 20px;
             box-shadow: var(--shadow); border-left: 3px solid var(--amber); }
.stat-card .value { font-size: 30px; font-weight: 700; color: var(--navy-900); }
.stat-card .label { font-size: 12px; color: var(--slate-400); text-transform: uppercase;
                    letter-spacing: 0.04em; margin-top: 2px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
     color: var(--slate-400); padding: 10px 12px; border-bottom: 2px solid var(--slate-200); }
td { padding: 11px 12px; border-bottom: 1px solid var(--slate-100); font-size: 14px; }
tr:hover td { background: var(--slate-100); }
.link-name { color: var(--navy-700); font-weight: 600; cursor: pointer; text-decoration: none; }
.link-name:hover { color: var(--amber-dark); text-decoration: underline; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green { background: #DCFCE7; color: #15803D; }
.badge-amber { background: #FEF3C7; color: #B45309; }
.badge-red { background: #FEE2E2; color: #B91C1C; }
.badge-slate { background: var(--slate-100); color: var(--slate-400); }

/* Page header */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head h2 { font-size: 22px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 27, 45, 0.55);
                 display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--white); border-radius: 12px; width: 100%; max-width: 560px;
         max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--slate-200);
              display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--slate-200);
              display: flex; justify-content: flex-end; gap: 10px; }
.form-row { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center;
              background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); }
.login-card { background: var(--white); border-radius: 14px; padding: 40px 36px;
              width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-card .brand .mark { width: 36px; height: 36px; border-radius: 8px; background: var(--amber);
                           display: grid; place-items: center; color: var(--navy-900); font-weight: 800; }
.login-card h1 { font-size: 22px; }
.login-card .sub { color: var(--slate-400); font-size: 13px; margin-bottom: 24px; }
.login-error { background: #FEE2E2; color: #B91C1C; padding: 10px 12px; border-radius: var(--radius);
               font-size: 13px; margin-bottom: 14px; }

.empty { text-align: center; color: var(--slate-400); padding: 40px; }
.flex { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--slate-400); font-size: 13px; }

/* -------------------------------------------------------------------------
   Schedule Builder — site template + simple weekly coverage grid
   ------------------------------------------------------------------------- */
.schedule-builder { min-width: 0; }
.schedule-page-head { align-items: flex-start; gap: 16px; }
.schedule-page-head h2 { margin-bottom: 2px; }
.schedule-head-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.schedule-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px; }
.schedule-toolbar select { width: auto; min-width: 120px; }
.schedule-toolbar strong { min-width: 196px; text-align: center; font-size: 13px; }
.schedule-spacer { flex: 1 1 auto; }
.schedule-message { margin-bottom: 12px; border-left: 4px solid var(--green); background: #f0fdf4; }
.schedule-kpis { display: grid; grid-template-columns: repeat(4,minmax(130px,1fr)); gap: 10px; margin-bottom: 10px; }
.schedule-kpis .card { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.schedule-kpis span { color: var(--slate-500); font-size: 12px; }
.schedule-kpis b { font-size: 22px; color: var(--navy-700); }
.schedule-kpi-warning { border-left: 4px solid #f59e0b; }
.schedule-kpi-info { border-left: 4px solid #3b82f6; }
.schedule-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 10px; font-size: 12px; color: var(--slate-600); }
.schedule-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; font-style: normal; font-weight: 800; }
.schedule-layout { display: grid; grid-template-columns: 245px minmax(0,1fr); gap: 12px; align-items: start; }
.schedule-crew { padding: 12px; position: sticky; top: 76px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.schedule-crew > small { display: block; margin: 3px 0 10px; }
.schedule-crew input { margin-bottom: 8px; }
.schedule-crew-list { overflow-y: auto; min-height: 180px; }
.crew-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--slate-100); font-size: 12px; }
.crew-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-row em, .schedule-pick-row em { font-style: normal; font-size: 9px; text-transform: uppercase; color: #1d4ed8; background: #dbeafe; border-radius: 999px; padding: 1px 5px; margin-left: 5px; }
.crew-row b { font-size: 11px; color: var(--slate-500); }
.crew-row b.over { color: #dc2626; }
.schedule-grid-wrap { min-width: 0; overflow-x: auto; }
.schedule-table-card { padding: 0; overflow: hidden; min-width: 880px; }
.schedule-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.schedule-table th, .schedule-table td { border-right: 1px solid var(--slate-200); border-bottom: 1px solid var(--slate-200); }
.schedule-table thead th { background: #0f1b2d; color: #fff; padding: 8px 5px; font-size: 11px; text-align: center; }
.schedule-table th:first-child, .schedule-table td:first-child { border-left: 0; }
.schedule-block-column { width: 210px; text-align: left !important; position: sticky; left: 0; z-index: 4; }
.schedule-block-cell { padding: 8px; background: #fff; position: sticky; left: 0; z-index: 3; vertical-align: top; box-shadow: 2px 0 0 rgba(15,23,42,.04); }
.schedule-block-cell strong { display: block; color: var(--navy-700); font-size: 12px; }
.schedule-block-cell span, .schedule-block-cell small { display: block; color: var(--slate-500); margin-top: 3px; font-size: 10px; }
.schedule-day-cell { padding: 4px; vertical-align: top; min-height: 95px; background: #fff; position: relative; }
.schedule-day-cell.coverage-open { background: #fffbeb; }
.schedule-day-cell.coverage-extra { background: #eff6ff; }
.coverage-count { width: 100%; border: 0; border-radius: 5px; padding: 2px 4px; margin-bottom: 4px; background: rgba(15,23,42,.06); color: var(--slate-700); font-weight: 700; font-size: 10px; cursor: pointer; }
.coverage-open .coverage-count { background: #fef3c7; color: #92400e; }
.coverage-extra .coverage-count { background: #dbeafe; color: #1d4ed8; }
.schedule-cell-people { display: flex; flex-direction: column; gap: 3px; }
.schedule-person { border: 0; border-radius: 5px; padding: 3px 4px; text-align: left; font-size: 10px; line-height: 1.15; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-person b { display: inline-flex; width: 15px; justify-content: center; margin-right: 2px; }
.schedule-assigned, .schedule-confirmed { background: #dcfce7; color: #166534; }
.schedule-last-minute { background: #dbeafe; color: #1d4ed8; }
.schedule-changed { background: #ffedd5; color: #9a3412; }
.schedule-planned-only { background: #f1f5f9; color: #64748b; text-decoration: line-through; }
.schedule-extra { background: #e0e7ff; color: #4338ca; }
.schedule-substitute { background: #f3e8ff; color: #7e22ce; }
.schedule-add { width: 100%; margin-top: 4px; border: 1px dashed var(--slate-300); background: transparent; color: var(--slate-500); border-radius: 5px; cursor: pointer; padding: 1px; }
.schedule-add:hover { border-color: var(--green); color: var(--green); background: #f0fdf4; }
.schedule-pick-modal { max-width: 480px; }
.schedule-pick-list { max-height: 360px; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.schedule-pick-row { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; }
.schedule-pick-row small { color: var(--slate-400); }
.schedule-template-modal { width: min(900px,94vw); max-width: 900px; }
.schedule-template-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow-y: auto; }
.schedule-template-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--slate-200); border-radius: 8px; padding: 9px 10px; }
.schedule-template-row.inactive { opacity: .55; background: #f8fafc; }
.schedule-template-row strong, .schedule-template-row span { display: block; }
.schedule-template-row span { font-size: 11px; color: var(--slate-500); margin-top: 2px; }
@media (max-width: 1050px) {
  .schedule-layout { grid-template-columns: 1fr; }
  .schedule-crew { position: static; max-height: 250px; }
  .schedule-kpis { grid-template-columns: repeat(2,minmax(130px,1fr)); }
}
@media (max-width: 680px) {
  .schedule-head-buttons { width: 100%; }
  .schedule-toolbar strong { min-width: 160px; }
  .schedule-kpis { grid-template-columns: 1fr 1fr; }
}

/* Schedule Builder 2026.09: keep daily use simple while preserving plan vs actual. */
.schedule-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.schedule-view-toggle button {
  border: 0;
  border-right: 1px solid var(--border, #cbd5e1);
  background: transparent;
  padding: 8px 11px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.schedule-view-toggle button:last-child { border-right: 0; }
.schedule-view-toggle button.active { background: #0f766e; color: #fff; }
.schedule-archive-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-left: 4px solid #64748b;
}
.schedule-archive-note span { color: #64748b; font-size: 13px; }
.schedule-compare-note {
  margin: -2px 0 10px;
  color: #475569;
  font-size: 12px;
  text-align: right;
}
.schedule-show-staff { width: 100%; margin-top: 8px; }
.schedule-pick-help { display: block; margin: 7px 0 10px; }
.schedule-crew-list { max-height: 540px; overflow: auto; }
.coverage-count:disabled { cursor: default; opacity: .82; }
@media (max-width: 1180px) {
  .schedule-toolbar { align-items: flex-start; }
  .schedule-view-toggle { order: 8; }
}

/* Schedule requirements 2026.09.1: editable ranges + Peak/Prime layers. */
.schedule-date-field { display: grid; gap: 2px; min-width: 142px; }
.schedule-date-field span { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-500); }
.schedule-date-field input { min-width: 142px; padding: 7px 8px; }
.schedule-kpis .card { min-height: 66px; }
.schedule-kpis .card small { display: block; color: var(--slate-400); font-size: 9px; margin-left: 8px; }
.schedule-required-kpi { border-left: 4px solid #16a34a; }
.schedule-special-badges { display: flex; gap: 3px; flex-wrap: wrap; margin: 0 0 3px; }
.schedule-special-badges span { border-radius: 999px; padding: 1px 5px; font-size: 8px; line-height: 1.45; font-weight: 800; white-space: nowrap; }
.schedule-peak-badge { color: #9a3412; background: #ffedd5; border: 1px solid #fdba74; }
.schedule-prime-badge { color: #6b21a8; background: #f3e8ff; border: 1px solid #d8b4fe; }
.schedule-requirement-source { display: block; text-align: right; color: var(--slate-400); font-size: 8px; text-transform: capitalize; margin: -1px 2px 3px; }
.schedule-requirement-modal { width: min(680px, 94vw); max-width: 680px; }
.schedule-requirement-help { margin: 0 0 14px; padding: 9px 11px; border-radius: 8px; background: #eff6ff; color: #1e40af; font-size: 12px; }
.schedule-requirement-grid { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: 10px; align-items: stretch; }
.schedule-special-card { border: 1px solid var(--slate-200); border-radius: 9px; padding: 9px 10px; }
.schedule-special-card.peak { background: #fff7ed; border-color: #fed7aa; }
.schedule-special-card.prime { background: #faf5ff; border-color: #e9d5ff; }
.schedule-special-toggle { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-weight: 800; text-transform: none; color: var(--navy-700); }
.schedule-special-toggle input { width: auto; }
.schedule-requirement-total { margin: 12px 0; border-radius: 9px; padding: 10px 12px; background: #f8fafc; display: flex; align-items: center; justify-content: space-between; }
.schedule-requirement-total span { color: var(--slate-500); font-size: 12px; font-weight: 700; }
.schedule-requirement-total b { color: var(--navy-700); font-size: 26px; }
@media (max-width: 780px) {
  .schedule-requirement-grid { grid-template-columns: 1fr; }
  .schedule-date-field { min-width: 128px; }
  .schedule-date-field input { min-width: 128px; }
}
/* Consolidated 2026.09.3: a past date without a published plan is neutral,
   not an open staffing position. */
.coverage-no-plan { background: #f8fafc !important; color: #64748b; }
.coverage-no-plan .coverage-count { border-color: #cbd5e1; background: #fff; color: #64748b; }
.coverage-no-plan::after { content: ""; }
