﻿/* ================= ROOT ================= */
.kot-desk {
    padding: 20px;
    background: #f6f7f9;
    max-width: 100%;
    overflow-x: hidden;
    min-height: 100%;
}

/* ================= HEADER ================= */
.kot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

    .kot-header h2 {
        margin: 0;
        font-size: 22px;
    }

.kot-subtitle {
    font-size: 13px;
    color: #777;
    display: block;
    margin-top: 2px;
}

.kot-legend {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ================= BODY ================= */
.kot-body {
    width: 100%;
}

/* ================= TABLE ================= */
.kot-table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    min-width: 620px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.kot-table-header,
.kot-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr 1.8fr 1.2fr 130px;
    padding: 11px 14px;
    gap: 10px;
    align-items: center;
}

.kot-table-header {
    background: #efefef;
    font-weight: 600;
    font-size: 13px;
}

.kot-row {
    border-top: 1px solid #eee;
    font-size: 13px;
    transition: background 0.15s;
}

    .kot-row:hover {
        background: #fafafa;
    }

    /* Columns */
    .kot-row .col-orderno {
        font-weight: 600;
        color: #1a1a1a;
    }

    .kot-row .col-table {
        color: #444;
    }

.dispatch-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    background: #f0f4ff;
    color: #3a3a8c;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

    .dispatch-badge.takeaway {
        background: #fff8e1;
        color: #7c5a00;
    }

.col-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    text-align: right;
}

/* ================= ACTION BUTTONS ================= */
.btn-kot-print,
.btn-kot-show {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s, transform 0.1s;
}

    .btn-kot-print:active,
    .btn-kot-show:active {
        transform: scale(0.96);
    }

.btn-kot-print {
    background: #111;
    color: #fff;
}

    .btn-kot-print:hover {
        background: #333;
    }

.btn-kot-show {
    background: #eef2ff;
    color: #3730a3;
}

    .btn-kot-show:hover {
        background: #e0e7ff;
    }

/* ================= STATUS PILLS ================= */
.status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
    font-weight: 500;
}

    .status-pill.preparing {
        background: #fff3cd;
        color: #856404;
    }

    .status-pill.ready {
        background: #d4edda;
        color: #155724;
    }

    .status-pill.placed {
        background: #cce5ff;
        color: #004085;
    }

    .status-pill.completed {
        background: #d1ecf1;
        color: #0c5460;
    }

    .status-pill.cancelled {
        background: #fdecea;
        color: #d32f2f;
    }

    .status-pill.updated {
        background: #f3e8ff;
        color: #6b21a8;
    }

    .status-pill.serving {
        background: #ffedd5;
        color: #9a3412;
    }

/* ================= EMPTY / LOADING ================= */
.kot-empty-row {
    padding: 30px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

/* ================= MODAL OVERLAY ================= */
.kotm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* ================= MODAL SHEET ================= */
.kotm-sheet {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Header */
.kotm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #eee;
}

.kotm-title-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kotm-title {
    font-size: 17px;
    font-weight: 700;
    color: #111;
}

.kotm-subtitle {
    font-size: 12px;
    color: #888;
}

.kotm-close {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.15s;
}

    .kotm-close:hover {
        background: #e0e0e0;
    }

/* Body */
.kotm-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

/* Info Grid (2-col label-value pairs) */
.kotm-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-bottom: 4px;
}

.kotm-info-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kotm-info-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.kotm-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Divider */
.kotm-divider {
    border-top: 1px dashed #e0e0e0;
    margin: 14px 0;
}

/* Items list */
.kotm-items-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}

.kotm-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 9px 0;
    border-bottom: 1px solid #f7f7f7;
    font-size: 14px;
}

    .kotm-item-row:last-child {
        border-bottom: none;
    }

.kotm-item-name {
    font-weight: 500;
    color: #222;
    flex: 1;
    padding-right: 12px;
}

.kotm-item-customizations {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.kotm-item-qty {
    font-weight: 700;
    color: #111;
    font-size: 15px;
    min-width: 30px;
    text-align: right;
}

/* Footer */
.kotm-footer {
    padding: 14px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.btn-mark-preparing {
    width: 100%;
    padding: 11px;
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: background 0.15s, transform 0.1s;
}

    .btn-mark-preparing:hover {
        background: #d97706;
    }

    .btn-mark-preparing:active {
        transform: scale(0.98);
    }

    .btn-mark-preparing:disabled {
        background: #d4d4d4;
        color: #888;
        cursor: not-allowed;
    }

/* ================= RESPONSIVE ================= */
@media (max-width: 700px) {
    .kot-table-header,
    .kot-row {
        grid-template-columns: 1fr 1.2fr 1fr 120px;
    }

        /* Hide customer column on very small screens */
        .kot-table-header > div:nth-child(3),
        .kot-row > div:nth-child(3) {
            display: none;
        }

    .kotm-info-grid {
        grid-template-columns: 1fr;
    }
}
