body {
    padding-top: 56px;
    padding-bottom: 20px;
}

/* Wider container caps for modern/high-DPI displays.
   Bootstrap 5 defaults cap .container at 1320px (xxl); too narrow on 1440p/4K. */
@media (min-width: 1400px) {
    .container, .container-xxl, .container-xl, .container-lg, .container-md, .container-sm {
        max-width: 1600px;
    }
}

@media (min-width: 1920px) {
    .container, .container-xxl, .container-xl, .container-lg, .container-md, .container-sm {
        max-width: 1800px;
    }
}

/* Hero banner */
.hero-banner { border-radius: 0.5rem; }
.hero-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 60%);
}

/* Contact card (Outlook-style) */
.contact-card { overflow: hidden; border-radius: 0.5rem; }
.contact-card-accent {
    height: 6px;
    background: linear-gradient(90deg, #0078d4, #005a9e);
}
.contact-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #0078d4;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.contact-card-fields { border-top: 1px solid #eee; }
.contact-card-field + .contact-card-field { border-top: 1px solid #f0f0f0; }
.contact-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f6ff;
    color: #0078d4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

/* Main content card styling */
.body-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

footer.footer {
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

body.admin-theme {
    background-color: #ffe1e1;
}

body.inspector-theme {
    background-color: #e8fff1;
}

/* Help accordion */
.accordion-button:not(.collapsed) {
    background-color: #e9ecef;
    color: #212529;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.15rem rgba(0,0,0,0.1);
}

.accordion-body {
    line-height: 1.7;
}

/* Inline CRUD panel (slide-down form above table) */
.crud-panel {
    display: none;
    margin-bottom: 1rem;
}
.crud-panel.open {
    display: block;
    animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toggle chip/pill multi-select */
.chip-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-toggle { display: none; }
.chip-label {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 50rem;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    user-select: none;
}
.chip-label:hover { border-color: #adb5bd; background: #e9ecef; }
.chip-toggle:checked + .chip-label {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* Inline delete confirmation */
.delete-confirm {
    display: none;
    margin-bottom: 1rem;
}
.delete-confirm.open { display: block; }

/* Markdown rule editor (side-by-side) */
.rule-editor-textarea {
    min-height: 400px;
    font-size: 0.875rem;
    line-height: 1.5;
}
.rule-editor-textarea:focus {
    box-shadow: none;
    outline: none;
}
.rule-editor-preview {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    background: #fafafa;
    font-size: 0.925rem;
}
.rule-editor-preview:empty::before {
    content: "Preview will appear here as you type.";
    color: #adb5bd;
    font-style: italic;
}
.rule-editor-preview h1, .rule-editor-preview h2, .rule-editor-preview h3 {
    margin-top: 1rem;
}
.rule-editor-preview h1:first-child, .rule-editor-preview h2:first-child, .rule-editor-preview h3:first-child {
    margin-top: 0;
}
.rule-editor-preview table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}
.rule-editor-preview th, .rule-editor-preview td {
    padding: 0.4rem 0.6rem;
    border: 1px solid #dee2e6;
}

/* Calendar loading overlay — paired with PPS.installCalendarLoading wired
   into FullCalendar's `loading:` callback. Opaque-enough shade + spinner +
   "Loading…" label; pointer-events:all blocks interaction with stale data
   during fetches. High z-index so the FullCalendar toolbar (prev/next/
   today buttons) sits *under* the overlay, not above. */
.pps-cal-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: all;
}
.pps-cal-loading.show { display: flex; }
.pps-cal-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #d6d6d6;
    border-top-color: #5cb85c;
    border-radius: 50%;
    animation: pps-cal-spin 0.8s linear infinite;
}
.pps-cal-loading-label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}
@keyframes pps-cal-spin { to { transform: rotate(360deg); } }

/* Session-expired toast — fixed bottom-right banner injected by
   pps-session.js when an AJAX request returns 401 (auth cookie rejected
   mid-session). Stays visible until the user clicks Reload. */
.pps-session-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1200;
    max-width: 360px;
    padding: 14px 18px;
    background: #d9534f;
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
}
.pps-session-toast-msg { line-height: 1.4; }
.pps-session-reload-btn { align-self: flex-start; }
