/* =========================================================
   TABLES
========================================================= */


/* =========================
   TABLE WRAPPERS
========================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}


/* =========================
   STANDARD TABLE
========================= */
 
table {
    border-collapse: collapse;
    width: 100%;
}

thead th {
    background: #f8f9fb;
    padding: 14px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}

tbody td {
    padding: 14px;
    border-bottom: 1px solid #ececec;
}

tbody tr:hover {
    background: #fafafa;
}


/* =========================
   MANAGEMENT TABLE
========================= */

.manage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.manage-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #eee;
    font-weight: 700;
    color: #1c2674;
    white-space: nowrap;
}

.manage-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.manage-table tr:hover {
    background: #f9faff;
}


/* =========================
   PROGRAMME TABLE
========================= */

.programme-card {
    max-width: 1000px;
    margin: 15px auto;
    overflow-x: auto;
    padding: 10px;
    border-radius: 14px;
    background: #ffffff;
}

.programme-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    font-weight: 400;
    font-size: 0.9rem;
}

.programme-table th {
    background: #f8fafc;
    font-weight: 500;
    font-size: 1rem;
}

.programme-table th,
.programme-table td {
    padding: 6px;
    text-align: center;
    border: 1px solid #eee;
}

.programme-table tbody tr:hover {
    background: #f9fafb;
}

.programme-table .name-col {
    text-align: left;
    font-weight: 500;
}

.name-link {
    text-decoration: none;
    color: #1c2674;
}


/* =========================
   COMPLETION CELLS
========================= */

.cell-complete {
    color: #ffffff;
}

.cell-complete.promise-col {
    background: #ffffff;
    color: #1c2674;
}

.cell-complete.bronze {
    background: #b56a2d;
}

.cell-complete.silver {
    background: #7a7f87;
}

.cell-complete.gold {
    background: #c79a00;
}

.cell-complete.anniversary {
    background: #8cb5e2;
    color: #ffffff;
}


/* =========================
   TABLE SECTION DIVIDERS
========================= */

.section-divider-left {
    border-left: 2px solid lightgrey !important;
}


/* =========================
   PROGRAMME THEME COLOURS
========================= */

.programme-table th.theme-know-myself {
    color: #1397df;
    background: #f8fafc;
}

.programme-table th.theme-express-myself {
    color: #ec178f;
    background: #f8fafc;
}

.programme-table th.theme-be-well {
    color: #8e58a7;
    background: #f8fafc;
}

.programme-table th.theme-have-adventures {
    color: #67b539;
    background: #f8fafc;
}

.programme-table th.theme-take-action {
    color: #f08a00;
    background: #f8fafc;
}

.programme-table th.theme-skills-future {
    color: #f2a6cb;
    background: #f8fafc;
}


/* Completed theme cells */

.cell-complete.theme-know-myself {
    background: #1397df;
    color: #ffffff;
}

.cell-complete.theme-express-myself {
    background: #ec178f;
    color: #ffffff;
}

.cell-complete.theme-be-well {
    background: #8e58a7;
    color: #ffffff;
}

.cell-complete.theme-have-adventures {
    background: #67b539;
    color: #ffffff;
}

.cell-complete.theme-take-action {
    background: #f08a00;
    color: #ffffff;
}

.cell-complete.theme-skills-future {
    background: #f2a6cb;
    color: #ffffff;
}


/* =========================
   ORDER TABLE
========================= */

.order-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    font-size: 14px;
}

.order-table th,
.order-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.order-table th {
    background: #f7f8fc;
}


/* Column sizing */

.order-table td:nth-child(1) {
    width: 25%;
}

.order-table td:nth-child(2) {
    width: 30%;
}

.order-table td:nth-child(3) {
    width: 20%;
}

.order-table td:nth-child(4) {
    width: 15%;
}

.order-table td:nth-child(5) {
    width: 10%;
}


/* =========================
   STOCK TABLE
========================= */

.stock-table {
    width: 100%;
    border-collapse: collapse;
}

.stock-table th,
.stock-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

.stock-table th {
    background: #f7f7f7;
    font-weight: 700;
}

