/*
 * Prime RoadRunners — shared styles of the three portals (driver, store, admin)
 *
 *   1. Fonts
 *   2. Tokens (colours, type, spacing) — day and night
 *   3. Base
 *   4. Components: buttons, fields, pills, cards, toasts, dialogs, tables ...
 *
 * Every colour pair used for text has a contrast of at least 4.5:1.
 * Nothing here is specific to one portal; those styles live next to each page.
 */

/* ------------------------------------------------------------------ 1. Fonts */

@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/commissioner-greek.woff2') format('woff2');
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/commissioner-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Sofia Sans Condensed';
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url('../fonts/sofia-sans-condensed-greek.woff2') format('woff2');
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
    font-family: 'Sofia Sans Condensed';
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url('../fonts/sofia-sans-condensed-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------------------------------------------- 2. Tokens */

:root {
    color-scheme: light;

    /* surfaces */
    --canvas: #F5F4F0;
    --surface: #FFFFFF;
    --surface-2: #EEEDE8;
    --border: #DDDBD3;
    --border-strong: #85889A;

    /* text */
    --ink: #15172B;
    --text-2: #4A4D63;
    --text-3: #62657B;

    /* brand */
    --brand: #4A53A3;
    --brand-hover: #3A4288;
    --brand-soft: #ECEEFA;
    --on-brand: #FFFFFF;
    --on-brand-2: #E3E5F2;
    --brand-soft-text: #3A4288;

    --accent: #D67628;
    --accent-strong: #A3510E;
    --accent-soft: #FCEEDD;
    --accent-soft-text: #8A4409;
    --on-accent: #15172B;

    /* meaning */
    --success: #1A6E36;
    --success-soft: #E3F4E8;
    --success-bright: #7DDC9A;
    --danger: #B3261E;
    --danger-hover: #8F1E18;
    --danger-soft: #FDECEB;
    --danger-soft-text: #A8261D;
    --warning-soft: #FFF1CC;
    --warning-soft-text: #7A4D00;
    --info-soft: #E5EFFB;
    --info-soft-text: #1B5AA6;

    /* order statuses: background / text */
    --st-pending-bg: #FFF1CC;     --st-pending: #7A4D00;
    --st-accepted-bg: #E5EFFB;    --st-accepted: #1B5AA6;
    --st-picked_up-bg: #ECEEFA;   --st-picked_up: #3D4589;
    --st-in_transit-bg: #F1E9FB;  --st-in_transit: #6B3FA8;
    --st-delivered-bg: #E3F4E8;   --st-delivered: #1A6E36;
    --st-cancelled-bg: #FDECEB;   --st-cancelled: #A8261D;
    --st-returned-bg: #ECEEF3;    --st-returned: #4B5168;

    /* the dark bar used by toasts */
    --toast-bg: #15172B;
    --toast-text: #FFFFFF;
    --toast-action: #F7A84A;

    --overlay: rgba(16, 18, 40, 0.55);
    --shadow-1: 0 1px 3px rgba(16, 18, 40, 0.10);
    --shadow-2: 0 12px 32px rgba(16, 18, 40, 0.24);
    --focus: #15172B;

    /* type */
    --font: 'Commissioner', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-figures: 'Sofia Sans Condensed', 'Commissioner', system-ui, sans-serif;

    /* shape */
    --r-sm: 10px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    /* the smallest comfortable target for a finger */
    --tap: 44px;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

:root[data-theme='dark'] {
    color-scheme: dark;

    --canvas: #0F1220;
    --surface: #171B2E;
    --surface-2: #1F2440;
    --border: #2B3152;
    --border-strong: #6A7099;

    --ink: #E8EAF6;
    --text-2: #B4B9D1;
    --text-3: #9298B5;

    --brand: #8E97E8;
    --brand-hover: #A7AEF0;
    --brand-soft: #252B52;
    --on-brand: #0F1220;
    --on-brand-2: #1F2440;
    --brand-soft-text: #B0B7F5;

    --accent: #F7941E;
    --accent-strong: #F7A84A;
    --accent-soft: #3A2611;
    --accent-soft-text: #FFC27A;
    --on-accent: #0F1220;

    --success: #7DDC9A;
    --success-soft: #12301F;
    --success-bright: #7DDC9A;
    --danger: #FF8A80;
    --danger-hover: #FFA79F;
    --danger-soft: #3A1614;
    --danger-soft-text: #FFA79F;
    --warning-soft: #3A2E10;
    --warning-soft-text: #FFCF70;
    --info-soft: #14294A;
    --info-soft-text: #9CC4FF;

    --st-pending-bg: #3A2E10;     --st-pending: #FFCF70;
    --st-accepted-bg: #14294A;    --st-accepted: #9CC4FF;
    --st-picked_up-bg: #252B52;   --st-picked_up: #B0B7F5;
    --st-in_transit-bg: #2D1F47;  --st-in_transit: #D2B5FF;
    --st-delivered-bg: #12301F;   --st-delivered: #7DDC9A;
    --st-cancelled-bg: #3A1614;   --st-cancelled: #FFA79F;
    --st-returned-bg: #262B3D;    --st-returned: #C3C8DC;

    --toast-bg: #E8EAF6;
    --toast-text: #0F1220;
    --toast-action: #8A4409;

    --overlay: rgba(4, 6, 16, 0.70);
    --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.40);
    --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.55);
    --focus: #E8EAF6;
}

