* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f5f7;
    color: #333;
}

/* Matches the 'Archivo Black' treatment already used for headings on
   the marketing site (Assets/css/home.css) — the font itself is loaded
   via a Google Fonts <link> in each dashboard page's <head>. */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Archivo Black', Arial, Helvetica, sans-serif;
}

/* ================
   Sidebar
   ================== */

.sidebar {
    width: 250px;
    background: #1b2a4a;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
}

.sidebar-logo {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo img {
    max-width: 100%;
    height: auto;
}

.sidebar-nav {
    padding: 16px 0;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Sidebar built by sidebar.js (Assets/JS/sidebar.js) uses Bootstrap's
   .nav-pills markup, not the .nav-item rows above — give its links the
   same light hover feedback. Excludes .active since that already gets
   a solid navy fill via --bs-nav-pills-link-active-bg below. */
#sidebar .nav-link:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ================
   Membership Card Badges & Icons
   Bootstrap ships bg-primary/success/danger/info/warning/dark, but not
   a purple — Dual Membership gets a custom color so it doesn't collide
   with any of the hues already used for member status badges.
   ================== */

.badge-dual {
    background-color: #6f42c1;
    color: #fff;
}

.badge-everlasting {
    background-color: #4A4A4A;
    color: #fff;
}

/* Icons replacing emoji on the membership cards (members.html), sized
   down from the 20px sidebar-nav-icon convention to sit inline with
   card text and badge labels. Lucide's SVGs default to
   stroke="currentColor", so they pick up the surrounding text/badge
   color automatically. */
.member-card-icon {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 4px;
    flex-shrink: 0;
}

.badge-icon {
    width: 12px;
    height: 12px;
    vertical-align: -1px;
    margin-right: 3px;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-left: 3px solid #ffffff;
}

.sidebar-bottom {
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Icons injected by sidebar.js (Assets/JS/sidebar.js) into the actual
   Bootstrap nav-pills sidebar every dashboard page uses — sized to
   match the 20px convention already used for the admin panel's own
   sidebar icons. Lucide's SVGs default to stroke="currentColor", so
   they automatically pick up whatever color the surrounding nav-link
   text already has, active or not. */
.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Bootstrap's .nav-pills sets --bs-nav-pills-link-active-bg itself
   (defaulting to Bootstrap blue, #0d6efd) rather than deriving it from
   --bs-primary, so overriding --bs-primary elsewhere in the dashboard
   never touched the sidebar's active-item highlight. Override that
   variable directly, scoped to the sidebar, so the clicked/active nav
   item gets a navy fill instead. */
#sidebar .nav-pills {
    --bs-nav-pills-link-active-bg: #1b2a4a;
}

/* The sidebar's user-menu (Settings / Sign out) is the one actual
   Bootstrap dropdown-menu popup in the dashboard — its hover/active
   item highlight defaults to Bootstrap blue same as the form controls
   above, so brand it navy too. */
#sidebar .dropdown-item:hover,
#sidebar .dropdown-item:focus,
#sidebar .dropdown-item:active {
    background-color: #1b2a4a;
    color: #fff;
}

/* ================
   Mobile/Tablet Nav (sidebar.js's setupMobileNav())
   Below the lg breakpoint (991.98px — same cutoff the media query at
   the bottom of this file uses) the real sidebar built by sidebar.js
   (id="sidebar", 280px wide, Bootstrap .nav-pills markup — NOT the
   dead .sidebar/.nav-item rules above, which nothing on the actual
   pages uses) switches from a normal in-flow flex column to an
   off-canvas drawer opened by a hamburger button in a slim top bar.
   ================== */

/* Fixed, not sticky/in-flow: `body` itself is display:flex (see top of
   this file), so a plain inserted child would sit beside the sidebar
   row as a flex item instead of stacking above it. Fixed positioning
   sidesteps that regardless of the parent's layout mode; the content
   wrapper gets margin-top to compensate (see the media query below). */
.gmp-mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
}

.gmp-mobile-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #1b2a4a;
    padding: 6px;
    cursor: pointer;
}

.gmp-mobile-toggle-btn i {
    width: 24px;
    height: 24px;
}

.gmp-mobile-topbar-logo {
    height: 28px;
    width: auto;
}

.gmp-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
}

.gmp-sidebar-backdrop.show {
    display: block;
}

/* Locks background scroll behind the open drawer. */
body.gmp-sidebar-locked {
    overflow: hidden;
}

/* ================
   Main Content
   ================== */

.dashboard-main {
    margin-left: 250px;
    padding: 40px;
    flex-grow: 1;
}