.stock-table .section-row td {
    background: #f0f0f0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}


/* =========================
   SCHEDULE TABLE
========================= */

.schedule-table-wrap {
    overflow-x: hidden;
}

.schedule-table-wrap table {
    width: 100%;
    table-layout: fixed;
}

.schedule-table-wrap th,
.schedule-table-wrap td {
    font-size: 0.85rem;
    padding: 6px;
}

.schedule-table-wrap input {
    width: 100%;
    padding: 6px;
    font-size: 0.8rem;
    box-sizing: border-box;
}

.schedule-table-wrap td:nth-child(2) input {
    word-break: break-word;
    max-width: 100%;
}

.schedule-table-wrap th:first-child,
.schedule-table-wrap td:first-child {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    text-align: center;
}


/* =========================
   EMAIL TEMPLATE TABLE
========================= */

.email-template-table {
    width: 100%;
    table-layout: auto;
}

.email-template-table th,
.email-template-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.email-template-table th:last-child,
.email-template-table td:last-child {
    width: 100px;
    text-align: center;
}

.email-template-table td:nth-child(2) {
    min-width: 300px;
}


/* =========================
   WAITING LIST TABLE
========================= */

.waiting-table th,
.waiting-table td {
    padding: 14px 18px;
    vertical-align: middle;
}


/* =========================
   BADGE EDIT TABLE
========================= */

.badge-edit-table {
    width: 100%;
    overflow: hidden;
}

.badge-edit-table table {
    width: 100%;
    table-layout: fixed;
}

.badge-edit-table th,
.badge-edit-table td {
    padding: 6px;
    font-size: 14px;
    overflow: hidden;
}


/* Badge edit column sizing */

.badge-edit-table th:nth-child(1),
.badge-edit-table td:nth-child(1) {
    width: 18%;
}

.badge-edit-table th:nth-child(2),
.badge-edit-table td:nth-child(2) {
    width: 15%;
}

.badge-edit-table th:nth-child(3),
.badge-edit-table td:nth-child(3) {
    width: 14%;
}

.badge-edit-table th:nth-child(4),
.badge-edit-table td:nth-child(4) {
    width: 15%;
}

.badge-edit-table th:nth-child(5),
.badge-edit-table td:nth-child(5) {
    width: 12%;
}

.badge-edit-table th:nth-child(6),
.badge-edit-table td:nth-child(6) {
    width: 8%;
}

.badge-edit-table th:nth-child(7),
.badge-edit-table td:nth-child(7) {
    width: 18%;
}


/* =========================
   SPACES TABLE
========================= */

.spaces-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 50px;
}

.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;
}


/* =========================
   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;
}


/* =========================
   TABLE STATUS / TYPE PILLS
========================= */

.type-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.type-interest {
    background: #eef2ff;
    color: #1c2674;
}

.type-skills {
    background: #e6f6ea;
    color: #1f7a3d;
}

.type-theme {
    background: #fff3cd;
    color: #8a6d3b;
}

.type-special {
    background: #ffe5e5;
    color: #b00020;
}


/* =========================
   TABLE ACTIONS
========================= */

.actions-cell {
    width: 160px;
    white-space: nowrap;
}


/* =========================
   REMOVING ROW
========================= */

.order-table tr.removing {
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* =========================
   UNIT SETTINGS
========================= */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}


/* =========================
   SETTING CARD
========================= */

.setting-card {
    background: #ffffff;
    border: 1px solid #e1e4eb;
    border-radius: 10px;
    padding: 18px;
    box-sizing: border-box;
}


/* =========================
   SETTING HEADER
========================= */

.setting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding-bottom: 12px;
    margin-bottom: 15px;

    border-bottom: 1px solid #e5e7ec;
}

.setting-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #161b4e;
}


/* =========================
   SPACE BADGE
========================= */

.space-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 4px 9px;

    border-radius: 20px;

    font-size: 0.72rem;
    font-weight: 600;

    white-space: nowrap;
}


/* Status colours */

.status-good {
    background: #e8f5e9;
    color: #218739;
}

.status-limited {
    background: #fff4df;
    color: #a66a00;
}

.status-full {
    background: #fdeaea;
    color: #b42318;
}


/* =========================
   SETTING DETAILS
========================= */

.setting-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}


/* =========================
   LABELS
========================= */

.setting-details label {
    display: block;

    margin-bottom: 5px;

    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
}


/* =========================
   VALUES
========================= */

.setting-details strong {
    display: block;

    font-size: 0.95rem;
    font-weight: 600;
    color: #161b4e;

    padding-top: 7px;
}


/* =========================
   CAPACITY INPUT
========================= */

.capacity-input {
    width: 100%;
    box-sizing: border-box;

    padding: 8px 9px;

    border: 1px solid #d9dde6;
    border-radius: 6px;

    background: #ffffff;

    color: #161b4e;

    font-size: 0.85rem;
}


/* Focus */

.capacity-input:focus {
    outline: none;
    border-color: #161b4e;
    box-shadow: 0 0 0 2px rgba(22,27,78,0.08);
}


/* =========================
   GUIDES GROUP DIVIDER
========================= */

.settings-section-divider {
    grid-column: 1 / -1;

    padding-top: 12px;
    margin-top: 4px;

    border-top: 1px solid #e5e7ec;
}

.settings-section-divider strong {
    display: inline;
    font-size: 0.82rem;
}

.settings-section-divider small {
    margin-left: 6px;

    font-size: 0.7rem;
    color: #7b8190;
}

.capacity-column {
    min-width: 180px;
    white-space: normal;
}

.payment-preview {
    border-left: 4px solid #161b4e;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.preview-stat {
    background: #f5f6fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.preview-stat strong {
    display: block;
    font-size: 1.5rem;
    color: #161b4e;
}

.preview-stat span {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #666;
}

.preview-warning {
    background: #fff8e6;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.preview-success {
    background: #edf8f0;
    border-radius: 10px;
    padding: 15px;
}

.preview-warning p,
.preview-success p {
    margin-bottom: 0;
}

.long-term-ok {
    color: #2f7d32;
    font-weight: 600;
}

.long-term-over {
    color: #c62828;
    font-weight: 700;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {

    .settings-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .setting-details {
        grid-template-columns: 1fr 1fr;
    }

}