/* ------------------------------------------------------------------- 3. Base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

a {
    color: var(--brand);
}
a:hover {
    color: var(--brand-hover);
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

img, svg {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* Figures: prices, counters, clocks */
.figure {
    font-family: var(--font-figures);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ------------------------------------------------------------- 4. Components */

/* Icons: line icons from assets/icons.svg, drawn in the colour of the text */
.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 40px; height: 40px; stroke-width: 1.6; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    background: var(--brand);
    color: var(--on-brand);
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
    text-decoration: none;
    text-align: center;
    user-select: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn:hover {
    background: var(--brand-hover);
    color: var(--on-brand);
}
.btn:active {
    transform: translateY(1px);
}
.btn[disabled],
.btn[aria-disabled='true'] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn--lg { min-height: 52px; font-size: 17px; }
.btn--xl { min-height: 56px; font-size: 17px; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn--block { display: flex; width: 100%; }

.btn--soft {
    background: var(--brand-soft);
    color: var(--brand-soft-text);
}
.btn--soft:hover {
    background: var(--brand-soft);
    color: var(--brand-soft-text);
    border-color: var(--brand);
}

.btn--outline {
    background: transparent;
    color: var(--ink);
    border-color: var(--border-strong);
    font-weight: 600;
}
.btn--outline:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.btn--ghost {
    background: transparent;
    color: var(--text-2);
}
.btn--ghost:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.btn--success {
    background: var(--success);
    color: var(--surface);
}
.btn--success:hover {
    background: var(--success);
    color: var(--surface);
    filter: brightness(0.92);
}

.btn--danger {
    background: var(--danger);
    color: var(--surface);
}
.btn--danger:hover {
    background: var(--danger-hover);
    color: var(--surface);
}

.btn--danger-outline {
    background: transparent;
    color: var(--danger-soft-text);
    border-color: var(--danger-soft-text);
    font-weight: 600;
}
.btn--danger-outline:hover {
    background: var(--danger-soft);
    color: var(--danger-soft-text);
}

/* A square button that holds only an icon */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-2);
}
.icon-btn:hover {
    background: var(--surface-2);
    color: var(--ink);
}
.icon-btn .icon {
    width: 22px;
    height: 22px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: rr-spin 0.7s linear infinite;
}
@keyframes rr-spin {
    to { transform: rotate(360deg); }
}
.is-refreshing .icon {
    animation: rr-spin 0.7s linear infinite;
}

/* Fields */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field__label {
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    color: var(--ink);
}
.field__optional {
    font-weight: 400;
    color: var(--text-3);
}
.field__hint {
    font-size: 13px;
    line-height: 18px;
    color: var(--text-3);
}
.field__error {
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    color: var(--danger-soft-text);
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--ink);
    /* 16px keeps iOS from zooming into the field */
    font-size: 16px;
    line-height: 24px;
    appearance: none;
}
.textarea {
    min-height: 96px;
    resize: vertical;
}
.select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2362657B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}
:root[data-theme='dark'] .select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239298B5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.input::placeholder,
.textarea::placeholder {
    color: var(--text-3);
    opacity: 1;
}
.input:focus,
.select:focus,
.textarea:focus {
    outline: 3px solid var(--brand);
    outline-offset: 0;
    border-color: var(--brand);
}
.input[aria-invalid='true'],
.select[aria-invalid='true'],
.textarea[aria-invalid='true'] {
    border-color: var(--danger-soft-text);
    border-width: 2px;
}
.input[readonly] {
    background: var(--surface-2);
    color: var(--text-2);
}

