/* ============================================================
   live-monitor.css  —  palette & fonts matched to staff-dashboard
   Place at: assets/css/live-monitor.css
   ============================================================ */

/* ── Palette (mirrored from staff-dashboard.css) ─────────────
   Brand Primary   #660810  Deep Red
   Brand Secondary #270707  Dark Red
   Accent          #d6c0b1  Grey Orange
   Stone bg        #f1ebeb
   ──────────────────────────────────────────────────────────── */

:root {
    /* Brand — exact staff-dashboard tokens */
    --brand-primary:        #660810;
    --brand-primary-light:  #8a2e35;
    --brand-primary-dark:   #450509;
    --brand-secondary:      #270707;

    /* Neutrals */
    --bg:#f4f5f7;
    --accent:       #d6c0b1;
    --white:        #ffffff;
    --text:         #1f1f1f;
    --gray:         #7a7a7a;
    --light-gray:   #f2f2f2;
    --border:rgba(20,20,20,0.10);
    --overlay:      rgba(39, 7, 7, 0.55);

    /* Cream surfaces */
    --cream:        #faf6f3;
    --cream-dark:   #efe4dc;
    --accent-soft:  rgba(214, 192, 177, 0.35);
    --primary-soft: rgba(102, 8, 16, 0.06);
    --primary-tint: rgba(102, 8, 16, 0.10);

    /* Status */
    --success:        #2e7d32;
    --success-light:  #dff6dd;
    --warning:        #b3791a;
    --warning-light:  #f3e3d1;
    --info:           #1976d2;
    --info-light:     #dcebfb;
    --danger:         #c62828;
    --danger-light:   #fbe0e0;

    /* Radius — flat scale, matched to theme.css (small rounding only) */
    --radius-sm:   6px;
    --radius-md:   8px;
    --radius-lg:   8px;
    --radius-xl:   8px;
    --radius-full: 999px;

    /* Layout */
    --gap:      14px;
    --header-h: 62px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body ───────────────────────────────────────────────── */
html, body { height: 100%; overflow: hidden; background: var(--bg); }

.lm-body {
    background: var(--bg);
    color: var(--text);
    /* Staff-dashboard system font stack — no Google Fonts */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lm-wrap {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: var(--gap);
    gap: var(--gap);
}

/* ── Header ─────────────────────────────────────────────── */
.lm-header {
    flex-shrink: 0;
    height: var(--header-h);
    background: var(--brand-primary);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.lm-header__live {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .8px;
    color: rgba(255, 255, 255, .65);
    text-transform: uppercase;
    min-width: 70px;
}

/* Live dot — same style as staff-dashboard's .live-dot */
.lm-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: lm-pulse 1.8s ease-out infinite;
    display: inline-block;
    flex-shrink: 0;
}
@keyframes lm-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(46, 125, 50, .55); }
    70%  { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(46, 125, 50, 0);   }
}

.lm-header__title {
    font-size: clamp(20px, 2.6vw, 30px);
    font-weight: 800;
    letter-spacing: -.3px;
    color: var(--white);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    padding: 0 16px;
}

.lm-header__clock {
    font-size: clamp(18px, 1.8vw, 24px);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: rgba(255, 255, 255, .85);
    min-width: 70px;
    text-align: right;
}

/* ── Grid ───────────────────────────────────────────────── */
/* Windows stand upright (patayo) in a proper grid instead of being
   squeezed into a single row — once an office has several windows,
   a plain flex row keeps shrinking every card thinner and thinner.
   auto-fit + a sane min-width lets cards wrap onto new rows instead,
   so each window card keeps a readable, "standing" proportion. */
.lm-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    grid-auto-rows: 1fr;
    gap: var(--gap);
    min-height: 0;
    overflow-y: auto;
}

.lm-grid > .lm-card {
    min-width: 0;
    min-height: 0;
}

/* ── Card — matches staff-dashboard__section ────────────── */
.lm-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--brand-primary-light);
    border-radius: var(--radius-xl);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 12px;
    overflow: hidden;
    transition: border-color .3s, box-shadow .3s;
    min-width: 0;
    min-height: 0;
}
.lm-card.is-serving {
    border-top-color: var(--brand-primary);
    box-shadow: none;
}
.lm-card--paused {
    opacity: .85;
    position: relative;
}
.lm-paused-stamp {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    text-align: center;
    font-size: clamp(13px, 1.3vw, 16px);
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--warning);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    background: var(--warning-light);
    z-index: 5;
    white-space: nowrap;
    pointer-events: none;
}

/* ── Closed window — grayed out with a big diagonal CLOSED stamp ── */
.lm-card--closed {
    position: relative;
    opacity: .85;
    pointer-events: none;
}
.lm-card--closed::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(120, 120, 120, .35);
    border-radius: inherit;
    z-index: 4;
}
.lm-card--closed .lm-ticket-big,
.lm-card--closed .lm-ticket-next,
.lm-card--closed .lm-ticket-last,
.lm-card--closed .lm-card__win-name {
    color: #9a9a9a !important;
}
.lm-closed-stamp {
    position: absolute;
    top: 50%;
    left: 12px;
    right: 12px;
    transform: translateY(-50%);
    text-align: center;
    font-size: clamp(15px, 1.6vw, 20px);
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--danger, #c62828);
    border: 1px solid var(--danger, #c62828);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    background: var(--danger-light, #fbe0e0);
    z-index: 5;
    white-space: nowrap;
    pointer-events: none;
}

/* ── Card header ────────────────────────────────────────── */
.lm-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--cream-dark);
    flex-shrink: 0;
}