.dashboard-header h1 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.dashboard-header p {
    color: #777;
}

/* ================
   Stats Cards
   ================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.stat-card i {
    width: 36px;
    height: 36px;
    color: #1b2a4a;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.85rem;
    color: #777;
}

/* ================
   Dashboard Grid
   ================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.dashboard-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.dashboard-card h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* ================
   Activity List
   ================== */

.activity-list {
    list-style: none;
}

.activity-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.activity-list li:last-child {
    border-bottom: none;
}

.activity-list li i {
    width: 20px;
    height: 20px;
    color: #1b2a4a;
    flex-shrink: 0;
}

.activity-list li p {
    font-size: 0.95rem;
}

.activity-list li span {
    font-size: 0.8rem;
    color: #999;
}

/* ================
   Events List
   ================== */

.events-list {
    list-style: none;
}

.events-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.events-list li:last-child {
    border-bottom: none;
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1b2a4a;
    color: #ffffff;
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 50px;
}

.event-month {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.event-day {
    font-size: 1.2rem;
    font-weight: 700;
}

.events-list li p {
    font-size: 0.95rem;
}

.events-list li span {
    font-size: 0.8rem;
    color: #999;
}

/* ================
   Image Upload Slots
   Shared across any page that needs a bounded image-upload
   preview box — events, website builder, profile/logo uploads, etc.
   Usage:
     <div class="image-upload-slot" data-slot="1">
       <span class="upload-placeholder">+ Add Image</span>
       <button type="button" class="remove-image-btn" data-slot="1">&times;</button>
     </div>
     <input type="file" accept="image/*" class="d-none" id="...-image-input-1">
   ================== */

.image-upload-slot {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #f8f9fa;
}

.image-upload-slot img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    margin: 0 !important;
}

.image-upload-slot .upload-placeholder {
    text-align: center;
    color: #777;
    font-size: 0.85rem;
}

.image-upload-slot .remove-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    line-height: 1;
    font-size: 0.85rem;
    display: none;
}

.image-upload-slot.has-image .remove-image-btn {
    display: block;
}

/* Size variants — add one of these alongside .image-upload-slot
   for pages that need something other than the 140px default
   (e.g. a wide website-builder banner image). */
.image-upload-slot--sm {
    height: 90px;
}

.image-upload-slot--wide {
    height: 200px;
}

/* ================
   Ticket Tier Rows
   Used on the events page for ticket types / bundles, but generic
   enough to reuse anywhere you need a repeatable, removable row
   of form fields (e.g. website builder page sections).
   ================== */