/* Pills: small labels for areas, states and counters */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 2px 10px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}
.pill--brand { background: var(--brand-soft); color: var(--brand-soft-text); }
.pill--accent { background: var(--accent-soft); color: var(--accent-soft-text); }
.pill--success { background: var(--success-soft); color: var(--success); }
.pill--warning { background: var(--warning-soft); color: var(--warning-soft-text); }
.pill--danger { background: var(--danger-soft); color: var(--danger-soft-text); }
.pill--info { background: var(--info-soft); color: var(--info-soft-text); }

/* Order status: the word always accompanies the colour */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 2px 10px;
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
}
.status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.status--pending    { background: var(--st-pending-bg);    color: var(--st-pending); }
.status--accepted   { background: var(--st-accepted-bg);   color: var(--st-accepted); }
.status--picked_up  { background: var(--st-picked_up-bg);  color: var(--st-picked_up); }
.status--in_transit { background: var(--st-in_transit-bg); color: var(--st-in_transit); }
.status--delivered  { background: var(--st-delivered-bg);  color: var(--st-delivered); }
.status--cancelled  { background: var(--st-cancelled-bg);  color: var(--st-cancelled); }
.status--returned   { background: var(--st-returned-bg);   color: var(--st-returned); }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

/* A note that needs attention: special instructions, warnings */
.note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    background: var(--warning-soft);
    color: var(--warning-soft-text);
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
}
.note .icon {
    width: 18px;
    height: 18px;
    margin-top: 1px;
}
.note--info { background: var(--info-soft); color: var(--info-soft-text); }
.note--danger { background: var(--danger-soft); color: var(--danger-soft-text); }
.note--success { background: var(--success-soft); color: var(--success); }

/* "Loading…" and "no more" under a list */
.list__more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: var(--text-3);
    font-size: 14px;
}

/* Nothing to show */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 24px;
    color: var(--text-3);
    text-align: center;
}
.empty .icon {
    margin-bottom: 6px;
    color: var(--border-strong);
}
.empty__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-2);
}
.empty__text {
    font-size: 14px;
    line-height: 20px;
}

/* Placeholders while the first answer is on its way */
.skeleton {
    border-radius: var(--r-sm);
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
    background-size: 400% 100%;
    animation: rr-shimmer 1.4s ease infinite;
}
@keyframes rr-shimmer {
    from { background-position: 100% 50%; }
    to { background-position: 0 50%; }
}
.skeleton--line {
    width: 60%;
    height: 16px;
}
.skeleton--figure {
    width: 40%;
    height: 36px;
}

/* What a page says when scripts are switched off */
.noscript {
    padding: 24px;
}

