:root {
    /* brand */
    --primary: #273F6F;
    --primary-dark: #1B2C4E;
    --primary-light: #3A5794;
    --primary-pale: #EEF1F7;

    /* surfaces */
    --bg: #FFFFFF;
    --card: #FFFFFF;
    --line: #DDE2EB;

    /* text */
    --ink: #1C2331;
    --ink-soft: #5A6478;

    --radius: 1px;
    --danger: #C0392B;
}

* { box-sizing: border-box; }


body, html {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", sans-serif;
    font-size: 18px;
    line-height: 1.5;
}


h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
    color: var(--primary); 
}

h2 {
    font-size: 22px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    color: var(--primary);
    margin: 20px 0 10px;
}

strong {
    color: var(--primary-dark); 
}

a {
    color: var(--primary-light);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.cartnr, td:first-child {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-weight: 600;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding:24px 16px 64px;
}

.container--wide {
    max-width: 1100px;
}

.container--centered{
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 0;
    padding-bottom: 0;
}

.auth-card {
    width: 100%;
    max-width: 340px;
    padding: 0 16px;
}

.button {
    appearance: button;
    backface-visibility: hidden;
    background-color: var(--primary);
    border-radius: var(--radius);
    border-width: 0;
    height: 44px;
    line-height: 1.15;
    margin: 12px 0 0;
    outline: none;
    overflow: hidden;
    padding: 0px 20px;
    position: relative;
    text-align: center;
    color: white;
    font-family: -apple-system, "Segoe UI", sans-serif;
    font-weight: bold;
}

.big-button {
    width: 100%;
    height: 64px;
    font-size: 18px;
}

.button-sm {
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
}

a.button {
    display: flex;
    align-items: center; 
    justify-content: center;
    text-decoration: none;
    padding: 10px ;
}


table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 16px;
    table-layout: fixed;
}

th, td {
    text-align: left;
    padding: 16px 14px;
    border-bottom: 1px solid var(--primary-dark);
    border-right: 1px solid var(--primary-dark);
    font-size: 16px;
    word-wrap: break-word;
}

/* th:last-child, td:last-child {
    border-right: none;
} */

th {
    background: var(--primary-dark);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f3f1ec;
}

table th:nth-child(1), table td:nth-child(1) { width: 10%; text-align: center; }   /* Cart nr */
table th:nth-child(2), table td:nth-child(2) { width: 45%; text-align: center; }                        /* Client */
table th:nth-child(3), table td:nth-child(3) { width: 18%; text-align: center; }  /* Status */
table th:nth-child(4), table td:nth-child(4) { width: 12%; text-align: center;}   /* Active */
table th:nth-child(5), table td:nth-child(5) { width: 15%; text-align: center; }  /* Manage link */



.content-row {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px 16px;
}


.content-value {
    font-size: 18px;
    color: var(--ink);
    margin-right: 16px;
}

.form-row {
    margin-bottom: 12px;
}

.form-row label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.form-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    font-size: 16px;
    background: white;
    color: var(--ink);
}

.form-row input:focus {
    outline: 2px solid #f3f1ec;
    outline-offset: 1px;
}

.inline-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.inline-group select,
.inline-group input[type="text"],
.inline-group input[type="number"] {
    flex: 2;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    font-size: 16px;
    background: white;
    color: var(--ink);
}

.inline-group input[name="aantal[]"] {
    flex: 0 0 90px;
    text-align: center;
}

.inline-group input[name="add_cartnr"],
.inline-group select[name="line"] {
    flex: 0 0 180px;
}



.inline-group .button .button-sm {
    margin: 0;
    flex-shrink: 0;
}

.driver-view {
    font-size: 19px;
    line-height: 1.6;
}

.driver-view strong {
    font-weight: 700;
}

.driver-view .button {
    font-size: 20px;
}

