/* ============================================================
   Table Reservation System - Main Stylesheet
   ============================================================ */

:root {
    --clr-available: #17a2b8;
    --clr-pending:   #ffc107;
    --clr-booked:    #dc3545;
    --clr-checkedin: #28a745;
    --clr-empty:     #e9ecef;
    --cell-size:     54px;
}

body { font-family: 'Segoe UI', Tahoma, sans-serif; }

/* ─── Stat Boxes ─────────────────────────────────────────── */
.stat-box {
    border-radius: 10px;
    padding: 10px 6px;
    color: #fff;
}
.stat-available { background: var(--clr-available); }
.stat-pending   { background: var(--clr-pending); color: #333 !important; }
.stat-booked    { background: var(--clr-booked); }
.stat-num { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-lbl { font-size: 0.75rem; }

/* ─── Legend ─────────────────────────────────────────────── */
.legend-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    font-size: 0.85rem;
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-item.available { color: var(--clr-available); }
.legend-item.pending   { color: #c89400; }
.legend-item.booked    { color: var(--clr-booked); }

/* ─── Department Filter ───────────────────────────────────── */
.dept-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ─── Chart Layout ───────────────────────────────────────── */
.chart-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}
.chart-inner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: max-content;
    padding: 4px;
}

/* ─── Department Block ───────────────────────────────────── */
.dept-block {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}
.dept-block.dept-vip {
    border-color: #ffd700;
    background: #fffdf0;
}
.dept-head {
    background: #495057;
    color: #fff;
    text-align: center;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.dept-vip .dept-head { background: #b8860b; }

/* ─── Table Grid ─────────────────────────────────────────── */
.tbl-grid {
    display: grid;
    gap: 3px;
    padding: 5px;
}

/* ─── Table Cell ─────────────────────────────────────────── */
.tbl-cell {
    width: var(--cell-size);
    height: var(--cell-size);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.6rem;
    text-align: center;
    padding: 2px;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
    overflow: hidden;
    cursor: default;
}
.tbl-cell.tbl-available {
    background: var(--clr-available);
    color: #fff;
    cursor: pointer;
}
.tbl-cell.tbl-available:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(23,162,184,0.5);
    color: #fff;
    z-index: 1;
}
.tbl-cell.tbl-pending {
    background: var(--clr-pending);
    color: #333;
    cursor: pointer;
}
.tbl-cell.tbl-pending:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(255,193,7,0.5);
    color: #333;
    z-index: 1;
}
.tbl-cell.tbl-booked {
    background: var(--clr-booked);
    color: #fff;
    cursor: pointer;
}
.tbl-cell.tbl-booked:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(220,53,69,0.5);
    color: #fff;
    z-index: 1;
}
.tbl-cell.tbl-checkedin {
    background: #198754 !important;
    color: #fff !important;
    cursor: pointer;
}
.tbl-cell.tbl-checkedin:hover {
    background: #157347 !important;
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(25,135,84,0.5);
    color: #fff !important;
    z-index: 1;
}
.tbl-cell.tbl-empty {
    background: var(--clr-empty);
    cursor: default;
}

.tbl-code {
    font-weight: 700;
    font-size: 0.65rem;
    display: block;
    line-height: 1.2;
}
.tbl-name {
    font-size: 0.5rem;
    display: block;
    word-break: break-all;
    line-height: 1.1;
    overflow: hidden;
    max-height: 28px;
}

/* ─── Stage ──────────────────────────────────────────────── */
.stage-area { margin-top: 16px; }
.stage-box {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 14px 48px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

/* ─── Admin Sidebar ──────────────────────────────────────── */
.admin-sidebar {
    min-height: 100vh;
    background: #2c3e50;
    color: #ecf0f1;
}
.admin-sidebar .nav-link {
    color: #bdc3c7;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: background 0.2s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.admin-sidebar .nav-link .icon { margin-right: 8px; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 576px) {
    :root { --cell-size: 46px; }
    .tbl-code { font-size: 0.58rem; }
    .tbl-name { font-size: 0.44rem; }
}
