/* =========================================================
   MEMBERSHIP / CAPACITY
   Spaces • Capacity • Waiting List • Forecasting
========================================================= */


/* =========================================================
   SPACES GRID
========================================================= */

.spaces-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}


/* =========================================================
   SPACE CARDS
========================================================= */

.spaces-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    transition: .25s;
}

.spaces-header {
    padding: 14px;
    text-align: center;
}

.spaces-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.spaces-body {
    padding: 18px;
    text-align: center;
}

.spaces-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.spaces-capacity {
    margin: 10px 0 20px;
    color: #777;
}

.spaces-progress {
    width: 100%;
    height: 12px;
    background: #ececec;
    border-radius: 20px;
    overflow: hidden;
}

.spaces-progress-bar {
    height: 100%;
    border-radius: 20px;
}

.spaces-footer {
    margin-top: 20px;
    font-weight: 600;
}


/* =========================================================
   SECTION COLOURS
========================================================= */

/* Rainbows */

.spaces-rainbows {
    border: 2px solid #96d3f5;
    box-sizing: border-box;
}

.spaces-rainbows .spaces-header {
    background: #96d3f5;
    color: #e1120e;
}

.spaces-rainbows .spaces-progress-bar {
    background: #e1120e;
}


/* Brownies */

.spaces-brownies {
    border: 2px solid #ffc80a;
    box-sizing: border-box;
}

.spaces-brownies .spaces-header {
    background: #ffc80a;
    color: #603d33;
}

.spaces-brownies .spaces-progress-bar {
    background: #603d33;
}


/* Guides */

.spaces-guides {
    border: 2px solid #173a86;
    box-sizing: border-box;
}

.spaces-guides .spaces-header {
    background: #173a86;
    color: #8cb5e2;
}

.spaces-guides .spaces-progress-bar {
    background: #8cb5e2;
}


/* Rangers */

.spaces-rangers {
    border: 2px solid #54184a;
    box-sizing: border-box;
}

.spaces-rangers .spaces-header {
    background: #54184a;
    color: #fbdfe7;
}

.spaces-rangers .spaces-progress-bar {
    background: #54184a;
}


/* =========================================================
   SPACES TABLE
========================================================= */

.spaces-table-card {
    background: #fff;
    overflow: hidden;
}

.spaces-table-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    margin-top: 20px;
}

.spaces-table-header h2 {
    margin: 0;
}

.spaces-table-header p {
    margin: 6px 0 0;
    color: #777;
}

.spaces-table {
    width: 100%;
    border-collapse: collapse;
}

.spaces-table th {
    text-align: left;
    padding: 16px 20px;
    background: #fafafa;
}

.spaces-table td {
    padding: 16px 20px;
    border-top: 1px solid #f1f1f1;
    font-size: .9rem;
}

.spaces-table tbody tr:hover {
    background: #fafcff;
}


/* =========================================================
   SPACE STATUS PILLS
========================================================= */

.spaces-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
}

.spaces-pill.good {
    background: #e8f7ea;
    color: #2e7d32;
}

.spaces-pill.warning {
    background: #fff4d8;
    color: #9b6b00;
}

.spaces-pill.full {
    background: #fde7e7;
    color: #b71c1c;
}


/* =========================================================
   WAITING LIST
========================================================= */

.waiting-table th,
.waiting-table td {
    padding: 14px 18px;
    vertical-align: middle;
}


/* =========================================================
   CAPACITY KPI GRID
========================================================= */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: none;
    border: 1px solid #e5e7eb;
    border-top: 5px solid #005baa;
}

.kpi-card.capacity {
    border-color: #666;
}

.kpi-card.current {
    border-color: #2196F3;
}

.kpi-card.available {
    border-color: #4CAF50;
}

.kpi-card.waiting {
    border-color: #ff9800;
}

.kpi-value {
    font-size: 38px;
    font-weight: 700;
    margin: 10px 0;
}

.kpi-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #777;
}


/* =========================================================
   OCCUPANCY
========================================================= */

.occupancy-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: none;
    border: 1px solid #e5e7eb;
    margin-bottom: 25px;
}