.lm-card__win-name {
    font-size: clamp(18px, 1.9vw, 22px);
    font-weight: 800;
    letter-spacing: -.2px;
    color: var(--brand-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lm-card__badges { display: flex; gap: 4px; flex-shrink: 0; }

/* Badges match the queue-type-badge style in staff-dashboard */
.lm-badge {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}
.lm-badge--open        { background: var(--success-light);  color: var(--success); }
.lm-badge--paused      { background: var(--warning-light);  color: var(--warning); }
.lm-badge--walkin      { background: var(--warning-light);  color: var(--warning); }
.lm-badge--appointment { background: var(--info-light);     color: var(--info);    }
.lm-badge--both        { background: var(--primary-soft);   color: var(--brand-primary); }

/* ── Section label ──────────────────────────────────────── */
.lm-section__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(13px, 1.15vw, 15px);
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--brand-secondary);
    opacity: .75;
    margin-bottom: 4px;
}

.lm-section            { flex-shrink: 0; }
.lm-section--serving   { text-align: center; padding: 4px 0 8px; }
.lm-section--next      { text-align: center; padding: 4px 0; }
.lm-section--waiting   { flex: 1; min-height: 0; overflow: hidden; padding: 4px 0; display: flex; flex-direction: column; }
.lm-section--last      { text-align: center; padding: 4px 0 2px; flex-shrink: 0; }

/* ── Big serving number ─────────────────────────────────── */
.lm-ticket-big {
    font-size: clamp(48px, 6.5vw, 84px);
    font-weight: 900;
    letter-spacing: -.5px;
    color: var(--brand-primary);
    line-height: 1;
    transition: color .3s;
}
.lm-ticket-big.is-empty { color: rgba(102, 8, 16, .18); }

@keyframes lm-flash {
    0%, 100% { opacity: 1; }
    30%, 70%  { opacity: 0; }
}
.lm-ticket-big.lm-flash { animation: lm-flash .55s ease; }

.lm-ticket-name {
    font-size: clamp(14px, 1.3vw, 17px);
    font-weight: 600;
    color: var(--gray);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    min-height: 1em;
}
.lm-ticket-name--sm { font-size: clamp(13px, 1.1vw, 15px); }

.lm-eta {
    margin-top: 4px;
    font-size: clamp(13px, 1.1vw, 15px);
    font-weight: 700;
    letter-spacing: .01em;
    color: rgba(255, 255, 255, .75);
    min-height: 1.2em;
}
.lm-eta--last { color: rgba(255, 255, 255, .65); }
.lm-eta:empty { opacity: 0; }

/* ── Next number ────────────────────────────────────────── */
.lm-ticket-next {
    font-size: clamp(28px, 3.6vw, 46px);
    font-weight: 800;
    color: var(--brand-primary-light);
    line-height: 1;
}
.lm-ticket-next.is-empty { color: rgba(138, 46, 53, .20); }

/* ── Dividers ───────────────────────────────────────────── */
.lm-divider {
    width: 100%;
    height: 1px;
    background: var(--cream-dark);
    margin: 8px 0;
    flex-shrink: 0;
}
.lm-divider--light {
    background: var(--accent-soft);
}

/* ── Waiting list ───────────────────────────────────────── */
.lm-count-badge {
    background: var(--success-light);
    color: var(--success);
    border: none;
    font-size: 13px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.lm-waiting-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.lm-waiting-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.lm-waiting-item__num {
    font-size: clamp(15px, 1.4vw, 18px);
    font-weight: 800;
    color: var(--brand-secondary);
    flex-shrink: 0;
    min-width: 40px;
}

.lm-waiting-item__type {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}
.lm-waiting-item__type--walkin      { background: var(--warning-light); color: var(--warning); }
.lm-waiting-item__type--appointment { background: var(--info-light);    color: var(--info);    }

.lm-waiting-item__name {
    font-size: clamp(13px, 1.15vw, 16px);
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.lm-waiting-item__right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.lm-waiting-empty {
    font-size: clamp(13px, 1.15vw, 16px);
    color: var(--gray);
    text-align: center;
    padding: 6px 0;
    font-style: italic;
}

/* ── Last in line ───────────────────────────────────────── */
.lm-ticket-last {
    font-size: clamp(20px, 2.3vw, 28px);
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.lm-ticket-last.is-empty { color: rgba(214, 192, 177, .50); }

/* ── No windows ─────────────────────────────────────────── */
.lm-no-windows {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 22px;
    font-weight: 700;
    font-style: italic;
}
/* ── Queue status badges (per ticket) ──────────────────── */
.lm-badge--qs-waiting     { background: var(--warning-light);  color: var(--warning); }
.lm-badge--qs-called      { background: var(--info-light);     color: var(--info);    }
.lm-badge--qs-in-progress { background: var(--primary-soft);   color: var(--brand-primary); }