.ticket-tier-row {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

/* ================
   Calendar Grid
   Shared month-view calendar — used on Hall Bookings, and reusable
   for Events or anywhere else a month grid is useful.
   ================== */

.calendar-grid {
    display: grid;
    /* minmax(0, 1fr), not a bare 1fr — a plain 1fr track's implicit
       minimum is its content's max-content width, so a day with a
       long event name (or several events) refuses to shrink below
       that and forces the whole grid, and the page along with it,
       to overflow horizontally instead of just wrapping/eliding the
       event text inside its cell like it's supposed to. */
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.calendar-grid .cal-dow {
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    padding: 4px 0;
    color: #777;
}

.calendar-grid .cal-cell {
    min-height: 90px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px;
    font-size: 0.8rem;
}

.calendar-grid .cal-cell.cal-empty {
    border-color: transparent;
}

.calendar-grid .cal-daynum {
    font-weight: 600;
    margin-bottom: 2px;
}

.calendar-grid .cal-event {
    display: block;
    color: #fff;
    border-radius: 4px;
    padding: 1px 4px;
    margin-bottom: 2px;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.cal-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

/* ================
   Form Fields, Dropdowns & Popups
   Shared focus appearance across every dashboard page — inside modals
   ("pop ups") and on regular pages alike — so native date/time pickers,
   <select> dropdowns, and text/textarea fields all match the same
   brand navy interactive state instead of Bootstrap's default blue.
   The CDN Bootstrap build's own focus colors are hardcoded at compile
   time, so they don't pick up the --bs-primary navy override above;
   these rules override them directly.
   ================== */

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    color-scheme: light;
}

input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
.form-select:focus,
.form-control:focus {
    border-color: #1b2a4a;
    box-shadow: 0 0 0 0.25rem rgba(27, 42, 74, 0.25);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 4px;
    padding: 3px;
    transition: background-color 0.15s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    background-color: rgba(27, 42, 74, 0.1);
}

/* Bootstrap's .is-invalid paints a background icon meant for plain
   text inputs; it overlaps the native calendar/clock icon on these,
   so drop it and keep just the red border + focus ring. */
input[type="date"].is-invalid,
input[type="time"].is-invalid,
input[type="datetime-local"].is-invalid {
    background-image: none;
    padding-right: 0.75rem;
}

/* ================
   Custom Dropdown (Assets/JS/custom-select.js)
   The browser draws a native <select>'s open option list itself (OS
   square corners, OS blue highlight) — CSS can only style the closed
   control, not that popup. custom-select.js progressively enhances
   every <select class="form-select"> with a trigger button + list
   built from real HTML, so the open state can finally match the same
   rounded, navy-accented look as the date/time inputs above.
   ================== */

.gmp-select {
    position: relative;
    display: block;
    width: 100%;
}

.gmp-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.gmp-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    text-align: left;
    cursor: pointer;
}

.gmp-select-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gmp-select-trigger:hover {
    border-color: #adb5bd;
}

.gmp-select-trigger:focus,
.gmp-select-trigger.open {
    outline: 0;
    border-color: #1b2a4a;
    box-shadow: 0 0 0 0.25rem rgba(27, 42, 74, 0.25);
}

.gmp-select-trigger.is-invalid {
    border-color: #dc3545;
}

.gmp-select-caret {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #666;
    transition: transform 0.15s;
}

.gmp-select-trigger.open .gmp-select-caret {
    transform: rotate(180deg);
}

.gmp-select-sm .gmp-select-trigger {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

/* Portaled to <body> (see custom-select.js) so it's never clipped by
   a scrolling panel or trapped under a modal's stacking context. */
.gmp-select-menu {
    position: fixed;
    z-index: 1080;
    display: none;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
    padding: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.gmp-select-menu.open {
    display: block;
}

.gmp-select-option {
    padding: 8px 12px;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
}

.gmp-select-option:hover,
.gmp-select-option.active {
    background-color: rgba(27, 42, 74, 0.08);
}

.gmp-select-option.selected {
    background-color: #1b2a4a;
    color: #fff;
}

.gmp-select-option.selected:hover,
.gmp-select-option.selected.active {
    background-color: #14213a;
}

/* ================
   Responsive
   ================== */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-nav span,
    .sidebar-bottom span {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .dashboard-main {
        margin-left: 60px;
    }
}

/* Flex items default to min-width:auto — meaning a page's content
   wrapper won't actually shrink below its own content's natural
   width, no matter how much room the (now off-canvas, or even still
   280px-wide) sidebar frees up. That's what let wide content on a
   couple of pages (a calendar grid, a horizontally-scrolling tab bar)
   push the whole page into a horizontal scrollbar instead of
   containing/wrapping/eliding within itself the way each was meant
   to. Applies at every width, not just mobile — harmless wherever
   content already fit, since min-width:0 only matters once something
   inside actually needs to shrink below its natural size. */
#sidebar ~ .flex-grow-1 {
    min-width: 0;
}

/* Real sidebar (id="sidebar", built by sidebar.js) → off-canvas drawer.
   991.98px matches Bootstrap's own lg breakpoint, so this also covers
   tablets in portrait, not just phones — a 280px static sidebar plus
   a page's own content (or, on the website builder, an additional
   360px editor panel) doesn't leave usable room below that width. */
@media (max-width: 991.98px) {
    .gmp-mobile-topbar {
        display: flex;
    }

    /* Every dashboard page's content wrapper is the sidebar's next
       sibling and carries flex-grow-1 (that's what makes it fill the
       rest of the row next to the sidebar in the first place) — this
       reserves room for the fixed topbar above it without needing to
       enumerate each page's own extra classes. */
    #sidebar ~ .flex-grow-1 {
        margin-top: 52px;
    }

    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1045;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    #sidebar.gmp-sidebar-open {
        transform: translateX(0);
    }

    #sidebar > div {
        height: 100%;
        overflow-y: auto;
    }
}

/* Safety net for the page-header / toolbar / filter-bar pattern used
   throughout the dashboard — a heading (or descriptive text) paired
   with one or more buttons/selects via `d-flex justify-content-between`,
   with no flex-wrap. That fits fine on desktop, but on a narrow phone
   the two sides can no longer share a row without overflowing or
   squeezing the control down to nothing. Wrapping only changes
   anything once a row is already too tight to fit unwrapped, so this
   is free on every screen size it doesn't affect. */
@media (max-width: 767.98px) {
    .d-flex.justify-content-between {
        flex-wrap: wrap;
        row-gap: 0.75rem;
    }
}