:root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #2b2927;
    background: #fbf8f4;
    --coffee-950: #2f211b;
    --coffee-800: #4b352b;
    --coffee-100: #f2e9e2;
    --surface: #ffffff;
    --border: #e8e1da;
    --muted: #746f69;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }

/* Compact global header, aligned with Guest and Dashboard. */
.board-header {
    min-height: 64px;
    padding: 10px 24px;
    background: var(--coffee-950);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 4px 18px rgba(47, 33, 27, .16);
}

.board-brand {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 9px;
    white-space: nowrap;
}

.board-brand-icon { font-size: 20px; }
.board-brand-name { font-size: 19px; font-weight: 800; }
.board-title { color: rgba(255,255,255,.72); font-size: 13px; font-weight: 600; }

.board-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 13px;
    white-space: nowrap;
}

.cafe-state {
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    font-size: 12px;
}
.cafe-state.open { background: rgba(62, 145, 95, .26); border-color: rgba(125, 207, 153, .48); }
.cafe-state.closed { background: rgba(171, 76, 68, .24); border-color: rgba(226, 137, 129, .42); }
.cafe-state.unknown { background: rgba(255,255,255,.08); }
.last-updated { color: rgba(255,255,255,.72); }
#cafe-error { color: #ffd0ca; font-weight: 700; }
#cafe-error:empty { display: none; }

.quick-order-link {
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-weight: 700;
}
.quick-order-link:hover { background: rgba(255,255,255,.1); }

main { padding: 10px 14px 14px; }

/* One compact toolbar on desktop: statuses + sort. */
.board-controls {
    min-height: 48px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.status-filter {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.control-label { font-size: 13px; font-weight: 800; color: var(--coffee-800); }
.checks { display: flex; align-items: center; gap: 5px 11px; flex-wrap: nowrap; }
.checks label { white-space: nowrap; cursor: pointer; font-size: 13px; }
input, select { accent-color: #6f4e37; }

.sort-control {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 800;
    color: var(--coffee-800);
}
select {
    padding: 6px 8px;
    border: 1px solid #d9d0c8;
    border-radius: 7px;
    background: white;
    color: #2b2927;
    font: inherit;
}

.error { color: #b54528; font-weight: 700; margin: 8px 0 0; }
.error:empty, #board-message:empty { display: none; }
#board-message { margin: 8px 0 0; }

.board-columns { display: flex; gap: .7rem; align-items: stretch; overflow-x: auto; padding: 9px 0 1rem; }
.board-column { --status-fill: #e5e7e9; --status-ink: #41484e; --status-accent: #6b737a; flex: 0 0 14rem; min-width: 14rem; border: 1px solid #cedbd5; background: white; border-radius: .85rem; overflow: hidden; }
.status-pending { --status-fill: #fff1c2; --status-ink: #604000; --status-accent: #8b6100; }
.status-accepted { --status-fill: #d8ecfb; --status-ink: #184d70; --status-accent: #286b98; }
.status-preparing { --status-fill: #ffe0bf; --status-ink: #703a0d; --status-accent: #aa5c17; }
.status-ready { --status-fill: #c8eee9; --status-ink: #11594f; --status-accent: #14796e; }
.status-delivering { --status-fill: #dedbfd; --status-ink: #44377a; --status-accent: #6253a4; }
.status-delivered { --status-fill: #d9efda; --status-ink: #205e31; --status-accent: #388147; }
.status-cancelled { --status-fill: #e5e7e9; --status-ink: #41484e; --status-accent: #6b737a; }
.board-column h2 { margin: 0; padding: .85rem; background: var(--status-fill); color: var(--status-ink); border-bottom: 3px solid var(--status-accent); font-size: 1.15rem; min-height: 4rem; }
.order-list { max-height: min(72vh, 850px); min-height: 6rem; overflow-y: auto; padding: .6rem; }
.order-number { font-size: 2rem; font-weight: 750; padding: .5rem; margin-bottom: .45rem; background: #f2f6f3; border-radius: .5rem; overflow-wrap: anywhere; }
.empty-column { color: #556765; }

footer { padding: 4px 14px 12px; color: var(--muted); font-size: 12px; }

@media (max-width: 980px) {
    .board-header { flex-wrap: wrap; gap: 7px 14px; }
    .board-meta { flex-wrap: wrap; }
    .board-controls { align-items: flex-start; flex-direction: column; }
    .status-filter { width: 100%; align-items: flex-start; }
    .checks { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .board-header { padding: 9px 12px; }
    .board-brand { width: 100%; }
    .board-title { display: none; }
    .board-meta { width: 100%; justify-content: flex-start; gap: 7px; }
    .last-updated { width: 100%; }
    main { padding: 8px; }
    .board-controls { padding: 8px; }
    .status-filter { flex-direction: column; gap: 6px; }
    .checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 6px 10px; }
    .sort-control { width: 100%; justify-content: space-between; }
    .board-column { flex-basis: 12rem; min-width: 12rem; }
}
