* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #1f2933;
    background: #f7f7f2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
    width: min(1080px, calc(100% - 32px));
    margin: 32px auto;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
}

a,
button {
    color: inherit;
}

nav a,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #c9d1c2;
    border-radius: 6px;
    background: #ffffff;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.button.primary {
    border-color: #2458a6;
    background: #2458a6;
    color: #ffffff;
}

.panel {
    padding: 20px;
    border: 1px solid #d8ded1;
    border-radius: 8px;
    background: #ffffff;
}

.panel.compact {
    padding: 16px;
}

.panel h2,
.toolbar h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.muted {
    color: #62706a;
}

.status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e7f0df;
    color: #315343;
    font-size: 13px;
}

.signage-number {
    font-size: clamp(56px, 12vw, 140px);
    font-weight: 800;
    letter-spacing: 0;
}

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

.admin-shell.narrow {
    width: min(520px, 100%);
    margin: 0 auto;
}

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

.admin-header h1,
.auth-panel h1 {
    margin: 0 0 6px;
    font-size: 30px;
}

.admin-header p {
    margin: 0;
}

.admin-actions,
.toolbar,
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar.between {
    align-items: center;
    justify-content: space-between;
}

.metric-grid,
.admin-grid {
    display: grid;
    gap: 12px;
}

.metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid.form-layout {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    align-items: start;
}

.metric {
    min-height: 86px;
    padding: 16px;
    border: 1px solid #d8ded1;
    border-radius: 8px;
    background: #ffffff;
}

.metric span {
    display: block;
    color: #62706a;
    font-size: 13px;
}

.metric strong {
    display: block;
    margin-top: 8px;
    color: #172033;
    font-size: 28px;
}

.notice {
    padding: 12px 14px;
    border: 1px solid #b8c3d6;
    border-radius: 6px;
    background: #eef4ff;
}

.notice.success {
    border-color: #8cbf9b;
    background: #edf8ef;
    color: #234d30;
}

.notice.error {
    border-color: #d79a91;
    background: #fff0ee;
    color: #7b271f;
}

.stacked-form {
    display: grid;
    gap: 12px;
}

.form-row,
.check-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stacked-form label {
    display: grid;
    gap: 6px;
    color: #344054;
    font-size: 14px;
    font-weight: 600;
}

.stacked-form input,
.stacked-form select,
.stacked-form textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid #c8d0dc;
    border-radius: 6px;
    background: #ffffff;
    color: #172033;
    font: inherit;
}

.stacked-form textarea {
    resize: vertical;
}

.check-row label {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.check-row input {
    width: auto;
    min-height: 0;
}

.detail-list {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
}

.detail-list dt {
    color: #62706a;
}

.detail-list dd {
    margin: 0;
    color: #172033;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.admin-list,
.order-board {
    display: grid;
    gap: 10px;
}

.admin-list.small {
    margin-top: 12px;
}

.side-stack {
    display: grid;
    gap: 12px;
}

.list-row,
.order-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid #d8ded1;
    border-radius: 8px;
    background: #fbfcfa;
}

.list-row p,
.order-card p {
    margin: 4px 0 0;
}

.list-row.editable {
    align-items: flex-start;
}

.inline-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
    width: 100%;
}

.inline-fields.menu-fields {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.inline-fields label {
    display: grid;
    gap: 4px;
    color: #344054;
    font-size: 12px;
    font-weight: 600;
}

.inline-fields input,
.inline-fields select {
    width: 100%;
    min-height: 36px;
    padding: 7px 8px;
    border: 1px solid #c8d0dc;
    border-radius: 6px;
    background: #ffffff;
    font: inherit;
}

.inline-fields .wide {
    grid-column: 1 / -1;
}

.inline-fields .inline-check {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-fields .inline-check input {
    width: auto;
    min-height: 0;
}

.order-card {
    align-items: flex-start;
}

pre {
    overflow: auto;
    padding: 12px;
    border-radius: 6px;
    background: #20242a;
    color: #f4f7f1;
}

@media (max-width: 760px) {
    main {
        width: min(100% - 20px, 1080px);
        margin: 20px auto;
    }

    .admin-header,
    .list-row,
    .order-card {
        align-items: stretch;
        flex-direction: column;
    }

    .metric-grid,
    .admin-grid.two,
    .admin-grid.form-layout,
    .side-stack,
    .form-row,
    .check-row,
    .inline-fields,
    .inline-fields.menu-fields {
        grid-template-columns: 1fr;
    }

    .row-actions .button,
    .admin-actions .button {
        flex: 1 1 auto;
    }
}
