/* ChurchSimple — base styles. Deep green, warm sand, amber light. */
:root {
    --cs-primary: #1F5C4F;
    --cs-primary-dark: #154238;
    --cs-accent: #E9A23B;
    --cs-clay: #B9652B;
    --cs-bg: #F7F5F0;
    --cs-surface: #FFFFFF;
    --cs-border: #E4E0D7;
    --cs-text: #26302D;
    --cs-muted: #5F6B67;
    --cs-negative: #B3261E;
}

html, body { margin: 0; height: 100%; background: var(--cs-bg); color: var(--cs-text); font-family: Inter, "Segoe UI", Roboto, sans-serif; }
#app { min-height: 100%; }

.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--cs-primary); }
#blazor-error-ui { background: #FFF4D6; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* App bar and drawer */
.mud-appbar { border-bottom: 3px solid var(--cs-accent); }
.app-brand { display: flex; flex-direction: column; line-height: 1.1; }
.app-brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -.2px; }
.app-brand-church { font-size: .78rem; opacity: .85; }
.app-drawer { border-right: 1px solid var(--cs-border); }
.mud-nav-link.active { background: rgba(31, 92, 79, .09) !important; color: var(--cs-primary) !important; font-weight: 600; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.page-header-text { display: flex; align-items: center; gap: 12px; }
.page-header-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(31, 92, 79, .1); color: var(--cs-primary); display: flex; align-items: center; justify-content: center; }
.page-header-title { color: var(--cs-text); }
.page-header-subtitle { color: var(--cs-muted); max-width: 820px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.mud-paper { border: 1px solid var(--cs-border); }
.mud-table { border: 1px solid var(--cs-border); }

/* Stat cards */
.stat-card { border-left: 4px solid var(--cs-primary); height: 100%; }
.stat-card--success { border-left-color: #2E7D4F; }
.stat-card--warning { border-left-color: var(--cs-accent); }
.stat-card--error { border-left-color: var(--cs-negative); }
.stat-card--info { border-left-color: #2D6A9F; }
.stat-card--secondary { border-left-color: var(--cs-clay); }
.stat-card-label { color: var(--cs-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.stat-card-value { font-weight: 700; margin-top: 2px; }
.stat-card-hint { color: var(--cs-muted); }
.stat-card-icon { color: var(--cs-primary); opacity: .55; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--cs-muted); }

/* Numbers and reports */
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.negative { color: var(--cs-negative) !important; }
.cursor-pointer { cursor: pointer; }
.report-table td, .report-table th { white-space: nowrap; }
.report-table .section-row td { font-weight: 700; padding-top: 14px !important; color: var(--cs-primary); border-bottom: none; }
.report-table .total-row td { font-weight: 600; border-top: 1px solid var(--cs-text); }
.report-table .grand-row td { font-weight: 700; border-top: 2px solid var(--cs-text); border-bottom: 3px double var(--cs-text); }
.journal { border-left: 3px solid var(--cs-border); }

/* Dashboard bars */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar { width: 42%; border-radius: 3px 3px 0 0; min-height: 0; }
.bar-in { background: var(--cs-primary); }
.bar-out { background: var(--cs-accent); }
.bar-label { font-size: .7rem; color: var(--cs-muted); margin-top: 4px; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--cs-muted); }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Till */
.till { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.till-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.till-item { border: 1px solid var(--cs-border); background: var(--cs-surface); border-radius: 12px; padding: 14px 10px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 86px; font: inherit; }
.till-item:hover { border-color: var(--cs-primary); box-shadow: 0 2px 8px rgba(31,92,79,.12); }
.till-item:active { transform: scale(.98); }
.till-item-name { font-weight: 600; }
.till-item-price { color: var(--cs-primary); font-weight: 700; }
.till-item-stock { font-size: .72rem; color: var(--cs-muted); }
.till-item-stock.low { color: var(--cs-negative); }
.till-basket { position: sticky; top: 80px; }
.basket-line { display: flex; align-items: center; gap: 4px; }
.basket-name { flex: 1; }
.basket-qty { min-width: 24px; text-align: center; }
.basket-total { min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) { .till { grid-template-columns: 1fr; } .till-basket { position: static; } }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: radial-gradient(circle at 20% 20%, rgba(233,162,59,.18), transparent 40%), linear-gradient(135deg, #1F5C4F 0%, #154238 100%); }
.login-card { width: 100%; max-width: 440px; border-radius: 18px !important; }
.login-title { color: var(--cs-primary); font-weight: 700; }

.import-steps { padding-left: 20px; margin: 8px 0; }
.import-steps li { margin-bottom: 4px; }

@media print {
    .no-print, .mud-appbar, .mud-drawer, .mud-tabs-toolbar { display: none !important; }
    .mud-main-content { padding: 0 !important; margin: 0 !important; }
    .mud-paper, .mud-table { border: none !important; box-shadow: none !important; }
    body { background: #fff; }
}
