:root {
    --primary: #800020;       /* Rich Maroon */
    --primary-hover: #5c0017; /* Darker Maroon */
    --accent: #d4af37;        /* School Gold */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #faf7f7;    /* Tinted soft background */
    --surface: #ffffff;
    --text: #2d1e21;          /* Warm dark text */
    --text-light: #6e5d60;    /* Muted maroon-gray text */
    --border: #e8dfdf;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header with Logo Layout */
header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 25px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(128, 0, 32, 0.05);
    border-left: 6px solid var(--primary);
    margin-bottom: 30px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* School Logo Placeholder */
.school-logo {
    width: 70px;
    height: 70px;
    background: var(--primary);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    text-align: center;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}

.school-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.header-text h1 { 
    color: var(--primary); 
    font-size: 1.8rem; 
    margin-bottom: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
}

@media (min-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
    }
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn:hover { 
    background: var(--primary-hover); 
    box-shadow: 0 4px 10px rgba(128, 0, 32, 0.2);
}

.btn-secondary { 
    background: transparent; 
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover { 
    background: var(--primary); 
    color: white;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 992px) {
    .grid { grid-template-columns: 1fr 1.2fr; }
}

.card {
    background: var(--surface);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
}

h2 { 
    margin-bottom: 20px; 
    color: var(--primary); 
    font-size: 1.4rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fdfcfc;
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.1);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: var(--surface);
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th { 
    background: #f7f1f2; 
    color: var(--primary); 
    font-weight: 700; 
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover td {
    background-color: #faf6f7;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-approved { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-rejected { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-free { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-paid { background: #faf5ff; color: #6d28d9; border: 1px solid #e9d5ff; }

/* Admin actions */
.actions {
    display: flex;
    gap: 5px;
}
.actions form { display: inline; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-approve { background: var(--success); }
.btn-approve:hover { background: #059669; box-shadow: none; }
.btn-reject { background: var(--danger); }
.btn-reject:hover { background: #dc2626; box-shadow: none; }
/* Calendar UI Components */
.calendar-wrapper {
    margin-top: 15px;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}
.calendar-day-name {
    font-weight: bold;
    color: var(--primary);
    padding: 5px 0;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.calendar-day {
    background: #fdfcfc;
    border: 1px solid var(--border);
    min-height: 75px;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}
.calendar-day.today {
    border-color: var(--accent);
    background: #fffbeb;
}
.calendar-day-num {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
}
.calendar-events {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 5px;
}
.cal-event-tag {
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 3px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    font-weight: 600;
    text-align: left;
}
.cal-event-Approved { background-color: var(--success); }
.cal-event-Pending { background-color: var(--warning); }

/* Hall Picker Styling */
.hall-filter-wrapper {
    margin-bottom: 20px;
    background: #f7f1f2;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
/* Styling for Rejected Events on the Calendar Grid */
.cal-event-Rejected { 
    background-color: var(--badge-rejected-bg, #f8d7da); 
    color: var(--badge-rejected-text, #721c24);
    border: 1px solid #f5c6cb;
}