* { box-sizing: border-box; }

:root {
    --pj-ink: #302e2e;
    --pj-ink-2: #242323;
    --pj-blue: #0789aa;
    --pj-blue-2: #0aa4c7;
    --pj-blue-soft: #e4f7fb;
    --pj-paper: #ffffff;
    --pj-page: #f3f6f7;
    --pj-line: #d9e1e5;
    --pj-muted: #667984;
    --pj-danger: #b42318;
    --pj-success: #177245;
    --pj-shadow: 0 16px 40px rgba(36, 35, 35, .12);
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--pj-page);
    color: var(--pj-ink);
}

a { color: var(--pj-blue); text-decoration: none; }
a:hover { color: var(--pj-blue-2); }
h1, h2, h3, h4, h5, h6 { margin-top: 0; letter-spacing: 0; }
label { display: inline-block; margin-bottom: 6px; font-weight: 700; color: var(--pj-ink); }

.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.public-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(7, 137, 170, .08), rgba(255, 255, 255, 0) 300px),
        var(--pj-page);
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--pj-ink);
    border-bottom: 4px solid var(--pj-blue);
    padding: 12px 24px;
    box-shadow: 0 10px 24px rgba(36, 35, 35, .18);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
}

.brand-link:hover { color: #fff; }
.brand-link img { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; border: 2px solid #fff; }
.brand-link span { line-height: 1.1; }

.public-admin-link {
    flex: 0 0 auto;
    color: #fff;
    border: 1px solid rgba(255,255,255,.35);
    padding: 9px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.public-admin-link:hover { background: #fff; color: var(--pj-ink); }

.retreat-catalog { padding: 56px 0 72px; }

.catalog-heading {
    max-width: 760px;
    margin-bottom: 42px;
}

.catalog-eyebrow,
.catalog-section-kicker,
.retreat-theme {
    display: block;
    color: var(--pj-blue);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.catalog-heading h1 {
    margin: 6px 0 8px;
    font-size: 44px;
    line-height: 1.05;
}

.catalog-heading p {
    margin: 0;
    color: var(--pj-muted);
    font-size: 18px;
    line-height: 1.6;
}

.catalog-section + .catalog-section { margin-top: 48px; }

.catalog-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--pj-line);
}

.catalog-section-heading h2 { margin: 4px 0 0; font-size: 27px; }

.catalog-count {
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--pj-blue);
    color: #fff;
    font-weight: 900;
}

.catalog-section-closed .catalog-count { background: #65777e; }

.retreat-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.retreat-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pj-line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(36, 35, 35, .07);
}

.retreat-card-accent {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: var(--pj-ink);
    border-bottom: 4px solid var(--pj-blue);
}

.retreat-card-accent img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #fff;
}

.retreat-public-status {
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--pj-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.retreat-card-soon .retreat-public-status { background: #f2b544; color: #2c2104; }
.retreat-card-closed .retreat-public-status,
.retreat-card-sold_out .retreat-public-status { background: #e5ecef; color: #485b63; }

.retreat-card-body { padding: 22px; }
.retreat-card-body h3 { margin: 5px 0 10px; font-size: 25px; }

.retreat-description {
    min-height: 48px;
    margin: 0 0 18px;
    color: var(--pj-muted);
    line-height: 1.5;
}

.retreat-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 22px;
}

.retreat-facts div { min-width: 0; }
.retreat-facts dt { color: var(--pj-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.retreat-facts dd { margin: 4px 0 0; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.retreat-card-action { width: 100%; }

.catalog-empty {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 24px;
    background: #fff;
    border: 1px dashed #aac2cb;
    border-left: 5px solid var(--pj-blue);
    border-radius: 8px;
}

.catalog-empty span { color: var(--pj-muted); }

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 276px 1fr;
    background: var(--pj-page);
}

.admin-shell aside {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--pj-ink);
    color: #fff;
    padding: 20px 16px;
    border-right: 5px solid var(--pj-blue);
}

.admin-shell main { padding: 28px; min-width: 0; }

.retreat-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px 22px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,.14);
}

.retreat-sidebar-brand img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(7, 137, 170, .55);
}

.retreat-sidebar-brand strong { display: block; color: #fff; line-height: 1.1; }
.retreat-sidebar-brand span { display: block; margin-top: 4px; color: #b8dce5; font-size: 13px; }

.retreat-sidebar a {
    display: block;
    color: #e8f4f7;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 700;
}

.retreat-sidebar a.active,
.retreat-sidebar a:hover {
    background: var(--pj-blue);
    color: #fff;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--pj-line);
}

.admin-title h1,
.admin-title .h3 {
    margin-bottom: 4px;
    font-size: 30px;
    color: var(--pj-ink);
}

.admin-title p { margin: 0; color: var(--pj-muted); }
.admin-actions, .btn-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.card,
.bg-light,
.auth-card {
    background: var(--pj-paper);
    border: 1px solid var(--pj-line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(36, 35, 35, .06);
}

.bg-light { border-top: 5px solid var(--pj-blue); }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--pj-line); font-weight: 800; }
.card-body { padding: 18px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-grid .card { padding: 20px; border-top: 5px solid var(--pj-blue); }
.metric-grid small, td small, .text-muted { color: var(--pj-muted); }
.metric-grid strong { display: block; font-size: 34px; margin-top: 8px; color: var(--pj-ink); }

.table-responsive { overflow-x: auto; border-radius: 8px; border: 1px solid var(--pj-line); background: #fff; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table td, .table th { padding: 14px; border-bottom: 1px solid var(--pj-line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-custom tr:hover { background: var(--pj-blue-soft); }

.form-group { margin-bottom: 16px; }
.form-row, .row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
[class*="col-"] { padding: 0 8px; width: 100%; }
.col, .col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-md-1 { width: 8.333%; }
.col-md-2 { width: 16.666%; }
.col-md-3 { width: 25%; }
.col-md-4 { width: 33.333%; }
.col-md-5 { width: 41.666%; }
.col-md-6 { width: 50%; }
.col-md-8 { width: 66.666%; }
.col-lg-6 { width: 50%; }
.col-lg-8 { width: 66.666%; }
.col-lg-9 { width: 75%; }
.justify-content-center { justify-content: center; }

.form-control {
    width: 100%;
    display: block;
    padding: 11px 12px;
    border: 1px solid #b9c9d0;
    border-radius: 8px;
    background: #fff;
    color: var(--pj-ink);
    font: inherit;
}

.form-control:focus {
    outline: 3px solid rgba(7, 137, 170, .18);
    border-color: var(--pj-blue);
}

.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-check-input { width: auto; accent-color: var(--pj-blue); }
.invalid-feedback, .text-danger { color: var(--pj-danger); }
.invalid-feedback { display: block; font-size: 13px; margin-top: 4px; }
.is-invalid { border-color: var(--pj-danger); }

.btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
}

.btn-sm { padding: 7px 10px; font-size: 14px; min-height: 34px; }
.btn-lg { padding: 14px 18px; font-size: 18px; }
.btn-block, .w-100 { width: 100%; }
.btn-primary { background: var(--pj-blue); color: #fff; }
.btn-primary:hover { background: #067895; color: #fff; }
.btn-success { background: var(--pj-success); color: #fff; }
.btn-danger { background: var(--pj-danger); color: #fff; }
.btn-warning { background: #f2b544; color: #2c2104; }
.btn-secondary { background: #53666d; color: #fff; }
.btn-light { background: #eef5f7; color: var(--pj-ink); border: 1px solid var(--pj-line); }

.alert { padding: 13px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: #e8f7ef; color: #165f3b; border-color: #b9e4cd; }
.alert-danger { background: #feeceb; color: #9b1c14; border-color: #f5c7c3; }
.alert-warning { background: #fff6dd; color: #855800; border-color: #f2d88d; }
.alert-info { background: var(--pj-blue-soft); color: #05667e; border-color: #b8e5ee; }

.progress { background: #dce8ec; border-radius: 999px; overflow: hidden; }
.progress-bar { background: var(--pj-blue); color: #fff; text-align: center; min-height: 100%; }

.form-builder-card .card-body { background: #fbfdfe; }

.form-builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-builder-header span,
.builder-panel-title span,
.fields-heading span {
    display: block;
    margin-top: 3px;
    color: var(--pj-muted);
    font-size: 13px;
    font-weight: 600;
}

.form-builder-top {
    display: grid;
    grid-template-columns: minmax(240px, .75fr) minmax(360px, 1.25fr);
    gap: 16px;
    margin-bottom: 16px;
}

.builder-panel,
.section-editor,
.field-editor {
    background: #fff;
    border: 1px solid var(--pj-line);
    border-radius: 8px;
}

.builder-panel { padding: 16px; }
.builder-panel h6,
.section-editor h6,
.fields-heading h6 {
    margin: 0 0 10px;
    font-size: 16px;
}

.builder-panel-fixed {
    background: linear-gradient(180deg, #f6fbfc, #fff);
    border-left: 4px solid var(--pj-blue);
}

.fixed-field-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.fixed-field-list span,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 10px;
    background: var(--pj-blue-soft);
    color: #05667e;
    font-weight: 800;
    font-size: 13px;
}

.status-pill {
    padding: 6px 12px;
    background: #e8f7ef;
    color: var(--pj-success);
}

.status-pill.muted {
    background: #eef3f5;
    color: var(--pj-muted);
}

.builder-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px auto;
    gap: 12px;
    align-items: end;
}

.quick-field-grid,
.field-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 180px 96px;
    gap: 12px;
}

.quick-field-grid .quick-field-options,
.field-edit-grid .field-options {
    grid-column: 1 / -1;
}

.builder-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}

.builder-actions .form-check { margin-bottom: 0; }

.section-list {
    display: grid;
    gap: 16px;
}

.section-editor {
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(36, 35, 35, .04);
}

.section-editor-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background: #f4f8fa;
    border-bottom: 1px solid var(--pj-line);
}

.section-editor-title span {
    display: block;
    color: var(--pj-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.section-editor-title strong {
    display: block;
    margin-top: 3px;
    font-size: 20px;
}

.section-editor-body { padding: 16px; }

.section-settings-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) 96px auto;
    gap: 12px;
    align-items: end;
}

.section-settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.section-settings-actions .form-check { margin-bottom: 0; }
.section-remove-form { margin-top: 10px; }

.fields-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--pj-line);
}

.add-field-strip {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 180px 86px auto auto;
    gap: 10px;
    align-items: center;
    margin: 12px 0 16px;
    padding: 12px;
    background: #f8fbfc;
    border: 1px solid var(--pj-line);
    border-radius: 8px;
}

.add-field-options {
    grid-column: 1 / -1;
}

.compact-check {
    margin: 0;
    font-weight: 700;
    color: var(--pj-ink);
}

.field-editor {
    padding: 14px;
    margin-top: 12px;
}

.field-editor + .field-editor { margin-top: 12px; }

.field-editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.field-editor-heading strong {
    font-size: 16px;
}

.field-editor-heading span {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 6px 10px;
    background: #eef5f7;
    color: var(--pj-muted);
    font-size: 12px;
    font-weight: 800;
}

.empty-builder-message {
    margin: 0;
    padding: 16px;
    border: 1px dashed #aac2cb;
    border-radius: 8px;
    background: #f8fbfc;
    color: var(--pj-muted);
}

.rounded { border-radius: 8px; }
.rounded-circle { border-radius: 999px; }
.border { border: 1px solid var(--pj-line); }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.p-md-5 { padding: 40px; }
.py-5 { padding-top: 48px; padding-bottom: 48px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mr-2 { margin-right: 8px; }
.text-center { text-align: center; }
.text-nowrap { white-space: nowrap; }
.d-inline { display: inline; }

.auth-container {
    min-height: calc(100vh - 76px);
    display: grid;
    place-items: center;
    padding: 40px 0;
}

.auth-card {
    width: min(460px, 100%);
    padding: 30px;
    border-top: 6px solid var(--pj-blue);
    box-shadow: var(--pj-shadow);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.auth-brand img {
    width: 82px;
    height: 82px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 4px var(--pj-blue);
}

.auth-brand span {
    display: block;
    color: var(--pj-blue);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.auth-brand h1 {
    margin: 3px 0 0;
    font-size: 28px;
    line-height: 1.1;
}

@media (max-width: 800px) {
    .public-header { padding: 10px 14px; }
    .brand-link img { width: 42px; height: 42px; }
    .brand-link span { font-size: 14px; }
    .public-admin-link { padding: 8px 10px; }
    .retreat-catalog { padding: 36px 0 52px; }
    .catalog-heading { margin-bottom: 32px; }
    .catalog-heading h1 { font-size: 36px; }
    .retreat-card-grid { grid-template-columns: 1fr; }
    .retreat-facts { grid-template-columns: 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-shell aside { position: static; height: auto; border-right: 0; border-bottom: 5px solid var(--pj-blue); }
    .admin-shell main { padding: 18px; }
    .admin-header { display: block; }
    .admin-actions { margin-top: 14px; }
    .metric-grid { grid-template-columns: 1fr; }
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-8, .col-lg-6, .col-lg-8, .col-lg-9 { width: 100%; }
    .p-md-5 { padding: 24px; }
    .auth-brand { align-items: flex-start; }
    .auth-brand img { width: 70px; height: 70px; }
    .form-builder-top,
    .builder-inline-form,
    .quick-field-grid,
    .field-edit-grid,
    .section-settings-form,
    .add-field-strip {
        grid-template-columns: 1fr;
    }
    .fixed-field-list { grid-template-columns: 1fr; }
    .builder-actions,
    .section-editor-title,
    .fields-heading,
    .field-editor-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .section-settings-actions { align-items: flex-start; }
    .add-field-strip .btn,
    .builder-inline-form .btn,
    .builder-actions .btn { width: 100%; }
}
