/* Mobile-first: this is used almost entirely on phones, held one-handed while
   the dispatcher is doing something else. Big tap targets, one column, header
   pinned so the counts and the Sledovat button are always reachable. */

:root {
    --brand: #F9A825;
    --bg: #F2F2F5;
    --card: #FFFFFF;
    --text: #16181D;
    --dim: #6B7280;
    --line: #E3E4E8;
    --danger: #C62828;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161A;
        --card: #1E2127;
        --text: #F2F3F5;
        --dim: #9AA0AA;
        --line: #2C303890;
    }
}

* {
    box-sizing: border-box;
}

html {
    /* Stop iOS bumping up font sizes when the phone is turned sideways. */
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.35;
}

.boot {
    padding: 32px 16px;
    text-align: center;
    color: var(--dim);
}

/* ---- Header ---- */

.bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
}

.bar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.brand {
    font-size: 18px;
    font-weight: 700;
}

.status {
    margin-top: 4px;
    font-size: 13px;
    color: var(--dim);
    min-height: 18px;
}

.status .err {
    color: var(--danger);
}

.status .dim {
    color: var(--dim);
}

.filters {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* Scoped to this page's own shell: the driver app now shares the document and
   has its own button sizing, which an unscoped `button` rule would override. */
.bar button,
main button,
.call {
    font: inherit;
    border-radius: 10px;
    border: 1px solid var(--line);
    /* 44px is the smallest reliably tappable target on a phone. */
    min-height: 44px;
    padding: 0 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.filters button {
    flex: 1;
    background: var(--card);
    color: var(--text);
}

.filters button.sel {
    background: var(--brand);
    border-color: var(--brand);
    color: #000;
    font-weight: 600;
}

.filters .ghost {
    flex: 0 0 auto;
    color: var(--dim);
}

.watch {
    background: var(--card);
    color: var(--text);
    font-weight: 600;
}

.watch.on {
    background: var(--brand);
    border-color: var(--brand);
    color: #000;
}

/* Who the notifications are for, and the sign-in when nobody is signed in. */
.viewer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--dim);
}

.viewer .ghost {
    background: var(--card);
    color: var(--text);
}

.sign-in {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.sign-in input {
    flex: 1 1 140px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    font: inherit;
}

.sign-in .err {
    flex-basis: 100%;
    color: var(--danger);
    font-size: 13px;
}

/* ---- Order list ---- */

main {
    padding: 8px 12px calc(24px + env(safe-area-inset-bottom));
}

.empty {
    text-align: center;
    color: var(--dim);
    padding: 48px 0;
}

.card {
    background: var(--card);
    border-radius: 14px;
    padding: 14px;
    margin: 10px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .07);
}

.row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.name {
    font-size: 18px;
    font-weight: 700;
}

.badge {
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.when {
    font-size: 13px;
    color: var(--dim);
    margin-top: 2px;
}

.route {
    margin-top: 4px;
}

.note {
    margin-top: 6px;
    padding: 6px 8px;
    border-left: 3px solid var(--brand);
    background: rgba(249, 168, 37, .10);
    border-radius: 0 6px 6px 0;
    font-size: 14px;
}

.phone {
    margin-top: 6px;
    font-weight: 700;
    /* Let the dispatcher long-press to copy the number. */
    user-select: text;
}

.call {
    display: block;
    margin-top: 10px;
    background: var(--brand);
    border-color: var(--brand);
    color: #000;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    line-height: 44px;
}

.call.disabled {
    background: transparent;
    border-color: var(--line);
    color: var(--dim);
    font-weight: 400;
}

/* ---- Blazor's own error strip ---- */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #FFE9A8;
    color: #000;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -1px 3px rgba(0, 0, 0, .2);
}

#blazor-error-ui .reload {
    color: #000;
    font-weight: 700;
}
