/* TeamChow admin theme: sits on top of Studio (app.min.css). */

:root {
    --cx-bg: #f6f4ef;
    --cx-surface: #ffffff;
    --cx-surface-2: #faf8f4;
    --cx-ink: #17181c;
    --cx-ink-2: #3d3f46;
    --cx-muted: #72747c;
    --cx-line: #e8e4dc;
    --cx-line-2: #f0ede6;
    --cx-brand: #d4500f;
    --cx-brand-ink: #a63b06;
    --cx-brand-soft: #fdeee4;
    --cx-ok: #23824a;
    --cx-ok-soft: #e4f4ea;
    --cx-warn: #b26a00;
    --cx-warn-soft: #fdf2dc;
    --cx-bad: #c4322b;
    --cx-bad-soft: #fbe6e4;
    --cx-info: #2a62c9;
    --cx-info-soft: #e6eefc;
    --cx-radius: 14px;
    --cx-radius-sm: 10px;
    --cx-shadow: 0 1px 2px rgba(23, 24, 28, .04), 0 1px 1px rgba(23, 24, 28, .02);
    --cx-shadow-lg: 0 10px 30px -12px rgba(23, 24, 28, .18);

    --bs-theme: var(--cx-brand) !important;
    --bs-theme-rgb: 212, 80, 15 !important;
    --bs-primary: var(--cx-brand);
    --bs-primary-rgb: 212, 80, 15;
    --bs-link-color: var(--cx-brand-ink);
    --bs-link-color-rgb: 166, 59, 6;
    --bs-link-hover-color: var(--cx-brand);
}

[data-bs-theme="dark"] {
    --cx-bg: #121316;
    --cx-surface: #1b1c20;
    --cx-surface-2: #202227;
    --cx-ink: #f1efe9;
    --cx-ink-2: #cfccc4;
    --cx-muted: #9a9890;
    --cx-line: #2c2e34;
    --cx-line-2: #25272c;
    --cx-brand-soft: rgba(212, 80, 15, .16);
    --cx-ok-soft: rgba(35, 130, 74, .18);
    --cx-warn-soft: rgba(178, 106, 0, .2);
    --cx-bad-soft: rgba(196, 50, 43, .2);
    --cx-info-soft: rgba(42, 98, 201, .2);
}

/* ---------- Shell ---------- */

body, .app, .app-content { background: var(--cx-bg); }
body { color: var(--cx-ink); -webkit-font-smoothing: antialiased; }
.app-content { padding: 28px 32px 48px; }
@media (max-width: 767.98px) { .app-content { padding: 18px 14px 40px; } }

.app-header {
    background: var(--cx-surface);
    border-bottom: 1px solid var(--cx-line);
    box-shadow: none;
}
.app-header .brand .brand-logo { gap: 10px; text-decoration: none; }
.cx-brand-mark {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    display: inline-grid; place-items: center;
    background: var(--cx-brand); color: #fff;
    font-weight: 800; font-size: 15px; letter-spacing: -.02em;
}
.cx-brand-name { font-weight: 700; color: var(--cx-ink); letter-spacing: -.01em; font-size: 1.05rem; line-height: 1.1; }
.cx-brand-sub { display: block; font-size: .68rem; font-weight: 600; color: var(--cx-muted); text-transform: uppercase; letter-spacing: .08em; }

.app-sidebar { background: var(--cx-surface); border-right: 1px solid var(--cx-line); }
.app-sidebar .menu .menu-header {
    font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
    color: var(--cx-muted); font-weight: 700; margin-top: 14px;
}
.app-sidebar .menu .menu-item .menu-link {
    border-radius: 9px; color: var(--cx-ink-2); font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}
.app-sidebar .menu .menu-item .menu-link:hover { background: var(--cx-surface-2); color: var(--cx-ink); }
.app-sidebar .menu .menu-item.active > .menu-link {
    background: var(--cx-brand-soft); color: var(--cx-brand-ink); font-weight: 600;
}
.app-sidebar .menu .menu-item.active > .menu-link .menu-icon { color: var(--cx-brand); }
.app-sidebar .menu .menu-icon { color: var(--cx-muted); }
.app-sidebar .menu .menu-header.cx-legacy { color: var(--cx-warn); }

/* ---------- Bootstrap / Studio polish ---------- */

