:root {
    --mcp-orange: #ff8a00;
    --mcp-orange-dark: #d96f00;
    --mcp-ink: #17202a;
    --mcp-muted: #667085;
    --mcp-bg: #f5f6f8;
    --mcp-card: #ffffff;
    --mcp-border: #e1e5ea;
    --mcp-success: #18794e;
    --mcp-danger: #b42318;
    --mcp-info: #175cd3;
    --mcp-shadow: 0 10px 30px rgba(23, 32, 42, .08);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    padding: 28px;
    background: var(--mcp-bg);
    color: var(--mcp-ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.55;
}

body > h1,
body > h2,
body > h3,
body > p,
body > form,
body > table,
body > ul,
body > .alerte,
body > .alerte-photos {
    width: min(1120px, 100%);
    margin-left: auto;
    margin-right: auto;
}

a { color: var(--mcp-orange-dark); font-weight: 650; }
a:hover { color: #a95600; }

h1, h2, h3 { line-height: 1.2; }
h2 { margin-top: 0; }

input,
select,
textarea,
button {
    font: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="month"],
input[type="number"],
input[type="file"],
select,
textarea {
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd2da;
    border-radius: 9px;
    background: #fff;
    color: var(--mcp-ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(255, 138, 0, .2);
    border-color: var(--mcp-orange);
}

button,
.mcp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    background: var(--mcp-orange);
    color: #111;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.mcp-button:hover { background: #f17f00; color: #111; }
button:disabled { opacity: .55; cursor: wait; }

table {
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(23, 32, 42, .06);
}

th, td { padding: 11px 12px; border: 1px solid var(--mcp-border); text-align: left; }
th { background: #fff4e6; }

.mcp-shell { width: min(1120px, 100%); margin: 0 auto; }

.mcp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
    padding: 18px 22px;
    border: 1px solid var(--mcp-border);
    border-radius: 16px;
    background: #111820;
    box-shadow: var(--mcp-shadow);
}

.mcp-logo { display: block; width: 132px; height: 78px; object-fit: contain; }
.mcp-header-copy { color: #fff; text-align: right; }
.mcp-header-copy strong { display: block; font-size: 1.15rem; }
.mcp-header-copy span { color: #cfd5dc; }

.mcp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.mcp-card {
    padding: 22px;
    border: 1px solid var(--mcp-border);
    border-radius: 14px;
    background: var(--mcp-card);
    box-shadow: var(--mcp-shadow);
}

.mcp-card h2, .mcp-card h3 { margin: 0 0 12px; }
.mcp-card--wide { grid-column: 1 / -1; }

.mcp-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.mcp-action {
    min-height: 88px;
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--mcp-border);
    border-radius: 12px;
    background: #fff;
    color: var(--mcp-ink);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(23, 32, 42, .05);
}

.mcp-action:hover { border-color: var(--mcp-orange); color: var(--mcp-ink); transform: translateY(-1px); }
.mcp-action--admin { background: #fff8ef; }

.mcp-message { padding: 14px 16px; border-radius: 10px; margin: 14px 0; }
.mcp-message--success { background: #e9f8f0; border: 1px solid #a9dfc4; color: var(--mcp-success); }
.mcp-message--danger { background: #fff0ee; border: 1px solid #f3b7b0; color: var(--mcp-danger); }
.mcp-message--warning { background: #fff7e8; border: 1px solid #f4d49a; color: #8a4b08; }
.mcp-message--info { background: #edf4ff; border: 1px solid #b2ccff; color: var(--mcp-info); }

.mcp-announcement { white-space: pre-wrap; }
.mcp-vacation { font-size: 1.1rem; font-weight: 800; color: var(--mcp-orange-dark); }
.mcp-muted { color: var(--mcp-muted); }
.mcp-top-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.mcp-footer { margin: 26px 0 8px; color: var(--mcp-muted); font-size: .9rem; text-align: center; }

.mcp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}
.mcp-form-grid label { display: grid; gap: 6px; }
.mcp-check { display: flex !important; grid-auto-flow: column; justify-content: start; align-items: center; }
.mcp-inline-actions, .mcp-filter, .mcp-inline-list, .mcp-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.mcp-inline-actions form { margin: 0; }
.mcp-button--secondary { background: #eef1f4; color: var(--mcp-ink); }
.mcp-button--danger { background: var(--mcp-danger); color: #fff; }
.mcp-icon-button { padding: 4px 7px; background: transparent; }
.mcp-table-wrap { width: 100%; overflow-x: auto; }
.mcp-badge { display: inline-block; padding: 2px 7px; border-radius: 999px; background: #e8eaf0; font-size: .75rem; font-weight: 800; }
.mcp-status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: .82rem; font-weight: 800; background: #edf0f3; }
.mcp-status--ok { color: var(--mcp-success); background: #e9f8f0; }
.mcp-status--error { color: var(--mcp-danger); background: #fff0ee; }
.mcp-status--warning { color: #8a4b08; background: #fff7e8; }
.mcp-status--off { color: #667085; background: #f2f4f7; }
.mcp-stop-series { margin: 10px 0 0; padding-left: 22px; }
.mcp-stop-series li + li { margin-top: 5px; }
.mcp-anomaly-list { display: grid; gap: 16px; margin-top: 18px; }
.mcp-anomaly { border-left: 6px solid #d0d5dd; }
.mcp-anomaly--yellow { border-left-color: #f2b84b; }
.mcp-anomaly--red { border-left-color: var(--mcp-danger); }
.mcp-anomaly.is-lifted { opacity: .68; }
.mcp-anomaly-heading h2 { margin: 8px 0 4px; }
.mcp-hours-focus td { background: #fff2cf !important; box-shadow: inset 0 2px 0 #f79009, inset 0 -2px 0 #f79009; }
.mcp-hours-alert { background: #ffd9d5 !important; color: #9f1710 !important; font-weight: 900; }
.mcp-daily-total { text-align: center; vertical-align: middle; white-space: nowrap; font-weight: 800; }
.mcp-modal-page { margin: 0; min-height: 100%; padding: 0 !important; overflow: hidden; }
.mcp-mandatory-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-start; justify-content: center; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; padding: max(16px, env(safe-area-inset-top)) 16px calc(90px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: rgba(18, 25, 38, .78); }
.mcp-mandatory-dialog { flex: 0 0 auto; width: min(680px, 100%); margin: auto 0; box-sizing: border-box; padding: 30px; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(0, 0, 0, .35); text-align: center; }
.mcp-mandatory-dialog .mcp-logo { margin: 0 auto 14px; }
.mcp-mandatory-kicker { margin: 0 0 5px; color: var(--mcp-orange); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.mcp-mandatory-dialog h1 { margin: 0 0 20px; overflow-wrap: anywhere; line-height: 1.12; }
.mcp-mandatory-content { margin: 0 0 24px; padding: 18px; border-radius: 12px; background: #f6f7f8; color: #222; line-height: 1.65; text-align: left; white-space: normal; }
.mcp-mandatory-button { width: 100%; min-height: 52px; font-size: 1rem; }

.mcp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mcp-stats a { display: grid; padding: 18px; border-radius: 14px; background: #fff; border: 1px solid var(--mcp-border); text-decoration: none; color: var(--mcp-ink); box-shadow: var(--mcp-shadow); }
.mcp-stats strong { font-size: 2rem; color: var(--mcp-orange-dark); }
.mcp-stats span { color: var(--mcp-muted); }
.mcp-stats .is-alert { border-color: #f3b7b0; background: #fff5f3; }
.mcp-stats .is-alert strong { color: var(--mcp-danger); }

.mcp-calendar { font-size: .82rem; white-space: nowrap; }
.mcp-calendar th small { display: block; color: var(--mcp-muted); }
.mcp-calendar td { min-width: 42px; text-align: center; font-weight: 800; }
.mcp-calendar td.work, .mcp-legend .work { background: #e9f8f0; color: #12633f; }
.mcp-calendar td.missing, .mcp-legend .missing { background: #fff0ee; color: #b42318; }
.mcp-calendar td.stop, .mcp-legend .stop { background: #edf4ff; color: #175cd3; }
.mcp-calendar td.vacation, .mcp-legend .vacation { background: #fff7e8; color: #8a4b08; }
.mcp-calendar td.weekend, .mcp-legend .weekend { background: #f2f4f7; color: #98a2b3; }
.mcp-legend span { padding: 5px 9px; border-radius: 7px; font-size: .82rem; }

@media (max-width: 780px) {
    body { padding: 14px; }
    .mcp-header { padding: 14px; }
    .mcp-logo { width: 105px; height: 64px; }
    .mcp-grid, .mcp-actions, .mcp-form-grid, .mcp-stats { grid-template-columns: 1fr; }
    .mcp-card--wide { grid-column: auto; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 480px) {
    .mcp-header { align-items: flex-start; }
    .mcp-header-copy { font-size: .9rem; }
    .mcp-mandatory-overlay { padding: max(10px, env(safe-area-inset-top)) 10px calc(105px + env(safe-area-inset-bottom)); }
    .mcp-mandatory-dialog { padding: 20px 16px; border-radius: 14px; }
    .mcp-mandatory-dialog .mcp-logo { width: 90px; height: auto; margin-bottom: 10px; }
    .mcp-mandatory-kicker { font-size: .78rem; letter-spacing: .06em; }
    .mcp-mandatory-dialog h1 { margin-bottom: 16px; font-size: clamp(1.65rem, 8vw, 2.25rem); }
    .mcp-mandatory-content { margin-bottom: 18px; padding: 15px; font-size: 1rem; line-height: 1.55; }
}
