:root {
    color-scheme: light;
    --bg: #f6f7f4;
    --surface: #ffffff;
    --surface-strong: #16201c;
    --text: #18211d;
    --muted: #627067;
    --border: #d8dfd8;
    --accent: #0f766e;
    --accent-strong: #0b4f49;
    --focus: #eab308;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a { color: inherit; }

.site-header,
.site-footer,
.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 24px;
}

.brand {
    color: var(--surface-strong);
    font-weight: 800;
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-weight: 700;
}

.site-nav a { text-decoration: none; }

.page-shell {
    display: grid;
    gap: 24px;
    padding: 32px 0 64px;
}

.hero {
    padding: 44px 0 8px;
    max-width: 860px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1 {
    margin-bottom: 16px;
    color: var(--surface-strong);
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 0.95;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 8px;
    color: var(--surface-strong);
    font-size: 1.45rem;
    letter-spacing: 0;
}

.lede {
    color: var(--muted);
    font-size: 1.2rem;
    max-width: 620px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.button.secondary {
    background: var(--surface);
    color: var(--surface-strong);
}

.workspace-panel,
.status-panel {
    display: grid;
    gap: 12px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.home-status {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
}

.home-status strong {
    color: var(--accent-strong);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.status-dot.offline {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.text-button {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
}

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

.kpi-card,
.dashboard-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.kpi-card {
    padding: 18px;
}

.kpi-card span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.kpi-card strong {
    display: block;
    margin-top: 8px;
    color: var(--surface-strong);
    font-size: 2.4rem;
    line-height: 1;
}

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 18px;
}

.dashboard-panel {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    padding: 18px;
}

.dashboard-panel.wide {
    grid-row: span 2;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel-heading h2 {
    margin-bottom: 0;
}

.table-scroll {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table-scroll.compact {
    max-height: 260px;
}

.analytics-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.analytics-table th,
.analytics-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.analytics-table th {
    background: #eef3ef;
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
}

.analytics-table tr:last-child td {
    border-bottom: 0;
}

.empty-table {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.bar-list {
    display: grid;
    gap: 14px;
}

.bar-row {
    display: grid;
    gap: 8px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.bar-label strong {
    color: var(--surface-strong);
}

.bar-track {
    height: 12px;
    overflow: hidden;
    background: #e8eee9;
    border-radius: 999px;
}

.bar-track span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
}

.demand-summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.demand-summary strong {
    color: var(--surface-strong);
    font-size: 2.6rem;
    line-height: 1;
}

.demand-summary span {
    color: var(--muted);
    font-weight: 800;
}

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

.quick-link-grid a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    background: #f4f7f4;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent-strong);
    font-weight: 800;
    text-decoration: none;
}

.overview-page {
    --bg: #11161b;
    --surface: #1c2228;
    --surface-strong: #f8fafc;
    --text: #eef2f6;
    --muted: #9dacbc;
    --border: #333d48;
    --accent: #60a5fa;
    --accent-strong: #bfdbfe;
    background: #11161b;
}

.overview-page .site-header,
.overview-page .site-footer,
.overview-page .page-shell {
    width: min(1480px, calc(100% - 32px));
}

.overview-page .brand,
.overview-page .site-nav a,
.overview-page .site-footer {
    color: var(--text);
}

.management-overview,
.overview-grid,
.overview-machine-grid,
.machine-profile-grid,
.overview-load-list,
.overview-attention-list {
    display: grid;
    gap: 16px;
}

.overview-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    gap: 24px;
    align-items: end;
    padding-top: 18px;
}

.overview-hero h1 {
    margin-bottom: 12px;
    color: var(--surface-strong);
    font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.overview-status-card,
.overview-panel,
.overview-kpi-card,
.overview-machine-card,
.machine-profile-card {
    background: #1c2228;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.overview-status-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    min-height: 96px;
    padding: 16px;
}

.overview-status-card small {
    grid-column: 2 / 4;
    color: var(--muted);
    font-weight: 800;
}

.overview-status-card .button {
    min-height: 38px;
    background: #111820;
    color: var(--text);
}

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

.overview-kpi-card {
    min-height: 120px;
    padding: 16px 14px;
    border-top: 3px solid #475569;
}

.overview-kpi-card.attention {
    border-top-color: #f59e0b;
}

.overview-kpi-card.active-attention {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.15), #1c2228 54%);
}

.overview-kpi-card span,
.overview-progress-line span,
.overview-machine-card footer,
.overview-load-row span,
.overview-load-row small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.overview-kpi-card strong {
    display: block;
    margin-top: 12px;
    color: var(--surface-strong);
    font-size: 2.25rem;
    line-height: 1;
}

@media (max-width: 1180px) {
    .overview-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.overview-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
}

.machine-profile-overview-grid {
    grid-template-columns: 1fr;
}

.overview-panel {
    align-content: start;
    min-width: 0;
    padding: 18px;
}

.overview-panel.wide {
    grid-row: span 2;
}

.machine-profile-panel.overview-panel.wide {
    grid-row: auto;
}

.overview-panel-heading,
.overview-machine-card header,
.overview-progress-line,
.overview-machine-card footer,
.overview-load-row > div:first-child {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.overview-panel-heading h2 {
    margin-bottom: 0;
    color: var(--surface-strong);
}

.overview-range {
    color: var(--muted);
    font-weight: 900;
}

.overview-machine-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.overview-machine-card {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.overview-machine-card strong,
.overview-load-row strong {
    color: var(--surface-strong);
}

.overview-machine-card header span:not(.overview-status-badge) {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 800;
}

.overview-status-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #475569;
    border-radius: 999px;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 900;
    overflow: hidden;
    text-transform: uppercase;
}

.overview-status-badge::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: translateX(-120%);
    animation: overview-status-sheen 2.8s ease-in-out infinite;
}

.overview-status-badge i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
}

.overview-status-badge.status-active { color: #34d399; border-color: rgba(52, 211, 153, 0.5); }
.overview-status-badge.status-idle { color: #93c5fd; border-color: rgba(147, 197, 253, 0.5); }
.overview-status-badge.status-cooldown { color: #38bdf8; border-color: rgba(56, 189, 248, 0.5); }
.overview-status-badge.status-cleaning { color: #fbbf24; border-color: rgba(251, 191, 36, 0.5); }
.overview-status-badge.status-pm { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.5); }
.overview-status-badge.status-down { color: #fb7185; border-color: rgba(251, 113, 133, 0.5); }

@keyframes overview-status-sheen {
    0%, 55% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

.overview-load-track {
    height: 9px;
    overflow: hidden;
    background: #323b46;
    border-radius: 999px;
}

.overview-load-track i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #34d399, #60a5fa);
    border-radius: inherit;
}

.overview-load-track.overloaded i {
    background: linear-gradient(90deg, #fbbf24, #fb7185);
}

.overview-machine-card footer .needs-attention {
    color: #fbbf24;
}

.overview-week-control {
    display: grid;
    grid-template-columns: auto minmax(190px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.overview-week-control.compact {
    grid-template-columns: auto minmax(190px, 1fr);
}

.overview-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.overview-week-control label,
.overview-week-control span,
.timeline-label,
.machine-profile-minirow,
.machine-profile-stats,
.machine-performance-head span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.overview-week-control select {
    min-height: 38px;
    padding: 0 12px;
    background: #111820;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 900;
}

.machine-profile-grid {
    grid-template-columns: minmax(0, 1fr);
}

.machine-profile-card {
    position: relative;
    display: grid;
    gap: 14px;
    min-height: 540px;
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 45%, rgba(96, 165, 250, 0.12), transparent 34%),
        linear-gradient(180deg, #1f2730, #171d23);
}

.machine-profile-card::before {
    position: absolute;
    top: 32px;
    bottom: 32px;
    left: 28px;
    width: 2px;
    content: "";
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.2), rgba(52, 211, 153, 0.45), rgba(251, 191, 36, 0.18));
}

.machine-timeline-section,
.machine-timeline-core,
.machine-profile-stats {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-radius: 8px;
    background: rgba(17, 24, 32, 0.82);
}

.machine-timeline-section {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.machine-profile-load,
.machine-performance-head,
.machine-profile-minirow,
.machine-lane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.machine-lane-head {
    align-items: end;
}

.machine-lane-head > div {
    display: grid;
    gap: 4px;
}

.machine-profile-load strong,
.machine-performance-head strong {
    color: var(--surface-strong);
    font-size: 1.8rem;
    line-height: 1;
}

.machine-profile-load.compact,
.machine-performance-head.compact {
    justify-items: end;
    text-align: right;
}

.machine-profile-load.compact strong,
.machine-performance-head.compact strong {
    font-size: 1.35rem;
}

.machine-timeline-core {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(150px, 0.28fr);
    gap: 16px;
    align-items: center;
    min-height: 150px;
    padding: 18px;
    border-color: rgba(96, 165, 250, 0.38);
    background:
        radial-gradient(circle at 24px 50%, rgba(96, 165, 250, 0.2), transparent 52%),
        rgba(17, 24, 32, 0.88);
}

.machine-efficiency-pulse {
    --efficiency-color: #34d399;
    position: relative;
    display: grid;
    gap: 5px;
    min-height: 104px;
    padding: 12px;
    overflow: hidden;
    color: var(--surface-strong);
    background: color-mix(in srgb, var(--efficiency-color) 10%, #0f1720);
    border: 1px solid color-mix(in srgb, var(--efficiency-color) 48%, rgba(71, 85, 105, 0.72));
    border-radius: 10px;
    box-shadow: 0 0 26px color-mix(in srgb, var(--efficiency-color) 14%, transparent);
}

.machine-efficiency-pulse::before {
    position: absolute;
    inset: -60% auto auto -24%;
    width: 84%;
    aspect-ratio: 1;
    content: "";
    background: radial-gradient(circle, color-mix(in srgb, var(--efficiency-color) 28%, transparent), transparent 62%);
    animation: efficiency-orbit 5.2s linear infinite;
}

.machine-efficiency-pulse span,
.machine-efficiency-pulse b {
    position: relative;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.machine-efficiency-pulse strong {
    position: relative;
    font-size: 2rem;
    line-height: 1;
}

.machine-efficiency-pulse > i {
    position: relative;
    display: block;
    height: 7px;
    overflow: hidden;
    background: rgba(51, 65, 85, 0.8);
    border-radius: 999px;
}

.machine-efficiency-pulse > i::after {
    display: block;
    width: min(var(--efficiency-width), 100%);
    height: 100%;
    content: "";
    background: linear-gradient(90deg, var(--efficiency-color), #93c5fd);
    border-radius: inherit;
}

.machine-efficiency-pulse.tone-slow {
    --efficiency-color: #fbbf24;
}

.machine-efficiency-pulse.tone-fast {
    --efficiency-color: #38bdf8;
}

@keyframes efficiency-orbit {
    from { transform: translateX(0) rotate(0deg); }
    to { transform: translateX(72%) rotate(360deg); }
}

.machine-history-section {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(17, 24, 32, 0.82)),
        #151b21;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 8px;
}

.machine-history-bar {
    position: relative;
    height: 72px;
    overflow: hidden;
    background: #0f1720;
    border: 1px solid rgba(71, 85, 105, 0.76);
    border-radius: 8px;
    box-shadow: inset 0 0 18px rgba(2, 6, 23, 0.4);
}

.timeline-layer,
.timeline-schedule-segment,
.timeline-segment {
    position: absolute;
}

.timeline-layer {
    inset: 0;
}

.schedule-layer {
    top: 0;
    height: 100%;
}

.state-layer {
    top: 22px;
    right: 0;
    bottom: 14px;
    left: 0;
}

.timeline-schedule-segment {
    top: 0;
    bottom: 0;
    opacity: 0.78;
}

.timeline-segment {
    top: 0;
    bottom: 0;
    min-width: 3px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.45), 0 8px 18px rgba(2, 6, 23, 0.32);
}

button.timeline-segment {
    cursor: pointer;
}

button.timeline-segment:hover,
button.timeline-segment.expanded,
button.timeline-segment:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.88);
    outline-offset: 1px;
    filter: brightness(1.15);
}

.timeline-schedule-segment.schedule-scheduled {
    background: rgba(37, 99, 235, 0.16);
}

.timeline-schedule-segment.schedule-exclusion {
    background:
        repeating-linear-gradient(135deg, rgba(251, 113, 133, 0.24), rgba(251, 113, 133, 0.24) 8px, rgba(127, 29, 29, 0.12) 8px, rgba(127, 29, 29, 0.12) 16px);
}

.timeline-schedule-segment.schedule-not-scheduled {
    background: rgba(71, 85, 105, 0.18);
}

.timeline-segment.state-active,
.machine-history-legend i.state-active {
    background: #34d399;
}

.timeline-segment.state-idle,
.machine-history-legend i.state-idle {
    background: #60a5fa;
}

.timeline-segment.state-cooldown,
.machine-history-legend i.state-cooldown {
    background: #38bdf8;
}

.timeline-segment.state-down,
.machine-history-legend i.state-down {
    background: #fb7185;
}

.timeline-segment.state-pm,
.machine-history-legend i.state-pm {
    background: #a78bfa;
}

.timeline-segment.state-cleaning,
.machine-history-legend i.state-cleaning {
    background: #fbbf24;
}

.timeline-segment.state-not-scheduled,
.machine-history-legend i.state-not-scheduled {
    background: rgba(100, 116, 139, 0.62);
}

.machine-history-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.machine-history-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.machine-history-legend i {
    display: inline-block;
    width: 18px;
    height: 8px;
    border-radius: 999px;
}

.machine-history-legend i.schedule-exclusion {
    background:
        repeating-linear-gradient(135deg, rgba(251, 113, 133, 0.56), rgba(251, 113, 133, 0.56) 4px, rgba(127, 29, 29, 0.24) 4px, rgba(127, 29, 29, 0.24) 8px);
}

.timeline-period-detail {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: rgba(11, 18, 24, 0.82);
    border: 1px solid rgba(52, 211, 153, 0.34);
    border-radius: 8px;
    animation: timeline-detail-in 180ms ease-out;
}

.timeline-period-detail header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.timeline-period-detail header > div {
    display: grid;
    gap: 3px;
}

.timeline-period-detail strong {
    color: var(--surface-strong);
}

.timeline-period-detail header > span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.timeline-run-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.timeline-run-card {
    display: grid;
    flex: 0 0 240px;
    gap: 7px;
    min-height: 132px;
    padding: 10px;
    background: #151b21;
    border: 1px solid rgba(71, 85, 105, 0.7);
    border-left: 4px solid #34d399;
    border-radius: 8px;
}

.timeline-run-card header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.timeline-run-card header strong,
.timeline-run-card p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-run-card strong {
    color: var(--surface-strong);
}

.timeline-run-card p,
.timeline-run-card span,
.timeline-run-card small {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.timeline-run-card div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.timeline-run-card div span {
    min-height: 34px;
    padding: 6px;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(71, 85, 105, 0.52);
    border-radius: 6px;
}

@keyframes timeline-detail-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.machine-status-ring {
    display: grid;
    width: 84px;
    height: 84px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: #93c5fd;
    box-shadow: 0 0 28px color-mix(in srgb, currentColor 22%, transparent);
}

.machine-status-ring i {
    width: 46px;
    height: 46px;
    border-radius: inherit;
    background: currentColor;
    box-shadow: 0 0 0 10px color-mix(in srgb, currentColor 12%, transparent);
    animation: machine-status-pulse 2.2s ease-in-out infinite;
}

.machine-status-ring.status-active { color: #34d399; }
.machine-status-ring.status-idle { color: #93c5fd; }
.machine-status-ring.status-cooldown { color: #38bdf8; }
.machine-status-ring.status-cleaning { color: #fbbf24; }
.machine-status-ring.status-pm { color: #c4b5fd; }
.machine-status-ring.status-down { color: #fb7185; }

@keyframes machine-status-pulse {
    0%, 100% { transform: scale(0.88); opacity: 0.72; }
    50% { transform: scale(1); opacity: 1; }
}

.machine-core-copy h3 {
    margin: 10px 0 6px;
    color: var(--surface-strong);
    font-size: 1.55rem;
}

.machine-core-copy p {
    margin: 0;
    color: var(--muted);
    font-weight: 900;
}

.machine-active-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
}

.machine-active-detail span,
.machine-section-subhead span,
.machine-batch-meta,
.machine-batch-row span,
.machine-batch-more {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.machine-active-detail span {
    min-height: 30px;
    padding: 7px 8px;
    background: rgba(21, 27, 33, 0.82);
    border: 1px solid rgba(71, 85, 105, 0.55);
    border-radius: 7px;
}

.machine-profile-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
}

.machine-profile-stats span {
    display: grid;
    gap: 2px;
    min-height: 56px;
    align-content: center;
    padding: 8px;
    background: #151b21;
    border: 1px solid rgba(71, 85, 105, 0.55);
    border-radius: 8px;
}

.machine-profile-stats b {
    color: var(--surface-strong);
    font-size: 1.15rem;
}

.machine-profile-stats .needs-attention b {
    color: #fbbf24;
}

.machine-review-chips {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.machine-review-chips span {
    display: grid;
    gap: 2px;
    min-height: 48px;
    align-content: center;
    padding: 8px;
    color: var(--muted);
    background: rgba(17, 24, 32, 0.82);
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.machine-review-chips b {
    color: var(--surface-strong);
    font-size: 1rem;
}

.machine-review-chips .needs-attention {
    border-color: rgba(245, 158, 11, 0.52);
    background: rgba(245, 158, 11, 0.1);
}

.machine-review-chips .needs-attention b {
    color: #fbbf24;
}

.machine-section-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.machine-section-subhead strong,
.machine-batch-row strong {
    color: var(--surface-strong);
}

.machine-batch-list {
    display: grid;
    gap: 7px;
}

.machine-card-lane {
    display: flex;
    gap: 10px;
    min-width: 0;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
    scrollbar-color: rgba(148, 163, 184, 0.74) rgba(15, 23, 42, 0.7);
}

.machine-batch-card {
    display: grid;
    flex: 0 0 260px;
    gap: 9px;
    min-height: 154px;
    padding: 11px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.88)),
        #151b21;
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-left: 4px solid #60a5fa;
    border-radius: 9px;
    scroll-snap-align: start;
}

.machine-batch-card.completed {
    border-left-color: #34d399;
}

.machine-batch-card.status-released {
    border-left-color: #60a5fa;
}

.machine-batch-card.status-draft {
    border-left-color: #fbbf24;
}

.machine-batch-card.status-paused {
    border-left-color: #c4b5fd;
}

.machine-batch-card header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.machine-batch-card header div {
    min-width: 0;
}

.machine-batch-card strong,
.machine-batch-card b {
    color: var(--surface-strong);
}

.machine-batch-card header strong,
.machine-batch-card header span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.machine-batch-card header span,
.machine-batch-card header b,
.machine-card-grid span,
.machine-card-times,
.machine-card-review {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.machine-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.machine-card-grid span {
    display: grid;
    gap: 3px;
    min-height: 42px;
    align-content: center;
    padding: 6px;
    background: rgba(11, 18, 24, 0.78);
    border: 1px solid rgba(71, 85, 105, 0.55);
    border-radius: 7px;
}

.machine-card-times {
    display: grid;
    gap: 2px;
}

.machine-card-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.machine-card-flags span,
.machine-card-review {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 22px;
    padding: 3px 7px;
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
}

.machine-card-flags .tone-warning,
.machine-card-review.open {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.52);
}

.machine-card-flags .tone-critical,
.machine-card-review.danger,
.machine-card-grid .tone-critical {
    color: #fb7185;
    border-color: rgba(251, 113, 133, 0.55);
}

.machine-card-grid .tone-good {
    color: #34d399;
}

.machine-card-action {
    width: fit-content;
    min-height: 32px;
    padding: 0 10px;
    color: var(--surface-strong);
    background: #111820;
    border: 1px solid rgba(96, 165, 250, 0.56);
    border-radius: 7px;
    font-weight: 900;
    cursor: pointer;
}

.machine-card-action:hover {
    border-color: #93c5fd;
    background: rgba(96, 165, 250, 0.14);
}

.machine-card-action.subscribed,
.machine-card-action:disabled.subscribed {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.55);
    background: rgba(16, 185, 129, 0.12);
    cursor: default;
}

.machine-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.overview-subscription-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    margin-top: 16px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.74));
    border: 1px solid rgba(71, 85, 105, 0.72);
    border-radius: 10px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.overview-subscription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.home-subscription-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.home-subscription-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 74px;
    padding: 11px 12px;
    background: #121922;
    border: 1px solid rgba(71, 85, 105, 0.75);
    border-left: 3px solid #34d399;
    border-radius: 8px;
}

.home-subscription-card strong,
.home-subscription-card span,
.home-subscription-card small {
    display: block;
}

.home-subscription-card strong {
    color: var(--surface-strong);
}

.home-subscription-card span,
.home-subscription-card small {
    margin-top: 3px;
    color: var(--muted);
}

.home-subscription-card .tone-critical {
    color: #fb7185;
}

.machine-batch-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 9px 10px;
    background: #151b21;
    border: 1px solid rgba(71, 85, 105, 0.62);
    border-left: 3px solid #60a5fa;
    border-radius: 8px;
}

.machine-batch-row.status-complete {
    border-left-color: #34d399;
}

.machine-batch-row.status-released {
    border-left-color: #60a5fa;
}

.machine-batch-row.status-draft {
    border-left-color: #fbbf24;
}

.machine-batch-row.status-paused {
    border-left-color: #c4b5fd;
}

.machine-batch-row span {
    display: block;
    margin-top: 2px;
}

.machine-batch-meta {
    display: grid;
    justify-items: end;
    gap: 2px;
    text-align: right;
}

.machine-batch-late {
    color: #fb7185;
}

.machine-batch-more {
    display: grid;
    flex: 0 0 130px;
    place-items: center;
    min-height: 154px;
    padding: 12px;
    text-align: center;
    background: rgba(17, 24, 32, 0.66);
    border: 1px dashed rgba(148, 163, 184, 0.42);
    border-radius: 9px;
}

.machine-timeline-performance.tone-over {
    border-color: rgba(251, 113, 133, 0.5);
}

.machine-timeline-performance.tone-under {
    border-color: rgba(52, 211, 153, 0.45);
}

.machine-timeline-performance.tone-over .performance-mini-track i {
    background: #fb7185;
}

.machine-timeline-performance.tone-under .performance-mini-track i {
    background: #34d399;
}

.overview-review-modal {
    width: min(560px, calc(100vw - 32px));
    padding: 0;
    color: var(--text);
    background: transparent;
    border: 0;
}

.overview-review-modal::backdrop {
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(4px);
}

.overview-review-panel {
    display: grid;
    gap: 16px;
    padding: 22px;
    background: #1f2730;
    border: 1px solid rgba(96, 165, 250, 0.38);
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.overview-review-panel header,
.overview-review-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.overview-review-panel h2 {
    margin: 0;
    color: var(--surface-strong);
}

.overview-review-panel label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.overview-review-panel textarea {
    min-height: 120px;
    padding: 12px;
    color: var(--text);
    background: #111820;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    resize: vertical;
    text-transform: none;
}

.overview-review-panel .modal-support {
    margin: 0;
    color: var(--surface-strong);
    font-weight: 900;
}

.overview-load-row {
    display: grid;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.overview-load-row:last-child {
    border-bottom: 0;
}

.overview-attention-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0 12px;
    background: #151b21;
    border: 1px solid var(--border);
    border-left: 4px solid #34d399;
    border-radius: 8px;
    color: var(--text);
    font-weight: 900;
    text-decoration: none;
}

.overview-attention-row.tone-warning {
    border-left-color: #f59e0b;
}

.overview-attention-row.tone-critical {
    border-left-color: #fb7185;
}

.overview-attention-row strong {
    font-size: 1.5rem;
}

.machine-profile-review-strip {
    display: grid;
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin: 16px 0;
    padding: 12px;
    background: #151b21;
    border: 1px solid rgba(71, 85, 105, 0.7);
    border-radius: 8px;
}

.machine-profile-review-strip h3 {
    margin: 0;
    color: var(--surface-strong);
}

.overview-attention-list.compact {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 8px;
}

.overview-attention-list.compact .overview-attention-row {
    min-height: 44px;
}

.overview-attention-list.compact .overview-attention-row strong {
    font-size: 1.15rem;
}

.performance-panel {
    grid-column: 2;
}

.overview-performance {
    display: grid;
    gap: 14px;
}

.performance-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.performance-stat {
    display: grid;
    gap: 4px;
    min-height: 104px;
    padding: 14px;
    background: #151b21;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.performance-stat span,
.performance-stat small,
.performance-row span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.performance-stat strong {
    color: var(--surface-strong);
    font-size: 1.35rem;
    line-height: 1.1;
}

.performance-stat.tone-over {
    border-color: rgba(251, 113, 133, 0.5);
    background: linear-gradient(145deg, rgba(251, 113, 133, 0.15), #151b21 60%);
}

.performance-stat.tone-under {
    border-color: rgba(52, 211, 153, 0.45);
    background: linear-gradient(145deg, rgba(52, 211, 153, 0.12), #151b21 60%);
}

.performance-columns {
    display: grid;
    gap: 14px;
}

.performance-columns h3 {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.performance-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.performance-row:last-child {
    border-bottom: 0;
}

.performance-row strong {
    color: var(--surface-strong);
}

.performance-row b {
    color: #bfdbfe;
}

.performance-row.tone-over b {
    color: #fb7185;
}

.performance-row.tone-under b {
    color: #34d399;
}

.performance-row.machine {
    grid-template-columns: minmax(0, 1fr) auto;
}

.performance-mini-track {
    grid-column: 1 / 3;
    height: 7px;
    overflow: hidden;
    background: #323b46;
    border-radius: 999px;
}

.performance-mini-track i {
    display: block;
    height: 100%;
    background: #60a5fa;
    border-radius: inherit;
}

.performance-row.tone-over .performance-mini-track i {
    background: #fb7185;
}

.performance-row.tone-under .performance-mini-track i {
    background: #34d399;
}

.overview-empty {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.overview-empty.compact {
    padding: 10px 0;
    text-align: left;
}

.auth-shell {
    display: grid;
    min-height: min(620px, calc(100vh - 180px));
    place-items: center;
}

.auth-panel {
    display: grid;
    gap: 18px;
    width: min(460px, 100%);
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.auth-panel h1 {
    margin-bottom: 0;
    font-size: 2.6rem;
}

.lede.small {
    margin-bottom: 0;
    font-size: 1rem;
}

.auth-form,
.admin-user-form {
    display: grid;
    gap: 14px;
}

.auth-form label,
.admin-user-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 800;
}

.form-input {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.form-status {
    min-height: 24px;
    margin: 0;
    color: var(--accent-strong);
    font-weight: 800;
}

.text-button.inline {
    margin-left: 0;
    width: fit-content;
}

.admin-shell {
    display: grid;
    gap: 24px;
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.admin-user-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 180px auto;
    align-items: end;
}

.status-line {
    color: var(--accent-strong);
    font-weight: 800;
}

.item-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.site-footer {
    padding: 24px 0 40px;
    color: var(--muted);
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 16px 0;
    }

    .kpi-grid,
    .analytics-grid,
    .quick-link-grid,
    .admin-user-form {
        grid-template-columns: 1fr;
    }

    .panel-heading,
    .bar-label,
    .admin-header,
    .overview-panel-heading,
    .overview-machine-card header,
    .overview-machine-card footer,
    .overview-week-control {
        flex-direction: column;
    }

    .overview-hero,
    .overview-grid,
    .overview-kpi-grid,
    .performance-summary-strip,
    .machine-profile-stats,
    .machine-review-chips,
    .machine-active-detail,
    .machine-profile-review-strip,
    .overview-attention-list.compact {
        grid-template-columns: 1fr;
    }

    .overview-week-control {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .overview-toolbar-controls {
        width: 100%;
        justify-content: stretch;
    }

    .machine-timeline-core {
        grid-template-columns: 1fr;
    }

    .performance-panel {
        grid-column: auto;
    }
}
