/* Floor Manager module visual language. Scoped entirely under .app-floormanager so it never
   leaks into the other PWAs, same convention as waiting.css/pricechecker.css. Reuses the
   --co-*/.btn-primary/.btn-secondary/.input/.field/.error/.modal-*/.table-card/.status-tab/
   .cart-lines tokens+components from app.css (defined globally on :root) so this module reads
   as part of the same app instead of a bolted-on skin, and the tables view lines up visually
   with the captain's own /tables page. */

.app-floormanager {
    background: var(--co-bg-grad);
    color: var(--co-text);
    min-height: 100vh;
    font-family: "Dubai", "Segoe UI Variable", "Segoe UI", Tahoma, Arial, sans-serif;
}

.app-floormanager * { box-sizing: border-box; }

/* ---------- Login screen ---------- */
.fm-login {
    max-width: 460px;
    width: 100%;
    margin: 4vh auto;
    padding: 32px;
    background: var(--co-surface);
    border-radius: var(--co-radius-lg);
    box-shadow: var(--co-shadow-lg);
}

.fm-login h1 { text-align: center; font-size: 1.6rem; color: var(--co-primary-dark); margin: 0 0 22px; }

.fm-input { font-size: 1.25rem !important; padding: 16px 18px !important; text-align: center; }

/* ---------- Topbar + tabs ---------- */
.fm-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(120deg, var(--co-primary-darker) 0%, var(--co-primary-dark) 55%, var(--co-primary) 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(10, 31, 61, .3);
}

.fm-topbar-title { font-size: 21px; font-weight: 800; }
.fm-topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm-topbar-user { font-size: 13px; font-weight: 700; }

.fm-topbar .btn-topbar {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,.14);
    border: 1.5px solid rgba(255,255,255,.32);
    color: #fff;
    padding: 8px 15px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 11px;
    cursor: pointer;
    transition: all var(--co-fast) var(--co-ease);
    white-space: nowrap;
    min-height: 36px;
}
.fm-topbar .btn-topbar:hover { background: rgba(255,255,255,.26); transform: translateY(-1px); }

.fm-tabs {
    position: sticky;
    top: 68px;
    z-index: 19;
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    background: var(--co-surface);
    border-bottom: 1px solid var(--co-border);
    box-shadow: var(--co-shadow-xs);
    overflow-x: auto;
}

