/**
 * Kitchen Display System (KDS) — Kanban board for kitchen display (laptop, iPad, desktop).
 */

.maca-staff-orders-page--kds {
    background: #1a1d21;
    color: #e8eaed;
    min-height: 100vh;
    min-height: 100dvh;
}

.maca-staff-orders-page--kds .maca-staff-orders-app {
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.maca-staff-orders-page--kds .maca-staff-orders-pin {
    max-width: 400px;
    margin: 10vh auto;
}

.maca-staff-orders-page--kds .maca-staff-orders-unlock {
    background: #2dd4bf;
    color: #0f1419;
}

.maca-kds-board {
    min-height: 100vh;
    min-height: 100dvh;
}

.maca-kds-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

.maca-kds-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px 12px 16px 16px;
}

.maca-kds-topbar {
    margin-bottom: 16px;
}

.maca-kds-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.maca-kds-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    flex: 1;
    align-items: stretch;
    min-height: 0;
}

@media (min-width: 901px) {
    .maca-kds-columns {
        min-height: calc(100vh - 88px);
        min-height: calc(100dvh - 88px);
    }

    .maca-kds-column {
        max-height: calc(100vh - 88px);
        max-height: calc(100dvh - 88px);
    }

    .maca-kds-column-body {
        max-height: none;
    }
}

.maca-kds-column {
    display: flex;
    flex-direction: column;
    min-height: 280px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    overflow: hidden;
}

.maca-kds-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.maca-kds-column-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.maca-kds-column-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.maca-kds-column--new .maca-kds-column-count {
    background: #ff6b4a;
    color: #fff;
}

.maca-kds-column--progress .maca-kds-column-count {
    background: #2dd4bf;
    color: #0f1419;
}

.maca-kds-column--ready .maca-kds-column-count {
    background: #6b7280;
    color: #fff;
}

.maca-kds-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.maca-kds-card {
    position: relative;
    background: #fff;
    color: #1a1d21;
    border-radius: 10px;
    padding: 14px 14px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #ccc;
}

.maca-kds-card--new {
    border-left-color: #e53935;
}

.maca-kds-card--progress {
    border-left-color: #f9a825;
}

.maca-kds-card--ready {
    border-left-color: #43a047;
}

.maca-kds-card-table {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.maca-staff-order-table-change--kds .maca-staff-order-table-change-label {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    width: 100%;
}

.maca-staff-orders-page--kds .maca-staff-order-table-select,
.maca-staff-orders-page--kds .maca-staff-order-table-input {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
}

.maca-staff-orders-page--kds .maca-staff-order-table-save {
    background: #ffb347;
    color: #1f1f1f;
}

.maca-kds-card-lines {
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 1.45;
}

.maca-kds-card-lines li {
    margin-bottom: 4px;
}

.maca-kds-card-line-note {
    margin: 0 0 6px 1.2em;
    font-size: 13px;
    color: #5f6368;
    font-style: italic;
}

.maca-kds-card-order-note {
    margin: 0 0 10px;
    padding: 8px 10px;
    background: #fff8e1;
    border-radius: 6px;
    font-size: 13px;
    color: #5d4037;
}

.maca-kds-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.maca-kds-card-timer-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.maca-kds-card-timer {
    font-size: 13px;
    font-weight: 700;
    color: #5f6368;
    white-space: nowrap;
}

.maca-kds-card-overdue {
    font-size: 13px;
    font-weight: 800;
    color: #dc2626;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.maca-kds-card--overdue {
    border-left-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.28);
}

.maca-kds-card--new .maca-kds-card-timer {
    color: #c62828;
}

.maca-kds-card--progress.maca-kds-card--overdue .maca-kds-card-timer {
    color: #dc2626;
}

.maca-kds-card-paid {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e8f5e9;
    color: #2e7d32;
}

.maca-kds-card-action {
    width: 100%;
    margin-top: 10px;
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    background: #1a1d21;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

@media (hover: hover) {
    .maca-kds-card-action:hover {
        filter: brightness(1.1);
    }

    .maca-kds-card-action:active {
        transform: scale(0.98);
    }
}

.maca-kds-card--progress .maca-kds-card-action {
    background: #f9a825;
    color: #1a1d21;
}

.maca-kds-card-action--overdue {
    background: #dc2626 !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.45);
}

@media (hover: hover) {
    .maca-kds-card-action--overdue:hover {
        filter: brightness(1.08);
    }
}

.maca-kds-card--ready .maca-kds-card-action {
    background: #43a047;
    color: #fff;
}

.maca-kds-card-ready-icon {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #43a047;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

.maca-kds-card--ready .maca-kds-card-footer {
    padding-right: 36px;
}

.maca-kds-stats {
    width: 200px;
    flex-shrink: 0;
    padding: 24px 20px;
    background: #12151a;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.maca-kds-stat-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9aa0a6;
    margin-bottom: 6px;
}

.maca-kds-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.maca-kds-empty {
    text-align: center;
    color: #9aa0a6;
    padding: 32px 16px;
    margin: 0;
}

/* Narrow screens only (phone / small tablet) — laptops keep 3-column Kanban */
@media (max-width: 768px) {
    .maca-kds-layout {
        flex-direction: column;
    }

    .maca-kds-stats {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px 24px;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 16px;
    }

    .maca-kds-stat {
        flex: 1 1 120px;
    }

    .maca-kds-columns {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .maca-kds-column {
        min-height: 120px;
        max-height: 40vh;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .maca-kds-stats {
        width: 160px;
        padding: 16px 12px;
    }

    .maca-kds-stat-value {
        font-size: 22px;
    }
}