/* Toasts: short messages at the bottom, above everything else, dialogs included */
.toasts {
    position: fixed;
    left: calc(16px + var(--safe-left));
    right: calc(16px + var(--safe-right));
    bottom: calc(16px + var(--safe-bottom) + var(--toasts-lift, 0px));
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
@media (min-width: 961px) {
    /* On a wide screen the messages keep to the corner, out of the way of the work */
    .toasts {
        left: auto;
        right: calc(24px + var(--safe-right));
        bottom: calc(24px + var(--safe-bottom));
        align-items: flex-end;
        width: 440px;
    }
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 480px;
    min-height: 52px;
    padding: 6px 6px 6px 16px;
    border-radius: 14px;
    background: var(--toast-bg);
    color: var(--toast-text);
    box-shadow: var(--shadow-2);
    font-size: 15px;
    line-height: 20px;
    pointer-events: auto;
    animation: rr-toast-in 0.2s ease-out;
}
.toast.is-leaving {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
@keyframes rr-toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}
.toast__text {
    flex-grow: 1;
    padding: 8px 0;
    overflow-wrap: anywhere;
}
.toast > .icon {
    stroke-width: 2.5;
}
.toast--success > .icon { color: #7DDC9A; }
.toast--error > .icon { color: #FF9A91; }
.toast--warning > .icon { color: #FFCF70; }
.toast--info > .icon { color: #A7AEF0; }
:root[data-theme='dark'] .toast--success > .icon { color: #1A6E36; }
:root[data-theme='dark'] .toast--error > .icon { color: #B3261E; }
:root[data-theme='dark'] .toast--warning > .icon { color: #7A4D00; }
:root[data-theme='dark'] .toast--info > .icon { color: #4A53A3; }
.toast__action,
.toast__close {
    min-height: var(--tap);
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--toast-action);
    font-size: 15px;
    font-weight: 700;
}
.toast__action {
    padding: 0 14px;
}
.toast__close {
    width: var(--tap);
    padding: 0;
    color: inherit;
    opacity: 0.75;
}
.toast__close .icon {
    margin: 0 auto;
    color: inherit;
}

/* Dialogs. On a phone they rise from the bottom edge; on wide screens they sit in the middle. */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--overlay);
    animation: rr-fade 0.15s ease-out;
}
@keyframes rr-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - 24px - var(--safe-top));
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-2);
    animation: rr-rise 0.2s ease-out;
}
@keyframes rr-rise {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
}
.dialog__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 12px 0 20px;
}
.dialog__title {
    flex-grow: 1;
    padding-top: 8px;
    font-size: 19px;
    font-weight: 700;
    line-height: 26px;
}
.dialog__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 20px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 15px;
    line-height: 22px;
    color: var(--text-2);
}
.dialog__foot {
    display: flex;
    gap: 10px;
    padding: 12px 20px calc(16px + var(--safe-bottom));
    border-top: 1px solid var(--border);
}
.dialog__foot .btn {
    flex: 1 1 0;
}
@media (min-width: 640px) {
    .dialog-backdrop {
        align-items: center;
        padding: 24px;
    }
    .dialog {
        border-radius: 20px;
        max-height: calc(100dvh - 48px);
    }
    .dialog--wide { max-width: 760px; }
    .dialog__foot {
        justify-content: flex-end;
        padding-bottom: 16px;
    }
    .dialog__foot .btn {
        flex: 0 1 auto;
        min-width: 140px;
    }
}

/* A switch with its label: settings */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 32px;
    flex-shrink: 0;
}
.switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.switch__track {
    position: absolute;
    inset: 0;
    border-radius: var(--r-pill);
    background: var(--border-strong);
    transition: background-color 0.15s ease;
    pointer-events: none;
}
.switch__track::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}
.switch input:checked + .switch__track {
    background: var(--success);
}
.switch input:checked + .switch__track::after {
    transform: translateX(20px);
}
:root[data-theme='dark'] .switch input:checked + .switch__track {
    background: #2E9E57;
}
.switch input:focus-visible + .switch__track {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* Rows of "label … value", as in settings and order details */
.rows {
    display: flex;
    flex-direction: column;
}
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
}
.row:first-child {
    border-top: 0;
}
.row__label {
    flex-grow: 1;
    font-size: 15px;
    color: var(--text-2);
}
.row__value {
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}
.is-good { color: var(--success); }
.is-bad { color: var(--danger-soft-text); }
.is-waiting { color: var(--warning-soft-text); }
.is-muted { color: var(--text-3); }

/* Sign-in screen, the same in all three portals */
.login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: calc(24px + var(--safe-top)) calc(20px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(20px + var(--safe-left));
}
.login__card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    padding: 28px 24px;
}
.login__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}
.login__logo {
    width: 180px;
    height: auto;
    margin-bottom: 12px;
}
.login__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 28px;
}
.login__sub {
    font-size: 14px;
    color: var(--text-3);
}
.login__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.login__foot {
    font-size: 12px;
    color: var(--text-3);
    text-align: center;
}

/* Banner across the top of a page: offline, location switched off by the office ... */
.banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--warning-soft);
    color: var(--warning-soft-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}
.banner--danger { background: var(--danger-soft); color: var(--danger-soft-text); }
.banner--info { background: var(--info-soft); color: var(--info-soft-text); }

/* Chips: a row of choices (period, theme), or of small facts */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chips:empty {
    display: none;
}
.chips--fill .chip {
    flex: 1 1 0;
    justify-content: center;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}
.chip[aria-pressed='true'] {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--on-brand);
}
span.chip {
    min-height: 32px;
    border-color: var(--border);
}

/* Totals of a period: a card of figures with their labels */
.totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    padding: 12px 4px;
    box-shadow: none;
}
.totals__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    padding: 0 4px;
    border-left: 1px solid var(--border);
}
.totals__item:first-child {
    border-left: 0;
}
.totals__value {
    font-size: 24px;
    line-height: 28px;
    white-space: nowrap;
}
.totals__value--money {
    color: var(--success);
    font-size: 20px;
}
.totals__label {
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
}

.search__input {
    padding-left: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2362657B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.600-3.600'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 20px;
}
:root[data-theme='dark'] .search__input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239298B5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.600-3.600'/%3E%3C/svg%3E");
}

/* A titled group of settings */
.panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    box-shadow: none;
}
.panel__title {
    color: var(--text-3);
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
}
.panel__text {
    color: var(--text-2);
    font-size: 14px;
    line-height: 20px;
}
.panel__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
}
.panel .chips {
    padding-top: 8px;
}
.panel .row__label[for] {
    cursor: pointer;
}

/* Fields one below the other, in a dialog or a card */
.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
