:root {
    --default: #E50914;
    --hover: #95060D;
    --lines: #C4C4C4;
    --gray: #777777;
    --gray2: #D9D9D9;
    --green: #0B8209;
    --orange: #FF9900;
}

body.monitor {
    background: black;
    padding: 15px 0;
    margin: 0;
    font-family: Roboto, sans-serif;
    font-size: 16px;
    line-height: normal;
}

body.monitor.is-anonymous,
body.monitor:has(.waiter-login-screen) {
    padding: 0;
    margin: 0;
}

a {
    text-decoration: none;
}

strong {
    font-weight: 700;
}

.button {
    text-align: center;
    background: var(--default);
    color: white;
    padding: 20px;
    border-radius: 5px;
    font-weight: 700;
    width: calc(100% - 40px);
    font-size: 1em;
    display: block;
}

/* LOGIN: Handled centrally by waiter.css */

/* HEADER */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
}

header ul {
    display: flex;
    gap: 15px;
}

header li:not(:last-child):after {
    content: '';
    height: 20px;
    width: 1px;
    background: var(--gray);
    display: inline-block;
    margin-left: 15px;
    vertical-align: middle;
}

header,
header a {
    color: var(--gray);
    font-size: 24px;
}

header a.active {
    color: white;
}

header strong {
    color: white;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
}

