/* ============================================================
   SCHEDULE APP STYLES
   Clean, medical-office-friendly design.
   Color-coded by office:
     Tampa Mohs  = Blue  (#2563eb / #dbeafe)
     TB Derm     = Green (#16a34a / #dcfce7)
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* The HTML `hidden` attribute must always win, even on elements whose
   class sets display:flex/grid (the UA's [hidden] rule loses to any
   author display declaration — this guard restores the semantics).
   Fixes the .bm-starts / .emp-starts popovers rendering open. */
[hidden] {
    display: none !important;
}

:root {
    /* Office colors */
    --mohs-primary: #2563eb;
    --mohs-light: #dbeafe;
    --mohs-border: #93c5fd;
    --derm-primary: #16a34a;
    --derm-light: #dcfce7;
    --derm-border: #86efac;
    --leadership-primary: #0d9488;
    --leadership-light: #ccfbf1;
    --leadership-border: #5eead4;

    /* Neutral palette */
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #64748b;  /* was #94a3b8 — failed WCAG AA contrast on --bg */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Accent / alerts */
    --highlight-bg: #fef3c7;   /* "different office" highlight */
    --highlight-border: #f59e0b;
    --danger: #dc2626;
    --danger-light: #fee2e2;     /* day-off / removable chip bg */
    --danger-border: #fecaca;
    --success: #16a34a;
    --info: #5b21b6;             /* PTO chip text (purple family) */
    --info-light: #ede9fe;       /* PTO chip bg */
    --info-border: #ddd6fe;

    /* Warning / amber family — pending statuses, late deadlines,
       "needs attention" accents. One palette; the hexes used to be
       sprinkled per-feature and drifted. */
    --warning-text: #92400e;
    --warning-strong: #d97706;
    --warning-border: var(--highlight-border);  /* #f59e0b */
    --warning-bg: var(--highlight-bg);          /* #fef3c7 */
    --warning-bg-soft: #fffbeb;
    --warning-chip: #fde68a;

    /* Role colors — single source of truth for month chips, the
       legend, and any future role-coded UI. */
    --role-provider: #dc2626;
    --role-leadership: #7c3aed;
    --role-manager: #f59e0b;
    --role-coordinator: #7c3aed;   /* legacy rows only */
    --role-leadma: #1d4ed8;
    --role-schedma: #c026d3;
    --role-ma: #06b6d4;
    --role-malab: #65a30d;
    --role-reception: #059669;
    --role-iv: #ca8a04;
    --role-lab: #6b7280;
    --role-trainer: #ea580c;
    --role-project: #334155;       /* muted — non-coverage assignment */
    --role-other: var(--border-strong);

    /* Sizing */
    --header-height: 56px;
    --tab-height: 44px;
    --radius: 8px;
    --radius-lg: 12px;

    /* Spacing scale — use these for new rules instead of ad-hoc px */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-modal: 0 8px 32px rgba(0,0,0,0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* ---------- SCREENS (login vs app) ---------- */
.screen {
    display: none;          /* hidden by default */
}
.screen.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- LOGIN SCREEN ---------- */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
    gap: 1.5rem;
}

.login-logo {
    text-align: center;
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.signin-btn-wrapper {
    min-height: 44px;
    display: flex;
    justify-content: center;
}

/* In-house Sign-In button (replaces GIS-rendered button). Styled
   to match Google's button per their branding guidelines: white
   background, dark text, multicolor G logo to the left. */
.signin-google-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.1rem;
    background: #fff;
    color: #1f1f1f;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-family: 'Roboto', 'Inter', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-height: 40px;
    transition: background 120ms ease, box-shadow 120ms ease;
}
.signin-google-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.signin-google-btn:active {
    background: #f1f3f4;
}

/* Mock login panel */
.mock-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 320px;
    width: 100%;
}

.mock-badge {
    font-weight: 600;
    color: var(--highlight-border);
}