.occupancy-progress {
    width: 100%;
    height: 18px;
    background: #e9ecef;
    border-radius: 20px;
    overflow: hidden;
    margin: 15px 0;
}

.occupancy-progress-fill {
    height: 100%;
    background: #4CAF50;
    border-radius: 20px;
}

.occupancy-text {
    text-align: center;
    font-weight: 600;
}


/* =========================================================
   TERM PLANNING
========================================================= */

.term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.term-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.term-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.term-date-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.term-date-group > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.term-date-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.term-date-group input {
    width: 100%;
    max-width: 220px;
}

.term-date-group small {
    margin-bottom: 4px;
    font-weight: 600;
    color: #666;
}

.term-year {
    color: #777;
    font-size: 0.9rem;
    font-weight: 500;
}


/* =========================================================
   FORECAST
========================================================= */

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.forecast-card {
    background: #fff;
    border: 1px solid #d9e2ef;
    border-top: 4px solid #6aa6d9;
    border-radius: 10px;
    overflow: hidden;
}

.forecast-card h3 {
    margin: 0;
    padding: 14px 18px;
    background: #eef4fb;
    color: #161b4e;
    border-bottom: 1px solid #d9e2ef;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.forecast-card h3 small {
    display: block;
    margin-top: 3px;
    color: #6b7280;
    font-size: .82rem;
    font-weight: 500;
}


/* Forecast mini table */

.forecast-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.forecast-mini th {
    background: #f8fafc;
    color: #161b4e;
    font-weight: 600;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.forecast-mini td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
}

.forecast-mini tr:hover {
    background: #fafcff;
}

.forecast-mini td:first-child,
.forecast-mini th:first-child {
    text-align: left;
    font-weight: 600;
}


/* =========================================================
   UNIT CAPACITY FORECAST
========================================================= */

.unit-forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.unit-forecast-card {
    background: #fff;
    border: 1px solid #dfe5f2;
    border-radius: 12px;
    overflow: hidden;
}

.unit-forecast-header {
    background: #eef3fb;
    border-bottom: 1px solid #dfe5f2;
    padding: 16px 20px;
    min-height: 40px;
}

.unit-forecast-title {
    font-size: 1rem;
    font-weight: 600;
    color: #161b4e;
}

.unit-forecast-year {
    margin-top: 4px;
    color: #6d7692;
    font-size: 0.8rem;
}

.unit-forecast-body {
    padding: 20px;
}

.unit-forecast-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.unit-forecast-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
}

.unit-forecast-value {
    font-size: 1rem;
    font-weight: 700;
    color: #007bc4;
}



.unit-forecast-divider {
    border-top: 1px solid #eceff6;
    margin: 18px 0;
}

.unit-forecast-section {
    margin-bottom: 18px;
}

.unit-forecast-section-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: #161b4e;
    margin-bottom: 10px;
}

.unit-forecast-person {
    background: #f8f9fc;
    border: 1px solid #eceff6;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.unit-forecast-none {
    color: #999;
    font-size: 0.8rem;
    font-style: italic;
}

.unit-forecast-reserved {
    background: #edf7ed;
    border-left: 4px solid #2f7d32;
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
}

/* =========================
   GUIDES A SCHOOL YEARS
========================= */

.guides-a-years {
    display: flex;
    justify-content: flex-start;
    gap: 14px;

    margin-top: 2px;
    margin-bottom: 6px;
    padding-left: 0;

    font-size: 0.68rem;
    line-height: 1.2;
    color: #85899b;
    font-weight: 400;
}

.guides-a-years span {
    white-space: nowrap;
}

/* =========================================================
   GUIDES SPACE BREAKDOWN
========================================================= */

.guides-space-breakdown {
    margin-top: 8px;
    font-size: 0.85em;
    font-weight: 400;
}

.guides-space-group {
    margin-top: 4px;
    font-weight: 400;
}

.guides-space-group span {
    margin-right: 6px;
    font-weight: 400;
}

.guides-space-group small {
    display: block;
    font-size: 0.9em;
    font-weight: 400;
    margin-top: 1px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .spaces-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .spaces-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .spaces-grid {
        grid-template-columns: 1fr;
    }

    .forecast-grid {
        grid-template-columns: 1fr;
    }
}