:root {
    --bg: #f5f1e8;
    --card: #fffef9;
    --ink: #23313b;
    --accent: #0e7a4b;
    --error: #b52d2d;
    --muted: #6f7b83;
    --line: #d8d4c9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    background: linear-gradient(160deg, #ece5d8 0%, #f8f4ec 100%);
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem 2rem;
}

.container-narrow {
    max-width: 680px;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem;
}

.brand-logo {
    width: 160px;
    max-width: 38%;
    height: auto;
    display: block;
}

.brand-text p {
    margin: 0;
}

.brand-actions {
    margin-left: auto;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-link {
    display: inline-block;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8f4ec;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}

.button-row,
.table-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form {
    margin: 0;
}

.inline-form button,
.danger-button {
    width: auto;
    margin: 0;
}

.danger-button {
    background: #b52d2d;
}

h1, h2 {
    margin: 0 0 0.8rem;
}

p {
    margin-top: 0;
}

.menu-card,
.order-form,
.overview,
.date-form {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.date-form-inline {
    flex: 1;
    margin: 0;
}

.week-nav {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin: 1rem 0;
}

.week-calendar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.week-day {
    display: block;
    text-decoration: none;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    color: var(--ink);
    text-align: center;
    font-weight: 600;
}

.week-day.active {
    background: #e7f5ed;
    border-color: #96c7ae;
}

label,
legend {
    font-weight: 600;
}

input,
select,
button {
    width: 100%;
    margin-top: 0.4rem;
    margin-bottom: 0.9rem;
    padding: 0.6rem;
    border-radius: 8px;
    border: 1px solid #c1bbae;
    font: inherit;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0 0 1rem;
}

fieldset label {
    display: block;
    font-weight: 400;
}

fieldset input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.checkbox-line input[type="checkbox"] {
    width: auto;
    margin: 0;
}

button {
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
}

.notice {
    padding: 0.8rem;
    border-radius: 8px;
    margin: 0.7rem 0;
}

.notice.error {
    background: #fdeaea;
    border: 1px solid #f0bcbc;
    color: var(--error);
}

.notice.success {
    background: #e8f8ef;
    border: 1px solid #bde5cc;
    color: #145f3b;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 0.5rem;
}

th {
    background: #faf8f3;
}

a {
    color: #0f5f97;
}

.print-actions {
    margin: 1rem 0;
}

.print-actions button {
    max-width: 320px;
}

.print-compact-summary {
    display: none;
}

.print-meta {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0.2rem 0 1rem;
}

@page {
    size: A4 portrait;
    margin: 12mm;
}

@media print {
    body {
        background: #fff;
        color: #000;
    }

    .container {
        max-width: 190mm;
        margin: 0;
        padding: 0;
    }

    .no-print {
        display: none !important;
    }

    .brand-header,
    .menu-card,
    .overview,
    .date-form {
        border: 1px solid #bdbdbd;
        box-shadow: none;
        page-break-inside: avoid;
    }

    a {
        color: #000;
        text-decoration: none;
    }

    body.print-full .print-compact-summary {
        display: none !important;
    }

    body.print-full .print-detailed {
        display: block !important;
    }

    body.print-compact .print-compact-summary {
        display: block !important;
    }

    body.print-compact .print-detailed {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .container {
        margin-top: 1rem;
    }

    .brand-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand-actions {
        margin-left: 0;
    }

    .button-row,
    .table-actions {
        align-items: stretch;
    }

    .brand-logo {
        max-width: 220px;
        width: 100%;
    }

    .week-calendar {
        grid-template-columns: 1fr;
    }

    .week-nav {
        flex-direction: column;
        align-items: stretch;
    }
}
