/* Auto Break Roster — design system (front + admin) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Zen+Maru+Gothic:wght@500;700;900&display=swap');
@import url('modern-ui.css');

:root {
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
    --font-display: 'Zen Maru Gothic', 'Inter', -apple-system, sans-serif;
    --brand: #0b1220;
    --brand-soft: #151f33;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.45);
    --accent-soft: #dbeafe;
    --violet: #6366f1;
    --surface: #ffffff;
    --surface-2: #f4f7fb;
    --glass: rgba(255, 255, 255, 0.78);
    --border: #e2e8f0;
    --border-subtle: rgba(15, 23, 42, 0.06);
    --text: #0f172a;
    --text-muted: #64748b;
    --risk: #dc2626;
    --risk-soft: #fef2f2;
    --ok: #059669;
    --ok-soft: #ecfdf5;
    --warn: #d97706;
    --warn-soft: #fffbeb;
    --radius: 1.125rem;
    --radius-sm: 0.75rem;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 0 0 1px var(--border-subtle);
    --shadow: 0 8px 30px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--border-subtle);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.14), 0 0 0 1px var(--border-subtle);
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* Utilities (no Tailwind CDN required) */
.hidden { display: none !important; }
.no-print { }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2\.5 { gap: 0.625rem; }
.w-full { width: 100%; }
.w-fit { width: fit-content; }
.min-w-0 { min-width: 0; }
.min-h-screen { min-height: 100vh; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-auto { margin-left: auto; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.italic { font-style: italic; }
.leading-tight { line-height: 1.25; }
.shrink-0 { flex-shrink: 0; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-900 { color: #0f172a; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-blue-700 { color: #1d4ed8; }
.text-green-700 { color: #15803d; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-amber-100 { background-color: #fef3c7; }
.text-amber-800 { color: #92400e; }
.bg-orange-100 { background-color: #ffedd5; }
.text-orange-800 { color: #9a3412; }
.bg-blue-100 { background-color: #dbeafe; }
.text-blue-800 { color: #1e40af; }
.border-red-200 { border-color: #fecaca; }
.border-slate-200 { border-color: #e2e8f0; }
.underline { text-decoration: underline; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.block { display: block; }
.grid { display: grid; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.border { border-width: 1px; }
.text-center { text-align: center; }
.whitespace-nowrap { white-space: nowrap; }
.word-break-all { word-break: break-all; }
.divide-y > * + * { border-top: 1px solid var(--border); }
.divide-slate-100 > * + * { border-top-color: #f1f5f9; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }

.admin-clock-desktop { display: none; }
@media (min-width: 640px) {
    .admin-clock-desktop { display: inline; }
    .sm\:inline { display: inline !important; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:col-span-2 { grid-column: span 2 / span 2; }
}

.form-grid {
    display: grid;
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid .span-2 { grid-column: span 2; }
}

.kanban-board {
    display: grid;
    gap: 1rem;
}
@media (min-width: 640px) {
    .kanban-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .kanban-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

#break-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
}
.fixed { position: fixed; }
.inset-x-0 { left: 0; right: 0; }
.z-40 { z-index: 40; }

body {
    font-family: var(--font);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
    color: white;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 22px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-dark {
    background: var(--brand);
    color: white;
}
.btn-dark:hover:not(:disabled) { background: var(--brand-soft); }

.btn-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }

.btn-outline {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover:not(:disabled) { background: var(--surface-2); }

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
    font-weight: 700;
    border: none;
}

.btn-sm { font-size: 0.75rem; padding: 0.4rem 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.btn-icon { padding: 0.55rem 0.65rem; min-width: 2.5rem; }

/* ── Forms ── */
.input, .select, textarea.input {
    font-family: var(--font);
    font-size: 0.875rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus, textarea.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-dark {
    background: var(--brand-soft);
    border-color: #334155;
    color: white;
}
.input-dark:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25); }

/* ── Cards & panels ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.premium-card {
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.premium-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.panel-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* ── Front shell ── */
.front-shell { min-height: 100vh; }

.front-header {
    background: linear-gradient(135deg, #0b1220 0%, #1a2744 45%, #0f1a2e 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.front-header-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.front-brand h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.front-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}

.front-clock {
    font-size: 0.7rem;
    color: #cbd5e1;
    font-weight: 500;
    margin-top: 0.35rem;
}

.front-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.front-main {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
}

/* ── Admin shell ── */
.admin-shell {
    display: flex;
    min-height: 100vh;
    background: var(--surface-2);
}

.admin-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-sidebar nav {
    flex: 0 0 auto;
    padding: 0.5rem;
    overflow-y: visible;
}

.admin-sidebar-footer {
    padding: 0.75rem 0.5rem 0.35rem;
    margin-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar {
    width: 15rem;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--brand) 0%, #0c1222 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.admin-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}

.admin-brand h1 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.admin-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.admin-nav-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: white;
}

.admin-nav-active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.28), rgba(99, 102, 241, 0.12)) !important;
    color: white !important;
    box-shadow: inset 3px 0 0 var(--accent), 0 4px 16px rgba(0, 0, 0, 0.15);
}

.admin-nav-icon { font-size: 1rem; width: 1.25rem; text-align: center; }

.admin-topbar {
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-workflow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.workflow-step {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.workflow-step.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: #93c5fd;
}

.workflow-step.done {
    background: var(--ok-soft);
    color: var(--ok);
    border-color: #6ee7b7;
}

.workflow-num {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: currentColor;
    color: white;
    font-size: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

.workflow-step.active .workflow-num,
.workflow-step.done .workflow-num {
    background: currentColor;
    color: white;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    max-width: 36rem;
}

/* ── Dashboard stats ── */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.dash-stat {
    background: linear-gradient(160deg, #fff, #f8fafc);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.dash-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.dash-stat .val {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.dash-stat .lbl {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.dash-stat-link {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.week-publish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
    gap: 0.5rem;
}
.week-publish-cell {
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    background: #fff;
    font-size: 0.75rem;
}
.week-publish-cell--published { border-color: #86efac; background: #f0fdf4; }
.week-publish-cell--draft { border-color: #fde68a; background: #fffbeb; }
.week-publish-cell--none { border-color: #e2e8f0; background: #f8fafc; color: #94a3b8; }
.week-publish-date { font-weight: 700; font-size: 0.68rem; }
.week-publish-status { font-weight: 600; margin-top: 0.15rem; }

/* Admin topbar — week publish quick view */
.roster-week-publish-bar {
    flex: 1 1 100%;
    min-width: 0;
}
@media (min-width: 900px) {
    .roster-week-publish-bar {
        flex: 1 1 auto;
        max-width: 36rem;
    }
}
.roster-week-publish-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.roster-week-publish-legend {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
}
.roster-week-legend-item::before {
    content: '';
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    margin-right: 0.25rem;
    vertical-align: middle;
}
.roster-week-legend-item--published::before { background: #22c55e; }
.roster-week-legend-item--draft::before { background: #f59e0b; }
.roster-week-legend-item--none::before { background: #cbd5e1; }
.roster-week-legend-item--imported::before { background: #93c5fd; }
.roster-week-day--imported-only {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}
.roster-week-day--imported-only .roster-week-day-status {
    color: #2563eb;
    font-weight: 800;
}
.roster-week-publish-days--calendar .iwc-brand-bar {
    width: 100%;
    margin: 0.08rem 0;
}
.roster-week-publish-days {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.roster-week-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 2.35rem;
    padding: 0.2rem 0.35rem 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    background: #f8fafc;
    font-size: 0.62rem;
    line-height: 1.15;
    cursor: pointer;
    color: #475569;
}
.roster-week-day:hover { background: #f1f5f9; }
.roster-week-day--active {
    box-shadow: 0 0 0 2px #3b82f6;
    border-color: #93c5fd;
}
.roster-week-day--published { border-color: #86efac; background: #f0fdf4; color: #166534; }
.roster-week-day--draft { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.roster-week-day--none { color: #94a3b8; }
.roster-week-day-dow { font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.roster-week-day-date { font-variant-numeric: tabular-nums; }
.roster-week-day-dot {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    margin-top: 0.1rem;
    background: #cbd5e1;
}
.roster-week-day--published .roster-week-day-dot { background: #22c55e; }
.roster-week-day--draft .roster-week-day-dot { background: #f59e0b; }
.roster-week-day--stale { border-color: #fdba74; background: #fff7ed; color: #c2410c; }
.roster-week-day--stale .roster-week-day-status { color: #ea580c; font-weight: 800; }

/* Roster panel — airline-style week calendar */
.roster-week-calendar {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.roster-week-publish-inner--calendar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}
.roster-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.roster-cal-nav-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #334155;
}
.roster-cal-nav-btn:hover { background: #f1f5f9; }
.roster-cal-week-label { font-size: 0.8rem; color: #475569; }
.roster-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 0.68rem;
    font-weight: 600;
}
.roster-week-publish-days--calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}
.roster-week-publish-days--calendar .roster-week-day {
    min-width: 0;
    padding: 0.45rem 0.25rem 0.5rem;
    font-size: 0.65rem;
}
.roster-week-day-status {
    font-size: 0.75rem;
    line-height: 1;
    margin-top: 0.1rem;
    font-weight: 700;
}
.roster-week-day-meta {
    font-size: 0.58rem;
    color: #64748b;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.roster-week-day--published .roster-week-day-status { color: #16a34a; }
.publish-sync-sub { opacity: 0.85; font-weight: 500; }

.snap-compare-result.hidden { display: none; }

.dash-stat-link:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.status-pill.ok { background: var(--ok-soft); color: var(--ok); }
.status-pill.warn { background: var(--warn-soft); color: var(--warn); }
.status-pill--ok { background: var(--ok-soft); color: var(--ok); }
.status-pill--warn { background: var(--warn-soft); color: var(--warn); }
.status-pill--muted { background: #e2e8f0; color: #475569; }

/* ── Learning hub — AI insights & batch tools ── */
.learning-insights { background: #f5f3ff; border-color: #ddd6fe; }
.learning-rec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.learning-rec {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.35;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    background: #fff;
    border-left: 3px solid #cbd5e1;
}
.learning-rec.rec-high { border-left-color: #dc2626; background: #fef2f2; }
.learning-rec.rec-medium { border-left-color: #d97706; background: #fffbeb; }
.learning-rec.rec-low { border-left-color: #64748b; }
.learning-rec-badge {
    flex: 0 0 auto;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: #334155;
}
.learning-rec.rec-high .learning-rec-badge { background: #dc2626; color: #fff; }
.learning-rec.rec-medium .learning-rec-badge { background: #d97706; color: #fff; }
.learning-weekday-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.learning-weekday-cell {
    flex: 1 1 0;
    min-width: 3rem;
    text-align: center;
    padding: 0.4rem 0.3rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
}
.learning-weekday-name { font-size: 0.7rem; font-weight: 700; color: #475569; }
.learning-weekday-val { font-size: 0.9rem; }
.learning-row-selected { background: #eff6ff !important; }
.btn-danger { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: #fff; border: none; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Auto-save & draft ── */
.autosave-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    transition: opacity 0.2s;
}

.autosave-pending { background: #fef3c7; color: #92400e; }
.autosave-saving { background: #e0e7ff; color: #3730a3; animation: autosave-pulse 1s infinite; }
.autosave-saved { background: #d1fae5; color: #065f46; }
.autosave-error { background: #fee2e2; color: #991b1b; }

@keyframes autosave-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.import-draft-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    font-size: 0.8rem;
    color: #92400e;
}

.publish-sync-banner {
    position: relative;
    padding: 0.45rem 2rem 0.45rem 0.85rem;
    font-size: 0.78rem;
    line-height: 1.35;
    border-bottom: 1px solid transparent;
}

.publish-sync-dismiss {
    position: absolute;
    top: 0.2rem;
    right: 0.35rem;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.publish-sync-dismiss:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.06);
}

.publish-sync-warn {
    background: #fff7ed;
    border-bottom-color: #fdba74;
    color: #9a3412;
}

.publish-sync-ok {
    background: #ecfdf5;
    border-bottom-color: #a7f3d0;
    color: #047857;
}

.draft-badge {
    display: inline-block;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.draft-panel-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.draft-table-wrap {
    overflow-x: auto;
    max-height: 22rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.draft-table {
    width: 100%;
    font-size: 0.78rem;
    border-collapse: collapse;
}

.draft-table th {
    text-align: left;
    padding: 0.45rem 0.5rem;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    position: sticky;
    top: 0;
}

.draft-table td {
    padding: 0.35rem 0.4rem;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.input-sm {
    padding: 0.3rem 0.45rem;
    font-size: 0.78rem;
    min-width: 0;
}

.progress-wrap {
    height: 0.35rem;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0f172a, #334155);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.app-dialog {
    border: none;
    border-radius: var(--radius);
    padding: 1.25rem;
    max-width: 22rem;
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0,0,0,0.15));
}

.app-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.front-live-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #10b981;
    background: #ecfdf5;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.front-fade-update {
    animation: front-fade 0.35s ease;
}

@keyframes front-fade {
    from { opacity: 0.55; }
    to { opacity: 1; }
}

.kanban-board .mf-card,
.kanban-board > article,
.kanban-board > div {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* ── Dropzone ── */
.dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
    min-height: 11rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.dropzone.dragover {
    border-color: var(--accent);
    border-style: solid;
    background: var(--accent-soft);
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.dropzone.has-file {
    border-color: var(--ok);
    border-style: solid;
    background: var(--ok-soft);
    cursor: default;
    padding: 1.5rem;
}

.dropzone-state { width: 100%; }
.dropzone-state.hidden { display: none; }

.dropzone-icon { font-size: 2.5rem; margin-bottom: 0.5rem; line-height: 1; }
.dropzone-icon-pulse { animation: dropzone-bounce 0.6s ease infinite; }
.dropzone-headline { font-size: 0.95rem; color: var(--text); margin: 0; }
.dropzone-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0.35rem 0 0; }

.dropzone-file-icon { font-size: 2.75rem; margin-bottom: 0.35rem; }
.dropzone-file-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    word-break: break-all;
}
.dropzone-file-meta { font-size: 0.8rem; color: var(--text-muted); margin: 0.25rem 0 0.65rem; }

.dropzone-ready-badge {
    display: inline-block;
    background: var(--ok);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.65rem;
}

.dropzone-remove {
    display: inline-block;
    background: transparent;
    border: 1px solid #cbd5e1;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.dropzone-remove:hover { border-color: var(--risk); color: var(--risk); }

@keyframes dropzone-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ── Intel strip ── */
.intel-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.intel-card {
    background: linear-gradient(160deg, #fff 0%, #f1f5f9 100%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    padding: 1rem 0.75rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
}

.intel-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.intel-card .value {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.03em;
}

.intel-card.risk .value {
    background: linear-gradient(135deg, #b91c1c, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
}

.intel-card.accent .value {
    background: linear-gradient(135deg, var(--accent), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
}

.intel-card .label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 0.35rem;
}


/* ── Break editor components ── */
.break-row {
    background: var(--surface-2) !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid rgba(0,0,0,0.04);
}

/* Time inputs inside break rows — no `.input` class so width must be explicit */
.break-start, .break-end {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.825rem;
    width: 5.75rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.break-start:focus, .break-end:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-nudge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.1s;
    white-space: nowrap;
}

.btn-nudge:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-nudge:active {
    transform: scale(0.95);
}

.btn-delete-break {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid #fecaca;
    background: transparent;
    color: var(--risk);
    cursor: pointer;
    transition: background 0.12s;
}

.btn-delete-break:hover {
    background: #fee2e2;
}

.btn-add-break {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: color 0.12s;
}

.btn-add-break:hover {
    color: var(--accent);
}

.break-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Roster cards ── */
.roster-card {
    break-inside: avoid;
    border-radius: var(--radius);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.roster-card:hover {
    box-shadow: var(--shadow);
}

.roster-card.on-break-now::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--risk), #f97316);
}

.roster-card.cover-risk {
    border-color: #fecaca !important;
    box-shadow: 0 0 0 1px #fecaca;
}

.roster-card-status {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.roster-card-status.breaking {
    background: var(--risk-soft);
    color: var(--risk);
    animation: break-pulse-soft 2s ease-in-out infinite;
}

@keyframes break-pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.work-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.55rem;
    border-radius: 9999px;
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.work-chip.risk {
    background: var(--risk-soft);
    color: var(--risk);
}

.dept-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    background: #e0e7ff;
    color: #3730a3;
}

.dept-select {
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 0.4rem 0.55rem;
    min-height: 2.25rem;
}

.break-row {
    background: var(--surface-2) !important;
    border-radius: var(--radius-sm) !important;
}

/* ── Empty & skeleton ── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 24rem;
    margin: 2rem auto;
}

.empty-state-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }
.empty-state-actions { margin-top: 1.25rem; }

.skeleton-card {
    height: 11rem;
    border-radius: var(--radius);
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Loading & toast ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-card {
    background: var(--surface);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

#toast {
    position: fixed;
    bottom: calc(1rem + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 55;
    max-width: 24rem;
    width: calc(100% - 2rem);
    padding: 0.85rem 1.1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: toast-in 0.35s var(--ease-spring);
    backdrop-filter: blur(8px);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#toast.toast-error { background: var(--risk); color: white; }
#toast.toast-success { background: var(--ok); color: white; }
#toast.toast-info { background: var(--brand); color: white; }

/* ── Break alert banner ── */
#break-alert {
    background: linear-gradient(90deg, var(--risk), #ef4444);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
}

.break-alert-flash {
    animation: break-pulse 1.2s ease-in-out infinite;
}

@keyframes break-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.88; }
}

/* ── Security banner ── */
.security-banner {
    background: var(--warn-soft);
    border-bottom: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.8125rem;
    padding: 0.6rem 1.25rem;
}

/* ── Login ── */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--brand) 0%, #1e3a5f 50%, #0f172a 100%);
}

.login-card {
    width: 100%;
    max-width: 22rem;
    background: var(--surface);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ── Site access gate ── */
.site-access-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--brand) 0%, #1e3a5f 50%, #0f172a 100%);
}

.site-access-gate.hidden {
    display: none;
}

body.site-access-locked .mf-header,
body.site-access-locked .mf-list,
body.site-access-locked .front-header,
body.site-access-locked .front-main,
body.site-access-locked .admin-sidebar,
body.site-access-locked .admin-body,
body.site-access-locked .admin-tabbar {
    visibility: hidden;
}

.site-access-gate-card {
    width: 100%;
    max-width: 22rem;
    background: var(--surface);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.site-access-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}

.site-access-sub {
    font-size: 0.85rem;
    color: var(--muted, #64748b);
    margin: 0 0 1.25rem;
}

.site-access-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.site-access-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.site-access-input {
    width: 100%;
}

.site-access-error {
    font-size: 0.8rem;
    color: #b91c1c;
    margin: 0;
}

.site-access-submit {
    width: 100%;
    margin-top: 0.25rem;
}

/* ── Misc ── */
.print-only { display: none; }

.nav-active { background: var(--brand); color: white; }

/* ── Motion & reveals ── */
.reveal-item {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition:
        opacity 0.5s var(--ease-spring),
        transform 0.5s var(--ease-spring);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-item.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

::view-transition-old(roster-board),
::view-transition-new(roster-board) {
    animation-duration: 0.28s;
}

/* ── Data panel ── */
.data-panel-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.data-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 5.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.data-chip b {
    font-size: 1.25rem;
    color: var(--brand);
    line-height: 1.1;
}

.data-chip.active {
    border-color: #fde68a;
    background: #fffbeb;
}

.data-chip.active b { color: #b45309; }

.dropzone {
    background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
    border-color: #c7d2fe;
}

.dropzone.dragover,
.dropzone.has-file {
    border-color: var(--accent);
    background: linear-gradient(160deg, #eff6ff 0%, #e0e7ff 100%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

@media (max-width: 767px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .admin-sidebar nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem;
    }
    .admin-nav-btn { width: auto; font-size: 0.72rem; padding: 0.45rem 0.6rem; }
    .admin-nav-icon { display: none; }
    .intel-strip { grid-template-columns: repeat(3, 1fr); }
    .intel-card .value { font-size: 1.5rem; }
    .kanban-board { grid-template-columns: 1fr !important; }
    .front-header-inner { align-items: flex-start; }
}

@media (min-width: 768px) {
    .admin-main { padding: 1.5rem 1.75rem 2rem; }
}