.fm-tab {
    padding: 10px 20px;
    border-radius: var(--co-radius-pill);
    border: 1.5px solid var(--co-border);
    background: var(--co-surface-alt);
    color: var(--co-text-muted);
    font-weight: 800;
    font-size: 13.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--co-fast) var(--co-ease);
}
.fm-tab:hover { border-color: var(--co-primary); color: var(--co-primary-dark); }
.fm-tab.active { background: var(--co-primary); border-color: var(--co-primary); color: #fff; box-shadow: var(--co-shadow-primary); }

.fm-body { padding: 22px 24px 40px; max-width: 1400px; width: 100%; margin: 0 auto; animation: co-fade-up var(--co-med) var(--co-ease) backwards; }

/* ---------- Tables tab extras (elapsed badge) ---------- */

/* ---------- Held orders / delivery shared filter bar ---------- */
.fm-dit-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.fm-dit-tab {
    padding: 9px 18px;
    border-radius: var(--co-radius-pill);
    border: 1.5px solid var(--co-border);
    background: var(--co-surface);
    color: var(--co-text-muted);
    font-weight: 800;
    font-size: 12.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: var(--co-shadow-xs);
    transition: all var(--co-fast) var(--co-ease);
}
.fm-dit-tab:hover { border-color: var(--co-primary); }
.fm-dit-tab.active { background: var(--co-primary); border-color: var(--co-primary); color: #fff; box-shadow: var(--co-shadow-primary); }
.fm-dit-count {
    background: var(--co-surface-alt);
    border-radius: var(--co-radius-pill);
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 800;
    color: var(--co-text);
}
.fm-dit-tab.active .fm-dit-count { background: rgba(255,255,255,.25); color: #fff; }

.fm-dit-tabs .search-input { margin-inline-start: auto; min-width: 240px; }

/* ---------- Held orders / delivery cards ---------- */
.fm-held-grid, .fm-delivery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 14px;
}

.fm-held-card, .fm-delivery-card {
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    border-top: 4px solid var(--co-text-muted);
    border-radius: var(--co-radius);
    box-shadow: var(--co-shadow);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: transform var(--co-fast) var(--co-ease), box-shadow var(--co-fast) var(--co-ease);
    animation: co-fade-up var(--co-med) var(--co-ease) backwards;
}
.fm-held-card:hover, .fm-delivery-card:hover { transform: translateY(-3px); box-shadow: var(--co-shadow-lg); }

/* Order-type accent - takeaway/delivery/dine-in - matches the same warning/primary/success
   trio the tables board already uses for hold/printed/free, so a manager reads DIT color the
   same way across every tab of this module. */
.fm-held-card.dit-1 { border-top-color: var(--co-warning); background: linear-gradient(180deg, var(--co-warning-bg) 0%, var(--co-surface) 70px); }
.fm-held-card.dit-2 { border-top-color: var(--co-primary); background: linear-gradient(180deg, var(--co-primary-light) 0%, var(--co-surface) 70px); }
.fm-held-card.dit-3 { border-top-color: var(--co-success); background: linear-gradient(180deg, var(--co-success-bg) 0%, var(--co-surface) 70px); }

.fm-held-card-header, .fm-delivery-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.fm-held-dit-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 11px;
    border-radius: var(--co-radius-pill);
    background: var(--co-surface-alt);
    color: var(--co-text);
}
.fm-held-dit-badge.dit-1 { background: var(--co-warning-bg); color: #8a5108; }
.fm-held-dit-badge.dit-2 { background: var(--co-primary-light); color: var(--co-primary-dark); }
.fm-held-dit-badge.dit-3 { background: var(--co-success-bg); color: #0f7a4b; }

.fm-held-time { font-size: 11px; color: var(--co-text-muted); font-weight: 700; white-space: nowrap; }

.fm-held-line { font-size: 13px; color: var(--co-text); }
.fm-held-note {
    font-size: 12px;
    font-style: italic;
    color: var(--co-text);
    background: var(--co-surface-alt);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius-sm);
    padding: 6px 10px;
    margin-top: 4px;
}
.fm-held-reprint-badge {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 800;
    color: var(--co-danger);
    background: var(--co-danger-bg);
    border-radius: var(--co-radius-sm);
    padding: 3px 9px;
    margin-top: 2px;
}

.fm-held-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--co-border);
}
.fm-held-order-id { font-size: 12px; color: var(--co-text-muted); font-weight: 700; }
.fm-held-net { font-size: 16px; font-weight: 800; color: var(--co-primary-dark); }

/* ---------- Inquiries tab ---------- */
.fm-inq-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fm-inq-input { flex: 1 1 280px; min-width: 220px; font-size: 1.05rem !important; padding: 12px 16px !important; }

.fm-inq-dates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; font-size: 12.5px; font-weight: 700; color: var(--co-text-muted); }
.fm-inq-date { width: 160px !important; padding: 8px 10px !important; }

.fm-inq-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; }
.fm-inq-summary strong { color: var(--co-primary-dark); font-size: 15px; }

/* Status accent on a result card: still-open hold / cashed-out sale / sale return. */
.fm-held-card.inq-held { border-top-color: var(--co-warning); background: linear-gradient(180deg, var(--co-warning-bg) 0%, var(--co-surface) 70px); }
.fm-held-card.inq-cashed { border-top-color: var(--co-success); background: linear-gradient(180deg, var(--co-success-bg) 0%, var(--co-surface) 70px); }
.fm-held-card.inq-return { border-top-color: var(--co-danger); background: linear-gradient(180deg, var(--co-danger-bg) 0%, var(--co-surface) 70px); }

