/* Shared tracks keep every table aligned, regardless of its name or session state. */
body.list-view #masalar-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 10px;
}

body.list-view .masa-card {
    display: grid;
    grid-template-columns: minmax(210px, 1.4fr) minmax(110px, 1fr) minmax(130px, 1fr) minmax(190px, 1.1fr) minmax(200px, 1.25fr);
    align-items: center;
    column-gap: 16px;
    row-gap: 10px;
    padding: 12px 24px;
    height: auto;
    min-height: 64px;
    border-radius: 12px;
    position: relative;
    overflow: visible;
}

body.list-view .masa-card > * { min-width: 0; }
body.list-view .luza,
body.list-view .luzalar-container { display: none; }

body.list-view .masa-header {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}

body.list-view .masa-num {
    font-size: 15px !important;
    overflow-wrap: anywhere;
    text-align: center;
}

body.list-view .tarif-chip {
    padding: 4px 7px;
    font-size: 11px;
    flex-shrink: 0;
    white-space: nowrap;
}

body.list-view .timer-display {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-size: 18px;
    text-align: center;
    letter-spacing: 1px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

body.list-view .timer-display .seperator {
    top: 0;
    margin: 0 2px;
    vertical-align: baseline;
}

body.list-view .live-price {
    grid-column: 3;
    grid-row: 1;
    justify-self: center;
    width: 100%;
    max-width: 156px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 15px;
    overflow-wrap: anywhere;
}

body.list-view .fancy-inputs {
    grid-column: 4;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

body.list-view .fancy-input-group { flex: 0 1 auto; min-width: 0; margin: 0; }
body.list-view .fancy-input-group label { display: none; }
body.list-view .spinner-wrap { margin: 0; height: 32px; }
body.list-view .spinner-input {
    width: 48px;
    min-width: 0;
    height: 30px;
    padding: 0 4px;
    font-size: 12px;
    text-align: center;
}
body.list-view .duration-input { width: 82px; }
body.list-view .spin-btn { width: 24px; height: 30px; flex-shrink: 0; }

body.list-view .masa-actions {
    grid-column: 5;
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
}

body.list-view .btn-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    min-height: 32px;
    height: auto;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
}

/* Session notices occupy their own row, never covering the amount or controls. */
body.list-view .status-badge,
body.list-view .time-warning {
    position: static;
    transform: none;
    justify-self: center;
    margin: 0;
    padding: 4px 10px;
    font-size: 11px;
    line-height: 1.5;
    border-radius: 6px;
    white-space: normal;
    text-align: center;
}
body.list-view .status-badge { grid-column: 2; grid-row: 2; }
body.list-view .time-warning { grid-column: 3 / 5; grid-row: 2; }
body.list-view .masa-bar-section {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 0;
    padding: 10px 0 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

@media (max-width: 1100px) {
    body.list-view .masa-card {
        grid-template-columns: minmax(190px, 1.4fr) minmax(110px, 1fr) minmax(130px, 1fr);
        padding: 14px 18px;
    }
    body.list-view .fancy-inputs { grid-column: 1; grid-row: 2; }
    body.list-view .masa-actions { grid-column: 2 / 4; grid-row: 2; }
    body.list-view .status-badge { grid-column: 1; grid-row: 3; }
    body.list-view .time-warning { grid-column: 2 / 4; grid-row: 3; }
    body.list-view .masa-bar-section { grid-row: 4; }
}

@media (max-width: 640px) {
    body.list-view .masa-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 14px 12px;
        column-gap: 10px;
    }
    body.list-view .masa-header { grid-column: 1 / -1; grid-row: 1; }
    body.list-view .timer-display { grid-column: 1; grid-row: 2; }
    body.list-view .live-price { grid-column: 2; grid-row: 2; }
    body.list-view .fancy-inputs { grid-column: 1 / -1; grid-row: 3; }
    body.list-view .masa-actions { grid-column: 1 / -1; grid-row: 4; }
    body.list-view .status-badge { grid-column: 1; grid-row: 5; }
    body.list-view .time-warning { grid-column: 2; grid-row: 5; }
    body.list-view .masa-bar-section { grid-row: 6; }
    body.list-view .btn-card { min-height: 40px; padding: 10px 16px; }
}
