/**
 * MLCA Website — Global Stylesheet
 * Methuen Lake Cottagers Association
 * Based on Toronto Harriers Design System
 *
 * All colours, fonts, layout values derive from CSS custom properties
 * set in <head> by Settings::getCSSVariables()
 *
 * Sections:
 *   1. Reset & Accessibility
 *   2. CSS Variables (Defaults)
 *   3. Typography
 *   4. Layout & Container
 *   5. Header & Navigation
 *   6. Page Header & Hero
 *   7. Page Content Container
 *   8. Flash Messages & Alerts
 *   9. Buttons
 *  10. Forms & Form Elements
 *  11. Cards & Tiles
 *  12. Data Tables
 *  13. Badges
 *  14. Modals
 *  15. Gallery & Lightbox
 *  16. Tab Navigation (MLCA-specific)
 *  17. Emergency Route (MLCA-specific)
 *  18. Member Dashboard Tiles (MLCA-specific)
 *  19. Footer
 *  20. Utility Classes
 *  21. Responsive (768px & 480px)
 */

/* ================================================================
   1. RESET & ACCESSIBILITY
   ================================================================ */

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

html {
    font-size: var(--font-size-base, 16px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body, 'Open Sans', sans-serif);
    font-size: 1rem;
    font-weight: var(--body-weight, 400);
    color: var(--text-color, #1f2937);
    background-color: var(--background-color, #ffffff);
    line-height: var(--line-height, 1.6);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Skip link (accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color, #407f35);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 100000;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--primary-color, #407f35);
    outline-offset: 2px;
}

*:focus-visible {
    outline: 3px solid var(--primary-color, #407f35);
    outline-offset: 2px;
}

/* ================================================================
   2. CSS VARIABLES
   All configurable values come from the database via getCSSVariables()
   in the inline <style> tag. Fallback defaults are specified inline
   where each variable is used (e.g. var(--primary-color, #407f35)).
   Do NOT add a :root block here — it loads after the inline styles
   and would override database settings.
   ================================================================ */

/* ================================================================
   3. TYPOGRAPHY
   ================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-weight: var(--heading-weight, 700);
    line-height: 1.2;
    color: var(--secondary-color, #2d3359);
    margin-bottom: 0.5em;
}

h1 { font-size: var(--font-size-h1, 2.5rem); }
h2 { font-size: var(--font-size-h2, 2rem); }
h3 { font-size: var(--font-size-h3, 1.75rem); }
h4 { font-size: var(--font-size-h4, 1.5rem); }

p {
    margin-bottom: var(--paragraph-spacing, 1em);
}

a {
    color: var(--primary-color, #407f35);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:where(:hover) {
    color: var(--secondary-color, #2d3359);
    text-decoration: underline;
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

blockquote {
    border-left: 4px solid var(--primary-color, #407f35);
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    background: #f8f9f7;
    font-style: italic;
    color: #555;
}

hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 2rem 0;
}

/* ================================================================
   4. LAYOUT & CONTAINER
   ================================================================ */

.container {
    width: 100%;
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

.content-section {
    padding: 2.5rem 0;
}

main {
    flex: 1;
    margin-top: 70px;
}

/* Homepage hero replaces the default margin */
.body-home main {
    margin-top: 0;
}

/* When a page header banner is present, main doesn't need its own top margin */
.page-header-banner + main {
    margin-top: 0;
}

.content-narrow {
    max-width: 720px;
    margin: 0 auto;
}

.body-admin .content-narrow,
.body-superadmin .content-narrow {
    max-width: 960px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* ================================================================
   5. HEADER & NAVIGATION
   ================================================================ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--header-bg-color, #1f2937);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header.transparent {
    background-color: transparent;
}

.site-header.transparent.scrolled {
    background-color: var(--header-bg-color, #1f2937);
}

/* Scroll-fade: header becomes transparent as user scrolls down */
.site-header.scroll-fade {
    background-color: transparent;
    box-shadow: none;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--header-text-color, #ffffff);
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-weight: var(--heading-weight, 700);
    font-size: var(--site-title-font-size, 1.5rem);
    text-decoration: none;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-logo .favicon {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

.site-logo .site-logo-img {
    height: 40px;
    max-width: 150px;
    width: auto;
    object-fit: contain;
}


/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.main-nav a {
    color: var(--header-text-color, #ffffff);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: var(--menu-font-size, 0.95rem);
    text-transform: var(--menu-text-transform, none);
    transition: color 0.2s ease, background-color 0.2s ease;
    line-height: 1.2;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--menu-hover-color, rgba(255, 255, 255, 0.7));
    text-decoration: none;
}

.main-nav .nav-label {
    color: var(--header-text-color, #ffffff);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: var(--menu-font-size, 0.95rem);
    line-height: 1.2;
    text-transform: var(--menu-text-transform, none);
    cursor: default;
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav .nav-label.active {
    color: var(--menu-hover-color, rgba(255, 255, 255, 0.7));
}

.main-nav .btn-login {
    background-color: var(--button-bg-color, var(--primary-color, #407f35));
    color: var(--button-text-color, #ffffff);
    margin-left: 10px;
}

.main-nav .btn-login:hover {
    background-color: var(--button-hover-bg-color, var(--secondary-color, #2d3359));
}

/* Padlock Icon */
.nav-padlock-form {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-padlock {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 6px;
    border-radius: 6px;
    color: var(--header-text-color, #ffffff);
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease, background-color 0.2s ease;
    cursor: default;
    text-decoration: none;
}

a.nav-padlock,
button.nav-padlock {
    cursor: pointer;
    background: none;
    border: none;
    font: inherit;
}

a.nav-padlock:hover,
button.nav-padlock:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-padlock.unlocked {
    opacity: 1;
    color: var(--header-text-color, #ffffff);
}

button.nav-padlock.unlocked:hover {
    color: #cc3333;
    filter: drop-shadow(0 0 2px rgba(204, 51, 51, 0.4));
}

/* Messages Icon */
.nav-messages {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6px;
    margin-left: 6px;
    color: var(--header-text-color, #ffffff);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.nav-messages:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--header-text-color, #ffffff);
}

.message-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background-color: #dc2626;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--header-bg-color, #1f2937);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--header-text-color, #ffffff);
    border-radius: 0;
    white-space: nowrap;
    line-height: 1.2;
    text-transform: var(--submenu-text-transform, var(--menu-text-transform, none));
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
    color: var(--menu-hover-color, rgba(255, 255, 255, 0.7));
    text-decoration: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
    background: none;
    border: none;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--header-text-color, #ffffff);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

/* ================================================================
   6. PAGE HEADER & HERO
   ================================================================ */

.hero {
    position: relative;
    height: var(--hero-height, 500px);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
    margin-top: 70px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, var(--hero-overlay-opacity, 0.4));
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.5rem);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

.btn-hero {
    display: inline-block;
    padding: 14px 36px;
    background-color: var(--button-bg-color, var(--primary-color));
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-hero:hover {
    background-color: var(--button-hover-bg-color, #356a2c);
    transform: translateY(-2px);
    color: #ffffff;
}

/* Full-viewport hero for homepage — fills space between transparent header and footer */
.hero-fullscreen {
    height: auto;
    min-height: 0;
    margin-top: 0;
}

.body-home {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.body-home #main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.body-home .hero-fullscreen {
    flex: 1;
}

/* Page Header */
.page-header {
    position: relative;
    height: var(--page-header-height, 300px);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    margin-top: 70px;
    padding: 40px 20px 60px;
    overflow: hidden;
}

.page-header-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, var(--hero-overlay-opacity, 0.4));
}

.page-header-content {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.page-header-title {
    font-size: clamp(2rem, 4vw, 3rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Page Header Banner (rendered by PageHeader class) */
.page-header-banner {
    margin-top: 70px;
    position: relative;
    z-index: 1;
}

/* Admin pages have shorter header */
.page-header-admin {
    min-height: var(--page-header-height-admin, 200px) !important;
}

/* ─── Cottage Sign Page Title ──────────────────────────────────── */
.page-title-sign {
    position: relative;
    display: inline-block;
    padding: 1rem 2.5rem 0.85rem;
    background:
        repeating-linear-gradient(
            2deg,
            transparent,
            transparent 18px,
            rgba(180, 160, 140, 0.08) 18px,
            rgba(180, 160, 140, 0.08) 19px
        ),
        linear-gradient(
            175deg,
            #faf8f5 0%,
            #f5f0eb 25%,
            #faf7f3 50%,
            #f3ede6 75%,
            #f8f4ef 100%
        );
    border: 3px solid #d6cfc5;
    border-top-color: #e0dbd4;
    border-left-color: #ddd7cf;
    border-radius: 4px;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.25),
        0 2px 0 #c4bbb0,
        0 3px 0 #b8aea2,
        inset 0 1px 2px rgba(255, 255, 255, 0.7),
        inset 0 -1px 3px rgba(0, 0, 0, 0.04);
    max-width: 90%;
}
.page-title-sign h1 {
    margin: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3.5vw, 2.4rem);
    color: #2c3e2a;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    line-height: 1.3;
}
/* Nail accents */
.page-title-sign .sign-nail-l,
.page-title-sign .sign-nail-r {
    position: absolute;
    top: 10px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #a09080, #6b5e50);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}
.page-title-sign .sign-nail-l { left: 12px; }
.page-title-sign .sign-nail-r { right: 12px; }

/* Admin pages — slightly smaller sign */
.page-header-admin .page-title-sign {
    padding: 0.7rem 2rem 0.6rem;
}
.page-header-admin .page-title-sign h1 {
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 15px 0;
    font-size: 0.875rem;
}

.breadcrumbs a {
    color: var(--text-color, #1f2937);
    opacity: 0.7;
}

.breadcrumbs a:hover {
    opacity: 1;
}

.breadcrumbs span {
    margin: 0 8px;
    opacity: 0.5;
}

/* ================================================================
   7. PAGE CONTENT CONTAINER
   ================================================================ */

.page-container {
    background-color: var(--footer-bg-color, #1f2937);
    flex: 1;
    padding-bottom: 40px;
}

.page-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 24px;
    margin: -30px 20px 0 20px;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    min-height: 300px;
}

.page-content-inner {
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 50px 40px 60px;
}

.page-content-inner.narrow {
    max-width: 800px;
}

/* ================================================================
   8. FLASH MESSAGES & ALERTS
   ================================================================ */

.flash-message,
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flash-success,
.alert-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.flash-error,
.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.flash-info,
.alert-info {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.alert-warning {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0 0.25rem;
    line-height: 1;
}

.flash-close:hover {
    opacity: 1;
}

/* ================================================================
   9. BUTTONS
   ================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--button-bg-color, var(--primary-color, #407f35));
    color: var(--button-text-color, #ffffff);
}

.btn-primary:hover {
    background-color: var(--button-hover-bg-color, var(--secondary-color, #2d3359));
    color: var(--button-text-color, #ffffff);
}

.btn-secondary {
    background-color: var(--secondary-color, #2d3359);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #1a1f2e;
    color: #ffffff;
}

.btn-outline {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f3f4f6;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: none;
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ================================================================
   10. FORMS & FORM ELEMENTS
   ================================================================ */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color, #374151);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #407f35);
    box-shadow: 0 0 0 3px rgba(64, 127, 53, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: auto;
}

.form-hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.8rem;
    color: #b91c1c;
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.form-check input {
    width: auto;
    margin: 0;
}

.form-check label {
    font-weight: normal;
    margin-bottom: 0;
}

.required::after {
    content: ' *';
    color: #dc2626;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ================================================================
   11. CARDS & TILES
   ================================================================ */

.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 24px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.card-body {
    padding: 20px;
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card-text {
    font-size: 0.9rem;
    color: #666;
}

/* Clickable tiles (member resources, gallery categories) */
.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #444;
    transition: all 0.2s;
}

.tile:hover {
    border-color: var(--primary-color, #407f35);
    box-shadow: 0 4px 12px rgba(64, 127, 53, 0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--primary-color, #407f35);
}

.tile-icon {
    display: block;
    width: 32px;
    height: 32px;
    margin-bottom: 0.4rem;
    color: var(--primary-color, #407f35);
}

.tile-icon svg {
    width: 100%;
    height: 100%;
}

.tile:hover .tile-icon {
    color: var(--accent-color, #356a2c);
}

.tile-title {
    font-weight: 600;
    font-size: 0.85rem;
}

/* ================================================================
   12. DATA TABLES
   ================================================================ */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.data-table th {
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 0.75rem 1rem;
    background: #f8f9f7;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="search"],
.filter-bar input[type="date"],
.filter-bar input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.filter-bar .form-control {
    width: auto;
    min-width: 160px;
}

.filter-bar-grid {
    display: grid;
    gap: 12px;
    align-items: end;
}

.filter-field {
    min-width: 0;
}

.filter-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.filter-field .form-control {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.85rem;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.filter-actions .filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 400;
    font-size: 0.85rem;
    color: #374151;
}

.filter-actions .filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color, #407f35);
}

.filter-actions .filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-actions .filter-count {
    color: #6b7280;
    font-size: 0.85rem;
    margin-left: auto;
}

/* ================================================================
   13. BADGES
   ================================================================ */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-draft { background: #f3f4f6; color: #6b7280; }
.badge-public { background: #dbeafe; color: #1e40af; }
.badge-physical { background: #dbeafe; color: #1e40af; }
.badge-ticket { background: #fef3c7; color: #92400e; }
.badge-membership { background: #dcfce7; color: #166534; }
.badge-coaching { background: #f3e8ff; color: #6b21a8; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }
.badge-refunded { background: #f3f4f6; color: #6b7280; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #4b5563; }

/* ================================================================
   14. MODALS
   ================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.modal {
    background: #fff;
    border-radius: 8px;
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-content h3 {
    margin: 0 0 20px 0;
}

/* ================================================================
   15. GALLERY & LIGHTBOX
   ================================================================ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.3;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.8;
    z-index: 3001;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.7;
    z-index: 3001;
}

.lightbox-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-caption {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    max-width: 80%;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ================================================================
   16. TAB NAVIGATION (MLCA-specific)
   ================================================================ */

.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-link {
    display: block;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-link:hover {
    color: var(--primary-color, #407f35);
}

.tab-link.active {
    color: var(--primary-color, #407f35);
    border-bottom-color: var(--primary-color, #407f35);
}

/* ================================================================
   17. EMERGENCY ROUTE (MLCA-specific)
   ================================================================ */

.emergency-route-heading {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.emergency-route-heading h3 {
    color: #991b1b;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.emergency-route-heading p {
    color: #7f1d1d;
    margin: 0;
    font-size: 0.9rem;
}

.emergency-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.emergency-table th,
.emergency-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.emergency-table th {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 600;
    border-bottom: 2px solid #dc2626;
}

.emergency-table tbody tr:hover {
    background: #fef2f2;
}

/* ================================================================
   18. MEMBER DASHBOARD TILES (MLCA-specific)
   ================================================================ */

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: var(--heading-weight, 700);
    font-family: var(--font-heading, sans-serif);
    color: var(--text-color, #1f2937);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-value.warning {
    color: #f59e0b;
}

.stat-value.danger {
    color: #dc2626;
}

.stat-value.good {
    color: #16a34a;
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

/* Members Area */
.members-dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin-top: 90px;
    min-height: calc(100vh - 90px);
}

.members-sidebar {
    background: #f8fafc;
    padding: 20px;
    border-right: 1px solid #e2e8f0;
}

.members-sidebar nav a {
    display: block;
    padding: 12px 16px;
    color: var(--text-color, #1f2937);
    border-radius: 8px;
    margin-bottom: 5px;
    transition: background 0.2s, color 0.2s;
}

.members-sidebar nav a:hover,
.members-sidebar nav a.active {
    background-color: var(--primary-color, #407f35);
    color: #ffffff;
}

.members-content {
    padding: 30px;
}

/* ================================================================
   19. PAGINATION
   ================================================================ */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin: 2rem 0;
    list-style: none;
    padding: 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.45rem 0.8rem;
    font-size: 0.875rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #444;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--primary-color, #407f35);
    color: var(--primary-color, #407f35);
    text-decoration: none;
}

.pagination .active span {
    background: var(--primary-color, #407f35);
    border-color: var(--primary-color, #407f35);
    color: #fff;
}

/* ================================================================
   20. FOOTER
   ================================================================ */

.site-footer {
    background-color: var(--footer-bg-color, #1f2937);
    color: var(--footer-text-color, #ffffff);
    padding: 10px 0;
    margin-top: auto;
}

.footer-content {
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

.footer-inner {
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 2rem 1.5rem 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.125rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul a {
    color: var(--footer-text-color, #ffffff);
    opacity: 0.8;
}

.footer-section ul a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 0;
    margin-top: 0;
    font-size: 0.875rem;
    opacity: 0.8;
}

.footer-bottom p {
    margin: 0;
}

.footer-copyright {
    font-size: 0.8rem;
    opacity: 0.6;
    margin: 0;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--footer-text-color, #ffffff);
    transition: background-color 0.2s ease;
}

.social-icons a:hover {
    background-color: var(--primary-color, #407f35);
}

/* ================================================================
   21. UTILITY CLASSES
   ================================================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #6b7280;
}

.text-small {
    font-size: 0.85rem;
}

.text-success {
    color: #16a34a;
}

.text-danger {
    color: #dc2626;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.py-1 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-2 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-3 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.d-flex {
    display: flex;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1.5rem;
    padding: 0;
    list-style: none;
}

.breadcrumb a {
    color: #666;
}

.breadcrumb a:hover {
    color: var(--primary-color, #407f35);
}

.breadcrumb-sep {
    margin: 0 0.3rem;
    opacity: 0.5;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-color, #407f35);
}

.back-to-dashboard {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.back-to-dashboard:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 10px;
    color: #374151;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 20px;
}

.stock-status {
    font-size: 0.9rem;
}

.stock-status.in-stock {
    color: #16a34a;
}

.stock-status.low-stock {
    color: #f59e0b;
}

.stock-status.out-of-stock {
    color: #dc2626;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.auth-container {
    max-width: 400px;
    margin: 80px auto 40px;
    padding: 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 25px;
}

/* ================================================================
   IMAGE TEXT WRAPPING (TinyMCE)
   ================================================================ */

.img-float-left {
    float: left;
    margin: 0.25rem 1.25rem 0.75rem 0;
    max-width: 50%;
    height: auto;
}

.img-float-right {
    float: right;
    margin: 0.25rem 0 0.75rem 1.25rem;
    max-width: 50%;
    height: auto;
}

.img-center {
    display: block;
    margin: 1rem auto;
    max-width: 100%;
    height: auto;
}

/* Constrain CMS pages to match functional page widths */
.body-page .container {
    max-width: 960px;
}

/* Clear float after wrapped images within CMS content */
.page-content::after,
.cms-content::after,
.mce-content-body::after {
    content: '';
    display: table;
    clear: both;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
    .page-header-banner {
        padding: 35px 20px 50px !important;
    }
    .page-header-admin {
        padding: 25px 20px 35px !important;
    }
    .page-title-sign {
        padding: 0.75rem 1.75rem 0.65rem;
    }

    .menu-toggle {
        display: flex;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--header-bg-color, #1f2937);
        flex-direction: column;
        padding: 20px;
        display: none;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-toggle {
        width: 100%;
        justify-content: center;
    }

    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 6px;
        margin: 5px 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        max-height: 500px;
        padding: 8px 0;
    }

    .nav-dropdown-menu a {
        padding: 10px 20px;
    }

    .nav-padlock {
        margin: 4px auto;
    }

    .nav-padlock-form {
        justify-content: center;
    }

    .hero {
        height: 60vh;
    }

    .page-header {
        min-height: 280px;
        padding: 35px 20px 50px;
    }

    .page-content {
        border-radius: 20px;
        margin-top: -30px;
        margin-left: 15px;
        margin-right: 15px;
    }

    .page-content-inner {
        padding: 35px 25px 50px;
    }

    .page-container {
        padding-bottom: 30px;
    }

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

    .members-sidebar {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .grid,
    .grid-2,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding: 16px 18px;
    }

    .data-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar select,
    .filter-bar input {
        width: 100%;
    }

    .filter-bar-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .filter-field-wide {
        grid-column: 1 / -1;
    }

    .filter-actions {
        flex-wrap: wrap;
    }

    .modal-content {
        max-width: 95vw;
        padding: 18px;
    }

    .modal-large {
        max-width: 95vw;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .gallery-item img {
        height: 130px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .tab-nav {
        flex-wrap: wrap;
    }

    .tab-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    /* Stack floated images on smaller screens */
    .img-float-left,
    .img-float-right {
        float: none;
        display: block;
        margin: 1rem auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header-banner {
        padding: 30px 15px 45px !important;
    }
    .page-header-admin {
        padding: 20px 15px 30px !important;
    }
    .page-title-sign {
        padding: 0.6rem 1.25rem 0.5rem;
    }
    .page-title-sign .sign-nail-l,
    .page-title-sign .sign-nail-r {
        width: 7px;
        height: 7px;
        top: 8px;
    }
    .page-title-sign .sign-nail-l { left: 8px; }
    .page-title-sign .sign-nail-r { right: 8px; }

    body {
        font-size: 15px;
    }

    .container {
        padding: 0 1rem;
    }

    .content-section {
        padding: 1.5rem 0;
    }

    .hero {
        height: 350px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .page-header {
        min-height: 250px;
        padding: 30px 15px 45px;
    }

    .page-header-title {
        font-size: 1.4rem;
    }

    .page-content {
        border-radius: 16px;
        margin-top: -30px;
        margin-left: 10px;
        margin-right: 10px;
    }

    .page-content-inner {
        padding: 25px 20px 40px;
    }

    .page-container {
        padding-bottom: 25px;
    }

    .auth-container {
        margin: 70px 15px 30px;
        padding: 20px;
    }

    .filter-bar-grid {
        grid-template-columns: 1fr !important;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .gallery-item img {
        height: 130px;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .form-control {
        width: 100%;
    }

    .tab-nav {
        flex-direction: column;
        border-bottom: none;
        margin-bottom: 1rem;
    }

    .tab-link {
        padding: 10px 0;
        border-bottom: 2px solid #e5e7eb;
        margin-bottom: 0;
    }

    .tab-link.active {
        border-bottom-color: var(--primary-color, #407f35);
    }
}

@media print {
    .site-header,
    .site-footer,
    .menu-toggle,
    .flash-message,
    .alert,
    .btn,
    .filter-bar {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    main {
        padding: 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* ═══════════════════════════════════════════════════════════════
   22. My Cottage — Member Self-Service
   ═══════════════════════════════════════════════════════════════ */

.my-cottage-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cottage-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.cottage-card-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    color: #2c3e2a;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cottage-card-title svg {
    color: #3d6b35;
    flex-shrink: 0;
}

.cottage-info-header h2 {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #2c3e2a;
}

/* Contact rows */
.contact-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.contact-row:last-of-type {
    border-bottom: none;
}

.contact-name strong {
    color: #1e293b;
}

.contact-phones {
    margin-top: 0.2rem;
}

.contact-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Inline edit forms */
.contact-edit-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.75rem;
}

.contact-edit-form .form-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.contact-edit-form .form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.contact-edit-form .form-group {
    margin-bottom: 0.75rem;
}

.contact-edit-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
    display: block;
}

/* Extra-small buttons */
.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    line-height: 1.4;
}

.btn-danger-outline {
    color: #dc2626;
    border-color: #fca5a5;
}

.btn-danger-outline:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #991b1b;
}

/* Pending changes */
.pending-changes {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 0.75rem 1rem;
}

.pending-item {
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

/* Cottage selector */
.cottage-selector {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Checkbox label styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color, #407f35);
}

/* ═══════════════════════════════════════════════════════════════
   23. Admin Review Cards — Pending Owner Changes
   ═══════════════════════════════════════════════════════════════ */

.admin-review-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.review-details {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.9rem;
}

.review-details p {
    margin: 0.25rem 0;
}

.review-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.review-actions .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .cottage-card {
        padding: 1rem;
    }

    .contact-edit-form .form-row {
        flex-direction: column;
    }

    .review-actions {
        flex-direction: column;
    }

    .review-actions .form-group {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cottage-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .cottage-selector select {
        width: 100% !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   24. Annual Dues — Payment Forms & Admin
   ═══════════════════════════════════════════════════════════════ */

/* Dues line items (checkbox + amount on same line) */
.dues-line-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.dues-line-item:last-of-type {
    border-bottom: none;
}

.dues-amount {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

.dues-total-row {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.dues-total {
    color: var(--primary-color, #407f35);
    font-weight: 700;
}

/* Donation presets */
.donation-presets {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.donation-preset.active {
    background: var(--primary-color, #407f35);
    color: #fff;
    border-color: var(--primary-color, #407f35);
}

.donation-input {
    max-width: 120px;
}

/* Payment method radio cards */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.radio-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.radio-card input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: var(--primary-color, #407f35);
}

.radio-card input[type="radio"]:checked ~ .radio-card-body {
    color: #1e293b;
}

.radio-card:has(input:checked) {
    border-color: var(--primary-color, #407f35);
    background: rgba(64, 127, 53, 0.04);
}

.radio-card-body strong {
    display: block;
    margin-bottom: 0.15rem;
}

.radio-card-body p {
    margin: 0.15rem 0 0;
}

/* Admin dues stats row */
.dues-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.dues-stat {
    text-align: center;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.dues-stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color, #407f35);
}

.dues-stat-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.15rem;
}

/* Tab navigation (used on admin dues page) */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
}

.tab-link {
    padding: 0.5rem 1.25rem;
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-link:hover {
    color: #1e293b;
    text-decoration: none;
}

.tab-link.active {
    color: var(--primary-color, #407f35);
    border-bottom-color: var(--primary-color, #407f35);
}

/* Filter bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .dues-line-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .dues-amount {
        text-align: left;
    }

    .dues-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .radio-card {
        padding: 0.6rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .dues-stats-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── 25. Marketplace / Lost & Found ───────────────────────────────── */

/* Call-to-action banner at top of listing pages */
.listing-cta {
    background: linear-gradient(135deg, #f0f7f0 0%, #e8f5e9 100%);
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.listing-cta h3 {
    margin: 0 0 0.15rem;
    font-size: 1.05rem;
    color: #2e7d32;
}
.listing-cta p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}
.listing-cta .btn {
    white-space: nowrap;
    flex-shrink: 0;
}
.listing-cta-muted {
    background: #f9fafb;
    border-color: #e5e7eb;
    justify-content: center;
}
.listing-cta-muted p {
    color: #888;
}

/* Form actions (Post / Cancel buttons) */
.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 600px) {
    .listing-cta {
        flex-direction: column;
        text-align: center;
    }
}

/* User header (read-only) */
.listing-user-header {
    background: #f0f7f0;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.listing-user-name {
    font-size: 1rem;
}
.listing-user-cottage {
    color: #555;
    font-size: 0.9rem;
}

/* Fieldsets for contact & photos */
.listing-fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.listing-fieldset legend {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 0.5rem;
    color: #2e7d32;
}

/* Contact method checkboxes */
.contact-method-checks {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.contact-method-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.contact-method-item input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}
.contact-method-item > span,
.contact-method-item > label {
    min-width: 100px;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}
.contact-method-item .form-control-sm {
    flex: 1;
    min-width: 180px;
    max-width: 300px;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
}
.contact-method-item .form-control-sm:disabled {
    background: #f5f5f5;
    opacity: 0.6;
}

/* Drag-and-drop image upload zone */
.image-drop-zone {
    border: 2px dashed #c8e6c9;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafff9;
}
.image-drop-zone:hover,
.image-drop-zone.drag-over {
    border-color: #2e7d32;
    background: #e8f5e9;
}
.drop-zone-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.drop-zone-content p {
    margin: 0.25rem 0;
}

/* Image preview row */
.image-preview-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.image-preview-item {
    position: relative;
    width: 100px;
    text-align: center;
}
.image-preview-item img {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}
.image-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #d32f2f;
    color: #fff;
    border: 2px solid #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.image-preview-name {
    display: block;
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Listing card image display — show full image instead of cropping */
.listing-card .card-img {
    height: auto;
    max-height: 360px;
    object-fit: contain;
    background: #f5f5f5;
}
.listing-card .listing-images {
    background: #f5f5f5;
    overflow: hidden;
}
.listing-card .gallery-main {
    height: auto;
    max-height: 320px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Listing card enhancements */
.listing-card .listing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.listing-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2e7d32;
}
.price-ono {
    font-size: 0.75rem;
    font-weight: 400;
    color: #888;
    margin-left: 0.25rem;
}
.listing-cottage {
    margin-top: 0 !important;
    margin-bottom: 0.25rem !important;
}
.listing-contact-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #555;
}
.listing-contact-info strong {
    display: block;
    margin-bottom: 0.15rem;
}
.contact-chip {
    display: inline-block;
    margin-right: 0.5rem;
}

/* Gallery for multiple images */
.listing-gallery {
    position: relative;
}
.gallery-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}
.gallery-thumbs {
    display: flex;
    gap: 4px;
    padding: 4px 4px 0;
    overflow-x: auto;
}
.gallery-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
    border-color: #2e7d32;
}

/* Price row */
#price-row {
    transition: all 0.2s;
}

@media (max-width: 600px) {
    .listing-user-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    .contact-method-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .contact-method-item .form-control-sm {
        max-width: 100%;
    }
    .image-preview-item {
        width: 80px;
    }
    .image-preview-item img {
        width: 80px;
        height: 60px;
    }
}