.fm-inq-status {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 11px;
    border-radius: var(--co-radius-pill);
    background: var(--co-surface-alt);
    color: var(--co-text);
}
.fm-inq-status.held { background: var(--co-warning-bg); color: #8a5108; }
.fm-inq-status.cashed { background: var(--co-success-bg); color: #0f7a4b; }
.fm-inq-status.return { background: var(--co-danger-bg); color: var(--co-danger); }

.fm-pay-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    padding: 8px 10px;
    background: var(--co-surface-alt);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius-sm);
}
.fm-pay-title { font-size: 12px; font-weight: 800; color: var(--co-text-muted); }
.fm-pay-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-pay-chip {
    font-size: 12px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--co-radius-pill);
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    color: var(--co-text);
}
.fm-pay-chip.cash { background: var(--co-success-bg); border-color: transparent; color: #0f7a4b; }
.fm-pay-chip.visa { background: var(--co-primary-light); border-color: transparent; color: var(--co-primary-dark); }
.fm-pay-chip.credit { background: var(--co-warning-bg); border-color: transparent; color: #8a5108; }
.fm-pay-chip.none { color: var(--co-text-muted); font-weight: 700; }

/* ---------- Cashed-out tab ---------- */
.fm-shift-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    box-shadow: var(--co-shadow-xs);
    font-size: 13.5px;
    font-weight: 700;
}
.fm-shift-bar strong { color: var(--co-primary-dark); }
.fm-shift-input { width: 90px !important; padding: 8px 10px !important; }

.fm-cashout-total {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: var(--co-primary-light);
    border-radius: var(--co-radius);
    font-size: 14px;
    font-weight: 700;
    color: var(--co-primary-dark);
}
.fm-cashout-total strong { font-size: 17px; }

.fm-cashout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }

.fm-cashout-card {
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    border-top: 4px solid var(--co-primary);
    border-radius: var(--co-radius);
    box-shadow: var(--co-shadow);
    padding: 18px;
    text-align: center;
    transition: transform var(--co-fast) var(--co-ease), box-shadow var(--co-fast) var(--co-ease);
}
.fm-cashout-card:hover { transform: translateY(-3px); box-shadow: var(--co-shadow-lg); }
.fm-cashout-card-name { font-size: 13px; font-weight: 800; color: var(--co-text-muted); margin-bottom: 10px; }
.fm-cashout-card-count { font-size: 30px; font-weight: 800; color: var(--co-primary-dark); line-height: 1; }
.fm-cashout-card-label { font-size: 11px; color: var(--co-text-muted); margin: 4px 0 10px; }
.fm-cashout-card-returns { font-size: 12px; color: var(--co-danger); margin-bottom: 6px; }
.fm-cashout-card-returns strong { font-size: 13px; }
.fm-cashout-card-net { font-size: 16px; font-weight: 800; color: var(--co-text); }
.fm-cashout-card-shares { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Held tab: numbers analysis (reuses the cashed-out cards, same DIT accents as the held cards) ---------- */
.fm-held-stats { margin-bottom: 14px; }
.fm-cashout-card.dit-1 { border-top-color: var(--co-warning); }
.fm-cashout-card.dit-2 { border-top-color: var(--co-primary); }
.fm-cashout-card.dit-3 { border-top-color: var(--co-success); }
.fm-cashout-card.dit-0 { border-top-color: var(--co-text-muted); }
.fm-held-insights { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.fm-held-insights .stat-chip-mini { padding: 6px 12px; font-size: 12px; }
.stat-chip-mini.warn { background: var(--co-warning-bg); color: #8a5108; }
.fm-held-filterbar { margin-top: 22px; }

/* ---------- Cashed-out tab: collapsible detail sections (type breakdown, cash-by-user,
   returns, safe balances, void items) ---------- */
.fm-section-card {
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    box-shadow: var(--co-shadow-xs);
    margin-top: 16px;
    overflow: hidden;
}
.fm-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--co-text);
    cursor: pointer;
    user-select: none;
}
.fm-section-header:hover { background: var(--co-surface-alt); }
.fm-section-toggle { color: var(--co-text-muted); transition: transform var(--co-fast) var(--co-ease); }
.fm-section-toggle.open { transform: rotate(180deg); }

.fm-table-scroll { overflow-x: auto; border-top: 1px solid var(--co-border); }
.fm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fm-table th {
    background: var(--co-surface-alt);
    color: var(--co-text-muted);
    font-weight: 700;
    padding: 10px 12px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--co-border);
}
.fm-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--co-border);
    color: var(--co-text);
    white-space: nowrap;
}
.fm-table tr:last-child td { border-bottom: none; }
.fm-table tbody tr:hover td { background: var(--co-surface-alt); }
/* Same side as the (right-aligned) column headers, otherwise the figures sit far left of their own column. */
.fm-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.stat-chip-mini {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--co-radius-pill);
    background: var(--co-primary-light);
    color: var(--co-primary-dark);
    font-size: 10.5px;
    font-weight: 700;
}

