/*
 * Operator portal theme, built for touchscreens (phones and tablets at the counter).
 * Large tap targets (48px minimum, main actions larger), large tokens and timers,
 * and on phones the main action sits in a bar at the bottom of the screen.
 * Shared pieces (dialogs, status pills) come from ../dashboard/css/fq-components.css.
 */

/* ---------- Base ---------- */
#content-wrapper, #content { background-color: #f5f7f8 !important; }
body { font-size: 1.05rem; }
.btn, a, button { touch-action: manipulation; }   /* no double-tap zoom delay */
.fq-op-card { border-radius: 16px; }
.fq-op-card > .card-body { padding: 1.25rem; }

/* ---------- Top bar ---------- */
.topbar { height: 4.25rem; }
.fq-op-brand { display: inline-flex; align-items: center; gap: .6rem; color: #2f3a4a; text-decoration: none; min-height: 48px; }
.fq-op-brand:hover { color: #2f3a4a; text-decoration: none; }
.fq-op-brand .fq-op-mark { width: auto; height: 38px; }
.fq-op-brand .fq-op-wordmark { display: block; width: auto; height: 22px; margin-bottom: .1rem; }
.fq-op-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.fq-op-brand small { font-size: .8rem; color: #6b7780; font-weight: 600; }
.topbar .img-profile { width: 2.5rem; height: 2.5rem; }

/* ---------- Header row of the main card ---------- */
.fq-op-card .card-header { background: #fff; padding: .75rem 1.25rem; }
.fq-op-card .card-header .d-flex.w-50:empty { display: none !important; }
.fq-op-card .card-header:has(#PH_OP_BACK[style*="none"]) { display: none !important; }
#PH_OP_BACK .btn { min-height: 48px; padding: .5rem 1rem; font-size: 1rem; border-radius: 10px; display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Operator picker: big tiles ---------- */
.fq-op-pick-head { margin-bottom: 1.5rem; text-align: center; }
.fq-op-pick-head .fq-page-title { font-size: 1.6rem; }
.fq-op-pick-head .fq-page-desc { font-size: 1rem; }
.fq-op-pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 360px)); justify-content: center; gap: 1rem; }   /* tiles stay a centred group */
.fq-op-pick {
    display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; min-height: 96px;
    background: #fff; border: 2px solid #e3e7ea; border-radius: 16px; color: #2f3a4a; text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
.fq-op-pick:hover, .fq-op-pick:focus { border-color: #22847a; box-shadow: 0 .5rem 1.25rem rgba(47, 58, 74, .1); text-decoration: none; color: #2f3a4a; outline: none; }
.fq-op-pick:active { background: #f6f8f9; }
.fq-op-pick img { width: 64px; height: 64px; object-fit: cover; flex-shrink: 0; background: #e3f3f0; }
.fq-op-pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.fq-op-pick-text strong { font-size: 1.3rem; line-height: 1.2; overflow-wrap: anywhere; }
.fq-op-pick-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .95rem; font-weight: 700; }
.fq-op-pick-status::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.fq-op-pick-status.on { color: #22847a; }
.fq-op-pick-status.off { color: #6b7780; }
.fq-op-pick-stats { display: flex; flex-direction: column; gap: .2rem; color: #4f5b63; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fq-op-pick-stats span { display: inline-flex; align-items: center; gap: .3rem; }
.fq-op-pick-stats .ph-duotone { font-size: 1.25rem; color: #22847a; vertical-align: 0; }
.fq-op-pick-go { color: #8fd3ca; font-size: 1.6rem; }

/* ---------- Workspace header ---------- */
.fq-op-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid #eef1f3; }
.fq-op-name { margin: 0; font-size: 1.5rem; font-weight: 700; color: #2f3a4a; display: inline-flex; align-items: center; gap: .5rem; }
.fq-op-name .ph-duotone { color: #22847a; font-size: 1.6rem; }
.fq-op-onoff .fq-qm-status { font-size: .95rem; padding: .45rem .9rem; }
.fq-op-onoff .fq-qm-status::before { width: 10px; height: 10px; }
.fq-op-head .btn { min-height: 52px; padding: .6rem 1.2rem; font-size: 1.05rem; font-weight: 700; border-radius: 12px; }
.fq-op-head .btn .ph-duotone { font-size: 1.4rem; }
.fq-op-next { margin-left: auto; }
.fq-op-next .fq-qm-controls { gap: .6rem; }
.fq-op-next .fq-btn-primary { min-height: 60px; padding: .75rem 1.6rem; font-size: 1.2rem; box-shadow: 0 .4rem 1rem rgba(34, 132, 122, .25); }

/* ---------- Workspace body ---------- */
.fq-op-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.fq-op-section { display: flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7780; margin-bottom: .7rem; }
.fq-op-serving-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }

/* serving card: huge token, clear timer, Finish first */
.fq-op-job { background: #fff; border: 2px solid #e3e7ea; border-left: 6px solid #2f3a4a; border-radius: 16px; padding: 1.1rem 1.25rem 1.25rem; }
.fq-op-job-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.fq-op-job-token span, .fq-op-job-timer span { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7780; }
.fq-op-job-token strong { display: block; font-size: 3.75rem; font-weight: 800; color: #2f3a4a; line-height: 1; font-variant-numeric: tabular-nums; }
.fq-op-job-channel { font-size: 2rem; line-height: 1; }
.fq-op-job-channel .ph-duotone { vertical-align: 0; }
.fq-op-job-timer { margin: .75rem 0 1rem; }
.fq-op-job-timer strong { font-size: 1.6rem; font-weight: 700; color: #22847a; font-variant-numeric: tabular-nums; }
.fq-op-finish { width: 100%; min-height: 60px; font-size: 1.25rem; font-weight: 700; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: .6rem; }
.fq-op-finish .ph-duotone { font-size: 1.6rem; vertical-align: 0; }
.fq-op-job-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.fq-op-job-actions .btn { min-height: 56px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; font-weight: 700; border-radius: 12px; padding: .4rem; font-size: .9rem; }
.fq-op-job-actions .btn .ph-duotone { font-size: 1.45rem; vertical-align: 0; }

/* your queue */
.fq-op-queue { background: #fff; border: 2px solid #e3e7ea; border-radius: 16px; padding: 1rem; max-height: 70vh; overflow-y: auto; }
.fq-op-waiting { display: flex; flex-direction: column; gap: .5rem; }
.fq-op-wait { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 56px; padding: .5rem .85rem; border: 1px solid #eef1f3; border-radius: 12px; background: #fafbfc; }
.fq-op-wait-token { font-size: 1.6rem; font-weight: 800; color: #2f3a4a; font-variant-numeric: tabular-nums; }
.fq-op-wait .badge { font-size: .9rem; font-weight: 700; border-radius: 999px; padding: .4em .75em; }
.fq-op-wait-empty { color: #6b7780; font-size: 1rem; padding: .75rem 0; }
.fq-op-queue .fq-serving-count { min-width: 2rem; height: 2rem; font-size: .95rem; }

/* empty states */
.fq-op-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; padding: 3rem 1.25rem; border: 2px dashed #cfd6db; border-radius: 16px; color: #6b7780; font-size: 1rem; }
.fq-op-empty .ph-duotone { font-size: 3.25rem; color: #8fd3ca; margin-bottom: .25rem; }
.fq-op-empty strong { color: #2f3a4a; font-size: 1.25rem; }

/* muted badges for wait times */
.badge-success { background: #e1f1e5; color: #2f7a4a; }
.badge-warning { background: #f8eed8; color: #8a5a0c; }
.badge-danger  { background: #f6e1e1; color: #a33f3c; }

/* ---------- Dialogs: touch friendly ---------- */
.fq-modal .modal-footer .btn, .fq-modal .fq-step-actions .btn { min-height: 52px; padding: .6rem 1.25rem; font-size: 1.05rem; border-radius: 12px; }
.fq-modal .form-control, .fq-modal select.form-control { min-height: 52px; font-size: 1.1rem; border-radius: 10px; }
.fq-modal .fq-pin-input { max-width: 220px; font-size: 1.5rem; letter-spacing: .5em; text-align: center; }
.fq-modal .fq-pin-input::placeholder { font-size: 1.05rem; letter-spacing: normal; }
.fq-modal .modal-body .btn { min-height: 52px; font-size: 1.05rem; border-radius: 12px; }
.fq-modal .close { font-size: 2rem; padding: .5rem 1rem; margin: -.75rem -1rem -.75rem auto; }
.fq-modal .form-check-input { width: 1.4rem; height: 1.4rem; margin-top: .1rem; }
.fq-modal .form-check-label { padding-left: .6rem; font-size: 1.05rem; }

/* ---------- Tablets ---------- */
@media (max-width: 992px) {
    .fq-op-body { grid-template-columns: 1fr; }
    .fq-op-queue { max-height: none; }
    .fq-op-waiting { flex-direction: row; flex-wrap: wrap; }
    .fq-op-wait { flex: 1 1 150px; }
}

/* ---------- Phones: main action in a bar at the bottom ---------- */
@media (max-width: 768px) {
    .container-fluid { padding-left: .75rem; padding-right: .75rem; }
    .fq-op-card > .card-body { padding: 1rem; }
    .fq-op-brand small { display: none; }
    #userNameDisplay { display: none !important; }
    .fq-op-name { font-size: 1.35rem; }
    .fq-op-next {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; margin: 0;
        padding: .75rem .75rem calc(.75rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .97); border-top: 1px solid #e3e7ea; box-shadow: 0 -.5rem 1.5rem rgba(47, 58, 74, .1);
    }
    .fq-op-next:empty { display: none; }
    .fq-op-next .fq-qm-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: .6rem; }
    .fq-op-next .btn, .fq-op-next .fq-btn-primary { width: 100%; justify-content: center; min-height: 60px; padding: .5rem .6rem; font-size: 1.1rem; white-space: normal; line-height: 1.2; text-align: center; }
    #PH_OP_BACK .btn { white-space: nowrap; min-height: 44px; }
    .fq-op-card .card-header { padding: .5rem 1rem; }
    #content { padding-bottom: 6.5rem; }                 /* room above the bottom bar */
    .fq-op-serving-grid { grid-template-columns: 1fr; }
    .fq-op-pick-grid { grid-template-columns: 1fr; }
    .fq-modal .modal-dialog { margin: .5rem; max-width: none; }
    .fq-modal .modal-footer { flex-wrap: nowrap; }
    .fq-modal .modal-footer > .btn { flex: 1; }
}

/* ---------- Dialog contents ---------- */
.fq-modal .fq-btn-block { width: 100%; justify-content: center; display: inline-flex; align-items: center; }
.fq-modal .modal-body > p:last-child { margin-bottom: 0; }

/* finish: token and time since check-in */
.fq-finish-summary { flex-direction: row !important; gap: 2rem; }
.fq-finish-summary > div { display: flex; flex-direction: column; }
.fq-finish-summary span { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #6b7780; }
.fq-finish-summary strong { font-size: 1.75rem; line-height: 1.15; color: #2f3a4a; font-variant-numeric: tabular-nums; }

/* page: notice then a full-width send button */
#pageModalAction .fq-notice { margin-bottom: .25rem; }
#pageModalAction .fq-notice > .ph-duotone { font-size: 1.5rem; }

/* history: newest first */
.fq-history-token { font-weight: 700; color: #2f3a4a; font-size: 1.1rem; margin-bottom: .75rem; }
.fq-history { list-style: none; margin: 0; padding: 0; }
.fq-history li { position: relative; display: flex; gap: .85rem; padding: 0 0 .85rem 1.25rem; font-size: 1rem; }
.fq-history li::before { content: ''; position: absolute; left: 0; top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: #8fd3ca; }
.fq-history li::after { content: ''; position: absolute; left: 4.5px; top: 1.15rem; bottom: 0; width: 1px; background: #e3e7ea; }
.fq-history li:last-child::after { display: none; }
.fq-history li:first-child::before { background: #22847a; }
.fq-history-time { color: #6b7780; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 4.6rem; }
.fq-history-text { color: #2f3a4a; }

/* choose a customer: big tappable rows */
.fq-choose-list { display: flex; flex-direction: column; gap: .5rem; max-height: 50vh; overflow-y: auto; }
.fq-choose-row {
    display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 60px; padding: .6rem 1rem;
    background: #fff; border: 2px solid #e3e7ea; border-radius: 12px; text-align: left; cursor: pointer;
}
.fq-choose-row:hover { border-color: #8fd3ca; }
.fq-choose-row:focus { outline: none; box-shadow: 0 0 0 .2rem rgba(34, 132, 122, .2); }
.fq-choose-row.selected { border-color: #22847a; background: #e3f3f0; }
.fq-choose-token { font-size: 1.6rem; font-weight: 800; color: #2f3a4a; min-width: 3.5rem; font-variant-numeric: tabular-nums; }
.fq-choose-row .badge { font-size: .9rem; font-weight: 700; border-radius: 999px; padding: .4em .75em; }
.fq-choose-tag { font-size: .8rem; font-weight: 700; color: #22847a; background: #e3f3f0; border-radius: 999px; padding: .2rem .6rem; }
.fq-choose-check { margin-left: auto; font-size: 1.6rem; color: #cfd6db; }
.fq-choose-row.selected .fq-choose-check { color: #22847a; }
#selectcustomerRes:empty { display: none; }

/* remove: reason and a large switch */
.fq-switch-row { margin-top: 1.1rem; padding-left: 3.4rem; min-height: 2rem; display: flex; align-items: center; }
.fq-switch-row .custom-control-label { font-size: 1.05rem; color: #2f3a4a; cursor: pointer; }
.fq-switch-row .custom-control-label::before { left: -3.4rem; top: -.05rem; width: 2.9rem; height: 1.6rem; border-radius: 1rem; }
.fq-switch-row .custom-control-label::after { left: calc(-3.4rem + 3px); top: calc(-.05rem + 3px); width: calc(1.6rem - 6px); height: calc(1.6rem - 6px); border-radius: 1rem; }
.fq-switch-row .custom-control-input:checked ~ .custom-control-label::after { transform: translateX(1.3rem); }
.fq-switch-row .custom-control-input:checked ~ .custom-control-label::before { background-color: #22847a; border-color: #22847a; }