.mock-login select {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:active:not(:disabled) {
    transform: scale(0.98);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--mohs-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.btn-small {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.btn-outline:hover {
    background: var(--bg);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 40px;   /* 40px minimum touch target — this app ships on iPads */
    height: 40px;
    font-size: 0.85rem;
    cursor: pointer;
}
.btn-icon:hover {
    background: var(--bg);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

/* ---------- APP HEADER ---------- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    height: auto;
    min-height: var(--header-height);
    padding: 0.5rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-small {
    font-size: 1.3rem;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.week-label {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 170px;
    text-align: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.user-role-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    background: var(--mohs-light);
    color: var(--mohs-primary);
}

/* ---------- VIEW TABS ---------- */
.view-tabs {
    display: flex;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.view-tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 0.65rem 1.1rem;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    letter-spacing: -0.005em;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--mohs-primary);
    border-bottom-color: var(--mohs-primary);
    font-weight: 600;
}

/* Small count pill inside a nav .tab button (e.g. pending swap requests). */
.tab-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    border-radius: 999px;
}

/* ---------- MAIN CONTENT ---------- */
.app-content {
    flex: 1;
    padding: 1.25rem;
    overflow-x: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.view {
    display: none;
}
.view.active {
    display: block;
}

/* ---------- EMPLOYEE VIEW: Schedule Cards ---------- */
.schedule-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.day-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.day-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Color the left border by office */
.day-card.office-mohs {
    border-left: 4px solid var(--mohs-primary);
}
.day-card.office-derm {
    border-left: 4px solid var(--derm-primary);
}
.day-card.office-leadership {
    border-left: 4px solid var(--leadership-primary);
}

/* Highlight if the employee is at a DIFFERENT office than their home */
.day-card.different-office {
    background: var(--highlight-bg);
    border-color: var(--highlight-border);
    border-left-width: 4px;
}

.day-card-date {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.day-card-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.day-card-office {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}

.office-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.office-dot.mohs { background: var(--mohs-primary); }
.office-dot.derm { background: var(--derm-primary); }
.office-dot.leadership { background: var(--leadership-primary); }

.different-office-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--warning-text);
    background: var(--warning-chip);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.3rem;
}

.day-card-note {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* Day off / no assignment card */
.day-card.day-off {
    background: #f1f5f9;
    border-color: var(--border);
    border-left-color: var(--border-strong);
    opacity: 0.7;
}

/* ---------- MANAGER VIEW: Team Grid ---------- */
.team-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.team-controls select {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.team-grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.team-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    min-width: 700px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.team-grid th,
.team-grid td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    vertical-align: top;
}
.team-grid th:last-child,
.team-grid td:last-child {
    border-right: none;
}
.team-grid tbody tr:last-child td {
    border-bottom: none;
}

.team-grid thead th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Sticky first column (employee name) */
.team-grid th:first-child,
.team-grid td:first-child {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 5;
    font-weight: 500;
    min-width: 130px;
}

.team-grid thead th:first-child {
    z-index: 15;
}

/* Office color chips inside grid cells */
.cell-office {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
}
.cell-office.mohs {
    background: var(--mohs-light);
    color: var(--mohs-primary);
}
.cell-office.derm {
    background: var(--derm-light);
    color: var(--derm-primary);
}
.cell-office.leadership {
    background: var(--leadership-light);
    color: var(--leadership-primary);
}

.cell-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cell-shift {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.cell-different {
    border-left: 3px solid var(--highlight-border) !important;
    background: var(--highlight-bg) !important;
}

.cell-off {
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.6;
}

/* Empty cells in manager view — subtle "+" that brightens on hover
   so it reads as clickable without screaming for attention. */
.cell-off.cell-add {
    opacity: 1;
    color: var(--text-secondary);
    text-align: center;
}
.cell-add-plus {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.25;
    transition: opacity 120ms ease;
}
.cell-off.cell-add:hover .cell-add-plus {
    opacity: 0.85;
    color: var(--mohs-primary);
}

/* Intentionally-off cell — distinct gray "OFF" badge so it reads
   clearly as "scheduled off" vs. an empty/forgotten cell. */
.cell-scheduled-off {
    background: #f1f5f9;
    text-align: center;
    color: var(--text-secondary);
}
.cell-off-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    background: var(--border-strong);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.cell-off-note {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* Clickable employee name in the team grid (manager view) */
.employee-edit-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    line-height: 1.3;
    display: block;
}
.employee-edit-link:hover {
    color: var(--mohs-primary);
    text-decoration: underline;
}

/* Edit Employee modal — centered overlay (no anchor element) */
.edit-employee-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
}
.edit-employee-modal {
    margin: 0;
    max-width: 540px;
}
.form-hint {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.form-hint-inline {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.emp-caps-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem 0.75rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}
.emp-cap-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}
.emp-cap-option input {
    margin: 0;
}

/* Optional holiday subtitle in the day-column header */
.day-holiday {
    font-size: 0.7rem;
    font-style: italic;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* ---------- TIME-OFF REQUEST VIEWS ---------- */
.timeoff-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--border);
}

/* Request form */
.timeoff-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 600px;
    box-shadow: var(--shadow-sm);
}

.form-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 140px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ---------- SHARED INPUT CHROME ----------
   Every input/select in the app gets the same border, radius, colors,
   and focus ring from this one rule. Context rules may override
   padding/font-size for compact layouts (team filter, pattern grid,
   Build Month), but the chrome stays consistent. */
.form-group input,
.form-group select,
.form-group textarea,
.mock-login select,
.team-controls select,
.month-filter,
.template-select,
.pattern-select,
.staffing-input,
.sync-actions input[type="email"],
.bm-fld {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.mock-login select:focus,
.team-controls select:focus,
.month-filter:focus,
.template-select:focus,
.pattern-select:focus,
.staffing-input:focus,
.sync-actions input[type="email"]:focus,
.bm-fld:focus {
    outline: none;
    border-color: var(--mohs-primary);
    box-shadow: 0 0 0 2px var(--mohs-light);
}

/* Submission-deadline policy line under the "Request Time Off" title */
.timeoff-policy-note {
    margin: -0.25rem 0 0.9rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
    max-width: 46ch;
}

/* Deadline warning indicator (shown below start date input) */
.deadline-warning-container {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    min-height: 1.2rem;
}

.deadline-warning-late {
    color: var(--warning-strong);
    background: var(--warning-bg);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--warning-strong);
}

.deadline-warning-ontime {
    color: #16a34a;
    padding: 0.4rem 0.6rem;
    font-weight: 500;
}

/* Who-else-is-off panel on the request form. Informational, never
   blocking: it sits between the dates and the notes so it is read on
   the way to Submit rather than after it. */
.overlap-panel {
    margin: 0.6rem 0 0.2rem;
    font-size: 0.82rem;
}

.overlap-clear {
    color: #16a34a;
    font-weight: 500;
    padding: 0.4rem 0.6rem;
}

.overlap-warning {
    background: var(--warning-bg-soft);
    border-left: 3px solid var(--warning-strong);
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
}

.overlap-heading {
    color: var(--warning-strong);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.overlap-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.overlap-day {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
}

.overlap-date {
    font-weight: 600;
    min-width: 8.5rem;
}

.overlap-people {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.overlap-name {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}

/* Same role as the requester: the comparison the approving manager is
   actually making, so it carries the weight in the list. */
.overlap-name.same-role {
    font-weight: 600;
}

.overlap-status {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
}

.overlap-approved {
    background: var(--warning-bg);
    color: var(--warning-strong);
}

.overlap-requested {
    background: var(--border);
    color: #475569;
}

.overlap-role {
    font-size: 0.72rem;
    font-weight: 500;
    color: #475569;
}

.overlap-note {
    margin-top: 0.45rem;
    font-size: 0.76rem;
    color: #475569;
}

@media (max-width: 600px) {
    .overlap-day { flex-direction: column; gap: 0.15rem; }
    .overlap-date { min-width: 0; }
}

/* Request cards (employee history + manager pending) */
.request-cards {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.request-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow-sm);
}

.request-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.request-type {
    font-weight: 600;
    font-size: 0.9rem;
}

.request-employee {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.request-dates {
    font-size: 0.85rem;
    color: var(--text);
}

.request-days {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.request-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.request-notes {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px dashed var(--border);
}

/* ---------- BADGE / CHIP COMPONENT ----------
   THE pattern for small labeled indicators going forward. Existing
   one-off chips (.cell-office, .month-chip, .bm-chip, .spare-pill,
   .lang-badge, .sync-matched-chip…) predate it and share its tokens;
   don't add new one-off chip classes — compose .badge + a modifier. */
.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.badge-pill    { border-radius: 99px; }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-success { background: var(--derm-light); color: var(--derm-primary); }
.badge-danger  { background: var(--danger-light); color: var(--danger); }
.badge-info    { background: var(--info-light); color: var(--info); border: 1px solid var(--info-border); }
.badge-neutral { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }

/* Amber "Pending" chip after a pre-hire's name (team grid, Build
   Month). They're scheduled as real headcount, but their work
   account doesn't exist yet, so no notifications or calendar shares
   until activated. Compose as class="badge badge-pill pending-badge". */
.pending-badge {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
    font-size: 0.65rem;
    margin-left: 4px;
    vertical-align: 1px;
    cursor: help;
    white-space: nowrap;
}

/* Status badges */
.status-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
}

/* Late-submission flag, shown to the left of the status pill. Outlined
   rather than filled so it reads as a qualifier on the request and does
   not compete with the status itself. */
.request-card-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-late {
    background: transparent;
    color: var(--warning-strong);
    border: 1px solid var(--warning-strong);
}

.status-pending {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.status-approved {
    background: var(--derm-light);
    color: var(--derm-primary);
}

.status-denied {
    background: var(--danger-light);
    color: var(--danger);
}

/* Approve / Deny action buttons */
.request-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

.btn-approve {
    background: var(--success);
    color: #fff;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
}
.btn-approve:hover:not(:disabled) {
    background: #15803d;
}

.btn-deny {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
}
.btn-deny:hover:not(:disabled) {
    background: var(--danger-light);
}

/* Requests table (manager "All Requests" view) */
.requests-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.requests-table th,
.requests-table td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    border: 1px solid var(--border);
    vertical-align: top;
}

.requests-table thead th {
    background: var(--bg);
    font-weight: 600;
    position: sticky;
    top: 0;
}

/* Empty state text */
.empty-state {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* ---------- CHANGE LOG TIMELINE ---------- */
.changelog-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.changelog-day {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.changelog-day-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.2rem;
}

.changelog-entry {
    display: flex;
    gap: 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.8rem;
    border-left: 3px solid var(--border-strong);
    transition: box-shadow 0.15s;
}

.changelog-entry:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Color-code left border by change type */
.changelog-entry.change-office  { border-left-color: var(--mohs-primary); }
.changelog-entry.change-role    { border-left-color: #8b5cf6; }
.changelog-entry.change-shift   { border-left-color: var(--highlight-border); }
.changelog-entry.change-approved { border-left-color: var(--success); }
.changelog-entry.change-denied  { border-left-color: var(--danger); }
.changelog-entry.change-added   { border-left-color: var(--derm-primary); }

.changelog-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
    padding-top: 0.1rem;
}

.changelog-body {
    flex: 1;
    min-width: 0;
}

.changelog-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.15rem;
}

.changelog-type {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.changelog-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.notif-sent {
    color: var(--success);
    font-size: 0.85rem;
}

.notif-pending {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.changelog-who {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.changelog-by {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.3rem;
}

.changelog-change {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.change-old {
    background: var(--danger-light);
    color: var(--danger);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    text-decoration: line-through;
}

.change-arrow {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.change-new {
    background: var(--derm-light);
    color: var(--derm-primary);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.changelog-affected {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.changelog-undo {
    margin-top: 0.5rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
}

/* ---------- LOADING OVERLAY ---------- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(248, 250, 252, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 1000;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--mohs-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ---------- TOASTS ---------- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}

.toast {
    background: var(--text);
    color: #fff;
    padding: 0.65rem 1.15rem;
    border-radius: var(--radius);
    font-size: 0.84rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(8px);
}

.toast.error {
    background: var(--danger);
}

.toast.success {
    background: var(--success);
}

.toast.warning {
    background: var(--highlight-border);   /* amber */
    color: #1f2937;
}

.toast.info {
    background: var(--mohs-primary);
}

/* Optional action button inside a toast (e.g. "Reload" on app update). */
.toast-action {
    margin-left: 0.75rem;
    padding: 0.2rem 0.7rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.toast-action:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Compact "x" to dismiss a toast without waiting it out, sitting next
   to .toast-action. */
.toast-dismiss {
    background: none;
    border: none;
    padding: 4px 8px;
    color: inherit;
    font-size: 14px;
    opacity: 0.7;
    cursor: pointer;
}
.toast-dismiss:hover,
.toast-dismiss:focus {
    opacity: 1;
}

/* Dismissal animation, applied by showToast before removal. */
.toast-hide {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ---------- FOOTER ---------- */
.app-footer {
    padding: 0.75rem 1.25rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border);
    background: var(--surface);
    letter-spacing: 0.02em;
}

.mock-indicator {
    font-weight: 600;
    color: var(--highlight-border);
    margin-right: 0.5rem;
}

/* ---------- RESPONSIVE: TABLET / IPAD ---------- */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
    }

    .header-right {
        order: -1;           /* put week nav on top on mobile */
        width: 100%;
        justify-content: center;
    }

    .header-user {
        width: 100%;
        justify-content: flex-end;
    }

    .week-label {
        font-size: 0.85rem;
        min-width: auto;
    }

    .schedule-cards {
        grid-template-columns: 1fr;
    }

    .team-grid {
        font-size: 0.8rem;
    }
}

/* ---------- RESPONSIVE: SMALL PHONES ---------- */
@media (max-width: 480px) {
    .login-logo h1 {
        font-size: 1.4rem;
    }

    .day-card {
        padding: 0.75rem;
    }
}

/* ==========================================================
   PHASE 4: SCHEDULE EDITING
   ========================================================== */

/* ---------- EDITABLE CELLS ---------- */
.cell-editable {
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}
.cell-editable:hover {
    background: var(--mohs-light) !important;
    outline: 2px solid var(--mohs-primary);
    outline-offset: -2px;
}
.cell-editable::after {
    content: '\270E';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s;
}
.cell-editable:hover::after {
    opacity: 1;
}

/* ---------- MODALS (shared base) ----------
   One overlay + one modal recipe. .bulk-off-overlay centers its modal
   with flex; .edit-modal-overlay deliberately does NOT — the edit
   modal is positioned next to the clicked cell by JS (anchorEl). */
.edit-modal-overlay,
.bulk-off-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 900;
}

.bulk-off-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-modal,
.bulk-off-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    /* Flex column so the body scrolls while header + footer stay
       pinned — Save button must always be reachable. */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.edit-modal {
    font-size: 1rem;
}

/* Manual-assign candidate picker (coverage gaps with no substitute).
   Reuses the bulk-off overlay/modal shell; these style the ranked
   candidate list inside it. */
.assign-pick-modal {
    max-width: 440px;
}

.assign-pick-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.assign-pick-group {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 12px 0 4px;
}

.assign-pick-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    margin-bottom: 4px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: inherit;
}

.assign-pick-row:hover,
.assign-pick-row:focus-visible {
    background: var(--surface-hover, #f1f5f9);
    border-color: var(--mohs-primary);
}

.assign-pick-name {
    font-weight: 500;
}

.assign-pick-capable {
    font-size: 11px;
    font-weight: 600;
    color: var(--success-text, #15803d);
    margin-left: 6px;
    white-space: nowrap;
}

.assign-pick-status {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.assign-pick-footnote {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.bulk-off-modal {
    max-width: 480px;
    max-height: 85vh;
}

.edit-modal-header,
.edit-modal-footer {
    flex: 0 0 auto;
}

.edit-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0; /* let it shrink inside the flex parent */
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border);
}

.edit-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.edit-modal-close {
    font-size: 1.3rem;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}
.edit-modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.edit-modal-body {
    padding: 1.1rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.edit-modal-body label {
    font-size: 0.95rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.35rem;
}

.edit-modal-body select,
.edit-modal-body input[type="text"] {
    font-size: 1rem;
    padding: 0.55rem 0.7rem;
    width: 100%;
}

.edit-modal-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.edit-modal-info strong {
    font-size: 1.15rem;
}
.edit-modal-info span {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.9rem 1.4rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Changes preview inside the modal */
.edit-modal-changes {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
}

.edit-changes-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.3rem;
}

.edit-change-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    padding: 0.2rem 0;
}

.edit-change-item .change-field {
    font-weight: 500;
    min-width: 50px;
}

/* ---------- DAILY SUMMARY CARDS ---------- */
.daily-summary-container {
    margin-top: 0.75rem;
}

.summary-cards {
    display: flex;
    gap: 0.5rem;
}

.summary-card {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.6rem;
    text-align: center;
    font-size: 0.8rem;
}

.summary-card.summary-today {
    border-color: var(--mohs-primary);
    background: var(--mohs-light);
}

.summary-day {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.summary-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.summary-diff {
    font-size: 0.7rem;
    color: var(--warning-text);
    background: var(--warning-bg);
    border-radius: 4px;
    padding: 0.1rem 0.3rem;
    margin-top: 0.2rem;
    display: inline-block;
}

/* ---------- SYNC DIAGNOSTICS ---------- */
.sync-diagnostics {
    margin-top: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.sync-diagnostics summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.sync-diagnostics > div {
    margin-top: 0.25rem;
}
.sync-diag-warning {
    color: var(--warning-text);
    background: var(--warning-bg);
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.4rem !important;
}
.sync-error-hint {
    margin-top: 0.5rem;
    font-weight: normal;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
}
.sync-error-hint code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    font-size: 0.85em;
}

/* ---------- MONTH VIEW ---------- */
.month-grid-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
}
.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.month-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.month-label {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 12ch;
    text-align: center;
}
.month-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.month-filter {
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
}
.month-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
/* Small screens: the 5-column week grid can't fit a phone at any
   readable size; let the page scroll horizontally instead of
   compressing every column into an unreadable sliver (mirrors the
   Build Month fix in the BUILD MONTH: SMALL SCREENS block). */
@media (max-width: 768px) {
    .month-grid-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .month-grid {
        min-width: 640px;
    }
}
.month-grid th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
}
.month-cell {
    border: 1px solid var(--border);
    vertical-align: top;
    padding: 0.35rem 0.4rem;
    min-height: 90px;
    height: 90px;
    background: var(--surface);
}
.month-cell-clickable { cursor: pointer; }
.month-cell-clickable:hover { background: var(--mohs-light); }
.month-cell-celebrate { font-size: 11px; color: var(--text-secondary); margin-top: 2px; line-height: 1.3; }
.cell-celebrate { margin-left: 4px; }
/* One badge per missing field — 🎂 birthday, 📅 hire date — so both
   show side by side when both are blank. white-space:nowrap keeps the
   warning triangle glued to the icon it qualifies. */
.missing-data-flag { margin-left: 4px; cursor: help; white-space: nowrap; font-size: 0.85em; }

/* Missing-email alert, top of the Team Schedule view for managers.
   Deliberately louder than the inline ⚠️✉️ badges: a blank email is
   silent in a way the other gaps are not, so it gets stated once at
   full size rather than only as an icon next to a name. */
.missing-email-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 12px;
    padding: 10px 14px;
    background: var(--warning-bg-soft);
    border: 1px solid var(--warning-border);
    border-left: 4px solid var(--warning-strong);
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--warning-text);
}
.missing-email-icon { font-size: 1.05rem; line-height: 1.35; }
.missing-email-body { flex: 1; min-width: 0; }
.missing-email-names {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.missing-email-name {
    font: inherit;
    font-weight: 600;
    padding: 2px 10px;
    background: var(--warning-chip);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
    border-radius: 999px;
    cursor: pointer;
}
.missing-email-name:hover,
.missing-email-name:focus-visible { background: var(--warning-bg); }
.occ-source { font-style: italic; opacity: 0.75; cursor: help; }
.staffing-add { margin-top: 6px; width: 100%; font-size: 12px; padding: 3px; }
.occ-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 0.5rem; }
.occ-table th, .occ-table td { border: 1px solid var(--border); padding: 4px 8px; text-align: center; }
.occ-table th:first-child, .occ-table td:first-child { text-align: left; }
.occ-table summary { cursor: pointer; }
.occ-detail { margin: 4px 0 4px 1rem; padding: 0; font-size: 12px; color: var(--text-secondary); }
.occ-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 2px; font-size: 13px; }
.occ-toolbar label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.occ-spacer { flex: 1 1 auto; }
.occ-type { color: var(--text-secondary); }
.occ-note { font-size: 12px; color: var(--text-secondary); margin: 6px 0 0; }
.occ-tenure { font-size: 11px; color: var(--text-secondary); }
.occ-trend-up { color: var(--warning-strong); cursor: help; }
.occ-trend-down { color: var(--success); cursor: help; }
.mark-req-hint { margin-top: 8px; font-size: 12.5px; background: var(--warning-bg-soft); border: 1px solid var(--warning-border); color: var(--warning-text); border-radius: 6px; padding: 6px 10px; }
.mark-ncns { display: flex; align-items: center; gap: 6px; }
/* PTO balance display (PTO Balances tab, maintained from Paycor) */
.pto-balance-banner { margin: 0 0 12px; padding: 8px 12px; background: var(--info-light); border: 1px solid var(--info-border); color: var(--info); border-radius: 8px; font-size: 13.5px; }
.pto-balance-banner .pto-chip { margin-right: 10px; white-space: nowrap; }
.pto-asof { color: var(--text-secondary); font-size: 12px; margin-left: 4px; }
.pto-asof.pto-stale { color: var(--warning-strong); font-weight: 600; }
.request-balance { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }
.mark-type-legend { font-size: 12px; color: var(--text-secondary); margin: -4px 0 10px; }
.pto-panel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: var(--info-light); border: 1px solid var(--info-border); border-radius: 8px; font-size: 13px; color: var(--info); }
.pto-panel-hint { font-size: 12px; color: var(--text-secondary); }
.pto-panel .pto-stale { color: var(--warning-strong); font-weight: 600; }
/* Per-day defaults grid (Edit Employee modal) */
.emp-day-row { display: flex; align-items: center; gap: 10px; }
.emp-day-off-label { display: flex; align-items: center; gap: 4px; font-size: 12.5px; white-space: nowrap; }
.emp-day-office { flex: 0 0 118px; font-size: 12.5px; }
/* Recurring-day-off chips in Build the Month (removable, unlike PTO) */
.bm-chip.recurring { background: var(--warning-bg-soft); color: var(--warning-text); border-color: var(--warning-border); }
.month-cell-outside {
    background: #f8fafc;
    color: var(--text-tertiary);
}
.month-cell-outside .month-cell-date {
    color: var(--text-tertiary);
}
.month-cell-today .month-cell-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mohs-primary);
    color: #fff;
    border-radius: 50%;
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.75rem;
    font-weight: 700;
}
.month-cell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}
.month-cell-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.month-cell-holiday {
    font-size: 0.65rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}