/* ---------- Delivery tab ---------- */
.fm-delivery-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.fm-delivery-summary-chip {
    padding: 9px 18px;
    border-radius: var(--co-radius-pill);
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: var(--co-shadow-xs);
}
.fm-delivery-summary-chip strong { font-size: 15px; }
.fm-delivery-summary-chip.unassigned strong { color: var(--co-danger); }
.fm-delivery-summary-chip.assigned strong { color: var(--co-warning); }
.fm-delivery-summary-chip.delivered strong { color: var(--co-success); }
.fm-delivery-summary-chip { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.fm-delivery-summary-chip:hover { transform: translateY(-1px); }
.fm-delivery-summary-chip.active { box-shadow: 0 0 0 2px var(--co-primary); }

.fm-delivery-zones {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: var(--co-radius-md);
    background: var(--co-surface-alt);
    border: 1px solid var(--co-border);
}
.fm-delivery-zones-title { font-size: 12px; font-weight: 700; color: var(--co-text-muted); }
.fm-delivery-zone-chip {
    cursor: pointer;
    padding: 5px 12px;
    border-radius: var(--co-radius-pill);
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    font-size: 12px;
    font-weight: 700;
    transition: box-shadow .15s, transform .15s;
}
.fm-delivery-zone-chip:hover { transform: translateY(-1px); }
.fm-delivery-zone-chip.active { box-shadow: 0 0 0 2px var(--co-primary); }
.fm-delivery-zone-chip strong { color: var(--co-danger); }

.fm-delivery-card.unassigned { border-top-color: var(--co-danger); background: linear-gradient(180deg, var(--co-danger-bg) 0%, var(--co-surface) 70px); }
.fm-delivery-card.assigned { border-top-color: var(--co-warning); background: linear-gradient(180deg, var(--co-warning-bg) 0%, var(--co-surface) 70px); }
.fm-delivery-card.delivered { border-top-color: var(--co-success); background: linear-gradient(180deg, var(--co-success-bg) 0%, var(--co-surface) 70px); }

.fm-delivery-card.overdue {
    border-top-color: var(--co-danger);
    border: 1px solid var(--co-danger);
    background: linear-gradient(180deg, var(--co-danger-bg) 0%, var(--co-surface) 70px);
    animation: fm-overdue-pulse 1.6s ease-in-out infinite;
}
@keyframes fm-overdue-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}
.fm-delivery-overdue-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--co-radius-pill);
    background: var(--co-danger);
    color: #fff;
}