h1, h2, h3, h4, h5, .page-header { color: var(--cx-ink); letter-spacing: -.015em; }
.page-header { font-weight: 700; }
.page-header small { color: var(--cx-muted); font-weight: 400; letter-spacing: 0; }
.breadcrumb { font-size: .8rem; }
.breadcrumb a { color: var(--cx-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--cx-brand-ink); }

.card, .panel {
    background: var(--cx-surface);
    border: 1px solid var(--cx-line);
    border-radius: var(--cx-radius);
    box-shadow: var(--cx-shadow);
}
.card { overflow: hidden; }
.card-header, .panel > .panel-heading, .panel-inverse > .panel-heading {
    background: var(--cx-surface);
    color: var(--cx-ink);
    border-bottom: 1px solid var(--cx-line-2);
    font-weight: 600;
}
.panel > .panel-heading { border-radius: var(--cx-radius) var(--cx-radius) 0 0; }
.panel-inverse > .panel-heading .panel-title { color: var(--cx-ink); }
.card-footer { background: var(--cx-surface-2); border-top: 1px solid var(--cx-line-2); }

.btn { border-radius: var(--cx-radius-sm); font-weight: 600; }
.btn-primary, .btn-theme {
    --bs-btn-bg: var(--cx-brand); --bs-btn-border-color: var(--cx-brand);
    --bs-btn-hover-bg: var(--cx-brand-ink); --bs-btn-hover-border-color: var(--cx-brand-ink);
    --bs-btn-active-bg: var(--cx-brand-ink); --bs-btn-active-border-color: var(--cx-brand-ink);
    --bs-btn-disabled-bg: var(--cx-brand); --bs-btn-disabled-border-color: var(--cx-brand);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
}
.btn-outline-primary {
    --bs-btn-color: var(--cx-brand-ink); --bs-btn-border-color: var(--cx-brand);
    --bs-btn-hover-bg: var(--cx-brand); --bs-btn-hover-border-color: var(--cx-brand); --bs-btn-hover-color: #fff;
}
.btn-light { --bs-btn-bg: var(--cx-surface); --bs-btn-border-color: var(--cx-line); --bs-btn-hover-bg: var(--cx-surface-2); --bs-btn-hover-border-color: var(--cx-line); }

.form-control, .form-select { border-radius: var(--cx-radius-sm); border-color: var(--cx-line); background-color: var(--cx-surface); }
.form-control:focus, .form-select:focus { border-color: var(--cx-brand); box-shadow: 0 0 0 .2rem rgba(212, 80, 15, .14); }
.form-check-input:checked { background-color: var(--cx-brand); border-color: var(--cx-brand); }
.form-label { font-weight: 600; font-size: .85rem; color: var(--cx-ink-2); }

.table { --bs-table-bg: transparent; color: var(--cx-ink); }
.table > thead > tr > th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--cx-muted); font-weight: 700; background: var(--cx-surface-2);
    border-bottom: 1px solid var(--cx-line); white-space: nowrap;
}
.table > :not(caption) > * > * { border-color: var(--cx-line-2); }

.badge { font-weight: 600; letter-spacing: .01em; border-radius: 999px; padding: .35em .7em; }
.alert { border-radius: var(--cx-radius-sm); border-width: 1px; }
.modal-content { border-radius: var(--cx-radius); border: 1px solid var(--cx-line); box-shadow: var(--cx-shadow-lg); }
.dropdown-menu { border-radius: var(--cx-radius-sm); border-color: var(--cx-line); box-shadow: var(--cx-shadow-lg); }
.pagination .page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--cx-line); color: var(--cx-ink-2); }
.pagination .page-item.active .page-link { background: var(--cx-brand); border-color: var(--cx-brand); color: #fff; }

/* ---------- Canteen components ---------- */

.cx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cx-head h1 { font-size: 1.65rem; font-weight: 750; margin: 0; }
.cx-head p { margin: 4px 0 0; color: var(--cx-muted); max-width: 62ch; }
.cx-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cx-eyebrow { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--cx-brand-ink); margin-bottom: 4px; }

.cx-card { background: var(--cx-surface); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); box-shadow: var(--cx-shadow); }
.cx-card + .cx-card { margin-top: 16px; }
.cx-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--cx-line-2); }
.cx-card-head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.cx-card-head .cx-sub { font-size: .8rem; color: var(--cx-muted); }
.cx-card-body { padding: 18px; }
.cx-card-body.p-0 { padding: 0; }

