:root {
    --bg: #f7f0e7;
    --card: #fffaf4;
    --card-2: #ffffff;
    --text: #27180f;
    --muted: #826c5a;
    --wood: #3b2518;
    --wood-light: #7a4b2d;
    --accent: #d7a160;
    --success: #236d3b;
    --danger: #9d2b24;
    --border: rgba(59, 37, 24, .12);
    --shadow: 0 18px 45px rgba(59, 37, 24, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(215, 161, 96, .28), transparent 34%),
        linear-gradient(180deg, #fffaf4 0%, var(--bg) 46%, #efe1d0 100%);
}

button,
input {
    font: inherit;
}

.app-shell {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    padding: max(18px, env(safe-area-inset-top)) 16px 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.eyebrow {
    display: block;
    color: var(--wood-light);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.topbar h1,
.login-card h1 {
    margin: 2px 0 0;
    font-size: 28px;
    letter-spacing: -.04em;
}

.icon-link {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 18px;
    color: #fff;
    background: var(--wood);
    text-decoration: none;
    box-shadow: var(--shadow);
}

.company-card,
.date-card,
.orders-card,
.empty-card,
.section-block {
    border: 1px solid var(--border);
    border-radius: 26px;
    background: rgba(255, 250, 244, .86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.company-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
    margin-bottom: 14px;
}

.company-card span,
.date-card span,
.muted,
.order-row span,
.meal-info p,
.deadline-note {
    color: var(--muted);
    font-size: 13px;
}

.company-card strong {
    display: block;
    margin-top: 2px;
    font-size: 16px;
}

.install-button {
    width: 100%;
    margin-bottom: 14px;
    border: 0;
    border-radius: 18px;
    padding: 14px 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--wood), var(--wood-light));
    font-weight: 800;
    box-shadow: var(--shadow);
}

.day-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0 14px;
    margin: 0 -16px 8px;
    padding-left: 16px;
    scrollbar-width: none;
}

.day-tabs::-webkit-scrollbar {
    display: none;
}

.day-tab {
    flex: 0 0 auto;
    min-width: 98px;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 12px 14px;
    color: var(--text);
    background: rgba(255, 255, 255, .75);
    text-align: left;
}

.day-tab span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.day-tab strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
}

.day-tab.active {
    color: #fff;
    border-color: transparent;
    background: var(--wood);
}

.day-tab.active span {
    color: rgba(255, 255, 255, .76);
}

.day-tab.closed {
    opacity: .58;
}

.day-panel {
    display: none;
    animation: fadeUp .22s ease-out;
}

.day-panel.active {
    display: block;
}

.date-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    margin-bottom: 10px;
}

.date-card h2 {
    margin: 0;
    font-size: 28px;
}

.date-status {
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.date-status.open {
    color: var(--success);
    background: rgba(35, 109, 59, .12);
}

.date-status.closed {
    color: var(--danger);
    background: rgba(157, 43, 36, .12);
}

.deadline-note {
    margin: 0 4px 16px;
}

.section-block {
    margin: 14px 0;
    padding: 16px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading h3 {
    margin: 0;
    font-size: 19px;
}

.section-heading span {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.section-heading.compact {
    margin-bottom: 8px;
}

.meal-card {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.meal-card:first-of-type {
    border-top: 0;
}

.meal-number {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--wood), var(--wood-light));
    font-weight: 900;
}

.meal-info h4 {
    margin: 0;
    font-size: 16px;
    line-height: 1.22;
}

.meal-info p {
    margin: 4px 0 0;
}

.order-btn,
.delete-btn,
.login-form button {
    border: 0;
    border-radius: 16px;
    padding: 11px 13px;
    font-weight: 850;
    cursor: pointer;
}

.order-btn,
.login-form button {
    color: #fff;
    background: var(--wood);
}

.delete-btn {
    color: var(--danger);
    background: rgba(157, 43, 36, .1);
}

.order-btn:disabled,
.delete-btn:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.orders-card,
.empty-card {
    padding: 16px;
    margin: 14px 0;
}

.order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.order-row:first-of-type {
    border-top: 0;
}

.order-row strong,
.order-row span {
    display: block;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 20;
    width: min(calc(100% - 32px), 440px);
    transform: translateX(-50%) translateY(20px);
    border-radius: 18px;
    padding: 14px 16px;
    color: #fff;
    background: rgba(39, 24, 15, .94);
    box-shadow: var(--shadow);
    opacity: 0;
    transition: .2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.login-body {
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(100%, 430px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 28px;
    background: rgba(255, 250, 244, .9);
    box-shadow: var(--shadow);
}

.login-logo {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(135deg, var(--wood), var(--wood-light));
    font-size: 30px;
    font-weight: 950;
}

.login-card p {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.login-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 15px 14px;
    color: var(--text);
    background: #fff;
    outline: 0;
}

.login-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(215, 161, 96, .18);
}

.login-form button {
    padding: 15px 16px;
    font-size: 16px;
}

.alert {
    margin-top: 16px;
    border-radius: 18px;
    padding: 13px 14px;
    color: var(--danger);
    background: rgba(157, 43, 36, .1);
    font-weight: 750;
}

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

@media (min-width: 460px) {
    .company-card {
        grid-template-columns: 1fr 1fr;
    }
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upcoming-orders-card {
    background: rgba(255, 255, 255, 0.94);
    color: #2b1a12;
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 18px 40px rgba(27, 15, 8, 0.18);
    margin-bottom: 14px;
    scroll-margin-top: 18px;
}

.upcoming-day-group {
    border-top: 1px solid rgba(59, 37, 24, 0.12);
    padding-top: 12px;
    margin-top: 12px;
}

.upcoming-day-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.upcoming-day-title strong {
    font-size: 15px;
}

.mini-status {
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    padding: 5px 9px;
    white-space: nowrap;
}

.mini-status.open {
    background: rgba(47, 125, 67, 0.12);
    color: #2f7d43;
}

.mini-status.closed {
    background: rgba(120, 86, 65, 0.13);
    color: #785641;
}

.compact-row {
    padding: 10px 0;
}

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