/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f0f4f8; color: #2d3748; min-height: 100vh; }
a { color: inherit; }

/* ── Header ────────────────────────────────────────────────────────────────── */
.header {
    background: #fff;
    color: #1a3c5e;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.5px; }
.header p  { font-size: 0.85rem; color: #718096; margin-top: 0.2rem; }
.header-links a {
    color: #1a3c5e;
    text-decoration: none;
    font-size: 0.85rem;
    background: #f0f4f8;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    transition: background 0.15s;
}
.header-links a:hover { background: #e2e8f0; }

/* ── Toolbar (nav) ─────────────────────────────────────────────────────────── */
.toolbar {
    background: #fff;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.view-toggle {
    display: flex;
    border: 2px solid #1a3c5e;
    border-radius: 6px;
    overflow: hidden;
}
.view-toggle a, .view-toggle button {
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a3c5e;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.view-toggle a:hover, .view-toggle button:hover { background: #ebf8ff; }
.view-toggle a.active, .view-toggle button.active {
    background: #1a3c5e;
    color: #fff;
}

.nav-arrows {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-arrows a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    color: #4a5568;
    text-decoration: none;
    font-size: 1.1rem;
    transition: background 0.15s;
}
.nav-arrows a:hover { background: #f7fafc; }
.nav-title {
    font-weight: 600;
    font-size: 1rem;
    min-width: 160px;
    text-align: center;
    color: #1a3c5e;
}

.btn { display: inline-block; padding: 0.4rem 1rem; border-radius: 6px; font-size: 0.85rem; font-weight: 600; text-decoration: none; cursor: pointer; border: none; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn-gold   { background: #e8b84b; color: #1a3c5e; margin-left: auto; }
.btn-blue   { background: #1a3c5e; color: #fff; }
.btn-green  { background: #38a169; color: #fff; }
.btn-red    { background: #e53e3e; color: #fff; }
.btn-gray   { background: #718096; color: #fff; }
.btn-teal   { background: #319795; color: #fff; }
.btn-sm     { padding: 0.25rem 0.6rem; font-size: 0.75rem; }

/* ── Container ─────────────────────────────────────────────────────────────── */
.container { max-width: 1140px; margin: 1.75rem auto; padding: 0 1.25rem; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert { padding: 0.9rem 1.25rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: 0.9rem; }
.alert ul { margin-top: 0.5rem; padding-left: 1.25rem; }
.alert-success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.alert-error   { background: #fff5f5; color: #742a2a; border: 1px solid #fc8181; }
.alert-info    { background: #ebf8ff; color: #2a4365; border: 1px solid #90cdf4; }

/* ── Equipment Status Cards ────────────────────────────────────────────────── */
.equip-row { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.equip-card {
    flex: 1; min-width: 220px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.equip-icon { font-size: 1.75rem; flex-shrink: 0; }
.equip-info { flex: 1; }
.equip-info h4 { font-size: 0.95rem; font-weight: 700; color: #1a3c5e; }
.equip-info p  { font-size: 0.78rem; color: #718096; margin-top: 0.15rem; }
.equip-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }
.equip-available { background: #c6f6d5; color: #22543d; }
.equip-busy      { background: #fed7d7; color: #742a2a; }
.equip-later     { background: #fef3c7; color: #78350f; }

/* ── Legend ────────────────────────────────────────────────────────────────── */
.legend { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; font-size: 0.82rem; color: #4a5568; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.dot-free  { background: #c6f6d5; border: 1px solid #68d391; }
.dot-venue { background: #fed7d7; border: 1px solid #fc8181; }
.dot-equip { background: #fef3c7; border: 1px solid #f6ad55; }

/* ── Month Calendar ─────────────────────────────────────────────────────────── */
.calendar {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
}
.cal-dow-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 2px solid #e2e8f0;
}
.cal-dow { text-align: center; padding: 0.6rem 0; font-size: 0.75rem; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: 0.5px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day {
    border-right: 1px solid #f0f4f8;
    border-bottom: 1px solid #f0f4f8;
    padding: 0.4rem 0.5rem;
    min-height: 88px;
    cursor: pointer;
    transition: background 0.12s;
    position: relative;
}
.cal-day:hover { background: #f7fafc; }
.cal-day.other-month { opacity: 0.3; cursor: default; }
.cal-day.today { background: #ebf8ff; }
.cal-day.today .day-num { color: #2b6cb0; font-weight: 800; }
.cal-day.selected { outline: 2px solid #1a3c5e; outline-offset: -2px; }
.day-num { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.3rem; }
.day-pills { display: flex; flex-direction: column; gap: 2px; }
.day-pill {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.pill-venue { background: #fed7d7; color: #c53030; }
.pill-equip { background: #fef3c7; color: #744210; }
.pill-more  { background: #e2e8f0; color: #718096; font-size: 0.65rem; }

/* ── Day Detail Panel ──────────────────────────────────────────────────────── */
.day-detail {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    margin-top: 1.25rem;
    padding: 1.25rem 1.5rem;
    display: none;
}
.day-detail.visible { display: block; }
.day-detail h3 { font-size: 1rem; font-weight: 700; color: #1a3c5e; margin-bottom: 1rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.5rem; }
.booking-card {
    border-left: 4px solid #cbd5e0;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: #f7fafc;
    border-radius: 0 8px 8px 0;
}
.booking-card.bc-venue { border-color: #fc8181; }
.booking-card.bc-equip { border-color: #f6ad55; }
.booking-card h4 { font-size: 0.9rem; font-weight: 700; }
.booking-card .bc-meta { font-size: 0.8rem; color: #718096; margin-top: 0.2rem; }
.booking-card .bc-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* ── Week View ─────────────────────────────────────────────────────────────── */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
}
.week-day-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
    min-width: 0;
}
.week-day-header {
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    text-align: center;
}
.week-day-header .wday { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: #718096; letter-spacing: 0.5px; }
.week-day-header .wdate { display: block; font-size: 1.1rem; font-weight: 700; color: #1a3c5e; }
.week-day-card.week-today .week-day-header { background: #ebf8ff; }
.week-day-card.week-today .week-day-header .wdate { color: #2b6cb0; }
.week-day-body { padding: 0.5rem; }
.week-booking-chip {
    border-radius: 5px;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
}
.wchip-time { display: block; font-weight: 700; color: #4a5568; }
.wchip-event { display: block; font-weight: 600; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wchip-venue { background: #fed7d7; }
.wchip-venue .wchip-event { color: #c53030; }
.wchip-equip { background: #fef3c7; }
.wchip-equip .wchip-event { color: #744210; }
.week-free { font-size: 0.75rem; color: #a0aec0; font-style: italic; padding: 0.25rem 0; text-align: center; }

/* ── Tags ──────────────────────────────────────────────────────────────────── */
.tag { display: inline-block; font-size: 0.72rem; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.tag-venue  { background: #fed7d7; color: #c53030; }
.tag-proj   { background: #bee3f8; color: #2b6cb0; }
.tag-screen { background: #c6f6d5; color: #276749; }

/* ── Upcoming Table ─────────────────────────────────────────────────────────── */
.section-title { font-size: 1.05rem; font-weight: 700; color: #1a3c5e; margin: 1.75rem 0 0.75rem; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    font-size: 0.84rem;
}
.data-table th {
    background: #1a3c5e;
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.data-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f4f8;
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f7fafc; }
.data-table .row-pending   td { border-left: 3px solid #ed8936; }
.data-table .row-confirmed td { border-left: 3px solid #38a169; }
.data-table .row-completed td { border-left: 3px solid #4299e1; }
.data-table .row-cancelled td { border-left: 3px solid #a0aec0; opacity: 0.65; }

/* ── Status Badges ─────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.74rem; font-weight: 700; text-transform: capitalize; }
.badge-pending   { background: #fef3c7; color: #78350f; }
.badge-confirmed { background: #c6f6d5; color: #22543d; }
.badge-completed { background: #bee3f8; color: #1e4e8c; }
.badge-cancelled { background: #e2e8f0; color: #4a5568; }

/* ── Booking Form ───────────────────────────────────────────────────────────── */
.form-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 2rem;
    max-width: 680px;
    margin: 0 auto;
}
.form-card h2 { font-size: 1.2rem; color: #1a3c5e; margin-bottom: 0.25rem; }
.form-card .subtitle { color: #718096; font-size: 0.85rem; margin-bottom: 1.5rem; }
.form-section { margin-bottom: 1.5rem; }
.form-section h3 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #718096; margin-bottom: 1rem; padding-bottom: 0.4rem; border-bottom: 1px solid #e2e8f0; }
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-size: 0.82rem; font-weight: 600; color: #4a5568; margin-bottom: 0.35rem; }
input[type="text"], input[type="date"], input[type="time"], select, textarea {
    width: 100%; padding: 0.55rem 0.75rem; border: 1.5px solid #cbd5e0; border-radius: 6px; font-size: 0.88rem; font-family: inherit; color: #2d3748; background: #fff; transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #1a3c5e; }
textarea { resize: vertical; }

/* Checkbox cards */
.checkbox-group { display: flex; flex-direction: column; gap: 0.6rem; }
.checkbox-card { display: flex; align-items: center; gap: 1rem; border: 2px solid #e2e8f0; border-radius: 8px; padding: 0.75rem 1rem; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.checkbox-card:has(input:checked) { border-color: #1a3c5e; background: #ebf8ff; }
.checkbox-card input[type="checkbox"] { width: 18px; height: 18px; accent-color: #1a3c5e; flex-shrink: 0; cursor: pointer; }
.cb-icon  { font-size: 1.4rem; }
.cb-label { font-weight: 700; font-size: 0.9rem; color: #1a3c5e; }
.cb-desc  { font-size: 0.78rem; color: #718096; margin-top: 1px; }

.btn-submit {
    width: 100%;
    padding: 0.75rem;
    background: #1a3c5e;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.5rem;
}
.btn-submit:hover { background: #2d6a9f; }

/* ── Admin Panel ────────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }
.filter-bar a { font-size: 0.82rem; padding: 0.3rem 0.85rem; border-radius: 20px; text-decoration: none; background: #e2e8f0; color: #4a5568; font-weight: 600; transition: background 0.12s; }
.filter-bar a.active { background: #1a3c5e; color: #fff; }
.filter-bar a:hover:not(.active) { background: #cbd5e0; }

.actions form { display: inline; }
.actions button { margin-right: 3px; }

.admin-add-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 1.5rem;
    margin-bottom: 1.75rem;
}
.admin-add-card summary { cursor: pointer; font-weight: 700; color: #1a3c5e; font-size: 0.95rem; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.admin-add-card summary::before { content: '＋'; font-size: 1.1rem; }
.admin-add-card[open] summary::before { content: '－'; }
.admin-add-card .inner { padding-top: 1.25rem; }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.footer { text-align: center; padding: 2rem 0; color: #a0aec0; font-size: 0.8rem; }
.footer a { color: #718096; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .week-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
    .header { padding: 1rem; }
    .toolbar { padding: 0.6rem 1rem; }
    .container { padding: 0 0.75rem; }
    .week-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .cal-day { min-height: 60px; padding: 0.25rem; }
    .day-pill { font-size: 0.6rem; }
    .equip-row { flex-direction: column; }
    .data-table { font-size: 0.78rem; }
    .data-table th, .data-table td { padding: 0.5rem 0.6rem; }
    .btn-gold { margin-left: 0; }
}