.month-cov {
    font-size: 0.85rem;
    line-height: 1;
}
.month-cov.ok {
    color: var(--success);
}
.month-cov.gap {
    color: var(--highlight-border);
}
/* Day cell split into two office sub-columns (Mohs left, Derm right).
   Office is conveyed by the column position + subtle background tint;
   chip color encodes the role. */
.month-cell-offices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem;
}
.month-cell-office {
    border-radius: 3px;
    padding: 0.1rem 0.2rem 0.2rem;
    min-height: 50px;
}
.month-cell-office.mohs {
    background: rgba(37, 99, 235, 0.05);
    border-left: 2px solid rgba(37, 99, 235, 0.35);
}
.month-cell-office.derm {
    background: rgba(22, 163, 74, 0.05);
    border-left: 2px solid rgba(22, 163, 74, 0.35);
}
.month-cell-office.leadership {
    background: rgba(13, 148, 136, 0.05);
    border-left: 2px solid rgba(13, 148, 136, 0.35);
}
.month-cell-office-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    line-height: 1;
    padding: 0.15rem 0 0.2rem 0.15rem;
}
.month-cell-office.mohs .month-cell-office-label {
    color: var(--mohs-primary);
    opacity: 0.7;
}
.month-cell-office.derm .month-cell-office-label {
    color: var(--derm-primary);
    opacity: 0.7;
}
.month-cell-office.leadership .month-cell-office-label {
    color: var(--leadership-primary);
    opacity: 0.7;
}
.month-cell-office-chips {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.month-chip {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.08rem 0.25rem 0.08rem 0.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: 3px;
    color: var(--text);
    line-height: 1.25;
    white-space: normal;
    min-width: 0;
}
.month-chip-name {
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}
.month-chip-time {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
/* Off-normal shift hours: late/different arrival or early departure.
   Same amber as the "late" deadline warning so the cue reads consistently.
   Placed after .month-chip-time / .cell-shift so it wins on color. */
.time-modified {
    color: var(--warning-strong);
    font-weight: 600;
}

/* Role color palette — applied as a left border on the chip so the
   chip body stays neutral and readable at small sizes. Colors come
   from the --role-* tokens in :root (shared with the legend below). */
.month-chip.role-provider,    .month-legend-swatch.role-provider    { border-left-color: var(--role-provider); }
.month-chip.role-leadership,  .month-legend-swatch.role-leadership  { border-left-color: var(--role-leadership); }
.month-chip.role-manager,     .month-legend-swatch.role-manager     { border-left-color: var(--role-manager); }
.month-chip.role-coordinator, .month-legend-swatch.role-coordinator { border-left-color: var(--role-coordinator); }
.month-chip.role-leadma,      .month-legend-swatch.role-leadma      { border-left-color: var(--role-leadma); }
.month-chip.role-schedma,     .month-legend-swatch.role-schedma     { border-left-color: var(--role-schedma); }
.month-chip.role-ma,          .month-legend-swatch.role-ma          { border-left-color: var(--role-ma); }
.month-chip.role-malab,       .month-legend-swatch.role-malab       { border-left-color: var(--role-malab); }
.month-chip.role-reception,   .month-legend-swatch.role-reception   { border-left-color: var(--role-reception); }
.month-chip.role-iv,          .month-legend-swatch.role-iv          { border-left-color: var(--role-iv); }
.month-chip.role-lab,         .month-legend-swatch.role-lab         { border-left-color: var(--role-lab); }
.month-chip.role-trainer,     .month-legend-swatch.role-trainer     { border-left-color: var(--role-trainer); }
.month-chip.role-project,     .month-legend-swatch.role-project     { border-left-color: var(--role-project); }
.month-chip.role-other       { border-left-color: var(--role-other); }

/* Role color legend at the top of the month view */
.month-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0.65rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.month-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.month-legend-swatch {
    width: 0.85rem;
    height: 0.6rem;
    border-radius: 2px;
    border-left: 3px solid var(--border-strong);
    background: var(--surface);
}
/* (Legend swatch role colors are defined with the chip rules above —
   one source, two consumers.) */

/* Print layout: landscape, hide everything except the month grid */
@media print {
    @page {
        size: landscape;
        margin: 0.4in;
    }
    body * { visibility: hidden; }
    #month-view, #month-view * { visibility: visible; }
    .month-header .month-nav button,
    .month-header .month-actions { display: none !important; }
    .month-grid-wrapper {
        position: absolute;
        top: 0; left: 0;
        width: 100%;
        border: none;
        padding: 0;
    }
    .month-cell {
        min-height: 0;
        height: auto;
        padding: 0.15rem 0.2rem;
        page-break-inside: avoid;
    }
    .month-chip {
        background: #fff;
        border-color: #ccc;
        font-size: 0.6rem;
        padding: 0.04rem 0.15rem 0.04rem 0.2rem;
    }
    /* A measured week row runs ~450px vs. the ~739px usable on a
       landscape page, so an unconstrained break was landing mid-week —
       one row's shifts split across two pages. Keeping a whole <tr>
       together moves the break to a week boundary instead. */
    .month-grid tbody tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ---------- STAFFING MINIMUMS PANEL ---------- */
.staffing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}
.staffing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 0.9rem;
}
.staffing-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.staffing-table {
    width: 100%;
    border-collapse: collapse;
}
.staffing-table tr + tr td {
    border-top: 1px solid var(--border);
}
.staffing-role {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text);
}
.staffing-count {
    padding: 0.4rem 0;
    text-align: right;
    width: 80px;
}
.staffing-input {
    width: 60px;
    padding: 0.3rem 0.4rem;
    text-align: center;
}
.staffing-hint {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---------- BULK MARK-DAY-OFF DIALOG ----------
   (Overlay + modal chrome shared with the edit modal — see
   "MODALS (shared base)" above.) */
.bulk-off-modal .edit-modal-body {
    gap: 0.9rem;
}
.bulk-off-preview {
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.bulk-off-preview .preview-stat {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.bulk-off-preview .preview-stat strong {
    font-weight: 600;
}
.bulk-off-preview .preview-overwrites {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.bulk-off-preview .preview-warning {
    color: var(--warning-text);
}

/* ---------- COVERAGE DASHBOARD ---------- */
.coverage-all-clear {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--derm-light);
    border: 1px solid var(--derm-border);
    border-radius: var(--radius);
    color: var(--derm-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.coverage-check {
    font-size: 1.2rem;
    font-weight: 700;
}

.coverage-office {
    margin-bottom: 0.75rem;
}

.coverage-office-header {
    margin-bottom: 0.4rem;
}

.coverage-day {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
}

.coverage-day-label {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.coverage-gap {
    margin-bottom: 0.4rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--danger);
}

.coverage-gap-role {
    font-size: 0.85rem;
    color: var(--danger);
    display: block;
    margin-bottom: 0.25rem;
}

.coverage-available {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.coverage-available-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.coverage-no-available {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ==========================================================
   PHASE 5: NOTIFICATIONS, CALENDAR EXPORT, TEMPLATES
   ========================================================== */

/* ---------- NOTIFICATION BELL ---------- */
.notif-bell-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s;
}
.notif-bell-btn:hover {
    background: var(--bg);
}

.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* ---------- NOTIFICATION PANEL ---------- */
.notif-panel {
    position: fixed;
    z-index: 950;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.notif-mark-read {
    font-size: 0.75rem !important;
}

.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.notif-list {
    padding: 0.25rem 0;
}

.notif-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item:hover {
    background: var(--bg);
}

.notif-unread {
    background: #eff6ff;
}

.notif-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 0.8rem;
    font-weight: 600;
}

.notif-item-body {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.notif-permission {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ---------- CALENDAR EXPORT ---------- */
.export-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.export-icon {
    font-size: 1rem;
}

.export-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.day-export-links {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
}

.btn-export-day {
    font-size: 0.7rem;
    color: var(--mohs-primary);
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.btn-export-day:hover {
    background: var(--mohs-light);
}

/* ---------- TEMPLATE CONTROLS ---------- */
.template-bar {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.template-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.template-apply {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.template-select {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    max-width: 200px;
}

/* ---------- RESPONSIVE ADJUSTMENTS ---------- */
@media (max-width: 768px) {
    .notif-panel {
        width: calc(100vw - 2rem);
        right: 1rem !important;
    }

    .export-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .template-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Accessibility: focus-visible styles */
.btn:focus-visible, .tab:focus-visible, .btn-icon:focus-visible,
.cell-editable:focus-visible, select:focus-visible, .bm-emp-link:focus-visible {
    outline: 2px solid var(--mohs-primary);
    outline-offset: 2px;
}

/* ==========================================================
   FEATURE 1: PRINT SCHEDULE
   ========================================================== */

.btn-print-schedule {
    gap: 0.3rem;
}

.print-icon {
    font-size: 1rem;
}

/* @media print — hide everything except the print view */
@media print {
    .app-header,
    .view-tabs,
    .app-footer,
    .toast-container,
    .loading-overlay,
    #login-screen,
    #export-controls,
    #print-btn-container,
    .team-controls,
    .daily-summary-container,
    #template-controls,
    #coverage-dashboard,
    #pattern-builder-container,
    #active-patterns-list {
        display: none !important;
    }

    .app-content {
        padding: 0;
    }

    .team-grid-wrapper {
        overflow: visible;
    }

    .team-grid {
        min-width: auto;
        font-size: 9px;
    }

    .team-grid th,
    .team-grid td {
        padding: 3px 4px;
    }
}

/* ==========================================================
   FEATURE 3: SWAP REQUESTS
   ========================================================== */

.swap-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 600px;
}

.swap-request-cards {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.swap-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    transition: box-shadow 0.15s;
}

.swap-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.swap-card.swap-needs-action {
    border-left: 4px solid var(--highlight-border);
    background: var(--warning-bg-soft);
}

.swap-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.swap-direction {
    font-size: 0.85rem;
    font-weight: 500;
}

.swap-participants {
    font-size: 0.85rem;
}

.swap-card-details {
    font-size: 0.85rem;
}

.swap-shift-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.swap-shift-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.swap-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.swap-arrow-icon {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.swap-reason {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px dashed var(--border);
}

.swap-meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.3rem;
    font-size: 0.75rem;
}

.swap-check {
    color: var(--success);
    font-weight: 500;
}

.swap-pending-label {
    color: var(--text-secondary);
}

.swap-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

/* ==========================================================
   FEATURE 4: RECURRING PATTERNS
   ========================================================== */

.pattern-builder {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    max-width: 700px;
}

.pattern-builder-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.pattern-day-grid {
    margin-top: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.pattern-grid-header {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pattern-grid-header span:first-child {
    min-width: 80px;
}

.pattern-day-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-top: 1px solid var(--border);
}

.pattern-day-label {
    font-weight: 500;
    font-size: 0.85rem;
    min-width: 80px;
}

.pattern-day-fields {
    display: flex;
    gap: 0.4rem;
    flex: 1;
    flex-wrap: wrap;
}

.pattern-select {
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    min-width: 100px;
}

.pattern-builder-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.pattern-preview {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.pattern-preview-header {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.pattern-preview-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.pattern-preview-chip {
    display: inline-block;
    font-size: 0.7rem;
    background: var(--mohs-light);
    color: var(--mohs-primary);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Active Patterns List */
.pattern-cards {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pattern-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--mohs-primary);
}

.pattern-card.pattern-paused {
    border-left-color: var(--border-strong);
    opacity: 0.7;
}

.pattern-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.pattern-card-body {
    font-size: 0.85rem;
}

.pattern-info-row {
    margin-bottom: 0.15rem;
}

.pattern-info-row span:first-child {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-right: 0.3rem;
}

.pattern-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* ==========================================================
   RESPONSIVE: NEW FEATURES
   ========================================================== */
@media (max-width: 768px) {
    .swap-form {
        max-width: 100%;
    }

    .swap-shift-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .pattern-builder {
        max-width: 100%;
    }

    .pattern-day-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .pattern-day-fields {
        width: 100%;
    }

    .pattern-select {
        flex: 1;
        min-width: 80px;
    }

}


/* ============================================================
   GOOGLE WORKSPACE SYNC STYLES
   ============================================================ */

.sync-controls {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.sync-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.sync-icon {
    font-size: 1.2rem;
}

.sync-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.sync-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.sync-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sync-actions .form-group {
    margin-bottom: 0;
}

.sync-actions input[type="email"] {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

/* Sync Results */
.sync-results {
    margin-top: 1rem;
}

.sync-banner {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.sync-banner-ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.sync-banner-action {
    background: var(--warning-bg-soft);
    color: var(--warning-text);
    border: 1px solid var(--warning-chip);
}

.sync-error {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid var(--danger-border);
    font-size: 0.85rem;
}

.sync-section {
    margin-bottom: 1rem;
}

.sync-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.sync-section-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.sync-member-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sync-member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    gap: 0.75rem;
}

.sync-new {
    border-left: 3px solid var(--mohs-primary);
    background: #f8fafc;
}

.sync-removed {
    border-left: 3px solid #ef4444;
    background: #fefce8;
}

/* A group account already linked to a pending roster entry */
.sync-linked {
    border-left: 3px solid #16a34a;
    background: #f0fdf4;
}

/* Fuzzy-match suggestion card: candidate radios below the account */
.sync-suggest {
    align-items: flex-start;
}

.sync-suggest-candidates {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.sync-suggest-candidate {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Action stack on member cards (Add plus link controls) */
.sync-member-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.sync-link-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.sync-link-select {
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    max-width: 260px;
}

.sync-member-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sync-member-info strong {
    font-size: 0.9rem;
}

.sync-member-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sync-matched-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sync-matched-chip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: #f1f5f9;
    font-size: 0.8rem;
    color: var(--text);
    border: 1px solid #e2e8f0;
}

/* Substitution gap rows */
.coverage-reason {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.2rem 0;
}

.coverage-suggested {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
    font-size: 0.95rem;
}

.coverage-apply-btn,
.coverage-manual-btn {
    margin-left: auto;
}

.spare-tag {
    font-size: 0.8rem;
    color: var(--derm-primary);
    background: var(--derm-light);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}

/* Spare-MA pill (Team Schedule cells) */
.spare-pill {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    line-height: 1.3;
}

.spare-pill-empty {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px dashed var(--warning-border);
}

.spare-pill-empty:hover {
    background: var(--warning-chip);
}

.spare-pill-filled {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #10b981;
}

/* ---------- BUILD MONTH PAGE ---------- */
.bm { background: var(--surface); color: var(--text);
      border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.bm-top { display: flex; align-items: center; justify-content: space-between;
          padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--bg); }
.bm-step { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; }
.bm-top-right { display: flex; align-items: center; gap: 12px; }
.bm-range { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.bm-note { font-size: 12.5px; color: var(--text); background: #eff6ff;
           border-bottom: 1px solid #dbeafe; padding: 9px 18px; }
.bm-headrow, .bm-row {
    display: grid;
    grid-template-columns: 34px 1.4fr 1.1fr 1.2fr 0.9fr auto 2fr;
    gap: 10px; align-items: center; padding: 8px 18px;
    font-size: 13px; border-top: 1px solid var(--border); }
.bm-hd { font-size: 10.5px; font-weight: 700; color: var(--text-tertiary);
         text-transform: uppercase; letter-spacing: .04em; }
.bm-grp { font-size: 11px; font-weight: 800; letter-spacing: .05em;
          color: var(--text-tertiary); text-transform: uppercase;
          padding: 12px 18px 6px; }
.bm-grp.mohs { color: var(--mohs-primary); }
.bm-grp.derm { color: var(--derm-primary); }
.bm-grp.leadership { color: var(--leadership-primary); }
.bm-row.off { opacity: .45; }
.bm-tgl { width: 34px; height: 20px; border-radius: 20px; background: var(--success);
          position: relative; cursor: pointer; flex-shrink: 0; }
.bm-tgl::after { content: ""; position: absolute; top: 2px; right: 2px;
                 width: 16px; height: 16px; border-radius: 50%; background: var(--surface); }
.bm-tgl.no { background: var(--border-strong); }
.bm-tgl.no::after { right: auto; left: 2px; }
.bm-nm { font-weight: 600; }
/* Click-the-name-to-edit affordance — looks like the text but is
   a button so keyboard users can tab to it and Enter-activate. */
.bm-emp-link {
    background: none; border: none; padding: 0; margin: 0;
    font: inherit; color: inherit; text-align: left;
    cursor: pointer;
}
.bm-emp-link:hover, .bm-emp-link:focus { text-decoration: underline; }
.bm-fld { padding: 5px 8px; font-size: 12.5px; }
.bm-doff { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bm-chip { font-size: 11.5px; padding: 3px 8px; border-radius: 20px;
           background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger-border); }
.bm-chip.pto { background: var(--info-light); color: var(--info); border-color: var(--info-border); cursor: not-allowed; }
.bm-chip-x { margin-left: 5px; opacity: .6; cursor: pointer; }
.bm-add-off { font-size: 11.5px; color: var(--mohs-primary);
              border: 1px dashed #93c5fd; border-radius: 20px;
              padding: 3px 9px; background: var(--surface); cursor: pointer; }
.bm-bottom { position: sticky; bottom: 0; display: flex;
             align-items: center; justify-content: space-between; gap: 14px;
             padding: 14px 18px; border-top: 1px solid var(--border); background: var(--bg); }
.bm-summary { font-size: 12.5px; color: var(--text); }
.bm-warn { font-size: 12px; color: var(--warning-text); background: var(--warning-bg-soft);
           border: 1px solid var(--warning-chip); border-radius: 7px;
           padding: 5px 9px; margin-top: 6px; display: inline-block; }
.bm-build { padding: 11px 20px; font-size: 14px; font-weight: 700; }
.bm-build:disabled { opacity: .5; cursor: not-allowed; }

/* Small inline "language" badge next to employee names — currently
   only Spanish, but the .lang-badge class is generic so other tags
   (e.g. ASL, Vietnamese) can join without new CSS. */
.lang-badge {
    display: inline-block;
    font-size: 0.65rem;
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info-border);
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 4px;
    vertical-align: 1px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Build Month / Edit Employee — "Languages" subsection looks like the
   capabilities grid, just a single row by default. */
.emp-langs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.25rem;
}

/* ---------- MONTH VIEW: per-day "Off:" line ---------- */
.month-cell-off {
    margin-top: 0.25rem;
    padding: 0.1rem 0.25rem;
    font-size: 0.62rem;
    line-height: 1.25;
    color: var(--text-tertiary);
    background: transparent;
    border-top: 1px dashed var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.month-cell-off-label {
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: 0.55rem;
    color: var(--text-tertiary);
    margin-right: 0.2rem;
}
@media print {
    .month-cell-off { border-color: #ccc; color: #555; }
}

/* ── Edit Employee: start-time overrides ── */
.emp-disclosure-btn {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--mohs-primary); font: inherit; text-align: left;
}
.emp-starts { margin-top: 8px; display: grid; gap: 6px; }
.emp-start-row { display: flex; align-items: center; gap: 10px; }
.emp-start-day { width: 38px; font-weight: 600; }
.emp-start-input { flex: 0 0 120px; }

/* ── Build Month: per-weekday start-time expander ── */
.bm-starts-wrap { position: relative; display: inline-flex; align-items: center; }
.bm-starts-toggle { background: none; border: 1px solid var(--border, #d1d5db); border-radius: 6px; cursor: pointer; padding: 2px 6px; }
.bm-starts { position: absolute; top: 100%; left: 0; z-index: 20; background: var(--surface);
    border: 1px solid var(--border, #d1d5db); border-radius: 8px; padding: 8px; display: grid; gap: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.bm-start-row { display: flex; align-items: center; gap: 6px; }
.bm-start-row span { width: 34px; font-weight: 600; }
.bm-start-input { width: 100px; }

/* ==========================================================
   UTILITIES
   Small single-purpose classes that replaced the inline
   style="…" attributes scattered through templates — required
   for the strict CSP (style-src without 'unsafe-inline').
   ========================================================== */
/* Hidden-by-default elements. JS may still show/hide via
   el.style.display = '…' (the inline property wins over this
   class) or via classList.toggle('hidden', …). */
.hidden { display: none; }
.section-gap { margin-top: 1rem; }
/* Collapsed-by-default wrapper for the legacy week-by-week tools on
   Team Schedule (Template Controls, Recurring Patterns) — same muted
   heading look as .section-title, plus the pointer cursor a <summary>
   needs since it's the click target. */
.adv-week-tools > summary {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-secondary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.adv-week-tools[open] > summary { margin-bottom: 0.75rem; }
.mt-sm { margin-top: 0.5rem; }
.form-group-grow { flex: 1; min-width: 200px; }
.noscript-msg { text-align: center; padding: 2rem; }

/* Schedule views */
.today-flag { color: var(--mohs-primary); }
.no-assignment { color: var(--text-secondary); }
.team-grid thead th.th-today { background: var(--mohs-light); }
.cell-note { font-style: italic; }

/* ==========================================================
   BUILD-FAILURE RECOVERY MODAL
   Blocking dialog for the worst case: Build Month died inside
   the destructive sheet rewrite. Styled via classes (not inline)
   so it works under the strict CSP.
   ========================================================== */
.build-failure-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.build-failure-modal {
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 30rem;
    width: 100%;
    box-shadow: var(--shadow-modal);
    font-size: 14px;
    line-height: 1.5;
}
.build-failure-modal p { margin: 0 0 0.75rem; }
.build-failure-modal code {
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
.build-failure-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--warning-text);
    margin-bottom: 0.5rem;
}
.build-failure-steps {
    margin: 0 0 1.25rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}
.build-failure-noconfig { color: var(--text-secondary); }
.build-failure-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================
   BUILD MONTH: SMALL SCREENS
   The 7-column grid can't fit a phone; let the page scroll
   horizontally instead of clipping, and tighten the row gutters.
   ========================================================== */
@media (max-width: 768px) {
    .build-month-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .bm { min-width: 640px; }
    .bm-headrow, .bm-row {
        gap: 6px;
        padding: 8px 10px;
    }
}