.cx-grid { display: grid; gap: 16px; }
.cx-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1199.98px) { .cx-grid-main, .cx-grid-2 { grid-template-columns: minmax(0, 1fr); } }

.cx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.cx-stat { background: var(--cx-surface); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 16px 18px; box-shadow: var(--cx-shadow); position: relative; }
.cx-stat-label { font-size: .78rem; color: var(--cx-muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cx-stat-value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 6px; line-height: 1.1; }
.cx-stat-foot { font-size: .78rem; color: var(--cx-muted); margin-top: 6px; }
.cx-stat.is-brand { background: var(--cx-ink); border-color: var(--cx-ink); color: #fff; }
.cx-stat.is-brand .cx-stat-label, .cx-stat.is-brand .cx-stat-foot { color: rgba(255, 255, 255, .7); }
[data-bs-theme="dark"] .cx-stat.is-brand { background: var(--cx-brand); border-color: var(--cx-brand); }

.cx-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; line-height: 1.3; white-space: nowrap; background: var(--cx-line-2); color: var(--cx-ink-2); }
.cx-chip.ok { background: var(--cx-ok-soft); color: var(--cx-ok); }
.cx-chip.warn { background: var(--cx-warn-soft); color: var(--cx-warn); }
.cx-chip.bad { background: var(--cx-bad-soft); color: var(--cx-bad); }
.cx-chip.info { background: var(--cx-info-soft); color: var(--cx-info); }
.cx-chip.brand { background: var(--cx-brand-soft); color: var(--cx-brand-ink); }

.cx-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--cx-muted); flex: none; }
.cx-dot.live { background: var(--cx-ok); box-shadow: 0 0 0 0 rgba(35, 130, 74, .45); animation: cx-pulse 1.8s infinite; }
@keyframes cx-pulse { 0% { box-shadow: 0 0 0 0 rgba(35, 130, 74, .45); } 70% { box-shadow: 0 0 0 7px rgba(35, 130, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(35, 130, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .cx-dot.live { animation: none; } }

.cx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.cx-table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--cx-muted); font-weight: 700; padding: 10px 16px; background: var(--cx-surface-2); border-bottom: 1px solid var(--cx-line); white-space: nowrap; text-align: left; }
.cx-table td { padding: 11px 16px; border-bottom: 1px solid var(--cx-line-2); vertical-align: middle; }
.cx-table tr:last-child td { border-bottom: 0; }
.cx-table tbody tr:hover td { background: var(--cx-surface-2); }
.cx-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cx-table-wrap { overflow-x: auto; }

.cx-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cx-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--cx-brand-soft); color: var(--cx-brand-ink); overflow: hidden; }
.cx-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cx-person-name { font-weight: 650; color: var(--cx-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-person-meta { font-size: .76rem; color: var(--cx-muted); }

.cx-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--cx-line-2); }
.cx-filter .form-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cx-muted); margin-bottom: 4px; }
.cx-filter .form-control, .cx-filter .form-select { min-width: 150px; height: 38px; }

.cx-empty { text-align: center; padding: 42px 20px; color: var(--cx-muted); }
.cx-empty i { font-size: 1.6rem; opacity: .5; display: block; margin-bottom: 10px; }

.cx-list { list-style: none; margin: 0; padding: 0; }
.cx-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--cx-line-2); }
.cx-list li:last-child { border-bottom: 0; }

.cx-bar { height: 6px; background: var(--cx-line-2); border-radius: 999px; overflow: hidden; }
.cx-bar > span { display: block; height: 100%; background: var(--cx-brand); border-radius: 999px; }

.cx-meal-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--cx-surface-2); flex: none; border: 1px solid var(--cx-line-2); }
.cx-meal-thumb.lg { width: 64px; height: 64px; border-radius: 12px; }
.cx-meal-thumb-fallback { display: grid; place-items: center; color: var(--cx-muted); }

.cx-segmented { display: inline-flex; background: var(--cx-surface-2); border: 1px solid var(--cx-line); border-radius: 11px; padding: 3px; gap: 2px; }
.cx-segmented a, .cx-segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: .84rem; font-weight: 600; color: var(--cx-ink-2); text-decoration: none; }
.cx-segmented .active { background: var(--cx-surface); color: var(--cx-ink); box-shadow: var(--cx-shadow); }

.cx-muted { color: var(--cx-muted); }
.cx-num { font-variant-numeric: tabular-nums; }