.logout-button {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.logout-button:hover {
    background-color: var(--primary-light);
}

.mobile-label {
    display: none;
}

.history-entry {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 12px;
}

.history-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-entry-time {
    font-size: 13px;
    color: var(--ink-soft);
}

.history-entry-empty {
    font-size: 14px;
    color: var(--ink-soft);
    margin: 4px 0 0;
}

.count-cards { 
    display: flex; 
    flex-direction: column;
    gap: 8px;
    max-width: 280px;
 }

.count-card {
    border: 1px solid var(--line, #d8d8d8);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.count-card__name {
    font-weight: 600;
    margin-bottom: 4px;
}

.count-card__stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    gap: 45px;
    
}

.count-stat { 
    display: flex;
    flex-direction: column;
 }

.count-stat__value { 
    font-size: 20px; 
    font-weight: 700; 
    line-height: 1.1; }

.count-stat__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-soft, #6b6b6b);
}

.warning-box {
    background: #fdecea;
    border: 2px solid #c0392b;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.warning-box p {
    color: #922b21;
    font-weight: 600;
    margin: 0 0 12px;
}

.warning-box .button {
    background-color: #c0392b;
}

.cart-chips {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cart-chip {
    display: inline-block;
    background: var(--primary-light);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 10px 18px;
    font-family: inherit;
    font-weight: 700;
    font-size: 22px;
    cursor: pointer;
    margin-right: 5px;
}

.count-row--unsaved { background: #fdecea; }

.button-danger {
    background-color: var(--danger);
}
.cart-chips-icon {
    display: inline-block;
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.js-open-addcart {
    height: 52px;
    font-size: 18px;
    padding: 0 20px;
    margin: 0;
}



.line-header,
.loading-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.line-header__name {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.line-switch { display: inline-flex; gap: 4px; margin-left: auto; }

.line-switch__option {
    padding: 6px 12px;
    border: 1px solid var(--line);
    background-color: var(--primary-light);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--bg);
}

.line-switch__option--active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    font-weight: 600;
}

/* the mode switch owns margin-left:auto to sit on the right; the machine
   strip belongs next to the line name, so it gives that back */
.line-switch--machine {
    margin-left: 0;
    margin-right: 8px;
}

.line-header__hint {
    font-size: 15px;
    font-weight: 600;
    color: var(--danger);
}

/* the job's state decides which of the two end-of-job buttons is shown */
.line-screen--empty .job-filled-only,
.line-screen:not(.line-screen--empty) .job-empty-only {
     display: none; 
}

.save-error {
    background: #fdecea;
    border: 1px solid #c0392b;
    border-radius: var(--radius);
    color: #922b21;
    font-weight: 600;
    padding: 10px 14px;
    margin: 0 0 12px;
}

.count-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    background: var(--card);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    overflow: hidden;
}

.count-table td {
    padding: 18px 12px;
    border: none;
    border-bottom: 1px solid #C5CDDB;
    border-right: none;
    font-size: 22px;
    text-align: left;
}

.count-table tr:last-child td {
    border-bottom: none;
}

.count-table__name {
    font-weight: 700;
    font-size: 22px;
    width: auto;
    white-space: nowrap;
    font-family: inherit;
}

.count-table__value {
    text-align: center;
    font-size: 34px;
    font-weight: 700;
    width: 90px;
}

.count-table__buttons {
    width: 150px;
    text-align: right;
    white-space: nowrap;
}

.count-table__buttons .button {
    margin: 0 0 0 8px;
    height: 56px;
    width: 64px;
    padding: 0;
    font-size: 30px;
    font-weight: 700;
}

.count-modal {
    border: none;
    border-radius: var(--radius);
    padding: 32px;
    min-width: 360px;
    max-width: 90vw;
    /* the on-screen keyboard covers the bottom half, so sit near the top
       instead of centred; dvh shrinks with the keyboard, vh does not */
    margin-top: 6vh;
    margin-bottom: auto;
    max-height: 88vh;
    overflow-y: auto;
}

.count-modal__name {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px;
    text-align: center;
}

.count-modal__input,
.addcart-modal__input {
    width: 100%;
    font-size: 56px;
    text-align: center;
    padding: 16px;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
}

.count-modal .button {
    flex: 1;
    height: 60px;
    font-size: 20px;
}

.count-modal .inline-group {
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 0;
}

.klant-tabs {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 20px;
}
 
.klant-tab {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
 
    /* real client names run long - "2929 MECHELEN HOLIDAY INN EXPRESS -
       HOTELWAS" - so the tab is a fixed box and the name is cut off rather
       than allowed to push the strip past the edge of the screen.
       0 0 230px = never grow, never shrink, always 230px. */
    flex: 0 0 230px;
    min-width: 0;
 
    padding: 12px 14px;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);              /* the global `a` rule would make it blue */
    text-align: left;
    text-decoration: none;
    font-family: inherit;
    overflow: hidden;
}
 