.fm-delivery-status-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 11px;
    border-radius: var(--co-radius-pill);
}
.fm-delivery-status-badge.unassigned { background: var(--co-danger-bg); color: var(--co-danger); }
.fm-delivery-status-badge.assigned { background: var(--co-warning-bg); color: #8a5108; }
.fm-delivery-status-badge.delivered { background: var(--co-success-bg); color: #0f7a4b; }

.fm-delivery-timings { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fm-delivery-timing-chip {
    font-size: 11px;
    font-weight: 700;
    color: var(--co-text-muted);
    background: var(--co-surface-alt);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius-sm);
    padding: 3px 8px;
}

/* ---------- Kitchen print follow-up tab (manual refresh only - no timer) ---------- */
.fm-kp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fm-kp-bar .btn-primary { width: auto; }
.fm-kp-updated { font-size: 12px; font-weight: 700; color: var(--co-text-muted); }
.fm-kp-select { width: auto !important; min-width: 140px; padding: 10px 12px !important; }
.fm-kp-search { flex: 1 1 260px; font-size: 14px !important; padding: 10px 14px !important; }
.fm-kp-hint { font-size: 12px; margin: 0 0 6px; }

.fm-kp-table tbody tr { cursor: pointer; }
.fm-kp-table tr.waiting td, .fm-kp-table tr.pending td { background: var(--co-warning-bg); }
.fm-kp-table tr.late td, .fm-kp-table tr.failed td { background: var(--co-danger-bg); }
.fm-kp-table tr.failed td { color: var(--co-danger); }
.fm-kp-table tr.printed td { background: var(--co-success-bg); }
.fm-kp-table tr.nolog td { color: var(--co-text-muted); }

.fm-kp-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 11px;
    border-radius: var(--co-radius-pill);
    background: var(--co-surface-alt);
    color: var(--co-text);
}
.fm-kp-status.waiting, .fm-kp-status.pending { background: var(--co-warning-bg); color: #8a5108; }
.fm-kp-status.late, .fm-kp-status.failed { background: var(--co-danger-bg); color: var(--co-danger); }
.fm-kp-status.printed { background: var(--co-success-bg); color: #0f7a4b; }

.fm-kp-modal { max-width: 720px; }
.fm-kp-banner {
    padding: 10px 14px;
    border-radius: var(--co-radius-sm);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 12px;
    background: var(--co-surface-alt);
    color: var(--co-text);
}
.fm-kp-banner.waiting, .fm-kp-banner.pending { background: var(--co-warning-bg); color: #8a5108; }
.fm-kp-banner.late, .fm-kp-banner.failed { background: var(--co-danger-bg); color: var(--co-danger); }
.fm-kp-banner.printed { background: var(--co-success-bg); color: #0f7a4b; }
.fm-kp-error {
    padding: 9px 12px;
    margin-bottom: 12px;
    border-radius: var(--co-radius-sm);
    background: var(--co-danger-bg);
    color: var(--co-danger);
    font-size: 12.5px;
    font-weight: 700;
    word-break: break-word;
}
.fm-kp-why {
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius-sm);
    background: var(--co-surface-alt);
    font-size: 12.5px;
}
.fm-kp-why-title { font-weight: 800; margin-bottom: 4px; }
.fm-kp-why ul { margin: 0; padding-inline-start: 18px; }
.fm-kp-why li { margin: 2px 0; line-height: 1.5; }
.fm-kp-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.fm-kp-group { border: 1px solid var(--co-border); border-radius: var(--co-radius-sm); padding: 10px 12px; background: var(--co-surface); }
.fm-kp-group-title { font-size: 12px; font-weight: 800; color: var(--co-primary-dark); margin-bottom: 6px; }
.fm-kp-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 12.5px; }
.fm-kp-label { color: var(--co-text-muted); flex-shrink: 0; }
.fm-kp-value { font-weight: 700; text-align: left; word-break: break-word; }

/* ---------- Dashboard tab ---------- */
.fm-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.fm-dash-title { font-size: 22px; font-weight: 800; color: var(--co-primary-dark); }
.fm-dash-sub { font-size: 13px; font-weight: 700; color: var(--co-text-muted); margin-top: 2px; }
.fm-dash-sub strong { color: var(--co-primary-dark); }
.fm-dash-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fm-dash-head-actions .btn-primary { width: auto; }

.fm-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 14px; }
.fm-kpi {
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    border-inline-start: 4px solid var(--co-primary);
    border-radius: var(--co-radius);
    box-shadow: var(--co-shadow);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: co-fade-up var(--co-med) var(--co-ease) backwards;
}
.fm-kpi.accent { background: linear-gradient(135deg, var(--co-primary-dark), var(--co-primary)); border-color: transparent; color: #fff; }
.fm-kpi.accent .fm-kpi-label, .fm-kpi.accent .fm-kpi-foot { color: rgba(255,255,255,.8); }
.fm-kpi.accent .fm-kpi-value { color: #fff; }
.fm-kpi.warn { border-inline-start-color: var(--co-warning); }
.fm-kpi.danger { border-inline-start-color: var(--co-danger); background: linear-gradient(180deg, var(--co-danger-bg) 0%, var(--co-surface) 80px); }
.fm-kpi-label { font-size: 12.5px; font-weight: 800; color: var(--co-text-muted); }
.fm-kpi-value { font-size: 30px; font-weight: 800; line-height: 1.15; color: var(--co-primary-dark); font-variant-numeric: tabular-nums; }
.fm-kpi-of { font-size: 14px; font-weight: 700; color: var(--co-text-muted); }
.fm-kpi-foot { font-size: 12px; font-weight: 700; color: var(--co-text-muted); }
.fm-meter { height: 6px; border-radius: 3px; background: var(--co-surface-alt); overflow: hidden; margin: 4px 0 2px; }
.fm-meter span { display: block; height: 100%; border-radius: 3px; background: var(--co-primary); }

.fm-dash-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.fm-dash-row .fm-dash-card.wide { grid-column: span 2; }
@media (max-width: 760px) { .fm-dash-row .fm-dash-card.wide { grid-column: auto; } }
.fm-dash-card {
    background: var(--co-surface);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    box-shadow: var(--co-shadow-xs);
    padding: 16px 18px;
    min-width: 0;
}
.fm-dash-card-title { font-size: 14px; font-weight: 800; margin-bottom: 12px; color: var(--co-text); }
.fm-dash-card.alerts { border-top: 4px solid var(--co-danger); }

/* Sales by hour */
.fm-hours { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 18px; }
.fm-hour { flex: 1 1 0; min-width: 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.fm-hour-val { font-size: 11px; font-weight: 800; color: var(--co-primary-dark); white-space: nowrap; height: 14px; }
.fm-hour-bar { width: 100%; max-width: 38px; background: var(--co-primary); opacity: .55; border-radius: 4px 4px 0 0; transition: opacity var(--co-fast) var(--co-ease); }
.fm-hour:hover .fm-hour-bar, .fm-hour-bar.peak { opacity: 1; }
.fm-hour-lbl { font-size: 11px; font-weight: 700; color: var(--co-text-muted); }

/* Payment split */
.fm-stack { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.fm-stack-seg { flex-basis: 0; min-width: 4px; }
.fm-stack-seg.cash, .fm-dot.cash { background: var(--co-success); }
.fm-stack-seg.visa, .fm-dot.visa { background: var(--co-primary); }
.fm-stack-seg.credit, .fm-dot.credit { background: var(--co-warning); }
.fm-legend-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--co-border); }
.fm-legend-row:last-child { border-bottom: none; }
.fm-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.fm-legend-name { font-weight: 700; flex: 1; }
.fm-legend-val { font-weight: 800; font-variant-numeric: tabular-nums; }
.fm-legend-pct { width: 40px; text-align: end; color: var(--co-text-muted); font-weight: 700; }

/* Horizontal bars (order types, top items, cashiers) */
.fm-hbar { margin-bottom: 11px; }
.fm-hbar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.fm-hbar-head span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-hbar-head span:last-child { color: var(--co-text-muted); white-space: nowrap; }
.fm-hbar-head strong { color: var(--co-text); }
.fm-hbar-track { height: 8px; border-radius: 4px; background: var(--co-surface-alt); overflow: hidden; }
.fm-hbar-track span { display: block; height: 100%; border-radius: 4px; background: var(--co-primary); }
.fm-hbar-track span.dit-1 { background: var(--co-warning); }
.fm-hbar-track span.dit-3 { background: var(--co-success); }

/* Attention list */
.fm-alert { padding: 9px 12px; border-radius: var(--co-radius-sm); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.fm-alert.danger { background: var(--co-danger-bg); color: var(--co-danger); }
.fm-alert.warn { background: var(--co-warning-bg); color: #8a5108; }
