:root {
    --cmm-green: #1b7f3b;
    --cmm-green-dark: #135c2a;
    --cmm-text: #1d2b22;
    --cmm-muted: #5d6b62;
}

html, body { font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--cmm-text); }
h1:focus { outline: none; }

/* ---- top bar, brand, menu ---- */
.cmm-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.cmm-brand img { height: 36px; width: auto; }
.cmm-brand-text { font-size: 1.1rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.cmm-staging-chip { font-weight: 700; letter-spacing: .04em; }
.cmm-quicksearch { min-width: 260px; max-width: 420px; background: rgba(255,255,255,.95); border-radius: 8px; margin: 0 8px; }
.cmm-quicksearch .mud-input-control-input-container { background: transparent; }
.cmm-nav-group { display: block; padding: 14px 16px 2px; color: var(--cmm-muted); font-weight: 600; }
.cmm-logout { margin: 0; }
.cmm-logout button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 16px; cursor: pointer; font-size: .95rem; }
.cmm-logout button:hover { background: rgba(0,0,0,.06); }
.cmm-main { min-height: calc(100vh - 64px); }

@media (max-width: 720px) {
    .cmm-brand-text { display: none; }
    .cmm-quicksearch { min-width: 140px; }
    .cmm-staging-chip { display: none; }
}

/* ---- staging banner on the sign-in page ---- */
.cmm-staging-strip { background: #e0a100; color: #2b1d00; text-align: center; font-weight: 700; padding: 8px 12px; letter-spacing: .03em; }

/* ---- sign in / change password ---- */
.cmm-auth { min-height: 90vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: #f4f7f4; }
.cmm-auth-card { width: 100%; max-width: 380px; background: #fff; border-radius: 12px; padding: 28px 26px 22px; box-shadow: 0 6px 24px rgba(0,0,0,.10); text-align: center; }
.cmm-auth-card h1 { font-size: 1.35rem; margin: 6px 0 2px; color: var(--cmm-green-dark); }
.cmm-auth-logo { height: 84px; width: auto; }
.cmm-auth-card form { text-align: left; margin-top: 10px; }
.cmm-auth-card label { display: block; font-size: .85rem; color: var(--cmm-muted); margin: 12px 0 4px; }
.cmm-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #b9c6bd; border-radius: 8px; font-size: 1rem; }
.cmm-input:focus { outline: 2px solid var(--cmm-green); border-color: var(--cmm-green); }
.cmm-btn { width: 100%; margin-top: 18px; padding: 11px; border: 0; border-radius: 8px; background: var(--cmm-green); color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; }
.cmm-btn:hover { background: var(--cmm-green-dark); }
.cmm-auth-error { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: #fdecea; color: #8a1f1f; text-align: left; font-size: .92rem; }
.cmm-muted { color: var(--cmm-muted); font-size: .92rem; }
.cmm-hint { color: var(--cmm-muted); font-size: .8rem; text-align: left; margin: 6px 0; }

/* ---- pages ---- */
.cmm-page-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cmm-page-title h1 { margin: 0; font-size: 1.5rem; }
.cmm-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cmm-stat { padding: 14px 16px; border-radius: 10px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-left: 5px solid var(--cmm-green); }
.cmm-stat .n { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.cmm-stat .l { color: var(--cmm-muted); font-size: .85rem; }
.cmm-stat.warn { border-left-color: #e0a100; }
.cmm-stat.bad { border-left-color: #c62f2f; }
.cmm-stat a { text-decoration: none; color: inherit; }
.cmm-money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cmm-void { text-decoration: line-through; color: #8a8a8a; }
.cmm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cmm-cal-head { font-weight: 600; text-align: center; color: var(--cmm-muted); padding: 4px 0; }
.cmm-cal-day { min-height: 92px; background: #fff; border-radius: 6px; padding: 4px 5px; box-shadow: 0 1px 2px rgba(0,0,0,.08); overflow: hidden; }
.cmm-cal-day.out { background: transparent; box-shadow: none; }
.cmm-cal-day.pick { cursor: pointer; }
.cmm-cal-day.pick:hover { background: #f3f8f4; }
.cmm-cal-day.selected { background: #e3f1e7; outline: 2px solid var(--cmm-green); }
.cmm-cal-day:focus-visible { outline: 3px solid #0f5c8a; }
.cmm-cal-day.today { outline: 2px solid var(--cmm-green); }
.cmm-cal-num { font-size: .78rem; color: var(--cmm-muted); }
.cmm-cal-ev { display: block; font-size: .72rem; line-height: 1.25; padding: 1px 4px; margin-top: 2px; border-radius: 4px; color: #fff; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmm-cal-ev.Hall { background: #0f5c8a; }
.cmm-cal-ev.Delivery { background: #1b7f3b; }
.cmm-cal-ev.Return { background: #8a6d1d; }
.cmm-cal-ev.alert { background: #c62f2f; }
.cmm-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cmm-choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #c9d3cc; border-radius: 8px; background: #fff; cursor: pointer; }
.cmm-choice input { width: 22px; height: 22px; accent-color: var(--cmm-green); flex: none; }
.cmm-choice .name { flex: 1; }
.cmm-choice .price { color: var(--cmm-muted); white-space: nowrap; }
.cmm-choice:has(input:checked) { border-color: var(--cmm-green); background: #eaf5ec; }
.cmm-choice:has(input:disabled) { opacity: .7; cursor: default; }
.cmm-cal-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.cmm-cal-title { min-width: 150px; text-align: center; }
.cmm-cal-key { display: inline-block; width: 14px; height: 14px; padding: 0; margin: 0 2px 0 0; vertical-align: -2px; }
.cmm-cal-agenda { display: none; }
.cmm-cal-agenda-day { background: #fff; border-radius: 6px; padding: 6px 10px; margin-top: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cmm-cal-agenda-day.today { outline: 2px solid var(--cmm-green); }
.cmm-cal-agenda-day .d { font-weight: 600; font-size: .85rem; color: var(--cmm-muted); }
.cmm-cal-agenda-ev { display: block; color: inherit; text-decoration: none; padding: 3px 0; font-size: .9rem; }
@media (max-width: 720px) {
    .cmm-cal-day { min-height: 44px; padding: 3px; }
    /* names do not fit in a phone-sized square: show each event as a coloured bar and list them underneath */
    .cmm-cal-day .cmm-cal-ev { height: 6px; padding: 0; font-size: 0; margin-top: 3px; }
    .cmm-cal-agenda { display: block; }
    .cmm-cal-title { min-width: 0; flex: 1; }
}

/* ---- error bar ---- */
#blazor-error-ui { color-scheme: light only; background: #fff3cd; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

@media print { .mud-appbar, .mud-drawer, .no-print { display: none !important; } .mud-main-content { padding-top: 0 !important; margin: 0 !important; } }