.header-center .date {
    font-size: 17px;
    font-weight: 500;
    color: var(--lines);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.header-center .date strong {
    color: white;
    font-weight: 700;
}

.kds-avg-time {
    font-size: 13px;
    font-weight: 500;
    color: #8e8e8e;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.2;
}

.kds-avg-time strong {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kds-filter-toggle {
    background: #1e1e1e;
    border: 1px solid var(--gray);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.kds-filter-toggle:hover,
.kds-filter-toggle:active {
    border-color: white;
    background: #2a2a2a;
}

.kds-filter-toggle .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.kds-filter-badge {
    background: #444;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
}

.kds-filter-badge.active {
    background: var(--default);
}

/* ARTICLE */

main .processing .hide {
    width: 0;
    min-width: 0;
}

main .items:not(.active) {
    display: none;
}

.completed .button {
    display: none;
}

.items {
    display: flex;
    gap: 15px;
    padding-top: 15px;
    height: calc(100vh - 90px);
    overflow-x: auto;
}

article {
    background: white;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    transition: all .3s;
    width: calc((100% - 100px) / 3);
    min-width: calc((100% - 100px) / 3);
}

@keyframes blink-orange {
    0% { background: var(--orange); }
    50% { background: #ffcc00; }
    100% { background: var(--orange); }
}

article.updated .info,
article.overdue .info {
    background: var(--orange);
    animation: blink-orange 2s infinite;
}

article.updated .info > *,
article.overdue .info > *,
article.updated .info>span:nth-child(2),
article.overdue .info>span:nth-child(2),
article.updated .info .dashicons-printer:before,
article.overdue .info .dashicons-printer:before {
    color: black !important;
}

@keyframes blink-red {
    0% { background: var(--default); }
    50% { background: #ff4444; }
    100% { background: var(--default); }
}

article.cancelled .info {
    background: var(--default);
    color: white;
    animation: blink-red 2s infinite;
}

article:first-child {
    margin-left: 15px;
}

article:last-child {
    margin-right: 15px;
}

article .info {
    background: var(--gray);
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    color: var(--lines);
    row-gap: 10px;
}

article .info > span:nth-child(1),
article .info > span:nth-child(2),
article .info > span:nth-child(3) {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid var(--lines);
    padding-bottom: 10px;
}

article.updated .info > span:nth-child(1),
article.overdue .info > span:nth-child(1),
article.updated .info > span:nth-child(2),
article.overdue .info > span:nth-child(2),
article.updated .info > span:nth-child(3),
article.overdue .info > span:nth-child(3) {
    border-bottom: 1px solid black;
}

article .info > span:nth-child(2) {
    color: white;
    text-align: center;
}

article .info > span:nth-child(3),
article .info > span:nth-child(6) {
    grid-column: 3;
    text-align: right;
}

article .info > span:nth-child(4) i {
    color: white;
    font-size: 20px;
}

article .info > span:nth-child(5) {
    grid-column: 2;
    text-align: center;
    color: white;
}

article .address {
    background: var(--gray2);
    color: var(--gray);
    padding: 15px;
    font-size: 14px;
}


article > ul {
    padding: 15px;
    overflow: auto;
    height: calc(100% - 184px);
}

article > ul li {
    border-bottom: 1px solid var(--lines);
    padding: 15px 0;
}

article > ul li:last-child {
    border: none;
}

article > ul span {
    display: block;
}

article > ul .description {
    color: var(--default);
    padding-top: 5px;
    font-weight: 700;
}

article > ul .description p {
    padding: 2px 0;
    color: var(--default);
    font-weight: 700;
}

article > ul .notes {
    color: var(--default);
}

article .button {
    width: calc(100% - 72px);
    background: white;
    border: 1px solid var(--green);
    color: var(--green);
    position: absolute;
    bottom: 15px;
    left: 15px;
    transition: all .3s;
}

article .button.finish {
    background: var(--green);
    color: white;
}

article .button.cancel {
    background: var(--default);
    border-color: var(--default);
    color: white;
}

.connection-alert {
    position: fixed;
    right: 0;
    bottom: 0;
    background: var(--default);
    border-top-left-radius: 5px;
    color: white;
    text-align: center;
    padding: 15px;
    z-index: 9999;
}

.kds-hidden {
    display: none !important;
}

/* KDS TOUCH-FIRST CATEGORY FILTER MODAL */

@keyframes kdsFadeIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.kds-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.kds-modal-content {
    background: #181818;
    border: 1px solid #333333;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    animation: kdsFadeIn 0.2s ease-out;
}

.kds-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #2d2d2d;
    background: #202020;
}

.kds-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.kds-modal-close {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.kds-modal-close:hover,
.kds-modal-close:active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.kds-modal-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px 8px;
}

.kds-action-btn {
    flex: 1;
    background: #262626;
    border: 1px solid #404040;
    color: white;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.kds-action-btn:hover,
.kds-action-btn:active {
    background: #333333;
    border-color: #555555;
}

.kds-action-btn.secondary {
    color: #aaaaaa;
}

.kds-modal-body {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.kds-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.kds-cat-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #242424;
    border: 2px solid #383838;
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    min-height: 52px;
    user-select: none;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.kds-cat-chip:hover {
    border-color: #555555;
    background: #2a2a2a;
}

.kds-cat-chip.selected {
    border-color: var(--default);
    background: rgba(229, 9, 20, 0.14);
}

.kds-cat-chip input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    accent-color: var(--default);
    cursor: pointer;
    flex-shrink: 0;
}

.kds-cat-chip .chip-label {
    color: white;
    font-size: 16px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.kds-cat-chip .chip-count {
    background: #333333;
    color: #cccccc;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    flex-shrink: 0;
    pointer-events: none;
}

.kds-cat-chip.selected .chip-count {
    background: var(--default);
    color: white;
}

.kds-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #2d2d2d;
    background: #202020;
}

.kds-btn-apply {
    flex: 2;
    background: var(--default);
    border: none;
    color: white;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    min-height: 52px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.kds-btn-apply:hover,
.kds-btn-apply:active {
    background: var(--hover);
}

.kds-btn-cancel {
    flex: 1;
    background: #333333;
    border: none;
    color: #cccccc;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-height: 52px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.kds-btn-cancel:hover,
.kds-btn-cancel:active {
    background: #444444;
    color: white;
}

/* TIMER ALERT MODAL */

.kds-timer-toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #242424;
    border: 1px solid #383838;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.kds-timer-toggle-label {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.kds-switch-btn {
    min-width: 130px;
    min-height: 44px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid #555555;
    background: #333333;
    color: #aaaaaa;
    transition: all 0.2s ease-in-out;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

.kds-switch-btn.active {
    background: var(--default);
    border-color: var(--default);
    color: white;
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.4);
}

.kds-timer-config-box {
    background: #1c1c1c;
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    padding: 20px;
    transition: opacity 0.2s ease;
}

.kds-timer-config-box.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.kds-timer-instruction {
    color: #cccccc;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.kds-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 16px 0 24px 0;
}

.kds-step-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #282828;
    border: 2px solid #444444;
    color: white;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.kds-step-btn:hover,
.kds-step-btn:active {
    background: #383838;
    border-color: #666666;
    transform: scale(1.05);
}

.kds-step-display {
    text-align: center;
    min-width: 120px;
}

.kds-step-display strong {
    font-size: 44px;
    font-weight: 800;
    color: white;
    line-height: 1;
    display: block;
}

.kds-step-display span {
    font-size: 13px;
    font-weight: 600;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kds-preset-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.kds-preset-btn {
    background: #262626;
    border: 2px solid #3a3a3a;
    color: white;
    border-radius: 8px;
    padding: 12px 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}

.kds-preset-btn:hover,
.kds-preset-btn:active {
    border-color: #666666;
    background: #303030;
}

.kds-preset-btn.active {
    border-color: var(--default);
    background: rgba(229, 9, 20, 0.18);
    color: white;
    font-weight: 700;
}

@media (max-width: 920px) {

    article {
        min-width: 273px;
    }
    
}

@media (max-width: 660px) {

    .header-center {
        display: none;
    }

    .kds-category-grid {
        grid-template-columns: 1fr;
    }

    .kds-modal-content {
        max-height: 94vh;
    }
    
}

@media (max-width: 580px) {

    article {
        min-width: calc((100% - 60px) / 1);
    }
    
}

/* Ensure customer storefront modals are never displayed on KDS monitor */
.qrfood-product-sheet-modal,
#qrfoodProductModal,
#qrfoodCartModal {
    display: none !important;
}