.klant-tab--active {
    background: var(--primary-pale);
    border-color: var(--primary);
}
 
.klant-tab__nr {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    line-height: 1.2;
}
 
.klant-tab--active .klant-tab__nr {
    color: var(--primary);
}
 
.klant-tab__naam {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
 
    /* two lines, then an ellipsis - every tab keeps the same height */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
 
/* dashed, so it reads as "add one" and not as a client */
.klant-tab--add {
    flex: 0 0 72px;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 400;
    line-height: 1;
    color: var(--ink-soft);
    background: var(--card);
    border: 2px dashed var(--line);
    cursor: pointer;
}
 
/* ---- nobody on the line yet ---- */
.line-empty {
    text-align: center;
    padding: 48px 16px;
}
 
.line-empty__text {
    font-size: 20px;
    color: var(--ink-soft);
    margin: 0 0 24px;
}
 
/* ---- the loader's cart row ----
   .cart-chips and .cart-chip are already styled; this is only the wrapper
   that the JS replaces when a cart is added or removed. */
.cart-chip-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
 
/* ---- the error line inside a modal ----
   min-height reserves the line so the buttons do not jump down when an
   error appears under the input. */
.addcart-modal__error {
    color: var(--danger);
    font-weight: 600;
    font-size: 16px;
    margin: 12px 0 0;
    min-height: 24px;
}
 
/* ---- driver: carts left behind ---- */
body.page-alert {
    background: #fdecea;        /* the whole screen, not just a banner */
    min-height: 100vh;
}

.delivery-alert {
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.delivery-alert--missing {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 12px 16px;
    background: var(--danger);
    color: #fff;
    text-align: left;
    border: 3px solid #7d2018;
}

.delivery-alert--done {
    background: #e7f4e9;
    color: #1d6b2b;
    border: 1px solid #1d6b2b;
}

.delivery-alert--info {
    background: var(--primary-pale);
    color: var(--primary);
    border: 1px solid var(--line);
}

.delivery-alert__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.delivery-alert__carts {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 0;
}

.delivery-alert__sub {
    font-size: 16px;
    margin: 0;
}



@media (max-width: 600px) {
    .responsive-table thead,
    .responsive-table tr {
        display: block;
    }

    .responsive-table th {
        display: none;
    }

    .responsive-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        overflow: hidden;
        background: var(--card);
    }

    .responsive-table td {
        display: flex;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid var(--ink);
        min-height: 40px;
    }

    .mobile-label {
        display: flex;
        flex: 0 0 80px;
        background: var(--primary);
        color: white;
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        align-items: center;
        padding: 8px;
    }

    .mobile-value {
        flex: 1;
        display: flex;
        align-items: center;
        padding: 8px 14px;
        font-size: 15px;
    }

    .responsive-table td.manage-cell {
        display: flex;
        width: 100%;
        justify-content: center;
        text-align: center;
        border-bottom: none;
        background: #f3f1ec;
        padding: 12px 14px;
    }

    .responsive-table td.manage-cell a {
        color: var(--primary);
        font-weight: 600;
    }
}