/* ============================================================
   IHM MEN'S GROUP — DESIGN SYSTEM TOKENS
   ============================================================
   CSS custom properties foundation. All component styles below
   should reference these tokens for consistency.
   ============================================================ */

:root {
    /* ── Brand Colors ─────────────────────────────────────── */
    --color-brand:            #2874B5;  /* IHM Blue — primary */
    --color-brand-dark:       #1f5a8f;  /* Hover / pressed */
    --color-brand-light:      #e3f2fd;  /* Tinted backgrounds */
    --color-brand-focus:      rgba(40, 116, 181, 0.3);  /* Focus rings */
    --color-brand-subtle:     rgba(40, 116, 181, 0.15); /* Subtle highlights */

    /* ── Semantic Colors ──────────────────────────────────── */
    --color-success:          #28a745;
    --color-success-dark:     #218838;
    --color-success-light:    #c8e6c9;
    --color-success-text:     #155724;
    --color-success-border:   #c3e6cb;
    --color-success-focus:    rgba(46, 125, 50, 0.3);

    --color-danger:           #dc3545;
    --color-danger-dark:      #bd2130;
    --color-danger-light:     #ffcdd2;
    --color-danger-text:      #721c24;
    --color-danger-border:    #f5c6cb;
    --color-danger-subtle:    rgba(220, 38, 38, 0.15);

    --color-warning:          #ffc107;
    --color-warning-dark:     #e0a800;
    --color-warning-light:    #fff3e0;
    --color-warning-text:     #856404;
    --color-warning-border:   #ffeeba;
    --color-warning-glow:     rgba(255, 193, 7, 0.5);

    --color-info:             #17a2b8;
    --color-info-dark:        #007a8c;
    --color-info-light:       #d1ecf1;
    --color-info-text:        #0c5460;

    /* ── Overlay ──────────────────────────────────────────── */
    --overlay-bg:             rgba(0, 0, 0, 0.5);

    /* ── Accent Colors ────────────────────────────────────── */
    --color-purple:           #673ab7;
    --color-pink:             #e91e63;
    --color-orange:           #ff9800;
    --color-gold:             #FFD700;
    --color-gold-dark:        #B8860B;
    --color-blue-alt:         #007bff;
    --color-green-alt:        #00a65d;
    --color-green-muted:      #5a9900;

    /* ── Neutral Scale ────────────────────────────────────── */
    --color-white:            #ffffff;
    --color-gray-50:          #f8f9fa;  /* Lightest backgrounds */
    --color-gray-100:         #f5f5f5;  /* Page background */
    --color-gray-200:         #eeeeee;  /* Borders, dividers */
    --color-gray-300:         #ddd;     /* Input borders */
    --color-gray-350:         #ccc;     /* Disabled borders */
    --color-gray-400:         #e0e0e0;  /* Muted borders */
    --color-gray-500:         #999;     /* Muted text */
    --color-gray-600:         #666;     /* Secondary text */
    --color-gray-700:         #6c757d;  /* Bootstrap secondary */
    --color-gray-750:         #5a6268;  /* Secondary hover */
    --color-gray-800:         #333;     /* Primary text */
    --color-black:            #000000;

    /* ── Typography ───────────────────────────────────────── */
    --font-family:            -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono:       'SF Mono', 'Fira Code', 'Consolas', monospace;

    /* Size scale — minor third (1.2 ratio) */
    --font-xs:                0.75rem;   /* 12px — fine print, badges */
    --font-sm:                0.85rem;   /* 13.6px — labels, captions */
    --font-base:              0.9rem;    /* 14.4px — body text */
    --font-md:                1rem;      /* 16px — emphasized body */
    --font-lg:                1.125rem;  /* 18px — section headers */
    --font-xl:                1.25rem;   /* 20px — page subtitles */
    --font-2xl:               1.5rem;    /* 24px — page titles */
    --font-3xl:               2.5rem;    /* 40px — hero / stats */

    /* Weights */
    --weight-normal:          400;
    --weight-medium:          500;
    --weight-semibold:        600;
    --weight-bold:            700;

    /* Line heights */
    --leading-tight:          1.2;
    --leading-normal:         1.5;
    --leading-relaxed:        1.65;

    /* ── Spacing Scale (4px base) ─────────────────────────── */
    --space-1:                4px;
    --space-2:                8px;
    --space-3:                12px;
    --space-4:                16px;
    --space-5:                20px;
    --space-6:                24px;
    --space-8:                32px;
    --space-10:               40px;
    --space-12:               48px;
    --space-16:               64px;

    /* ── Border Radius ────────────────────────────────────── */
    --radius-sm:              3px;
    --radius-md:              4px;
    --radius-lg:              6px;
    --radius-xl:              8px;   /* Cards, panels */
    --radius-2xl:             12px;  /* Badges, pills */
    --radius-full:            50%;   /* Circles */

    /* ── Shadows ──────────────────────────────────────────── */
    --shadow-xs:              0 1px 3px rgba(0,0,0,0.1);
    --shadow-sm:              0 2px 5px rgba(0,0,0,0.1);
    --shadow-md:              0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg:              0 4px 12px rgba(0,0,0,0.15);
    --shadow-xl:              0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    --shadow-2xl:             0 10px 40px rgba(0,0,0,0.3);
    --shadow-focus:           0 0 0 3px var(--color-brand-focus);

    /* ── Z-Index Scale ────────────────────────────────────── */
    --z-base:                 1;
    --z-raised:               10;
    --z-dropdown:             1000;
    --z-sticky:               2000;
    --z-overlay:              2500;
    --z-modal:                3000;
    --z-toast:                4000;
    --z-tooltip:              9999;
    --z-top:                  10000;
    --z-critical:             10100;  /* Error modals, always on top */

    /* ── Transitions ──────────────────────────────────────── */
    --transition-fast:        0.15s ease;
    --transition-base:        0.2s ease;
    --transition-slow:        0.3s ease;

    /* ── Layout ───────────────────────────────────────────── */
    --container-narrow:       700px;
    --container-default:      900px;
    --container-wide:         1200px;
    --container-full:         1400px;
    --sidebar-width:          250px;

    /* ── Breakpoints (reference — use in @media queries) ──── */
    /* --bp-sm:  576px   — Small phones                       */
    /* --bp-md:  768px   — Tablets / mobile breakpoint         */
    /* --bp-lg:  992px   — Desktop                             */
    /* --bp-xl:  1200px  — Wide desktop                        */
}

/* ============================================================
   BASE RESET & DEFAULTS
   ============================================================ */

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--color-gray-100);
    color: var(--color-gray-800);
    font-size: var(--font-base);
    line-height: var(--leading-normal);
}

/* Navigation */
.navbar {
    background-color: var(--color-brand);
    color: var(--color-white);
    padding: 15px var(--space-5);
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    max-width: var(--container-full);
    margin: 0 auto;
}

.navbar-logo {
    flex-shrink: 0;
}

.logo-img {
    height: 60px;
    width: auto;
    background-color: var(--color-white);
    padding: 5px 10px;
    border-radius: var(--radius-md);
}

.navbar-content {
    flex-grow: 1;
}

.navbar h2 {
    margin: 0 0 10px 0;
    font-size: var(--font-xl);
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: var(--space-5);
}

.nav-menu li {
    display: inline;
}

.nav-menu a {
    color: var(--color-white);
    text-decoration: none;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-slow);
    border: 1px solid transparent;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-menu a.active {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--color-white);
}

/* Content area */
.content {
    padding: var(--space-5);
}

h1 {
    text-align: center;
    color: var(--color-brand);
}

.total {
    text-align: center;
    font-size: var(--font-lg);
    margin: var(--space-5);
    font-weight: var(--weight-bold);
    color: var(--color-brand);
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: var(--space-5) auto;
    padding: var(--space-5);
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    padding: var(--space-3);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-md);
    transition: border-color var(--transition-slow);
    min-width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 5px var(--color-brand-focus);
}

.search-select {
    padding: var(--space-3);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-md);
    background-color: var(--color-white);
    min-width: 150px;
}

.search-select:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 5px var(--color-brand-focus);
}

.btn-search {
    padding: var(--space-3) var(--space-6);
    white-space: nowrap;
}

.search-results {
    text-align: center;
    margin: 15px 0;
    color: var(--color-gray-600);
    font-size: var(--font-base);
}

.no-results {
    text-align: center;
    padding: var(--space-10);
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin: var(--space-5) auto;
    max-width: 600px;
}

.no-results p {
    color: var(--color-gray-600);
    font-size: var(--font-md);
}

/* Table styles */
table {
    border-collapse: collapse;
    width: 80%;
    margin: var(--space-5) auto;
    box-shadow: var(--shadow-sm);
    background-color: var(--color-white);
}

th, td {
    border: 1px solid var(--color-gray-300);
    padding: var(--space-3);
    text-align: left;
    background-color: var(--color-white);
}

th {
    background-color: var(--color-brand);
    color: var(--color-white);
    font-weight: var(--weight-bold);
}

/* Edit link styling - Updated to IHM Blue */
.edit-link {
    color: var(--color-brand);  /* IHM Blue */
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.edit-link:hover {
    text-decoration: underline;
    color: var(--color-brand-dark);  /* Darker blue on hover */
}

/* Legacy member list photo/edit column widths — scoped to avoid global bleed */
/* Grid.js handles its own widths; these are for any remaining static tables */
#membersGrid th:first-child, #membersGrid td:first-child {
    text-align: center;
    width: 120px;
}

#membersGrid th:nth-child(2), #membersGrid td:nth-child(2) {
    text-align: center;
    width: 50px;
}

/* Member photo styles */
.member-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-brand);  /* IHM Blue border */
}

.member-photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--color-brand);  /* IHM Blue */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-weight: bold;
    font-size: 40px;
    border: 2px solid var(--color-brand-dark);
    margin: 0 auto;
}

/* Form styles */
.form-container {
    max-width: 600px;
    margin: var(--space-5) auto;
    background: var(--color-white);
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: var(--weight-bold);
    color: var(--color-gray-800);
}

/* Consistent input styling for ALL input types */
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    font-size: var(--font-base);
    font-family: var(--font-family);
    background-color: var(--color-white);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 5px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    font-size: var(--font-base);
}

/* Focus states for ALL input types */
.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 5px var(--color-brand-focus);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--color-gray-600);
    font-size: var(--font-xs);
}

/* Form Row Layouts */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-row .form-group {
    margin-bottom: 0;
}

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

.form-row-3 .form-group {
    margin-bottom: 0;
}

/* Vertical spacing between consecutive form rows inside cards */
.form-row + .form-row,
.form-row + .form-row-3,
.form-row + .form-row-4,
.form-row-3 + .form-row,
.form-row-3 + .form-row-3,
.form-row-3 + .form-row-4,
.form-row-4 + .form-row,
.form-row-4 + .form-row-3,
.form-row-4 + .form-row-4 {
    margin-top: 15px;
}

/* Form Actions */
.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Required Field Indicator */
.required {
    color: var(--color-danger);
}

/* Password container with eye icon */
.password-container {
    position: relative;
}

.password-container input {
    width: 100%;
    padding: 10px;
    padding-right: 45px;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.password-container input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 5px var(--color-brand-focus);
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 20px;
    height: 20px;
    user-select: none;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: #999;
    transition: fill 0.2s;
}

.password-toggle:hover svg {
    fill: var(--color-brand);
}

/* Birthday container with inline age */
.birthday-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.birthday-container input[type="date"] {
    flex: 0 0 auto;
    width: auto;
}

.age-display {
    color: var(--color-gray-600);
    font-size: 14px;
    white-space: nowrap;
}

/* Section divider */
.section-divider {
    margin: 30px 0 20px 0;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.section-divider h3 {
    margin: 0 0 10px 0;
    color: var(--color-brand);
    font-size: 1.1em;
}

/* ──────────────── Button System ──────────────── */
/* 4 types: primary (.btn), secondary, danger, ghost */
/* 2 sizes: default, small (.btn-sm) */
/* Icons: 16x16 SVG with gap, or text "+" prefix */

/* Base — all buttons inherit this */
/* .btn-create and .btn-add are legacy aliases — migrate to .btn when touching templates */
.btn,
.btn-create,
.btn-add {
    background-color: var(--color-brand);
    color: var(--color-white);
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--font-md);
    font-weight: var(--weight-medium);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

.btn:hover,
.btn-create:hover,
.btn-add:hover {
    background-color: var(--color-brand-dark);
    color: var(--color-white);
    text-decoration: none;
}

/* Secondary — outline style */
.btn-secondary {
    background-color: var(--color-white);
    color: var(--color-gray-700);
    border-color: var(--color-gray-300);
}

.btn-secondary:hover {
    background-color: var(--color-gray-50);
    border-color: var(--color-gray-400);
    color: var(--color-gray-800);
}

/* Danger — destructive actions */
.btn-danger {
    background-color: var(--color-danger);
    color: var(--color-white);
    border-color: transparent;
}

.btn-danger:hover {
    background-color: var(--color-danger-dark);
}

/* Ghost — tertiary, minimal */
.btn-ghost {
    background-color: transparent;
    color: var(--color-brand);
    border-color: transparent;
    padding: 8px 12px;
}

.btn-ghost:hover {
    background-color: var(--color-gray-50);
    color: var(--color-brand-dark);
}

/* Save — green for save/confirm actions */
.btn-save {
    background-color: var(--color-success);
    color: var(--color-white);
    border-color: transparent;
}

.btn-save:hover {
    background-color: var(--color-success-dark);
}

/* Edit — alias for primary (backward compat) */
.btn-edit {
    background-color: var(--color-brand);
}

.btn-edit:hover {
    background-color: var(--color-brand-dark);
}

/* Small size */
.btn-sm,
.btn-small {
    padding: 4px 12px;
    font-size: var(--font-sm);
}

/* Button SVG icons — consistent 16x16 */
.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Button dropdown (split button with menu) */
.btn-dropdown-wrapper {
    position: relative;
    display: inline-flex;
}
.btn-dropdown-wrapper > .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.btn-dropdown-toggle {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    padding: 8px 6px !important;
    margin-left: -1px;
}
.btn-dropdown-toggle svg { vertical-align: middle; }
.btn-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 160px;
    z-index: var(--z-dropdown);
    overflow: hidden;
}
.btn-dropdown-wrapper.open .btn-dropdown-menu { display: block; }
.btn-dropdown-menu a {
    display: block;
    padding: 8px 14px;
    color: var(--color-gray-700);
    text-decoration: none;
    font-size: var(--font-sm);
    white-space: nowrap;
}
.btn-dropdown-menu a:hover {
    background: var(--color-gray-50);
    color: var(--color-brand);
}

/* Message styles */
.message {
    padding: 15px;
    margin: 20px auto;
    max-width: 600px;
    border-radius: 4px;
    text-align: center;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.message.reminder {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid var(--color-warning);
}

.message.reminder a {
    color: #856404;
    font-weight: 600;
}

/* Member Badges */
.member-badges {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-2xl);
    font-size: var(--font-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.5px;
}

.badge-active {
    background-color: #d4edda;
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}

.badge-inactive {
    background-color: var(--color-danger-light);
    color: var(--color-danger-text);
    border: 1px solid var(--color-danger-border);
}

.badge-role-member {
    background-color: var(--color-brand);
    color: var(--color-white);
}

.badge-role-admin {
    background-color: var(--color-warning);
    color: var(--color-gray-800);
}

.badge-role-super-admin {
    background-color: #6f42c1;
    color: var(--color-white);
}

/* Role badges (list page) */
.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-2xl);
    font-size: 0.8em;
    font-weight: var(--weight-bold);
}

.role-super-admin {
    background-color: #6f42c1;
    color: var(--color-white);
}

.role-admin {
    background-color: #ffd93d;
    color: var(--color-gray-800);
}

.role-member {
    background-color: var(--color-brand);
    color: var(--color-white);
}

/* Card badges row */
.card-badges {
    display: flex;
    gap: var(--space-2);
    padding: 10px 15px;
    border-top: 1px solid var(--color-gray-200);
}

.card-header .card-badges {
    padding: 0;
    border-top: none;
    flex-shrink: 0;
}

/* Desktop table — modern SaaS pattern
   No vertical borders, horizontal dividers only, zebra striping, hover highlight.
   Matches Stripe/Linear/GitHub table conventions. */
.desktop-table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

/* Fixed layout — column widths respect th widths, not content */
.desktop-table.table-fixed {
    table-layout: fixed;
}

.desktop-table th,
.desktop-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border: none;
    border-bottom: 1px solid var(--color-gray-100);
}

.desktop-table th {
    background-color: var(--color-gray-50);
    color: var(--color-gray-600);
    font-weight: var(--weight-semibold);
    font-size: var(--font-sm);
    border-bottom: 1px solid var(--color-gray-200);
}

/* Zebra striping — gray-100 gives visible contrast against white rows */
.desktop-table tbody tr:nth-child(even),
.desktop-table tr:nth-child(even) {
    background-color: var(--color-gray-100);
}

.desktop-table tr:hover {
    background-color: #e8f0fe;
}

/* Table alignment utilities */
.col-right { text-align: right; }
.col-center { text-align: center; }
.col-bold { font-weight: var(--weight-semibold); }
.col-badge { width: 80px; white-space: nowrap; } /* Narrow badge columns */
.col-expand { width: 45%; } /* Primary content column — takes most space */

/* Mobile cards - hide on larger screens */
.mobile-cards {
    display: none;
}

/* Mobile card utilities */
.filter-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.filter-row label { white-space: nowrap; color: var(--color-gray-700); font-size: var(--font-sm); }
.filter-row select { flex: 1; }
.card-subtitle { display: block; font-size: var(--font-xs); color: var(--color-gray-600); }
.card-subtitle a { color: var(--color-gray-600); text-decoration: none; }
.card-subtitle a:hover { color: var(--color-brand); }

/* Desktop only - hide on mobile */
.desktop-only {
    display: block;
}

/* Admin filters - desktop only */
.admin-filters-desktop {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.admin-filters-desktop label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-brand);
    font-weight: 600;
}

.admin-filters-desktop select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

/* Admin filters - mobile only */
.admin-filters-mobile {
    display: none;
    margin-bottom: 10px;
}

.admin-filters-mobile label {
    white-space: nowrap;
    color: var(--color-brand);
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-filters-mobile select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ──────────────── Status Badges (unified) ──────────────── */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: var(--weight-semibold);
    cursor: default;
    white-space: nowrap;
}

/* Active / Inactive */
.status-active    { background: #c8e6c9; color: #2e7d32; border: 1px solid #a5d6a7; }
.status-inactive  { background: #ffcdd2; color: #c62828; border: 1px solid #ef9a9a; }

/* Budget statuses */
.status-draft     { background: var(--color-warning-light); color: #e65100; }
.status-approved  { background: #e8f5e9; color: #2e7d32; }
.status-closed    { background: var(--color-gray-100); color: #757575; }

/* Transaction / general statuses */
.status-completed { background: #e8f5e9; color: #2e7d32; }
.status-pending   { background: #fff3e0; color: #e65100; }
.status-cancelled { background: var(--color-gray-100); color: #757575; }
.status-received  { background: #c8e6c9; color: #2e7d32; border: 1px solid #a5d6a7; }
.status-unknown   { background: var(--color-gray-100); color: #757575; }

/* Type badges (income/expense, vendor/donor/sponsor) */
.status-income    { background: #e8f5e9; color: #2e7d32; }
.status-expense   { background: #ffebee; color: #c62828; }
.status-vendor    { background: #e3f2fd; color: #1565c0; }
.status-donor     { background: #e8f5e9; color: #2e7d32; }
.status-sponsor   { background: #f3e5f5; color: #7b1fa2; }
.status-other     { background: var(--color-gray-100); color: #757575; }
.status-affiliate { background: #fff3e0; color: #e65100; }

/* Scope badges (budget dashboard) */
.status-series    { background: #e3f2fd; color: #1565c0; }
.status-event     { background: #fff3e0; color: #e65100; }
.status-general   { background: var(--color-gray-100); color: #757575; }

/* Inactive row styling */
.inactive-row {
    opacity: 0.7;
    background-color: #fafafa;
}

.inactive-row:hover {
    opacity: 1;
}

/* Plain text status (non-clickable for Super Admins) */
.status-text {
    font-size: 0.85em;
}

.status-text-active {
    color: #2e7d32;
}

.status-text-inactive {
    color: #c62828;
}

/* Mobile Card Styles */
.member-card,
.party-card,
.account-card,
.category-card,
.series-card,
.job-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    margin-bottom: 15px;
    overflow: hidden;
}

.inactive-card {
    opacity: 0.7;
}

.card-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-200);
    gap: 10px;
}

.card-header-with-badge {
    justify-content: space-between;
}

.card-photo {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
    border: 2px solid var(--color-brand);
}

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

.card-photo-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--color-brand);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xl);
    font-weight: var(--weight-bold);
}

.card-name {
    flex-grow: 1;
}

.card-name a {
    color: var(--color-brand);
    text-decoration: none;
    font-size: var(--font-lg);
    font-weight: var(--weight-bold);
}

.card-name a:hover {
    text-decoration: underline;
}

.inactive-label {
    display: block;
    color: var(--color-gray-500);
    font-size: 12px;
}

.card-details {
    padding: 15px;
}

.card-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.card-row:last-child {
    margin-bottom: 0;
}

.card-label {
    min-width: 70px;
    flex-shrink: 0;
    font-size: var(--font-sm);
    color: var(--color-gray-500);
    font-weight: var(--weight-medium);
}

.card-value {
    flex-grow: 1;
}

.card-value a {
    color: var(--color-brand);
    text-decoration: none;
}

/* User info styling (navbar) */
.user-info {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.user-name {
    color: var(--color-white);
    font-weight: 500;
}

.user-role {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* ============================================
   PAGE CONTAINER AND HEADER STYLES
   ============================================ */

.page-container {
    max-width: var(--container-default);
    margin: 0 auto;
    padding: var(--space-5);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    padding-bottom: 15px;
    border-bottom: 2px solid var(--color-gray-400);
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    margin: 0;
    text-align: left;
    font-size: 1.8em;
    flex: 1;
    min-width: 200px;
}

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

.header-actions .inline-form {
    display: contents;
}

/* ============================================
   DETAILS CARD (View/Edit Pages)
   ============================================ */

.details-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}

.details-card .card-title {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-gray-200);
    color: var(--color-brand);
    font-size: 1.1em;
}

/* Info Grid - only set the grid layout, let individual pages handle item styles */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-grid .full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Financial page info styles - uses unique selectors to avoid conflicts */
.page-container .info-item {
    margin-bottom: 6px;
}

.page-container .info-label {
    color: var(--color-gray-600);
    font-size: 0.9em;
    margin-right: 8px;
}

.page-container .info-value {
    color: var(--color-gray-800);
}

.page-container .info-value a {
    color: var(--color-brand);
    text-decoration: none;
}

.page-container .info-value a:hover {
    text-decoration: underline;
}

/* Back Link */
.back-link {
    margin-top: 20px;
    text-align: center;
}

.back-link a {
    color: var(--color-brand);
    text-decoration: none;
}

.back-arrow-icon {
    vertical-align: middle;
    margin-right: var(--space-1);
}

.back-link a:hover {
    text-decoration: underline;
}

/* Usage Info */
.usage-info {
    color: var(--color-gray-600);
    margin: 0;
}

/* Text Muted */
.text-muted {
    color: var(--color-gray-500);
}

/* Utility: No Wrap */
.nowrap {
    white-space: nowrap;
}

/* ============================================
   FINANCIAL PARTY TYPE BADGES
   ============================================ */

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

.type-vendor {
    background-color: #fff3e0;
    color: #e65100;
}

.type-donor {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.type-sponsor {
    background-color: #e3f2fd;
    color: #1565c0;
}

.type-both {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

/* ============================================
   FINANCIAL CATEGORY TYPE BADGES
   ============================================ */

.category-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

.category-type-income {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.category-type-expense {
    background-color: #ffebee;
    color: #c62828;
}

/* Event Category Badge */
.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    background-color: #e3f2fd;
    color: #1565c0;
}

/* ============================================
   LINK STYLES FOR LISTS
   ============================================ */

.party-link,
.account-link,
.category-link,
.series-link,
.job-link {
    color: var(--color-brand);
    text-decoration: none;
    font-weight: 500;
}

.party-link:hover,
.account-link:hover,
.category-link:hover,
.series-link:hover,
.job-link:hover {
    text-decoration: underline;
}

/* Description Text in Lists */
.party-description,
.account-description,
.category-description,
.series-description {
    color: var(--color-gray-600);
    font-size: 0.9em;
}

/* ============================================
   SERIES ROLES
   ============================================ */

.role-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--color-gray-50);
    border-radius: 6px;
    border-left: 4px solid var(--color-brand);
}

.role-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.role-name-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    background-color: #e3f2fd;
    color: #1565c0;
    font-size: 0.85em;
    font-weight: 600;
}

/* Override for member name in series roles (not a badge) */
.role-info .role-member {
    font-weight: 500;
    color: var(--color-gray-800);
    background: none;
    padding: 0;
    border-radius: 0;
}

.role-notes {
    font-size: 0.85em;
    color: var(--color-gray-600);
    font-style: italic;
}

.roles-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.btn-icon {
    padding: 6px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    color: var(--color-gray-600);
}

.btn-icon:hover {
    background-color: #e0e0e0;
}

.btn-icon svg {
    stroke: currentColor;
}

.btn-edit-role:hover {
    background-color: #e3f2fd;
    color: #1565c0;
}

.btn-delete:hover {
    background-color: #ffebee;
    color: #c62828;
}

.no-roles, .no-events {
    color: var(--color-gray-600);
    font-style: italic;
    margin: 0;
}

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

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 10px;
    }

    .logo-img {
        height: 50px;
    }

    .navbar h2 {
        font-size: 18px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input,
    .search-select {
        width: 100%;
        min-width: auto;
    }

    .btn-search {
        width: 100%;
    }

    table {
        width: 95%;
    }

    .form-container {
        margin: 10px;
        padding: 20px;
    }

    .nav-menu {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .nav-menu a {
        display: block;
        text-align: center;
    }

    th, td {
        padding: 8px;
        font-size: 14px;
    }

    .member-photo,
    .member-photo-placeholder {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .birthday-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .birthday-container input[type="date"] {
        width: 100%;
    }

    /* Mobile cards - show on mobile */
    .desktop-table,
    .admin-filters-desktop,
    .desktop-only {
        display: none;
    }
    
    .admin-filters-mobile {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-cards {
        display: block;
        padding: 0 10px;
    }

    /* Collapsible mobile cards */
    .collapsed .card-body { display: none; }
    .collapsed .card-toggle { transform: rotate(-90deg); }
    .card-toggle { transition: transform 0.2s; color: var(--color-gray-400); }
    .card-actions { margin-top: var(--space-3); }

    /* Mobile card drag-and-drop */
    .category-card.dragging { opacity: 0.5; background: #dbeafe; }
    .category-card.drag-over { border-top: 3px solid var(--color-brand); }

    h1 {
        font-size: 24px;
    }

    .total {
        font-size: 16px;
    }

    .search-container {
        margin: 10px;
        padding: 15px;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-top: 5px;
    }

    /* Form rows stack on mobile */
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    /* Info grid single column on mobile */
    .info-grid {
        grid-template-columns: 1fr;
    }

    /* Page header stacks on mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 1.5em;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /* Role items stack on mobile */
    .role-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ==========================================================================
   Grid.js Styles - IHM Blue Theme (standalone, no mermaid theme)
   ========================================================================== */

/* Container */
.gridjs-container {
    width: 100%;
    padding: 0;
    overflow: hidden;
    margin: 0;
}

/* Grid.js UMD does NOT inject its own stylesheet — mermaid.css is never loaded.
   All Grid.js visual styling comes from these rules alone. The only !important
   is on width: auto to override inline styles set by autoWidth calculations. */
.gridjs-wrapper {
    border: none;
    border-radius: var(--radius-xl);
    overflow: auto;
    padding: 0;
    margin: 0;
    box-shadow: var(--shadow-sm);
}

.gridjs-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    display: table;
    padding: 0;
    margin: 0;
}

/* Override autoWidth inline styles (JS sets style.width on elements) */
th.gridjs-th,
td.gridjs-td {
    width: auto !important;
}

.gridjs-body {
    padding: 0;
    margin: 0;
}

.gridjs-thead {
    background-color: var(--color-gray-50);
}

th.gridjs-th {
    background-color: var(--color-gray-50);
    color: var(--color-gray-600);
    padding: var(--space-3) 15px;
    font-weight: var(--weight-semibold);
    font-size: var(--font-sm);
    white-space: nowrap;
    text-align: center;
    border: none;
    border-bottom: 1px solid var(--color-gray-200);
    cursor: pointer;
    user-select: none;
}

.gridjs-th:hover {
    background-color: var(--color-gray-100);
}

.gridjs-th-content {
    display: inline-block;
}

.gridjs-th-sort {
    position: relative;
}

.gridjs-th-sort .gridjs-sort {
    display: none;
}

.gridjs-tbody {
    background-color: var(--color-white);
}

.gridjs-tr {
    border-bottom: 1px solid var(--color-gray-100);
}

.gridjs-tr:nth-child(even) {
    background-color: var(--color-gray-100);
}

.gridjs-tr:hover {
    background-color: #e8f0fe;
}

td.gridjs-td {
    padding: 10px 15px;
    vertical-align: middle;
    text-align: center;
    border: none;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Head section - search and pagination row */
.gridjs-head {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.gridjs-head::after {
    display: none;
}

/* Pagination in header - summary left, pages right */
.gridjs-head .gridjs-pagination {
    display: contents;
}

.gridjs-summary {
    font-size: var(--font-md);
    color: var(--color-brand);
    font-weight: var(--weight-semibold);
    order: 1;
    white-space: nowrap;
}

/* Search - centered */
.gridjs-search {
    order: 2;
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.gridjs-search-input {
    width: 300px;
    padding: var(--space-3) 15px;
    border: 1px solid var(--color-gray-350);
    border-radius: var(--radius-md);
    font-size: var(--font-md);
    font-family: inherit;
}

.gridjs-search-input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px var(--color-brand-subtle);
}

/* Page buttons - right */
.gridjs-pages {
    order: 3;
    display: flex;
    gap: 3px;
}

/* Person cell pattern — name with small gray contact info below */
.person-cell a {
    color: var(--color-brand);
    text-decoration: none;
    font-weight: var(--weight-medium);
}
.person-cell a:hover {
    text-decoration: underline;
}
.person-contact {
    font-size: 0.78em;
    color: #9ca3af;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Footer - hidden via JS after pagination moves to header */
.gridjs-footer {
    margin-top: 15px;
    padding: 0;
    background: transparent;
    border: none;
}

/* Pagination fallback styling */
.gridjs-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-brand);
    border: none;
    padding: 0;
    background: transparent;
}

.gridjs-pages {
    display: flex;
    gap: 3px;
}

.gridjs-pages button {
    padding: var(--space-2) 14px;
    margin: 0 2px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-gray-300);
    color: var(--color-brand);
    font-weight: var(--weight-medium);
    background: var(--color-white);
    cursor: pointer;
}

.gridjs-pages button:hover:not(:disabled) {
    background: var(--color-gray-200);
    border-color: var(--color-brand);
}

.gridjs-pages button:disabled {
    color: var(--color-gray-500);
    cursor: default;
}

.gridjs-pages button.gridjs-currentPage {
    background: var(--color-brand);
    color: var(--color-white);
    border-color: var(--color-brand);
}

.gridjs-pages button.gridjs-currentPage:hover {
    background: var(--color-brand-dark);
}

/* Loading and empty states */
.gridjs-loading {
    text-align: center;
    padding: var(--space-5);
    color: var(--color-gray-600);
}

.gridjs-notfound {
    text-align: center;
    padding: var(--space-5);
    color: var(--color-gray-600);
}

/* Link styles within Grid.js */
.gridjs-td a {
    color: var(--color-brand);
    text-decoration: none;
    font-weight: var(--weight-medium);
}

.gridjs-td a:hover {
    text-decoration: underline;
}

/* Grid.js responsive - hide on mobile */
@media (max-width: 768px) {
    .gridjs-container {
        display: none !important;
    }
}

/* Note type badges */
.badge-secondary {
    background: var(--color-gray-700);
    color: var(--color-white);
}

.badge-primary {
    background: var(--color-brand);
    color: var(--color-white);
}

.badge-success {
    background: var(--color-success);
    color: var(--color-white);
}

.badge-info {
    background: var(--color-info);
    color: var(--color-white);
}

.badge-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.badge-warning {
    background: var(--color-warning);
    color: #212529;
}

/* VIRTUS card header with badge */
.virtus-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.virtus-header-row .card-title {
    margin-bottom: 0;
}

.virtus-header-row .badge {
    flex-shrink: 0;
}

.cert-header-icon {
    color: var(--color-brand);
    display: flex;
    align-items: center;
    margin-left: 4px;
}

.cert-header-icon:hover {
    color: var(--color-brand-dark);
}

/* VIRTUS grid layout */
.virtus-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.virtus-row {
    display: flex;
    gap: 20px;
}

.virtus-row .info-item {
    flex: 1;
}

/* Share VIRTUS checkbox option */
.share-virtus-option {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.share-virtus-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
    color: #4b5563;
}

.share-virtus-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* VIRTUS edit layout */
.virtus-edit-layout {
    display: flex;
    gap: 20px;
}

.virtus-cert-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    min-width: 80px;
}

.cert-wrapper {
    width: 60px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-file-icon {
    cursor: default;
}

.cert-file-icon.has-file svg {
    stroke: var(--color-brand);
}

.cert-file-icon.new-file svg {
    stroke: var(--color-success);
}

.cert-file-icon.no-file svg {
    stroke: #ccc;
}

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

.cert-actions .delete-action {
    color: var(--color-danger);
}

.cert-actions .delete-action:hover {
    color: var(--color-danger-dark);
}

.virtus-fields-section {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
    max-width: 100%;
}

.virtus-fields-section input {
    max-width: 100%;
    box-sizing: border-box;
}

/* Date input with clear button */
.date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input-wrapper input[type="date"] {
    flex: 1;
    min-width: 0;
}

.date-clear-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    font-size: 1.1em;
    line-height: 1;
    opacity: 0.7;
}

.date-clear-btn:hover {
    color: var(--color-danger);
    opacity: 1;
}

.form-row.two-col {
    display: flex;
    gap: 15px;
}

.form-row.two-col .form-group {
    flex: 1;
}

.readonly-field {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

/* Responsive VIRTUS edit */
@media (max-width: 600px) {
    .virtus-edit-layout {
        flex-direction: column;
    }

    .virtus-cert-section {
        flex-direction: row;
        justify-content: center;
    }

    .form-row.two-col {
        flex-direction: column;
        gap: 0;
    }
}

/* Notes table preview column */
.note-preview {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Member photo placeholder for list view */
.member-photo-placeholder-sm {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-weight: bold;
    font-size: 20px;
    border: 2px solid var(--color-brand-dark);
    margin: 0 auto;
}

.page-title {
    color: var(--color-brand);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-title svg {
    vertical-align: middle;
}

/* Page Description Box */
.page-description {
    background: #e8f4fc;
    border: 1px solid var(--color-brand);
    border-radius: 6px;
    padding: 12px 15px;
    margin: 0 15px 20px 15px;
    color: var(--color-brand);
    font-weight: 500;
}

.page-description svg {
    vertical-align: middle;
    margin-right: 8px;
}

/* Admin filters - left justified */
.admin-filters-left {
    display: flex;
    gap: 15px;
    align-items: center;
    margin: 0 15px 15px 15px;
    flex-wrap: wrap;
}

.admin-filters-left label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-brand);
    font-weight: 600;
}

/* ============================================
   Similar Members Sidebar & Mobile Card
   ============================================ */

/* Page wrapper for flex layout */
.profile-page-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.profile-main-content {
    flex: 1;
    min-width: 0;
}

/* Profile container - constrains form width */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Sidebar Area - 2-column grid for all sidebar cards */
.sidebar-area {
    width: 620px;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-content: start;
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* Sidebar Container - stacks cards vertically within a grid cell */
.sidebar-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    height: fit-content;
}

/* Sidebar drag-and-drop */
.sidebar-drag-handle {
    cursor: grab;
    font-size: 16px;
    color: #bbb;
    padding: 0 6px 0 0;
    user-select: none;
    transition: color 0.2s;
    line-height: 1;
}

.sidebar-drag-handle:hover {
    color: var(--color-gray-600);
}

.sidebar-drag-handle:active {
    cursor: grabbing;
}

.similar-members-sidebar.dragging {
    opacity: 0.4;
    border: 2px dashed #4a90d9;
}

.similar-members-sidebar.drag-over {
    border-top: 3px solid #4a90d9;
}

.sidebar-drop-zone {
    min-height: 60px;
    transition: border-color 0.2s, background-color 0.2s;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 2px;
}

.sidebar-drop-zone.drop-zone-active {
    border-color: #4a90d9;
    background-color: rgba(74, 144, 217, 0.04);
}

/* Desktop Sidebar */
.similar-members-sidebar {
    width: 100%;
    min-width: 0;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    height: fit-content;
    margin-bottom: 0 !important;
    overflow: hidden;
}

.similar-members-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-gray-200);
    background: var(--color-gray-50);
    border-radius: 8px 8px 0 0;
}

.similar-members-sidebar:not(.expanded) .similar-members-header {
    border-radius: 8px;
    border-bottom: none;
}

.similar-members-header h3 {
    margin: 0;
    font-size: 1em;
    color: var(--color-brand);
    display: flex;
    align-items: center;
}

.similar-members-toggle {
    color: var(--color-gray-600);
    font-size: 0.8em;
}

.similar-members-content {
    max-height: 600px;
    overflow-y: auto;
}

.similar-members-count {
    padding: 10px 15px;
    font-size: 0.85em;
    color: var(--color-gray-600);
    border-bottom: 1px solid var(--color-gray-200);
    background: #fafafa;
}

.similar-member-card {
    display: flex;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--color-gray-200);
}

.similar-member-card:last-child {
    border-bottom: none;
}

.similar-member-photo-link {
    flex-shrink: 0;
}

.similar-member-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-gray-300);
}

.similar-member-initial {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--color-brand);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1em;
}

.similar-member-info {
    flex: 1;
    min-width: 0;
}

.similar-member-name {
    display: block;
    font-weight: 600;
    color: var(--color-brand);
    text-decoration: none;
    margin-bottom: 4px;
}

.similar-member-name:hover {
    text-decoration: underline;
}

.similar-member-message {
    margin: 0;
    font-size: 0.85em;
    color: #555;
    line-height: 1.4;
}

/* Empty state */
.similar-members-empty {
    padding: 20px 15px;
    text-align: center;
}

.similar-members-empty p {
    margin: 0 0 8px 0;
    color: #555;
}

.similar-members-empty p.muted {
    font-size: 0.85em;
    color: #888;
}

/* Mobile Card - Hidden on desktop */
.similar-members-mobile {
    display: none;
}

/* Medium screens - single column sidebar */
@media (max-width: 1400px) {
    .sidebar-area {
        width: 300px;
        grid-template-columns: 1fr;
    }
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .profile-page-wrapper {
        flex-direction: column;
    }
    
    .sidebar-area {
        display: none;
    }

    .sidebar-container {
        display: none;
    }

    .similar-members-sidebar {
        display: none;
    }
    
    .similar-members-mobile {
        display: block;
        background: var(--color-white);
        border: 1px solid var(--color-gray-300);
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    .similar-members-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        cursor: pointer;
        background: var(--color-gray-50);
        border-radius: 8px;
    }
    
    .similar-members-header-mobile h3 {
        margin: 0;
        font-size: 1em;
        color: var(--color-brand);
        display: flex;
        align-items: center;
    }
    
    .similar-members-toggle-mobile {
        color: var(--color-gray-600);
        font-size: 0.8em;
    }
    
    .similar-members-content-mobile {
        border-top: 1px solid var(--color-gray-200);
    }
    
    .similar-member-card-mobile {
        display: flex;
        gap: 12px;
        padding: 12px 15px;
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .similar-member-card-mobile:last-child {
        border-bottom: none;
    }
}

/* Badge styles for admin pages */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75em;
    font-weight: 500;
    border-radius: 4px;
}

.badge-exact {
    background-color: #d4edda;
    color: #155724;
}

.badge-keyword_exact {
    background-color: #cce5ff;
    color: #004085;
}

.badge-keyword_fuzzy {
    background-color: #fff3cd;
    color: #856404;
}

.badge-location {
    background-color: #e2d4f0;
    color: #4a235a;
}

.btn-view-roster {
    display: flex;
    align-items: center;
    background-color: #20c997;
    color: var(--color-white);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-view-roster:hover {
    background-color: #17a689;
    color: var(--color-white);
    text-decoration: none;
}

.btn-share-roster {
    display: flex;
    align-items: center;
    background-color: #6f42c1;
    color: var(--color-white);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-share-roster:hover {
    background-color: #5a32a3;
}

.btn-volunteer-signup {
    display: flex;
    align-items: center;
    background-color: #e67e22;
    color: var(--color-white);
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-volunteer-signup:hover {
    background-color: #d35400;
    color: var(--color-white);
    text-decoration: none;
}

.btn-share-signup {
    display: flex;
    align-items: center;
    background-color: #2ecc71;
    color: var(--color-white);
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-share-signup:hover {
    background-color: #27ae60;
}

.btn-student-signup {
    display: flex;
    align-items: center;
    background-color: #f59e0b;
    color: var(--color-white);
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-student-signup:hover {
    background-color: #d97706;
    color: var(--color-white);
    text-decoration: none;
}

.btn-share-student-signup {
    display: flex;
    align-items: center;
    background-color: #8b5cf6;
    color: var(--color-white);
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-share-student-signup:hover {
    background-color: #7c3aed;
}

.section-header {
    font-size: 1.2em;
    color: var(--color-gray-800);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1a5f7a;
}

code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.inactive-row {
    opacity: 0.6;
}

.no-data {
    color: var(--color-gray-600);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.form-help {
    display: block;
    font-size: 0.85em;
    color: var(--color-gray-600);
    margin-top: 4px;
}

/* ============================================
   Inline Edit Sections
   ============================================ */

.inline-edit-section {
    position: relative;
}

/* For details-card with inline edit */
.details-card.inline-edit-section {
    position: relative;
}

.details-card.inline-edit-section .edit-icon-btn {
    top: 12px;
    right: 12px;
}

/* For info-group sections (name, contact, address) */
.info-group.inline-edit-section {
    position: relative;
}

.info-group.inline-edit-section .edit-icon-btn {
    top: 0;
    right: 0;
}

/* Contact section - single edit button for entire section */
.contact-section.inline-edit-section {
    position: relative;
}

.contact-section.inline-edit-section > .edit-icon-btn {
    top: 0;
    right: 0;
}

.section-header-inline {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.section-title-inline {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-icon-btn {
    position: absolute;
    top: -10px;
    right: -5px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    padding: 6px;
    cursor: pointer;
    color: #888;
    border-radius: 50%;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 10;
}

.edit-icon-btn:hover {
    background: #f0f0f0;
    color: var(--color-brand);
    border-color: var(--color-brand);
}

.edit-icon-btn.active {
    background: var(--color-brand);
    color: var(--color-white);
    border-color: var(--color-brand);
}

.inline-read-view {
    /* Matches existing info-item styling */
}

.inline-edit-view {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--color-gray-400);
}

.inline-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* Mobile adjustments for inline edit */
@media (max-width: 768px) {
    .edit-icon-btn {
        padding: 8px;
        top: -8px;
        right: -3px;
    }
    
    .details-card.inline-edit-section .edit-icon-btn {
        top: 10px;
        right: 10px;
    }
    
    .inline-edit-actions {
        flex-direction: row;
    }
    
    .inline-edit-actions .btn {
        flex: 1;
    }
}

/* Similar Members Search Card */
.similar-members-sidebar.search-card {
    /* Spacing handled by sidebar-container gap */
}

.similar-members-mobile.search-card {
    margin-top: 10px;
}

.similar-search-form {
    display: flex;
    gap: 8px;
    padding: 15px;
}

.similar-search-input {
    flex: 1;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-family: Arial, sans-serif !important;
    background-color: white !important;
    box-sizing: border-box;
    height: auto !important;
}

.similar-search-input:focus {
    outline: none;
    border-color: var(--color-brand) !important;
    box-shadow: 0 0 5px var(--color-brand-focus) !important;
}

.similar-search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0 15px 15px 15px;
}

.similar-search-results:empty {
    padding: 0;
}

.similar-search-message {
    color: var(--color-gray-600);
    font-size: 0.9em;
    padding: 10px 0;
    text-align: center;
    margin: 0;
}

.similar-search-count {
    color: var(--color-gray-600);
    font-size: 0.85em;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--color-gray-200);
}

/* Volunteer Assignments Styles */
.volunteer-assignments-card {
    margin-top: 0;
}

.volunteer-section {
    padding: 10px 15px;
}

.volunteer-section:first-child {
    padding-top: 15px;
}

.volunteer-section-title {
    margin: 0 0 10px 0;
    font-size: 0.85em;
    color: var(--color-gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.volunteer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.volunteer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.volunteer-item:hover {
    background-color: #f0f7ff;
}

.volunteer-item.upcoming {
    background: #f8fff9;
    border-left: 3px solid var(--color-success);
}

.volunteer-item.past {
    background: var(--color-gray-50);
    border-left: 3px solid var(--color-gray-700);
    opacity: 0.8;
}

.volunteer-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
}

.volunteer-date {
    min-width: 50px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-brand);
    white-space: nowrap;
}

.volunteer-item.past .volunteer-date {
    color: var(--color-gray-700);
}

.volunteer-details {
    flex: 1;
    min-width: 0;
}

.volunteer-event-name {
    font-size: 0.9em;
    color: var(--color-gray-800);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.volunteer-job {
    font-size: 0.8em;
    color: var(--color-gray-600);
    margin-top: 2px;
}

.volunteer-calendar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--color-brand);
    background: transparent;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.volunteer-calendar-btn:hover {
    background: #e3f2fd;
    color: #1565c0;
}

.volunteer-item.past .volunteer-calendar-btn {
    color: var(--color-gray-700);
}

.volunteer-item.past .volunteer-calendar-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.volunteer-signup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--color-success);
    background: transparent;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.volunteer-signup-btn:hover {
    background: #d4edda;
    color: #155724;
}

.volunteer-roster-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #e8f4fc;
    color: var(--color-brand);
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
}

.volunteer-roster-btn:hover {
    background: var(--color-brand);
    color: var(--color-white);
}

/* Admin sidebar: single stacked column spanning full width */
.admin-sidebar-stacked {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .volunteer-item {
        padding: 8px;
    }

    .volunteer-date {
        min-width: 45px;
        font-size: 0.8em;
    }

    .volunteer-event-name {
        font-size: 0.85em;
    }
}

/* Common interests icon wrapper */
.common-interests-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Floating card tooltip - appears below icon */
.common-interests-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #e8f4fc;
    color: var(--color-brand);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    white-space: normal;
    width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #d0e3f0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 9999;
    pointer-events: none;
    line-height: 1.4;
}

/* Tooltip pointer - points up */
.common-interests-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 12px;
    border: 8px solid transparent;
    border-bottom-color: #e8f4fc;
}

/* Show tooltip on hover */
.common-interests-icon:hover .common-interests-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Member notes icon */
.member-notes-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Notes tooltip */
.member-notes-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #e8f4fc;
    color: var(--color-brand);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    white-space: normal;
    width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #d0e3f0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 9999;
    pointer-events: none;
    line-height: 1.4;
}

.member-notes-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 12px;
    border: 8px solid transparent;
    border-bottom-color: #e8f4fc;
}

.member-notes-icon:hover .member-notes-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Member Reminder Tooltip */
.member-reminder-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #fff9e6;
    color: #856404;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    white-space: normal;
    width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--color-warning);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 9999;
    pointer-events: none;
    line-height: 1.4;
}

.member-reminder-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 12px;
    border: 8px solid transparent;
    border-bottom-color: #fff9e6;
}

.reminder-indicator:hover .member-reminder-tooltip {
    opacity: 1;
    visibility: visible;
}

.reminder-tooltip-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #856404;
}

.reminder-tooltip-item {
    padding: 4px 0;
    border-bottom: 1px solid #ffe69c;
    word-wrap: break-word;
}

.reminder-tooltip-item:last-child {
    border-bottom: none;
}

.reminder-tooltip-more {
    padding-top: 6px;
    font-style: italic;
    font-size: 12px;
}

/* Note item styling */
.note-item {
    padding: 8px 0;
    border-bottom: 1px solid #d0e3f0;
}

.note-item:last-child {
    border-bottom: none;
}

.note-title {
    font-weight: 600;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.note-preview {
    font-size: 12px;
    color: #4a7ba7;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.note-date {
    font-size: 11px;
    color: #6b9bc3;
}

.note-more {
    padding-top: 8px;
    font-size: 12px;
    font-style: italic;
    color: #4a7ba7;
}

/* Mobile card icons row tooltip adjustments */
.card-icons-row .common-interests-tooltip,
.card-icons-row .member-notes-tooltip {
    left: 0;
    right: auto;
    top: calc(100% + 10px);
    bottom: auto;
}

.card-icons-row .common-interests-tooltip::after,
.card-icons-row .member-notes-tooltip::after {
    left: 12px;
    right: auto;
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #e8f4fc;
}

/* Mobile tooltip widths */
@media screen and (max-width: 768px) {
    .common-interests-tooltip {
        width: 200px;
    }
    
    .member-notes-tooltip {
        width: 200px;
    }
}

/* My Notes section on profile */
.my-notes-list {
    max-height: 400px;
    overflow-y: auto;
}

.my-note-item {
    display: block;
    padding: 12px;
    border-bottom: 1px solid var(--color-gray-200);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.my-note-item:hover {
    background-color: #f5f9fc;
}

.my-note-item:last-child {
    border-bottom: none;
}

.my-note-title {
    font-weight: 600;
    color: var(--color-brand);
    margin-bottom: 4px;
}

.my-note-preview {
    font-size: 0.85em;
    color: var(--color-gray-600);
    margin-bottom: 6px;
    line-height: 1.4;
}

.my-note-meta {
    font-size: 0.75em;
    color: var(--color-gray-500);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.my-note-link {
    color: var(--color-brand);
}

/* Sidebar card left-border accent colors */
.similar-members-sidebar[data-card-id="common_interests"] {
    border-left: 3px solid var(--color-brand);
}

.similar-members-sidebar[data-card-id="search_members"] {
    border-left: 3px solid #00897b;
}

.similar-members-sidebar[data-card-id="my_notes"] {
    border-left: 3px solid #f9a825;
}

.similar-members-sidebar[data-card-id="upcoming_volunteering"] {
    border-left: 3px solid var(--color-success);
}

.similar-members-sidebar[data-card-id="past_volunteering"] {
    border-left: 3px solid var(--color-gray-700);
}

.similar-members-sidebar[data-card-id="email_engagement"] {
    border-left: 3px solid #e65100;
}

.similar-members-sidebar[data-card-id="email_history"] {
    border-left: 3px solid #4a90d9;
}

/* Family member styles */
.my-family-card {
    border-left: 3px solid #5c6bc0;
}

.family-list {
    max-height: 400px;
    overflow-y: auto;
}

.family-item {
    display: block;
    padding: 12px;
    border-bottom: 1px solid var(--color-gray-200);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.family-item:hover {
    background-color: #f5f9fc;
}

.family-item:last-child {
    border-bottom: none;
}

.family-name {
    font-weight: 600;
    color: var(--color-brand);
    margin-bottom: 4px;
}

.family-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.family-relationship {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e8eaf6;
    color: #5c6bc0;
    font-size: 0.75em;
    font-weight: 500;
    border-radius: 12px;
}

.family-youth-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e8f5e9;
    color: #388e3c;
    font-size: 0.7em;
    font-weight: 600;
    border-radius: 12px;
}

.family-contact {
    font-size: 0.8em;
    color: var(--color-gray-600);
}

/* Resources sidebar styles */
.resources-list {
    max-height: 300px;
    overflow-y: auto;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-gray-200);
    text-decoration: none;
    color: var(--color-brand);
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.resource-item:hover {
    background-color: #f5f9fc;
}

.resource-item:last-child {
    border-bottom: none;
}

.resource-item svg {
    flex-shrink: 0;
    color: #6b7280;
}

.resource-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.view-all-link {
    display: block;
    text-align: center;
    padding: 10px;
    color: var(--color-brand);
    text-decoration: none;
    font-size: 0.85em;
    border-top: 1px solid var(--color-gray-200);
}

.view-all-link:hover {
    background-color: #f5f9fc;
    text-decoration: underline;
}

/* Reminder styles */
.reminder-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--color-warning);
    color: #000;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.reminder-due-item {
    background-color: #fffcf0 !important;
    border-left: 3px solid var(--color-warning);
}

.reminder-due-item:hover {
    background-color: #fff9e6 !important;
}

/* Header icon buttons */
.header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e8f4fc;
    color: var(--color-brand);
    transition: background-color 0.2s, transform 0.2s;
}

.header-icon-btn:hover {
    background-color: var(--color-brand);
    color: var(--color-white);
    transform: scale(1.1);
}

.header-icon-btn svg {
    stroke: currentColor;
}

/* Reminder Bell Badge */
.reminder-bell-container {
    position: relative;
    display: inline-block;
}

.reminder-bell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--color-warning);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: bellPulse 2s infinite;
}

.reminder-bell-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.5);
}

.reminder-bell-btn svg {
    stroke: #000;
}

.reminder-bell-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-danger);
    color: var(--color-white);
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

@keyframes bellPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 193, 7, 0); }
}


.reminder-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 350px;
    z-index: 1000;
    overflow: hidden;
}

@media (max-width: 768px) {
    .reminder-dropdown {
        left: auto;
        right: 0;
        min-width: 280px;
        max-width: calc(100vw - 30px);
    }
    
    .reminder-bell-container {
        position: absolute;
        right: 15px;
    }
}

.reminder-dropdown.show {
    display: block;
}

.reminder-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-200);
}

.reminder-dropdown-header strong {
    color: var(--color-gray-800);
}

.reminder-dropdown-header a {
    font-size: 0.85em;
    color: var(--color-brand);
}

.reminder-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
}

.reminder-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    gap: 10px;
}

.reminder-dropdown-item:hover {
    background-color: #fff9e6;
}

.reminder-dropdown-item:last-child {
    border-bottom: none;
}

.reminder-item-link {
    flex: 1;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.reminder-item-link:hover {
    text-decoration: none;
}

.reminder-item-title {
    font-weight: 500;
    color: var(--color-gray-800);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-item-preview {
    font-size: 0.85em;
    color: var(--color-gray-600);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Reminder action buttons (dismiss/snooze) */
.reminder-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.reminder-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

.reminder-action-btn.snooze-btn {
    background-color: #e8f4fc;
    color: var(--color-brand);
}

.reminder-action-btn.snooze-btn:hover {
    background-color: #d0e8f7;
    transform: scale(1.05);
}

.reminder-action-btn.dismiss-btn {
    background-color: #f8e8e8;
    color: #c44;
}

.reminder-action-btn.dismiss-btn:hover {
    background-color: #f0d0d0;
    transform: scale(1.05);
}

/* Snooze dropdown menu */
.snooze-dropdown {
    position: relative;
}

.snooze-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    min-width: 120px;
    margin-top: 4px;
}

.snooze-menu.show {
    display: block;
}

.snooze-menu button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--color-gray-800);
    transition: background-color 0.2s;
}

.snooze-menu button:first-child {
    border-radius: 6px 6px 0 0;
}

.snooze-menu button:last-child {
    border-radius: 0 0 6px 6px;
}

.snooze-menu button:hover {
    background-color: var(--color-gray-100);
}

/* Snooze Modal */
.snooze-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.snooze-modal-content {
    background: var(--color-white);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.snooze-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-gray-200);
}

.snooze-modal-header h3 {
    margin: 0;
    color: var(--color-gray-800);
    font-size: 1.1em;
}

.snooze-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.snooze-modal-close:hover {
    color: var(--color-gray-800);
}

.snooze-modal-body {
    padding: 20px;
}

.snooze-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.snooze-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.snooze-option:hover {
    border-color: var(--color-brand);
    background: #f8fbfd;
}

.snooze-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.snooze-option input[type="radio"]:checked + span {
    color: var(--color-brand);
    font-weight: 500;
}

.snooze-custom-date {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--color-gray-200);
}

.snooze-custom-date input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 1rem;
}

.snooze-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--color-gray-200);
}

/* Reminder Bell Icon (inline in headers) */
.reminder-bell-icon {
    animation: pulse 2s infinite;
    fill: var(--color-warning);
    stroke: var(--color-warning);
}

/* ── Profile Hero Card ─────────────────────────────────── */
.profile-hero-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-6);
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
}

.profile-hero-photo-area {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}



.profile-hero-photo-area .photo-wrapper {
    width: 240px;
    height: 240px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 3px solid var(--color-brand-light);
    box-shadow: var(--shadow-sm);
}

.profile-hero-photo-area .photo-wrapper > div {
    width: 100%;
    height: 100%;
}

.profile-hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.profile-hero-photo-area .photo-wrapper:hover .profile-hero-photo {
    transform: scale(1.05);
}

.profile-hero-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-3xl);
    font-weight: var(--weight-bold);
    color: var(--color-white);
    letter-spacing: 1px;
    user-select: none;
}

.profile-hero-photo-area .photo-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-1);
}

.profile-hero-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-self: stretch;
}

.profile-hero-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.profile-hero-name-row h1 {
    margin: 0;
    font-size: var(--font-2xl);
    font-weight: var(--weight-bold);
    color: var(--color-gray-800);
    line-height: var(--leading-tight);
}

.profile-hero-badges {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.profile-hero-badges .status-badge {
    font-size: var(--font-xs);
}

.status-badge-role-admin {
    background-color: var(--color-brand-light);
    color: var(--color-brand);
}

.status-badge-role-super-admin {
    background-color: #f3e5f5;
    color: var(--color-purple);
}

.status-badge-role-member {
    background-color: var(--color-gray-100);
    color: var(--color-gray-600);
}

.profile-hero-meta {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.profile-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--font-sm);
    color: var(--color-gray-600);
}

.profile-hero-meta-item svg {
    flex-shrink: 0;
    stroke: var(--color-gray-500);
}

.profile-hero-contact {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-gray-200);
}

.profile-hero-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    color: var(--color-gray-700);
}

a.profile-hero-contact-link {
    text-decoration: none;
    color: var(--color-gray-700);
    transition: color 0.2s;
}

a.profile-hero-contact-link:hover {
    color: var(--color-brand);
}

a.profile-hero-contact-link:hover svg {
    stroke: var(--color-brand);
}

.profile-hero-contact-item svg {
    flex-shrink: 0;
    stroke: var(--color-gray-500);
    transition: stroke 0.2s;
}

.profile-hero-status-note {
    font-size: var(--font-sm);
    color: var(--color-gray-700);
}

.profile-hero-actions {
    display: flex;
    gap: var(--space-1);
    margin-left: auto;
}

.profile-hero-actions .edit-icon-btn,
.profile-hero-actions .contact-icon-btn {
    position: static;
}

/* VIRTUS icon in badges row */
.profile-hero-badges .virtus-icon {
    margin-left: auto;
}

.profile-hero-info > .inline-read-view {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.profile-hero-social {
    display: flex;
    gap: var(--space-3);
    margin-top: auto;
    margin-bottom: var(--space-6);
}

.profile-hero-social .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.profile-hero-social .social-link:hover {
    transform: scale(1.15);
}

.profile-hero-social .social-link.linkedin {
    color: #0077b5;
}

.profile-hero-social .social-link.facebook {
    color: #1877f2;
}

.profile-hero-social .social-link.instagram {
    color: #e4405f;
}

/* Hero card responsive */
@media (max-width: 768px) {
    .profile-hero-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: var(--space-5);
    }

    .profile-hero-name-row {
        justify-content: center;
    }

    .profile-hero-badges {
        justify-content: center;
    }

    .profile-hero-meta {
        justify-content: center;
    }

    .profile-hero-social {
        justify-content: center;
    }

    .profile-hero-contact {
        justify-content: center;
    }

    .profile-hero-status-note {
        text-align: center;
    }

    .profile-hero-photo-area .photo-wrapper {
        width: 200px;
        height: 200px;
    }

    .profile-hero-name-row h1 {
        font-size: var(--font-xl);
    }

    .profile-hero-actions {
        margin-left: 0;
    }
}

/* Education Cards */
.education-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.education-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-gray-200);
}

.education-card-logo {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.education-card-logo img {
    border-radius: 4px;
}

.company-favicon {
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 3px;
}

.education-card-logo-fallback {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
    border-radius: 4px;
}

.education-card-info {
    flex: 1;
    min-width: 0;
}

.education-card-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-500);
    margin-bottom: 2px;
}

.education-card-school {
    font-weight: 600;
    color: var(--color-gray-800);
    font-size: 0.95em;
}

.education-card-degree {
    color: var(--color-gray-600);
    font-size: 0.88em;
    margin-top: 1px;
}

/* University Select — clear button positioning */
.ts-wrapper.university-select .clear-button { cursor: pointer; }

.university-option {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.university-option-favicon {
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

.university-option-loc {
    font-size: 0.85em;
    margin-left: 6px;
    color: var(--color-gray-500);
}

.university-select-no-results {
    padding: 8px 12px;
    color: var(--color-gray-500);
}

.edit-member-page .ai-insight-item.ai-insight-dismissing {
    opacity: 0;
    transition: opacity 0.3s;
}

/* Modern Icon Buttons for Actions */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

a.icon-btn.edit-icon-btn,
.icon-btn.edit-icon-btn {
    position: static;
    color: var(--color-brand);
    text-decoration: none;
    background: none;
    border: none;
    box-shadow: none;
}

a.icon-btn.edit-icon-btn:hover,
.icon-btn.edit-icon-btn:hover {
    background-color: #e8f4fc;
    color: var(--color-brand);
}

.icon-btn.delete-icon-btn {
    color: var(--color-danger);
}

.icon-btn.delete-icon-btn:hover {
    background-color: #ffeef0;
    transform: scale(1.1);
}


/* Pulse Animation for Reminder Indicators */
.reminder-indicator {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Events list table layout */
#eventsGrid .gridjs-table td:first-child {
    white-space: nowrap;
}

/* Sub-text for secondary info (time under date, room under location) */
.sub-text {
    font-size: 0.8em;
    color: var(--color-gray-600);
}

/* App Footer */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--color-gray-50);
    border-top: 1px solid #e9ecef;
    font-size: 0.8em;
    color: var(--color-gray-700);
    margin-top: auto;
}

.app-footer .version {
    font-family: monospace;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Generic Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.is-hidden {
    display: none;
}

.modal-content {
    background: var(--color-white);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin: 0 0 16px 0;
    color: var(--color-gray-800);
    font-size: 1.2em;
}

.modal-content p {
    margin: 0 0 20px 0;
    color: #555;
    line-height: 1.5;
}

.modal-content.consent-modal {
    max-width: 550px;
}

.modal-content.consent-modal p {
    font-size: 0.95em;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Assignments Table (within cards) */
.assignments-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.9em;
}

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

.assignments-table th {
    background: var(--color-gray-50);
    font-weight: 600;
    color: #495057;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.assignments-table tbody tr:hover {
    background: var(--color-gray-50);
}

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

.assignments-table a {
    color: var(--primary-color);
    text-decoration: none;
}

.assignments-table a:hover {
    text-decoration: underline;
}

/* ============================================
   Event Page Layout (Modern Sidebar Style)
   ============================================ */

/* Page wrapper for flex layout */
.event-page-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.event-main-content {
    flex: 1;
    min-width: 0;
}

/* Event container - constrains form width */
.event-container {
    max-width: 800px;
    margin: 0;
}

/* Desktop Sidebar */
.event-sidebar-desktop {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

/* Mobile Sidebar (shows at top on mobile) */
.event-sidebar-mobile {
    display: none;
}

/* Staffing Sidebar Card */
.staffing-sidebar-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
}

.staffing-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-gray-200);
    background: var(--color-gray-50);
    border-radius: 8px 8px 0 0;
}

.staffing-sidebar-card:not(.expanded) .staffing-sidebar-header {
    border-radius: 8px;
    border-bottom: none;
}

.staffing-sidebar-header h3 {
    margin: 0;
    font-size: 1em;
    color: var(--color-brand);
    display: flex;
    align-items: center;
    gap: 8px;
}

.staffing-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.staffing-header-left .collapse-icon {
    transition: transform 0.2s ease;
}

.staffing-sidebar-card.expanded .staffing-header-left .collapse-icon {
    transform: rotate(90deg);
}

.staffing-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.staffing-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: #e8f4fc;
    color: var(--color-brand);
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
}

.staffing-header-btn:hover {
    background-color: var(--color-brand);
    color: var(--color-white);
}

.staffing-sidebar-content {
    display: none;
}

.staffing-sidebar-card.expanded .staffing-sidebar-content {
    display: block;
}

/* Constrain scrollable height on RSVP/Attendance cards, not staffing */
.rsvp-sidebar-content,
#attendanceSidebarCard .staffing-sidebar-content {
    max-height: 500px;
    overflow-y: auto;
}

.staffing-summary-row {
    padding: 10px 15px;
    font-size: 0.85em;
    color: var(--color-gray-600);
    border-bottom: 1px solid var(--color-gray-200);
    background: #fafafa;
}

/* Staffing Job Items in Sidebar */
.staffing-sidebar-list {
    padding: 10px 15px;
}

.staffing-sidebar-job {
    padding: 10px 12px;
    border-radius: 6px;
    border-left: 4px solid #ddd;
    background: var(--color-gray-50);
    margin-bottom: 8px;
}

.staffing-sidebar-job:last-child {
    margin-bottom: 0;
}

.staffing-sidebar-job.job-full {
    border-left-color: var(--color-success);
    background: #f8fff9;
}

.staffing-sidebar-job.job-partial {
    border-left-color: var(--color-warning);
    background: #fffef5;
}

.staffing-sidebar-job.job-empty {
    border-left-color: var(--color-danger);
    background: #fff8f8;
}

/* Mobile Staffing Card */
.staffing-mobile-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    margin-bottom: 20px;
}

.staffing-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    background: var(--color-gray-50);
    border-radius: 8px;
}

.staffing-mobile-card:not(.collapsed) .staffing-mobile-header {
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--color-gray-200);
}

.staffing-mobile-header h3 {
    margin: 0;
    font-size: 1em;
    color: var(--color-brand);
    display: flex;
    align-items: center;
    gap: 8px;
}

.staffing-mobile-toggle {
    color: var(--color-gray-600);
    font-size: 0.8em;
}

.staffing-mobile-content {
    display: block;
}

.staffing-mobile-card.collapsed .staffing-mobile-content {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .event-page-wrapper {
        flex-direction: column;
        padding: 10px;
    }

    .event-sidebar-desktop {
        display: none;
    }

    .event-sidebar-mobile {
        display: block;
    }

    .event-container {
        max-width: 100%;
    }
}

/* Event Header with modern buttons */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--color-gray-400);
    flex-wrap: wrap;
    gap: 15px;
}

.event-header h1 {
    margin: 0;
    text-align: left;
    font-size: 1.8em;
    flex: 1;
    min-width: 200px;
    color: var(--color-brand);
}

/* Event inline edit sections */
.event-inline-section {
    position: relative;
}

.event-inline-section .edit-icon-btn {
    top: 12px;
    right: 12px;
}

/* Location read view - no label style */
.location-display {
    font-weight: 500;
    color: var(--color-gray-800);
    margin-bottom: 8px;
}

.location-address {
    color: var(--color-gray-600);
    line-height: 1.5;
}

/* RSVP button in header */
.btn-rsvp-header {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
}

.btn-rsvp-header:hover {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    box-shadow: 0 3px 8px rgba(46, 125, 50, 0.4);
}

/* =============================================
   EDIT EVENT PAGE — Icon Buttons, Badges, Docs
   ============================================= */

/* Modern icon-only action buttons */
.event-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

/* RSVP button states */
.event-action-btn.rsvp { background-color: var(--color-gray-100); color: var(--color-gray-600); }
.event-action-btn.rsvp:hover { background-color: var(--color-gray-200); color: var(--color-gray-800); }
.event-action-btn.rsvp.rsvp-yes { background-color: #c8e6c9; color: #2e7d32; box-shadow: 0 0 0 2px #2e7d32; }
.event-action-btn.rsvp.rsvp-yes:hover { background-color: #2e7d32; color: var(--color-white); }
.event-action-btn.rsvp.rsvp-maybe { background-color: #ffe0b2; color: #e65100; box-shadow: 0 0 0 2px #e65100; }
.event-action-btn.rsvp.rsvp-maybe:hover { background-color: #e65100; color: var(--color-white); }
.event-action-btn.rsvp.rsvp-no { background-color: #ffcdd2; color: #c62828; box-shadow: 0 0 0 2px #c62828; }
.event-action-btn.rsvp.rsvp-no:hover { background-color: #c62828; color: var(--color-white); }

/* Action button color variants */
.event-action-btn.note { background-color: #e3f2fd; color: #1565c0; }
.event-action-btn.note:hover { background-color: #1565c0; color: var(--color-white); }
.event-action-btn.clone { background-color: #e0f7fa; color: #00838f; }
.event-action-btn.clone:hover { background-color: #00838f; color: var(--color-white); }
.event-action-btn.staff { background-color: #e8f5e9; color: #388e3c; }
.event-action-btn.staff:hover { background-color: #388e3c; color: var(--color-white); }
.event-action-btn.tasks { background-color: #fff3e0; color: #e65100; }
.event-action-btn.tasks:hover { background-color: #e65100; color: var(--color-white); }
.event-action-btn.budget { background-color: #f3e5f5; color: #7b1fa2; }
.event-action-btn.budget:hover { background-color: #7b1fa2; color: var(--color-white); }
.event-action-btn.transactions { background-color: #e0f2f1; color: #00695c; }
.event-action-btn.transactions:hover { background-color: #00695c; color: var(--color-white); }
.event-action-btn.delete { background-color: #ffebee; color: #c62828; }
.event-action-btn.delete:hover { background-color: #c62828; color: var(--color-white); }
.event-action-btn.pos-report { background-color: #fce4ec; color: #ad1457; }
.event-action-btn.pos-report:hover { background-color: #ad1457; color: var(--color-white); }
.event-action-btn.order-online { background-color: #e8eaf6; color: #283593; }
.event-action-btn.order-online:hover { background-color: #283593; color: var(--color-white); }
.event-action-btn.calendar { background-color: #ede7f6; color: #6f42c1; }
.event-action-btn.calendar:hover { background-color: #6f42c1; color: var(--color-white); }
.event-action-btn.gcal { background-color: #e3f2fd; color: #4285f4; }
.event-action-btn.gcal:hover { background-color: #4285f4; color: var(--color-white); }
.event-action-btn.online-orders { background-color: #e3f2fd; color: #3b82f6; }
.event-action-btn.online-orders:hover { background-color: #3b82f6; color: var(--color-white); }

/* RSVP Status Banner */
.rsvp-status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    font-weight: var(--weight-medium);
    font-size: var(--font-sm);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}
.rsvp-your-status { display: flex; align-items: center; gap: 6px; }
.rsvp-divider { width: 1px; height: 20px; background: currentColor; opacity: 0.3; }
.rsvp-counts { display: flex; align-items: center; gap: var(--space-3); font-size: 0.9em; opacity: 0.9; }
.rsvp-count { display: flex; align-items: center; gap: 4px; }
.rsvp-count.yes::before,
.rsvp-count.maybe::before,
.rsvp-count.no::before { content: ''; width: 8px; height: 8px; border-radius: var(--radius-full); }
.rsvp-count.yes::before { background: #2e7d32; }
.rsvp-count.maybe::before { background: #e65100; }
.rsvp-count.no::before { background: #c62828; }
.rsvp-status-banner.rsvp-status-yes { background: linear-gradient(135deg, #c8e6c9, #a5d6a7); color: #1b5e20; }
.rsvp-status-banner.rsvp-status-maybe { background: linear-gradient(135deg, #ffe0b2, #ffcc80); color: #e65100; }
.rsvp-status-banner.rsvp-status-no { background: linear-gradient(135deg, #ffcdd2, #ef9a9a); color: #b71c1c; }
.rsvp-status-banner.rsvp-status-none { background: linear-gradient(135deg, #e0e0e0, #bdbdbd); color: #424242; }

/* Event Type & Status Badges */
.event-type-badge, .event-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: var(--weight-semibold);
}
.badge-meeting { background-color: #e3f2fd; color: #1565c0; }
.badge-fundraiser { background-color: #e8f5e9; color: #2e7d32; }
.badge-service-project { background-color: #fff3e0; color: #e65100; }
.badge-retreat { background-color: #f3e5f5; color: #7b1fa2; }
.badge-social { background-color: #fce4ec; color: #c2185b; }
.status-planning { background-color: #fff3e0; color: #e65100; }
.status-scheduled { background-color: #e3f2fd; color: #1565c0; }

/* Document tabs and items */
.doc-tabs-modern { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.doc-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-gray-300);
    background: var(--color-gray-50);
    color: var(--color-gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.doc-tab-btn:hover { background: var(--color-gray-200); border-color: var(--color-gray-400); }
.doc-tab-btn.active { background: var(--color-brand); color: var(--color-white); border-color: var(--color-brand); }
.doc-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--color-success);
    color: var(--color-white);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.doc-add-btn:hover { background: var(--color-success-dark, #218838); transform: scale(1.05); }

.document-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-gray-100);
}
.document-item:last-child { border-bottom: none; }
.doc-icon { flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-link { color: var(--color-brand); text-decoration: none; font-weight: var(--weight-medium); display: block; }
.doc-link:hover { text-decoration: underline; }
.doc-filename { display: block; font-size: var(--font-xs); color: var(--color-gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { color: var(--color-gray-500); font-size: var(--font-xs); flex-shrink: 0; }
.btn-delete-doc { background: none; border: none; color: var(--color-danger); font-size: 1.4em; cursor: pointer; padding: 0 5px; opacity: 0.7; }
.btn-delete-doc:hover { opacity: 1; }

/* Add document section */
.add-doc-section { padding-top: var(--space-4); border-top: 1px solid var(--color-gray-100); }
.doc-tab-content .doc-form-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.doc-tab-content .form-control { flex: 1; min-width: 150px; padding: 8px 12px; border: 1px solid var(--color-gray-300); border-radius: var(--radius-sm); }

/* Address with map button */
.address-with-map { display: flex; align-items: flex-start; gap: var(--space-3); }
.map-button { background-color: var(--color-brand); color: var(--color-white); border: none; border-radius: var(--radius-sm); padding: var(--space-2); cursor: pointer; transition: background-color var(--transition-fast); flex-shrink: 0; }
.map-button:hover { background-color: var(--color-brand-dark); }

/* Series link */
.series-link { color: var(--color-brand); text-decoration: none; font-weight: var(--weight-medium); }
.series-link:hover { text-decoration: underline; }

/* Event content layout */
.event-content { display: flex; flex-direction: column; gap: var(--space-5); }

/* Info grid */
.info-item { margin-bottom: var(--space-2); }
.info-label { color: var(--color-gray-600); font-size: var(--font-sm); margin-right: var(--space-2); }
.info-value { color: var(--color-gray-800); }
.info-value.muted { color: var(--color-gray-400); font-style: italic; }
.info-item.full-width { grid-column: 1 / -1; }

/* Visibility badges */
.visibility-badge { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 3px; font-size: var(--font-xs); flex-shrink: 0; }
.visibility-badge.visible-members { background: var(--color-success-bg, #d4edda); color: var(--color-success-text, #155724); }
.visibility-badge.visible-admin { background: var(--color-warning-bg, #fff3cd); color: var(--color-warning-text, #856404); }
button.visibility-badge { border: none; cursor: pointer; transition: opacity var(--transition-fast); }
button.visibility-badge:hover { opacity: 0.7; }

/* Staffing job styles (shared desktop/mobile) */
.job-header { display: flex; justify-content: space-between; align-items: center; }
.job-name { font-weight: var(--weight-medium); color: var(--color-gray-800); }
.job-count { font-size: var(--font-sm); color: var(--color-gray-600); font-weight: var(--weight-medium); }
.job-members { margin-top: var(--space-2); display: flex; flex-wrap: wrap; gap: 6px; }
.member-chip { background: var(--color-white); border: 1px solid var(--color-gray-300); padding: 2px 8px; border-radius: var(--radius-full); font-size: var(--font-xs); color: var(--color-gray-600); text-decoration: none; cursor: pointer; }
.member-chip:hover { background: #f0f7ff; border-color: var(--color-brand); color: var(--color-brand); }
.summary-badge { padding: 4px 10px; border-radius: var(--radius-full); font-size: var(--font-xs); font-weight: var(--weight-medium); }
.badge-success { background: var(--color-success-bg, #d4edda); color: var(--color-success-text, #155724); }
.badge-warning { background: var(--color-warning-bg, #fff3cd); color: var(--color-warning-text, #856404); }

/* AI analysis callout */
.ai-analysis-box { padding: 10px 14px; background: #f0f9ff; border-left: 4px solid #3b82f6; border-radius: var(--radius-md); font-size: var(--font-sm); color: #1e40af; line-height: 1.6; }
.ai-analysis-label { font-size: var(--font-xs); text-transform: uppercase; letter-spacing: 0.5px; color: #3b82f6; font-weight: var(--weight-semibold); }
.ai-analysis-text { margin-top: 6px; }

/* Summary preview box */
.summary-preview { padding: 12px 16px; background: var(--color-gray-50); border: 1px solid var(--color-gray-200); border-radius: var(--radius-md); font-size: var(--font-sm); line-height: 1.6; color: var(--color-gray-700); }

/* Empty state text */
.event-empty-state { color: var(--color-gray-400); font-style: italic; text-align: center; padding: var(--space-4) 0; font-size: var(--font-sm); }

/* Dropdown results (RSVP/attendance member search) */
.event-dropdown-results { display: none; position: absolute; left: 15px; right: 15px; background: var(--color-white); border: 1px solid var(--color-gray-300); border-radius: 0 0 var(--radius-md) var(--radius-md); max-height: 150px; overflow-y: auto; z-index: 100; box-shadow: var(--shadow-lg); }
.event-dropdown-item { padding: 8px 12px; cursor: pointer; font-size: var(--font-xs); border-bottom: 1px solid var(--color-gray-100); }
.event-dropdown-item:hover { background: var(--color-gray-50); }
.event-dropdown-empty { padding: 8px 12px; color: var(--color-gray-400); font-size: var(--font-xs); }
.event-dropdown-error { padding: 8px 12px; color: var(--color-danger); font-size: var(--font-xs); }

/* Edit event — mobile responsive */
@media (max-width: 768px) {
    .event-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .event-header h1 {
        font-size: 1.5em;
        text-align: center;
        width: 100%;
    }
    .event-header .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    .rsvp-status-banner {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-xs);
        gap: var(--space-2);
    }
    .document-item {
        flex-wrap: wrap;
    }
    .doc-meta {
        width: 100%;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .event-header h1 {
        font-size: 1.3em;
    }
    .event-header .header-actions {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
        width: 100%;
    }
    .event-action-btn {
        width: 100%;
        height: 36px;
    }
    .event-action-btn svg {
        width: 16px;
        height: 16px;
    }
    .event-page-wrapper {
        gap: var(--space-2);
        padding: var(--space-2);
    }
    .staffing-sidebar-job {
        padding: 8px 10px;
        margin-bottom: 6px;
    }
    .member-chip {
        font-size: 0.75em;
        padding: 2px 6px;
    }
    .doc-tab-content .doc-form-row {
        flex-direction: column;
    }
}

/* =============================================
   PREDEFINED LOCATIONS
   ============================================= */

.location-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 8px;
}

.location-select-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.location-select-row select {
    flex: 1;
}

/* =============================================
   EMAIL HISTORY (Gmail Integration)
   ============================================= */

/* email-history-card uses standard sidebar styling with blue accent border */

.email-history-list {
    padding: 0;
}

.email-history-item {
    padding: 10px;
    margin-bottom: 8px;
    background: var(--color-white);
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.email-history-item:last-child {
    margin-bottom: 0;
}

.email-history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.email-history-datetime {
    font-size: 0.75em;
    color: #888;
}

.email-history-addresses {
    font-size: 0.8em;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.4;
}

.email-history-addresses strong {
    color: var(--color-gray-800);
    font-weight: 600;
}

.email-history-subject {
    font-size: 0.85em;
    color: var(--color-gray-800);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-inbound {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.badge-outbound {
    display: inline-block;
    background: #cce5ff;
    color: #004085;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.badge-sent {
    display: inline-block;
    background: #e5e7eb;
    color: #374151;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.badge-opened {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.badge-clicked {
    display: inline-block;
    background: #ede9fe;
    color: #5b21b6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.badge-received {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.badge-bounced {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.badge-unsubscribed {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.email-history-content {
    display: none;
}

.email-history-icon {
    vertical-align: middle;
    margin-right: 6px;
}

.email-history-view-all {
    text-align: center;
    margin-top: 0.5rem;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.email-history-view-all a {
    font-size: 0.82em;
    color: #4a90d9;
    text-decoration: none;
}

.email-history-view-all a:hover {
    text-decoration: underline;
}

/* =============================================
   EMAIL HISTORY LIST PAGE (Standard Table Format)
   ============================================= */

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

.emails-header h1 {
    color: var(--color-brand);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.emails-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Standard search box (shared across list pages) */
.search-box {
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 0.95em;
    width: 200px;
}

.search-box:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px var(--color-brand-subtle);
}

.emails-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.emails-table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.emails-table th:hover {
    background: #f1f5f9;
}

.emails-table th .sort-icon {
    margin-left: 5px;
    opacity: 0.3;
}

.emails-table th.sorted .sort-icon {
    opacity: 1;
}

.emails-table td {
    padding: 10px 12px;
    font-size: 0.9em;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.emails-table tr:hover {
    background: #f8fafc;
}

/* Header column with stacked to/from */
.emails-table .col-header {
    width: 200px;
    min-width: 150px;
}

.email-header-cell {
    font-size: 0.85em;
    line-height: 1.5;
}

.email-header-cell .header-to,
.email-header-cell .header-from {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.email-header-cell .header-label {
    color: #888;
    font-weight: 500;
}

/* Entity links */
.entity-link {
    font-weight: 600;
    color: var(--color-brand);
    text-decoration: none;
}

.entity-link:hover {
    text-decoration: underline;
}

/* Subject column with preview button */
.subject-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.subject-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.preview-btn:hover {
    background: #f3f4f6;
    color: var(--color-brand);
}

/* Summary column */
.summary-cell {
    color: #6b7280;
    font-size: 0.88em;
    max-width: 280px;
}

.summary-cell .no-data {
    color: #d1d5db;
}

.summary-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.summary-text {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.summary-wrapper.expanded .summary-text {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.expand-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.expand-btn:hover {
    color: var(--color-brand);
}

.expand-btn.expanded .chevron-icon {
    transform: rotate(90deg);
}

/* Action buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #f3f4f6;
    color: var(--color-brand);
}

.action-btn.delete-btn:hover,
.action-btn.action-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Email Preview Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.email-preview-modal {
    background: var(--color-white);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.email-preview-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8fafc;
}

.email-preview-modal .modal-header h2 {
    margin: 0;
    font-size: 1.1em;
    color: var(--color-gray-800);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
}

.email-preview-modal .close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #888;
    padding: 0 8px;
}

.email-preview-modal .close-btn:hover {
    color: var(--color-gray-800);
}

.email-preview-modal .modal-meta {
    padding: 12px 20px;
    background: #fafbfc;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9em;
}

.email-preview-modal .modal-meta p {
    margin: 4px 0;
    color: #555;
}

.email-preview-modal .modal-meta strong {
    color: var(--color-gray-800);
}

.email-preview-frame {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.email-preview-frame iframe {
    width: 100%;
    height: 400px;
    border: none;
    background: var(--color-white);
}

/* Mobile responsive for email history list */
@media (max-width: 768px) {
    .emails-header {
        flex-direction: column;
        align-items: stretch;
    }

    .emails-controls {
        flex-direction: column;
    }

    .emails-controls .search-box {
        width: 100%;
    }

    .emails-table {
        display: block;
    }

    .emails-table thead {
        display: none;
    }

    .emails-table tbody {
        display: block;
    }

    .emails-table tr {
        display: block;
        background: var(--color-white);
        margin-bottom: 10px;
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
        padding: 12px;
    }

    .emails-table td {
        display: block;
        border: none;
        padding: 4px 0;
    }

    .emails-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: 0.8em;
        display: block;
        margin-bottom: 2px;
    }

    /* Hide summary on mobile */
    .emails-table td.summary-cell {
        display: none;
    }

    .email-preview-modal {
        width: 95%;
        max-height: 95vh;
    }

    .email-preview-frame iframe {
        height: 300px;
    }
}

/* ============================================
   Task Management Styles
   ============================================ */

/* Task count badge in sidebar nav */
.task-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: #ef4444;
    color: var(--color-white);
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
}

/* Task list page header */
.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.tasks-header h1 {
    color: var(--color-brand);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tasks-header .event-subtitle {
    font-size: 0.5em;
    color: #6b7280;
    font-weight: normal;
    display: block;
    margin-top: 4px;
}

.tasks-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Search box */
.search-box {
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 0.95em;
    width: 200px;
}

.search-box:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px var(--color-brand-subtle);
}

/* .btn-create — legacy alias, now defined with .btn above */

.btn-report {
    background: #7c3aed;
    color: var(--color-white);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
}

.btn-report:hover {
    background: #6d28d9;
    color: var(--color-white);
}

/* Task list table */
.tasks-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tasks-table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.tasks-table td {
    padding: 12px;
    font-size: 0.9em;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.tasks-table tr:hover {
    background: #f8fafc;
}

.tasks-table .task-title {
    font-weight: 500;
    color: var(--color-brand);
    text-decoration: none;
}

.tasks-table .task-title:hover {
    text-decoration: underline;
}

/* Task status and priority badges */
.task-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: capitalize;
}

.task-status-badge.status-pending { background: #f3f4f6; color: #6b7280; }
.task-status-badge.status-assigned { background: #dbeafe; color: #1d4ed8; }
.task-status-badge.status-in_progress { background: #fef3c7; color: #b45309; }
.task-status-badge.status-completed { background: #d1fae5; color: #065f46; }
.task-status-badge.status-cancelled { background: #fee2e2; color: #b91c1c; }
.task-status-badge.status-blocked { background: #ede9fe; color: #6d28d9; }

.task-priority-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.task-priority-badge.priority-low { background: #f3f4f6; color: #6b7280; }
.task-priority-badge.priority-medium { background: #e0f2fe; color: #0369a1; }
.task-priority-badge.priority-high { background: #fed7aa; color: #c2410c; }
.task-priority-badge.priority-urgent { background: #fecaca; color: #b91c1c; }

/* Task due date */
.task-due {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 0.9em;
}

.task-due.overdue {
    color: #dc2626;
    font-weight: 500;
}

/* Task action buttons */
.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.task-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    text-decoration: none;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.task-action-btn:hover {
    background: #f3f4f6;
    color: var(--color-brand);
}

.task-action-btn.action-assign {
    color: #3b82f6;
}

.task-action-btn.action-assign:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.task-action-btn.action-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Task card list (for admin event tasks) */
.task-card-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-card {
    background: var(--color-white);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    border-left: 4px solid #e5e7eb;
}

.task-card.priority-low { border-left-color: #9ca3af; }
.task-card.priority-medium { border-left-color: #3b82f6; }
.task-card.priority-high { border-left-color: #f59e0b; }
.task-card.priority-urgent { border-left-color: #ef4444; }

.task-card.task-completed { border-left-color: #10b981; opacity: 0.7; }
.task-card.task-cancelled { border-left-color: #6b7280; opacity: 0.5; }

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
}

.task-card-title {
    font-weight: 600;
    font-size: 1.05em;
}

.task-card-title a {
    color: var(--color-gray-800);
    text-decoration: none;
}

.task-card-title a:hover {
    color: var(--color-brand);
}

.task-card-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.task-card-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.task-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-unassigned {
    font-style: italic;
    color: #9ca3af;
}

.task-card-description {
    font-size: 0.9em;
    color: #4b5563;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Sidebar task card */
.sidebar-task-card {
    background: var(--color-white);
    border-radius: 8px;
    margin: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-task-card.collapsed .sidebar-task-content {
    display: none;
}

.sidebar-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-task-header h4 {
    margin: 0;
    font-size: 0.9em;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-task-header .task-count {
    background: #ef4444;
    color: var(--color-white);
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 10px;
}

.sidebar-task-toggle {
    color: #9ca3af;
    transition: transform 0.2s;
}

.sidebar-task-card.collapsed .sidebar-task-toggle {
    transform: rotate(-90deg);
}

.sidebar-task-content {
    padding: 0;
}

.sidebar-task-item {
    display: block;
    padding: 10px 15px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: var(--color-gray-800);
    font-size: 0.85em;
}

.sidebar-task-item:last-child {
    border-bottom: none;
}

.sidebar-task-item:hover {
    background: #f8fafc;
}

.sidebar-task-item .task-item-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.sidebar-task-item .task-item-event {
    font-size: 0.85em;
    color: #6b7280;
}

.sidebar-task-item .task-item-due {
    font-size: 0.8em;
    color: #9ca3af;
    margin-top: 2px;
}

.sidebar-task-item .task-item-due.overdue {
    color: #dc2626;
}

.sidebar-task-footer {
    padding: 10px 15px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.sidebar-task-footer a {
    display: block;
    text-align: center;
    color: var(--color-brand);
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none;
}

.sidebar-task-footer a:hover {
    text-decoration: underline;
}

/* Empty state for tasks */
.tasks-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.tasks-empty-state svg {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
}

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

.tasks-empty-state.success p {
    color: #10b981;
    font-weight: 500;
}

/* Task list helper classes */
.task-count-label {
    font-size: 0.6em;
    color: #6b7280;
    font-weight: normal;
}

.task-description-preview {
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 2px;
}

.task-event-name {
    color: var(--color-brand);
    font-weight: 500;
    text-decoration: none;
}

.task-event-name:hover,
.task-series-name:hover {
    text-decoration: underline;
}

.task-series-name {
    color: #7c3aed;
    font-weight: 500;
    text-decoration: none;
}

.task-series-label {
    font-size: 0.75em;
    color: #7c3aed;
    font-weight: 500;
}

.task-event-date {
    font-size: 0.85em;
    color: #6b7280;
}

.task-no-value {
    color: #9ca3af;
}

.tasks-section-header {
    font-size: 1.1em;
    color: #6b7280;
    margin: 40px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.tasks-table.completed {
    opacity: 0.7;
}

/* Task modal */
.modal-content.modal-medium {
    max-width: 500px;
}

/* Task filters bar */
.filters-bar {
    background: var(--color-white);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.filters-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.8em;
    font-weight: 500;
    color: #6b7280;
}

.filter-group select {
    min-width: 150px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
}

/* Task assignee display */
.task-assignee {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-notes-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
}

.task-no-notes {
    color: #d1d5db;
}

/* Inline form for delete */
.inline-form {
    display: inline;
}

/* Responsive task list */
@media (max-width: 768px) {
    .tasks-header {
        flex-direction: column;
        align-items: stretch;
    }

    .tasks-controls {
        flex-direction: column;
    }

    .tasks-table {
        display: block;
    }

    .tasks-table thead {
        display: none;
    }

    .tasks-table tbody {
        display: block;
    }

    .tasks-table tr {
        display: block;
        background: var(--color-white);
        margin-bottom: 10px;
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
        padding: 15px;
    }

    .tasks-table td {
        display: block;
        border: none;
        padding: 5px 0;
    }

    .tasks-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: 0.85em;
        display: block;
        margin-bottom: 3px;
    }

    .task-actions {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #e5e7eb;
    }
}

/* ============================================
   Task Form / Edit Task Styles
   ============================================ */

.task-form {
    max-width: 700px;
}

.task-form .form-card {
    background: var(--color-white);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.task-form .form-card h3 {
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1.1em;
    color: var(--color-gray-800);
}

.task-form .form-row {
    display: flex;
    gap: 20px;
}

.task-form .form-row .form-group {
    flex: 1;
}

.task-form .assignee-info {
    margin-top: 10px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.9em;
}

/* Member search in task form */
.member-search-wrapper {
    position: relative;
}

.member-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 8px;
}

.member-search-input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px var(--color-brand-subtle);
}

.member-select-filtered {
    max-height: 200px;
    overflow-y: auto;
}

.member-inactive {
    color: #9ca3af;
    font-style: italic;
}

/* Task notes */
.task-form .add-note-form {
    margin-bottom: 20px;
}

.task-form .note-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.task-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: #6b7280;
}

.task-form .notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-form .note-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid var(--color-brand);
}

.task-form .note-item.internal {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.task-form .note-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.85em;
}

.task-form .note-author {
    font-weight: 600;
    color: var(--color-gray-800);
}

.task-form .note-date {
    color: #9ca3af;
}

.task-form .internal-badge {
    background: #fef3c7;
    color: #b45309;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 500;
}

.task-form .note-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.2em;
}

.task-form .note-delete:hover {
    color: #ef4444;
}

.task-form .note-content {
    color: #4b5563;
    line-height: 1.5;
    white-space: pre-wrap;
}

.task-form .no-notes {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Task email form */
.task-form .email-form .form-group label {
    display: inline-block;
    width: 80px;
    font-weight: 500;
}

.task-form .no-email {
    color: #9ca3af;
    font-style: italic;
}

.task-form .email-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-form .email-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
}

.task-form .email-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.85em;
}

.task-form .email-type {
    font-weight: 500;
    color: var(--color-brand);
}

.task-form .email-date {
    color: #9ca3af;
}

.task-form .email-subject {
    font-weight: 500;
    margin-bottom: 2px;
}

.task-form .email-to {
    font-size: 0.85em;
    color: #6b7280;
}

/* Task timeline */
.task-form .timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-form .timeline-item {
    display: flex;
    gap: 10px;
    font-size: 0.9em;
}

.task-form .timeline-label {
    font-weight: 500;
    color: #6b7280;
    min-width: 80px;
}

.task-form .timeline-value {
    color: var(--color-gray-800);
}

@media (max-width: 600px) {
    .task-form .form-row {
        flex-direction: column;
        gap: 0;
    }
    .task-form .note-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ============================================================================
   Folder System — Reusable sidebar for organizing items into folders
   ============================================================================ */

/* Page layout: sidebar + content */
.folder-page-layout {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Sidebar */
.folder-sidebar {
    width: 200px;
    min-width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.folder-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.folder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    color: var(--color-gray-800);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.88em;
    transition: background 0.15s;
    cursor: pointer;
}

.folder-item:hover {
    background: #f0f7ff;
    text-decoration: none;
    color: var(--color-gray-800);
}

.folder-item.active {
    background: #e8f0fe;
    color: var(--color-brand);
    font-weight: 600;
}

.folder-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-count {
    color: var(--color-gray-500);
    font-size: 0.82em;
    font-weight: normal;
    min-width: 18px;
    text-align: right;
}

/* Folder item wrapper (for hover actions) */
.folder-item-wrap {
    position: relative;
}

.folder-actions {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    gap: 2px;
    align-items: center;
}

.folder-item-wrap:hover .folder-actions {
    display: flex;
}

.folder-item-wrap:hover .folder-count {
    display: none;
}

.folder-action-btn {
    background: none;
    border: none;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.folder-action-btn:hover {
    background: #e0e0e0;
    color: var(--color-gray-800);
}

.folder-delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Add folder section */
.folder-add-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-gray-200);
}

.folder-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--color-brand);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 0.85em;
    border-radius: 6px;
    width: 100%;
}

.folder-add-btn:hover {
    background: #f0f7ff;
}

.folder-add-input {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
}

.folder-add-input input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 0.85em;
    min-width: 0;
}

.folder-add-input input:focus {
    outline: none;
    border-color: var(--color-brand);
}

.folder-save-btn {
    background: var(--color-brand);
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.folder-save-btn:hover {
    background: var(--color-brand-dark);
}

.folder-cancel-btn {
    background: none;
    color: var(--color-gray-500);
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.folder-cancel-btn:hover {
    background: #f5f5f5;
    color: var(--color-gray-800);
}

/* Content area (right side of folder layout) */
.folder-content {
    flex: 1;
    min-width: 0;
}

/* Drag handle on cards */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    color: #ccc;
    cursor: grab;
    margin-right: 8px;
    transition: color 0.15s;
}
.drag-handle:active { cursor: grabbing; }
.draggable-card:hover .drag-handle { color: var(--color-gray-500); }
.draggable-card.dragging { opacity: 0.4; }
.drop-target.drag-over { background: #e3f2fd !important; outline: 2px dashed var(--color-brand); outline-offset: -2px; border-radius: 6px; }
.dnd-active .drop-target * { pointer-events: none; }

/* Table drag-and-drop (reorder rows)
   Grip appears on row hover. Inherits row background for zebra stripe compat.
   Usage: <th class="col-drag"></th> / <td class="col-drag"><span class="drag-handle">...</span></td> */
.col-drag {
    width: 20px;
    padding: 0 2px !important;
    border: none !important;
}
.col-drag .drag-handle {
    opacity: 0;
    transition: opacity var(--transition-fast);
    cursor: grab;
}
tr:hover .col-drag .drag-handle {
    opacity: 0.35;
}
tr:hover .col-drag .drag-handle:hover {
    opacity: 1;
    color: var(--color-gray-700);
}
tr.dragging { opacity: 0.5; background: #dbeafe !important; }
tr.drag-over { border-top: 2px solid var(--color-brand); }

/* Mobile drag-and-drop */
.mobile-controls { margin-bottom: var(--space-4); text-align: right; }
.mobile-drag-handle {
    cursor: grab;
    padding: 5px;
    color: var(--color-gray-400);
    margin-right: var(--space-3);
}
.mobile-drag-handle:active { cursor: grabbing; }

/* Move-to-folder dropdown on cards */
.move-folder-select {
    padding: 4px 8px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 0.8em;
    color: var(--color-gray-600);
    background: var(--color-white);
    cursor: pointer;
}

.move-folder-select:focus {
    outline: none;
    border-color: var(--color-brand);
}

/* Mobile: sidebar becomes horizontal pills */
@media (max-width: 768px) {
    .folder-page-layout {
        flex-direction: column;
        gap: 16px;
        padding: 12px;
    }

    .folder-sidebar {
        width: 100%;
        min-width: unset;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .folder-list {
        flex-direction: row;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .folder-item {
        padding: 6px 14px;
        white-space: nowrap;
        border: 1px solid var(--color-gray-400);
        border-radius: 20px;
        font-size: 0.82em;
    }

    .folder-item.active {
        border-color: var(--color-brand);
    }

    .folder-item-wrap {
        flex-shrink: 0;
    }

    .folder-item-wrap .folder-actions {
        display: none !important;
    }

    .folder-item-wrap:hover .folder-count {
        display: inline;
    }

    .drag-handle { display: none; }

    .folder-add-section {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex-shrink: 0;
    }

    .folder-add-btn {
        padding: 6px 14px;
        border: 1px dashed var(--color-brand);
        border-radius: 20px;
        white-space: nowrap;
    }

    .folder-add-input {
        padding: 0;
    }
}

/* ============================================
   Quick Email Modal — Summernote Rich Editor
   ============================================ */

/* Modal wrapper — just a display toggle, no positioning */
.quick-email-modal {
    display: none;
}

/* Modal content — fixed position, draggable */
.quick-email-content {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white);
    border-radius: 8px;
    border: 2px solid #7B1FA2;
    width: 95%;
    max-width: 750px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 2000;
}

/* Draggable header cursor */
.quick-email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: move;
    user-select: none;
}

.quick-email-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--color-gray-800);
}

.qe-email-display {
    font-size: 0.85em;
    color: var(--color-gray-600);
    margin-top: 2px;
}

.quick-email-header > button {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #888;
    padding: 0;
    line-height: 1;
    align-self: flex-start;
}

.quick-email-header > button:hover {
    color: var(--color-gray-800);
}

.quick-email-body {
    padding: 20px;
}

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

.quick-email-body .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--color-gray-800);
}

.quick-email-body .form-group input,
.quick-email-body .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    font-size: 0.95em;
    box-sizing: border-box;
}

.quick-email-body .form-group input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 3px rgba(74,144,217,0.3);
}

.quick-email-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
    background: var(--color-gray-50);
    border-radius: 0 0 8px 8px;
}

.qe-footer-left {
    display: flex;
    gap: 8px;
}

.qe-footer-right {
    display: flex;
    gap: 10px;
}

.quick-email-footer .btn-secondary {
    background: var(--color-gray-700);
    color: var(--color-white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.quick-email-footer .btn-primary {
    background: #4a90d9;
    color: var(--color-white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.quick-email-footer .btn-primary:hover {
    background: #3a7bc8;
}

.btn-outline-sm {
    background: var(--color-white);
    color: #555;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-base);
}

.btn-outline-sm:hover {
    border-color: #4a90d9;
    color: #4a90d9;
}

.btn-outline-sm.active {
    background: #e3f2fd;
    border-color: #4a90d9;
    color: #1565c0;
}

/* Template row */
.qe-template-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.qe-template-row label {
    font-weight: 500;
    color: var(--color-gray-800);
    white-space: nowrap;
    min-width: 70px;
}

.qe-template-row select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    font-size: 0.95em;
}

/* Save as Template */
.qe-save-tpl-btn {
    white-space: nowrap;
    font-size: 0.85em;
    padding: 6px 10px;
    gap: 4px;
    display: inline-flex;
    align-items: center;
}

.qe-save-template-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.qe-save-template-form input[type="text"] {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9em;
}

.qe-save-template-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

/* Context Selector (Event/Job) */
.qe-context-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.qe-context-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.qe-context-field label {
    font-weight: 500;
    color: var(--color-gray-800);
    white-space: nowrap;
    font-size: 0.95em;
}

.qe-context-field select {
    padding: 7px 10px;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    font-size: 0.95em;
    max-width: 280px;
}

/* Summernote inside modal */
.quick-email-modal .note-editor.note-frame {
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.quick-email-modal .note-toolbar {
    background: #f8f9fa !important;
    border-bottom: 1px solid #ddd !important;
    padding: 6px !important;
}

.quick-email-modal .note-editing-area {
    background: var(--color-white);
}

.quick-email-modal .note-editable {
    font-family: Tahoma, sans-serif;
    font-size: 14px;
    color: #073763;
    line-height: 1.6;
    padding: 14px !important;
    text-align: left;
}

.quick-email-modal .note-editable a {
    color: #3D85C6;
}

/* Summernote z-index fixes inside modal */
.quick-email-modal .note-editor {
    z-index: auto !important;
}

.quick-email-modal .note-editor .dropdown-menu,
.quick-email-modal .note-editor .note-dropdown-menu {
    z-index: 2060 !important;
}

.quick-email-modal .note-modal {
    z-index: 2070 !important;
}

.quick-email-modal .note-modal-backdrop {
    z-index: 2065 !important;
}

/* Summernote dialogs rendered in body (dialogsInBody: true) need high z-index */
body > .note-modal {
    z-index: 2070 !important;
}
body > .note-modal .note-modal-backdrop {
    z-index: 2065 !important;
}
body > .note-modal .note-modal-content {
    z-index: 2075 !important;
}

/* Merge field dropdown */
.merge-field-dropdown {
    max-height: 300px;
    overflow-y: auto;
    min-width: 260px;
}

.merge-field-category {
    padding: 6px 12px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    background: #f5f5f5;
    border-top: 1px solid var(--color-gray-200);
}

.merge-field-category:first-child {
    border-top: none;
}

.merge-field-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.merge-field-item:hover {
    background: #e3f2fd;
    color: #1565c0;
}

.merge-field-item code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    margin-right: 8px;
    flex-shrink: 0;
}

.mf-copy-btn {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 0.75em;
    color: #4a90d9;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: var(--color-white);
    flex-shrink: 0;
    transition: all 0.15s;
}

.mf-copy-btn:hover {
    background: #e3f2fd;
    border-color: #4a90d9;
}

.mf-copy-btn.copied {
    background: #d4edda;
    border-color: var(--color-success);
    color: var(--color-success);
}

/* Email Preview Modal wrapper — just a display toggle */
.email-preview-modal {
    display: none;
}

.email-preview-content {
    position: fixed;
    top: 20px;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white);
    border-radius: 8px;
    border: 2px solid #7B1FA2;
    width: 95%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 3000;
}

.email-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
    cursor: move;
    user-select: none;
}

.email-preview-header h3 {
    margin: 0;
    font-size: 1em;
    color: var(--color-gray-800);
}

.email-preview-header > button {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #888;
    padding: 0;
    line-height: 1;
}

.email-preview-header > button:hover {
    color: var(--color-gray-800);
}

.email-preview-envelope {
    padding: 12px 20px;
    background: var(--color-gray-50);
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.envelope-row {
    display: flex;
    align-items: baseline;
    padding: 3px 0;
    font-size: 0.9em;
}

.envelope-label {
    width: 65px;
    font-weight: 600;
    color: var(--color-gray-600);
    flex-shrink: 0;
}

.envelope-value {
    color: var(--color-gray-800);
}

.envelope-subject {
    font-weight: 600;
}

.email-preview-body {
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.email-preview-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.email-preview-footer {
    padding: 10px 20px;
    border-top: 1px solid #e9ecef;
    text-align: right;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .email-preview-content {
        top: 10px;
        bottom: 10px;
        width: 98%;
        border-radius: 6px;
    }
    .email-preview-header {
        padding: 10px 14px;
    }
    .email-preview-envelope {
        padding: 8px 14px;
    }
}

/* ============================================================
   Staffing Import - JotForm Sync
   ============================================================ */

.import-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.import-divider::before,
.import-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dee2e6;
}

.import-divider span {
    color: var(--color-gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sync-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sync-card-header h2 {
    margin: 0;
}

.sync-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spin-icon {
    animation: spin 1s linear infinite;
}

/* ============================================================================
   POS Admin Styles
   ============================================================================ */

.pos-seed-banner {
    background: #fff3e0;
    border: 1px solid #ffcc02;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.pos-seed-banner p {
    margin-bottom: 12px;
    color: var(--color-gray-600);
}

.pos-menu-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pos-menu-table th {
    background: #f5f5f5;
    padding: 10px 14px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
    border-bottom: 2px solid var(--color-gray-400);
}

.pos-menu-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    text-align: center;
}

.pos-menu-table tbody tr:hover {
    background: #f9f9f9;
}

/* Fish Fry Sales report table */
.pos-sales-table {
    table-layout: fixed;
}

.pos-sales-table .pos-col-item { width: 22%; text-align: left; }
.pos-sales-table .pos-col-price { width: 12%; }
.pos-sales-table .pos-col-qty { width: 10%; }
.pos-sales-table .pos-col-rev { width: 14%; }
.pos-sales-table .pos-col-bw { width: 12%; }

.pos-sales-table td:first-child {
    text-align: left;
}

.pos-sales-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    margin-bottom: 10px;
}

.pos-sales-header h2 {
    margin: 0;
}

.pos-compare-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-compare-select label {
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
    white-space: nowrap;
}

.pos-compare-select select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9em;
    background: var(--color-white);
    min-width: 280px;
}

.pos-totals-row td {
    border-top: 2px solid #333;
    background: #f9f9f9;
}

.pos-compare-tier-row td {
    color: #888;
    font-size: 0.9em;
    background: #fafafa;
}

.pos-bw-positive {
    color: #2e7d32;
}

.pos-bw-negative {
    color: #c62828;
}

.event-action-btn.pos-report {
    color: #43a047;
}

.event-action-btn.order-online {
    color: #ff9800;
    background: none;
    border: none;
    cursor: pointer;
}

/* Order Online Modal */
.order-online-modal {
    max-width: 440px;
    padding: 28px;
}
.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.order-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #1e293b;
}
.order-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 4px;
    line-height: 1;
}
.order-modal-close:hover {
    color: #475569;
}
.order-modal-qr {
    text-align: center;
    margin-bottom: 20px;
}
.order-modal-qr img {
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.order-modal-qr-hint {
    font-size: 0.8em;
    color: #94a3b8;
    margin-top: 6px;
}
.order-modal-link {
    margin-bottom: 20px;
}
.order-modal-link label {
    font-size: 0.8em;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}
.order-modal-link input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85em;
    background: #f8fafc;
    color: #334155;
}
.order-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.order-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    color: var(--color-white);
    transition: opacity 0.2s;
}
.order-modal-btn:hover {
    opacity: 0.9;
}
.order-modal-btn-share {
    background: #22c55e;
}
.order-modal-btn-open {
    background: #3b82f6;
}
.order-modal-btn-download {
    background: #64748b;
}

.btn-pos {
    background-color: #43a047;
    color: var(--color-white);
    border: 1px solid #388e3c;
}

.btn-pos:hover {
    background-color: #388e3c;
    color: var(--color-white);
}

.pos-item-inactive {
    opacity: 0.5;
}

.pos-name-cell {
    white-space: nowrap;
}

.pos-action-btn {
    background: none;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, border-color 0.15s;
    vertical-align: middle;
    margin: 0 2px;
}

.pos-action-edit {
    color: var(--color-brand);
}

.pos-action-edit:hover {
    background-color: #e3f2fd;
    border-color: var(--color-brand);
}

.pos-action-delete {
    color: #f44336;
}

.pos-action-delete:hover {
    background-color: #ffebee;
    border-color: #f44336;
}

.pos-color-preview {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.1);
}

.pos-color-input {
    width: 50px;
    height: 36px;
    padding: 2px;
    cursor: pointer;
}

.pos-item-actions {
    white-space: nowrap;
}

.pos-button-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.pos-preview-btn {
    padding: 16px 12px;
    border-radius: 10px;
    color: var(--color-white);
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.pos-preview-name {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 4px;
}

.pos-preview-price {
    font-size: 1.3em;
    font-weight: 700;
}

.pos-item-form {
    background: var(--color-white);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.pos-item-form h3 {
    margin-bottom: 16px;
    color: var(--color-gray-800);
}

.pos-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.pos-form-row .form-group {
    flex: 1;
    min-width: 120px;
}

.pos-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* POS Summary Cards */
.pos-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.pos-summary-card {
    background: var(--color-white);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pos-summary-value {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--color-brand);
}

.pos-summary-label {
    font-size: 0.8em;
    color: #888;
    text-transform: uppercase;
    margin-top: 4px;
}

.pos-void-notice {
    background: #fff3e0;
    border: 1px solid #ffcc02;
    border-radius: 6px;
    padding: 10px 16px;
    color: #e65100;
    font-size: 0.9em;
}

.pos-closeout-section {
    background: var(--color-white);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.pos-closeout-done {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 6px;
    padding: 10px 16px;
    color: #2e7d32;
}

.drawer-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* POS Badges */
.pos-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-cash { background: #e8f5e9; color: #2e7d32; }
.badge-card { background: #e3f2fd; color: #1565c0; }
.badge-completed { background: #e8f5e9; color: #2e7d32; }
.badge-voided { background: #ffebee; color: #c62828; }

.btn-link-danger { color: #f44336; }
.btn-link-danger:hover { color: #c62828; }

/* =====================================================================
   Weather Display
   ===================================================================== */

/* Inline SVG icon alignment */
.weather-icon-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Compact inline badge (series events list, Grid.js cells) */
.weather-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    color: #555;
    white-space: nowrap;
}

.weather-inline-text {
    vertical-align: middle;
}

/* Full weather card (event detail page) */
.weather-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.weather-card .card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    font-size: 1em;
    font-weight: 600;
    color: #334155;
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.weather-detail-row {
    display: flex;
    flex-direction: column;
}

.weather-detail-label {
    font-size: 0.75em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.weather-detail-value {
    font-size: 0.95em;
    color: #1e293b;
    font-weight: 500;
}

.weather-temp {
    font-weight: 600;
}

/* Weather badge pill (report headers) */
.weather-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.85em;
    color: #475569;
}

.weather-badge-pill .weather-temp {
    color: #334155;
}

.weather-badge-pill .weather-precip {
    color: #3B82F6;
}

/* ── AI Rewrite Modal ── */
.ai-rewrite-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}
.ai-rewrite-modal.visible {
    display: flex;
}
.ai-rewrite-content {
    width: 700px;
    max-width: 95vw;
    max-height: 85vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ai-rewrite-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ai-rewrite-header h3 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7B1FA2;
}
.ai-rewrite-header .close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--color-gray-600);
    padding: 0 4px;
    line-height: 1;
}
.ai-rewrite-header .close-btn:hover {
    color: var(--color-gray-800);
}
.ai-rewrite-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.ai-rewrite-footer {
    padding: 14px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.ai-tone-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.ai-tone-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-base);
}
.ai-tone-btn:hover {
    border-color: #7B1FA2;
}
.ai-tone-btn.active {
    border-color: #7B1FA2;
    background: #F3E5F5;
    color: #7B1FA2;
    font-weight: 600;
}
.ai-rewrite-preview {
    border: 1px solid var(--color-gray-400);
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
    min-height: 120px;
    max-height: 40vh;
    overflow-y: auto;
    font-family: Tahoma, sans-serif;
    font-size: 14px;
    color: #073763;
    line-height: 1.6;
}
.ai-rewrite-rationale {
    margin-top: 12px;
    padding: 12px 16px;
    background: #F3E5F5;
    border-radius: 8px;
    font-size: 13px;
    color: #4A148C;
    line-height: 1.5;
}
.ai-rewrite-rationale strong {
    font-weight: 600;
}
.ai-rewrite-spinner {
    text-align: center;
    padding: 40px;
    color: var(--color-gray-600);
}
.ai-rewrite-spinner .spinner-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #7B1FA2;
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
    margin-bottom: 10px;
}
@keyframes ai-spin {
    to { transform: rotate(360deg); }
}
.ai-rewrite-error {
    padding: 12px 16px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    color: #DC2626;
    font-size: 13px;
}
.ai-rewrite-initial {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 14px;
}

/* ── RSVP Sidebar Card ── */
.rsvp-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-white);
}
.rsvp-pill.yes { background: #2e7d32; }
.rsvp-pill.maybe { background: #f57c00; }
.rsvp-pill.no { background: #c62828; }
.rsvp-pill.admin-added { background: #7c3aed; }
.rsvp-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 4px;
}
.rsvp-badge-dot.yes { background: #2e7d32; }
.rsvp-badge-dot.maybe { background: #f57c00; }
.rsvp-badge-dot.no { background: #c62828; }
.rsvp-badge-dot.admin-added { background: #7c3aed; }
.rsvp-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: #9ca3af;
    border-radius: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    transition: color 0.15s;
}
.rsvp-delete-btn:hover { color: #ef4444; }
.rsvp-attended-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.rsvp-attended-btn:hover svg { stroke: #16a34a; }
.rsvp-member-link {
    font-size: 13px;
    color: var(--color-gray-800);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rsvp-member-link:hover {
    color: #1565c0;
}
.rsvp-comment-icon {
    flex-shrink: 0;
    cursor: pointer;
}
.rsvp-comment-icon:hover svg {
    stroke: var(--color-brand);
}
.rsvp-topic-icon {
    flex-shrink: 0;
    cursor: pointer;
}
.rsvp-topic-icon:hover svg {
    stroke: #D97706;
}
/* RSVP Feedback Card (Member Suggestions & Comments) */
.rsvp-feedback-group {
    margin-bottom: 16px;
}
.rsvp-feedback-group:last-child {
    margin-bottom: 0;
}
.rsvp-feedback-heading {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--color-gray-100);
}
.rsvp-feedback-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-gray-50);
}
.rsvp-feedback-item:last-child {
    border-bottom: none;
}
.rsvp-feedback-member {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--color-brand);
    text-decoration: none;
}
.rsvp-feedback-member:hover {
    text-decoration: underline;
}
.rsvp-feedback-text {
    margin-top: 4px;
    font-size: 0.9em;
    color: var(--color-gray-700);
    line-height: 1.5;
    white-space: pre-wrap;
}

.rsvp-guest-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-gray-600);
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 8px;
    flex-shrink: 0;
}
.rsvp-sidebar-content {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* ── Attendance Sidebar Card ── */
.attendance-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-white);
    margin-left: 4px;
}
.attendance-pill.admin { background: #2e7d32; }
.attendance-pill.member { background: #2563eb; }
.attendance-source-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.attendance-source-badge.member {
    background: #dbeafe;
    color: #2563eb;
}
.attendance-source-badge.admin {
    background: #dbeafe;
    color: #1e40af;
}
.attendance-toggle {
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    user-select: none;
    -webkit-user-select: none;
}
.attendance-toggle:hover {
    background: var(--color-gray-50);
}
.attendance-toggle.checked-in {
    background: var(--color-success-light);
    border-left: 3px solid var(--color-success);
}
.attendance-toggle.checked-in .attendance-member-name {
    color: var(--color-success-text);
    font-weight: 600;
}
.attendance-toggle.toggling {
    opacity: 0.6;
    pointer-events: none;
}
.attendance-member-name {
    flex: 1;
    font-size: 0.9em;
}
.attendance-origin-icon {
    flex-shrink: 0;
    color: var(--color-gray-400);
    opacity: 0.6;
}
.attendance-toggle.checked-in .attendance-origin-icon {
    color: var(--color-success);
    opacity: 0.7;
}
.attendance-empty-msg {
    padding: 10px 15px;
    color: var(--color-gray-500);
    font-size: 0.85em;
    font-style: italic;
}
.attendance-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #d1d5db;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.attendance-remove-btn:hover {
    color: #dc2626;
}
.attendance-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    background: var(--color-brand);
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.attendance-start-btn:hover {
    background: #1e5f96;
}
.attendance-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 15px;
    border-bottom: 1px solid #f3f4f6;
}
.attendance-row:last-child {
    border-bottom: none;
}
.attendance-row .rsvp-member-link {
    flex: 1;
}
.attendance-actions-bar {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid var(--color-gray-200);
}
.attendance-walkup-wrapper {
    flex: 1;
    position: relative;
}
.attendance-walkup-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: 0.85em;
    box-sizing: border-box;
}
.attendance-walkup-results {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 150px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-md);
}
.attendance-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    background: var(--color-white);
    cursor: pointer;
    color: var(--color-gray-600);
    flex-shrink: 0;
    transition: var(--transition-fast);
}
.attendance-refresh-btn:hover {
    background: var(--color-gray-50);
    color: var(--color-brand);
    border-color: var(--color-brand);
}
.attendance-refresh-btn.spinning svg {
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Comment Modal ── */
.comment-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}
.comment-modal-overlay.visible {
    display: flex;
}
.comment-modal-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 400px;
    max-width: 90vw;
    overflow: hidden;
}
.comment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--color-gray-50);
    border-bottom: 1px solid #ddd;
}
.comment-modal-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-brand);
}
.comment-modal-header .close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.comment-modal-header .close-btn:hover {
    color: var(--color-gray-800);
}
.comment-modal-body {
    padding: 18px;
}
.comment-modal-body p {
    margin: 0;
    font-size: 14px;
    color: var(--color-gray-800);
    line-height: 1.5;
}
.comment-modal-footer {
    display: flex;
    gap: var(--space-2);
    padding: 14px 18px;
    border-top: 1px solid #ddd;
    background: var(--color-gray-50);
}

/* ─── Square Integration ─────────────────────────────────────────────────── */
.square-env-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}
.square-env-sandbox {
    background: #fff3cd;
    color: #856404;
}
.square-env-production {
    background: #d4edda;
    color: #155724;
}
.square-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
}
.square-status-completed {
    background: #d4edda;
    color: #155724;
}
.square-status-pending {
    background: #fff3cd;
    color: #856404;
}
.square-status-failed, .square-status-canceled {
    background: #f8d7da;
    color: #721c24;
}
.square-status-approved {
    background: #cce5ff;
    color: #004085;
}

/* ─── Square Device Table ──────────────────────────────────────────────── */
.square-device-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.square-device-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--color-gray-400);
    color: var(--color-gray-600);
    font-weight: 500;
    font-size: 0.85em;
    text-transform: uppercase;
}
.square-device-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}
.square-device-selected {
    background: #f0fdf4;
}
.square-device-online {
    color: #16a34a;
    font-weight: 600;
}
.square-device-offline {
    color: #9ca3af;
}
.square-device-active-label {
    color: #16a34a;
    font-weight: 600;
    font-size: 0.85em;
}
.square-sandbox-note {
    margin-top: 12px;
    padding: 8px 12px;
    background: #fff3cd;
    color: #856404;
    border-radius: 6px;
    font-size: 0.85em;
}

.square-pairing-code-card {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    text-align: center;
}
.square-pairing-code-card h4 {
    margin: 0 0 8px 0;
    color: #2e7d32;
}
.square-pairing-code {
    font-size: 2.5em;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #1b5e20;
    font-family: monospace;
    margin: 12px 0;
}
.square-pairing-code-card p {
    margin: 8px 0 0 0;
    font-size: 0.9em;
    color: var(--color-gray-800);
}

/* ─── POS Card Payment Modal ─────────────────────────────────────────── */
.pos-card-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.pos-card-overlay.active {
    display: flex;
}
.pos-card-modal {
    background: var(--color-white);
    border-radius: 16px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}
.pos-card-header {
    background: #2196F3;
    color: var(--color-white);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pos-card-header h3 {
    margin: 0;
    font-size: 1.2em;
}
.pos-card-amount {
    font-size: 1.6em;
    font-weight: 700;
}
.pos-card-body {
    padding: 24px;
}
#card-container {
    min-height: 90px;
}
.pos-card-errors {
    color: var(--color-danger);
    font-size: 0.9em;
    margin-top: 8px;
    min-height: 20px;
}
.pos-card-footer {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pos-card-pay-btn {
    background: #4CAF50;
    color: var(--color-white);
    border: none;
    border-radius: 10px;
    padding: 16px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.pos-card-pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pos-card-pay-btn:active:not(:disabled) {
    opacity: 0.8;
}
.pos-card-cancel-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    font-size: 1em;
    cursor: pointer;
    color: var(--color-gray-600);
}
.pos-card-cancel-btn:hover {
    background: #f5f5f5;
    border-color: var(--color-gray-500);
}
.pos-card-processing {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-gray-800);
}
.pos-processing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: posSpinner 0.8s linear infinite;
}
@keyframes posSpinner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ─── App Modal (replaces browser alert/confirm) ─────────────────────────── */
.app-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.app-modal-overlay.active {
    display: flex;
}
#appModal.app-modal-overlay {
    z-index: 10100;
}
.app-modal {
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    max-width: 480px;
    width: 90%;
    overflow: hidden;
    animation: appModalIn 0.15s ease-out;
}
@keyframes appModalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.app-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}
.app-modal-header.success { background: #d4edda; }
.app-modal-header.error { background: #f8d7da; }
.app-modal-header.info { background: #cce5ff; }
.app-modal-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.app-modal-title {
    font-weight: 600;
    font-size: 1em;
}
.app-modal-header.success .app-modal-title { color: #155724; }
.app-modal-header.error .app-modal-title { color: #721c24; }
.app-modal-header.info .app-modal-title { color: #004085; }
.app-modal-body {
    padding: 20px;
    font-size: 0.9em;
    color: var(--color-gray-800);
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}
.app-modal-detail {
    background: var(--color-gray-50);
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 12px;
    font-family: monospace;
    font-size: 0.85em;
    word-break: break-all;
    position: relative;
}
.app-modal-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #e9ecef;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8em;
    cursor: pointer;
    color: #555;
}
.app-modal-copy-btn:hover {
    background: #dee2e6;
}
.app-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
}
.app-modal-btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}
.app-modal-btn-primary {
    background: #4a90d9;
    color: var(--color-white);
}
.app-modal-btn-primary:hover {
    background: #3a7bc8;
}
.app-modal-btn-secondary {
    background: #e9ecef;
    color: var(--color-gray-800);
}
.app-modal-btn-secondary:hover {
    background: #dee2e6;
}

/* ==========================================
   Form Section Cards (shared: events, meetings)
   ========================================== */
.form-section {
    background: var(--color-white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}
.form-section h2 {
    font-size: 1.1em;
    color: #374151;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================
   Collapsible Sections (shared: events, meetings)
   ========================================== */
.form-section.collapsible h2 {
    cursor: pointer;
    user-select: none;
}
.form-section.collapsible h2 .collapse-chevron {
    margin-left: auto;
    transition: transform 0.2s;
}
.form-section.collapsible.collapsed h2 .collapse-chevron {
    transform: rotate(-90deg);
}
.form-section.collapsible.collapsed .form-section-body {
    display: none;
}
.form-section.collapsible.collapsed {
    padding-bottom: 16px;
}
.form-section.collapsible.collapsed h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* ==========================================
   Transcript Display (shared: events, meetings)
   ========================================== */
.transcript-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
}
.transcript-segment {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.transcript-segment:last-child {
    border-bottom: none;
}
.transcript-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.transcript-timestamp {
    font-family: monospace;
    font-size: 0.8em;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
}
.transcript-speaker {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--color-brand);
}
.transcript-text {
    font-size: 0.9em;
    color: #374151;
    line-height: 1.5;
    padding-left: 2px;
}
.transcript-segment .seg-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}
.transcript-segment.seg-collapsed .transcript-text {
    display: none;
}
.transcript-segment.seg-collapsed .seg-chevron {
    transform: rotate(-90deg);
}

/* Speaker Time Summary */
.speaker-time-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.speaker-time-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 20px;
    font-size: 0.85em;
    color: #0c4a6e;
}
.speaker-time-chip .speaker-chip-name {
    font-weight: 600;
}
.speaker-time-chip .speaker-chip-time {
    color: #6b7280;
    font-size: 0.9em;
}
.speaker-time-chip .speaker-chip-pct {
    background: #e0f2fe;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
    color: #0369a1;
}

/* Content Card Save Button */
.content-card-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--color-success);
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    margin-top: 10px;
}
.content-card-save:hover {
    background: var(--color-success-dark);
}
.content-card-save:disabled {
    background: #94d3a2;
    cursor: not-allowed;
}

/* Audio Player Modal */
.audio-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.audio-modal-overlay.active {
    display: flex;
}
.audio-modal {
    background: var(--color-white);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.audio-modal h3 {
    margin: 0 0 16px 0;
    font-size: 1.1em;
    color: #1f2937;
}
.audio-modal audio {
    width: 100%;
    margin-bottom: 12px;
}
.audio-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.audio-modal-close {
    background: #6b7280;
    color: var(--color-white);
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
}

/* Document Category Badges (shared) */
.doc-category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 500;
}
.doc-category-general { background: #f3f4f6; color: #6b7280; }
.doc-category-transcript { background: #dcfce7; color: #166534; }
.doc-category-audio { background: #fef3c7; color: #92400e; }
.doc-category-pdf { background: #fee2e2; color: #991b1b; }
.doc-category-spreadsheet { background: #d1fae5; color: #065f46; }
.doc-category-document { background: #dbeafe; color: #1e40af; }
.doc-category-presentation { background: #ffedd5; color: #9a3412; }
.doc-category-image { background: #ccfbf1; color: #0f766e; }
.doc-category-video { background: #ede9fe; color: #5b21b6; }

/* ==========================================
   Google Drive File Picker Modal
   ========================================== */
.drive-picker-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.drive-picker-overlay.active {
    display: flex;
}
.drive-picker-modal {
    background: var(--color-white);
    border-radius: 12px;
    width: 560px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.drive-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.drive-picker-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}
.drive-picker-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.drive-picker-close:hover { color: #374151; }
.drive-picker-breadcrumb {
    padding: 10px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.85em;
    color: #6b7280;
}
.drive-breadcrumb-item {
    cursor: pointer;
    color: var(--color-brand);
}
.drive-breadcrumb-item:hover { text-decoration: underline; }
.drive-breadcrumb-item.active {
    color: #374151;
    font-weight: 600;
    cursor: default;
}
.drive-breadcrumb-item.active:hover { text-decoration: none; }
.drive-breadcrumb-sep { color: #d1d5db; margin: 0 2px; }
.drive-picker-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: #9ca3af;
    font-size: 0.9em;
}
.drive-picker-list {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 400px;
}
.drive-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid #f3f4f6;
}
.drive-item:hover { background: #f9fafb; }
.drive-item.drive-folder { cursor: pointer; font-weight: 500; }
.drive-item.drive-file { cursor: default; }
.drive-item-info { flex: 1; min-width: 0; }
.drive-item-name {
    display: block;
    font-size: 0.9em;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drive-item-meta {
    display: block;
    font-size: 0.78em;
    color: #9ca3af;
    margin-top: 2px;
}
.drive-file-category {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8em;
    flex-shrink: 0;
}
.drive-picker-selected {
    display: none;
    align-items: center;
    padding: 8px 20px;
    background: #eff6ff;
    border-top: 1px solid #dbeafe;
    font-size: 0.85em;
    color: var(--color-brand);
    font-weight: 500;
}
.drive-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
}
.drive-picker-footer .btn-drive-cancel {
    background: var(--color-white);
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
}
.drive-picker-footer .btn-drive-cancel:hover { background: #f9fafb; }
.drive-picker-footer .btn-drive-import {
    background: var(--color-brand);
    color: var(--color-white);
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}
.drive-picker-footer .btn-drive-import:hover { background: #1e5f96; }
.drive-picker-footer .btn-drive-import:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}
.drive-empty, .drive-error {
    text-align: center;
    padding: 40px;
    font-size: 0.9em;
}
.drive-empty { color: #9ca3af; }
.drive-error { color: #dc2626; }
@media (max-width: 600px) {
    .drive-picker-modal { width: 100%; max-height: 90vh; border-radius: 8px; }
    .drive-item { padding: 10px 14px; }
    .drive-file-category { font-size: 0.75em; padding: 3px 6px; }
}

/* AI Insights */
.ai-insights-card .similar-members-header {
    background: linear-gradient(135deg, #f0f0ff 0%, #f8f9fa 100%);
}
.ai-summary-section {
    padding: 10px 15px;
    border-bottom: 1px solid var(--color-gray-200);
}
.ai-summary-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #374151;
    white-space: pre-wrap;
}
.ai-summary-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 6px;
}
.ai-insight-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}
.ai-insight-item:last-child {
    border-bottom: none;
}
.ai-insight-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.ai-insight-reason {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 8px;
    line-height: 1.3;
}
.ai-insight-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
.ai-insight-actions .btn {
    font-size: 0.75rem;
    padding: 2px 12px;
}
.ai-insight-applied {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #16a34a;
    font-size: 0.85rem;
    padding: 4px 0;
}
/* Shimmer loading animation */
.ai-shimmer-container {
    padding: 8px 0;
}
.ai-shimmer-line {
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: aiShimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}
.ai-shimmer-line.short {
    width: 60%;
}
@keyframes aiShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* AI Insights Dashboard */
.ai-dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.ai-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.ai-dashboard-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
}
.insights-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.insights-stats .stat-card {
    flex: 1;
    min-width: 160px;
    background: var(--color-white);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}
.insights-stats .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-brand);
}
.insights-stats .stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
}
.ai-dashboard-section {
    background: var(--color-white);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.ai-dashboard-section .gridjs-table {
    table-layout: fixed;
}
.ai-dashboard-section .gridjs-td {
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-dashboard-section h2 {
    margin: 0 0 15px 0;
    font-size: 1.15rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.count-badge {
    background: #e5e7eb;
    color: #374151;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}
/* Needs Analysis — distinct amber section */
.ai-needs-analysis-section {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
}
.ai-needs-analysis-section h2 {
    color: #92400e;
}
.ai-needs-badge {
    background: #fbbf24;
    color: #78350f;
}
.ai-needs-hint {
    margin: -8px 0 14px 0;
    font-size: 0.85rem;
    color: #92400e;
}
.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.suggestions-filters {
    display: flex;
    gap: 4px;
}
.filter-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
}
.filter-btn.active {
    background: var(--color-brand);
    color: var(--color-white);
    border-color: var(--color-brand);
}
.filter-btn:hover:not(.active) {
    background: #e5e7eb;
}
/* Type badges */
.ai-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}
.type-field { background: #dbeafe; color: #1e40af; }
.type-family { background: #d1fae5; color: #065f46; }
.type-family-update { background: #fef3c7; color: #92400e; }
.type-vendor { background: #fff7ed; color: #c2410c; }
.type-affiliate { background: #ede9fe; color: #5b21b6; }
.type-affiliate-update { background: #f3e8ff; color: #7c3aed; }
.type-org { background: #fce7f3; color: #9d174d; }
/* Entity type badges */
.ai-entity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}
.entity-member { background: #e0f2fe; color: #0369a1; }
.entity-affiliate { background: #ede9fe; color: #5b21b6; }
.entity-org { background: #fce7f3; color: #9d174d; }
/* Status badges */
.ai-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 500;
}
.status-applied { background: #d1fae5; color: #065f46; }
.status-dismissed { background: #e5e7eb; color: #6b7280; }
/* AI insights button color combos (sizing from canonical .btn-sm above) */
.btn-sm.btn-primary {
    background: var(--color-brand);
    color: var(--color-white);
}
.btn-sm.btn-success {
    background: #16a34a;
    color: var(--color-white);
}
.btn-sm.btn-outline {
    background: var(--color-white);
    color: #6b7280;
    border: 1px solid #d1d5db;
}
.btn-sm.btn-outline:hover {
    background: #f3f4f6;
}
.btn-sm.btn-done {
    background: #d1fae5;
    color: #065f46;
}
.btn-sm.btn-analyzing {
    background: #fef3c7;
    color: #92400e;
}
.applied-info {
    font-size: 0.75rem;
    color: #9ca3af;
}
/* Icon action buttons for AI suggestions grid */
.ai-actions-cell {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}
.btn-icon {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: var(--color-white);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}
.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-icon-success { color: #16a34a; }
.btn-icon-success:hover:not(:disabled) {
    background: #d1fae5;
    border-color: #16a34a;
}
.btn-icon-dismiss { color: #9ca3af; }
.btn-icon-dismiss:hover:not(:disabled) {
    background: #fee2e2;
    border-color: #ef4444;
    color: #ef4444;
}
.btn-icon-warning { color: var(--color-warning-text); }
.btn-icon-warning:hover:not(:disabled) {
    background: var(--color-warning-light);
    border-color: var(--color-warning);
    color: var(--color-warning-dark);
}
@keyframes spin-icon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin-icon {
    animation: spin-icon 1s linear infinite;
}
.btn-icon-chat { color: var(--color-brand); }
.btn-icon-chat:hover:not(:disabled) {
    background: #dbeafe;
    border-color: var(--color-brand);
}
.status-redirected {
    background: #dbeafe;
    color: #1e40af;
}
/* Custom AI Search */
.ai-custom-search {
    background: var(--color-white);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.ai-custom-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.ai-custom-search-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s;
}
.ai-custom-search-input:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(40, 116, 181, 0.1);
}
/* Button inline SVG icon alignment */
.btn-svg-icon {
    margin-right: 6px;
    vertical-align: -2px;
}
.btn-copy-icon {
    vertical-align: middle;
    margin-right: 4px;
}
/* AI modal size variants */
.app-modal-sm { max-width: 420px; }
.app-modal-md { max-width: 580px; }
.app-modal-body-scroll { max-height: 500px; overflow-y: auto; }
/* Dismiss modal */
.ai-dismiss-hint {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #374151;
}
.ai-modal-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.88rem;
    resize: vertical;
    box-sizing: border-box;
}
/* Redirect modal */
.ai-redirect-context {
    background: var(--color-gray-50);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
    font-size: 0.85rem;
}
.ai-redirect-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 6px;
}
.ai-redirect-loading {
    display: none;
    text-align: center;
    padding: 20px;
}
.ai-redirect-loading-text {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #6b7280;
}
.ai-redirect-results-heading {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin: 14px 0 8px;
}
/* Redirect revised suggestion cards */
.ai-revised-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.ai-revised-label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    cursor: pointer;
}
.ai-revised-check {
    margin-top: 3px;
}
.ai-revised-title {
    font-weight: 600;
    font-size: 0.88rem;
}
.ai-revised-meta {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 2px;
}
.ai-revised-reason {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 4px;
}
/* Redirect context in startRedirect JS */
.ai-context-type-line {
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.82rem;
}
.ai-context-reason {
    margin-top: 6px;
    font-size: 0.82rem;
    color: #6b7280;
}
/* Grid cell no-wrap for dates */
.cell-nowrap { white-space: nowrap; }
/* Hidden by default, shown via JS */
.hidden { display: none; }
/* Analysis progress bar */
.analysis-progress-container {
    background: var(--color-white);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
}
.analysis-progress-text {
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 8px;
}
.analysis-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}
.analysis-progress-fill {
    height: 100%;
    background: var(--color-brand);
    border-radius: 4px;
    transition: width 0.3s;
}
.ai-empty-state {
    text-align: center;
    padding: 30px;
    color: #9ca3af;
    font-size: 0.95rem;
}

/* ==========================================
   Event Staffing Import - Member Updates
   ========================================== */
.member-updates-section {
    margin-top: 2rem;
    border-top: 1px solid #dee2e6;
    padding-top: 1.5rem;
}
.member-updates-table .old-value {
    color: var(--color-gray-700);
    text-decoration: line-through;
}
.member-updates-table .new-value {
    color: #155724;
    font-weight: 600;
}
.member-updates-table .arrow-cell {
    text-align: center;
    color: var(--color-brand);
    font-size: 1.2em;
    padding: 0.75rem 0.5rem;
}
.badge-add {
    background: #d4edda;
    color: #155724;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    display: inline-block;
}
.badge-change {
    background: #fff3cd;
    color: #856404;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    display: inline-block;
}
.summary-item.update-info {
    background: #e7f1ff;
}
.summary-item.update-info .summary-number {
    color: var(--color-brand);
}
.member-updates-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   VENDOR ORDERS
   ============================================ */

/* Full-width page wrapper (no max-width constraint) */
.page-container-wide {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: var(--space-5);
}

/* ──────────────── Financial Party Detail ──────────────── */
.card-title-action {
    float: right;
    font-size: var(--font-sm);
}

.add-contact-form {
    margin-top: var(--space-4);
    padding: var(--space-4);
    border: 1px dashed var(--color-gray-300);
    border-radius: var(--radius-lg);
}

.add-contact-heading {
    margin-bottom: var(--space-3);
}

.add-contact-actions {
    text-align: right;
    margin-top: var(--space-2);
}

/* Inline edit inputs for contact table rows */
.inline-edit-name {
    width: 80px;
    display: inline;
    margin-right: 4px;
}

.inline-edit-field {
    width: 100px;
}

.inline-edit-phone {
    width: 110px;
}

.inline-edit-email {
    width: 140px;
}

/* Storage category color dots */
.category-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
}
.category-dot-dry { background: #f59e0b; }
.category-dot-refrigerated { background: #3b82f6; }
.category-dot-frozen { background: #8b5cf6; }

/* Tom Select overrides — match .form-group input styling */
.form-group .ts-wrapper.single .ts-control {
    padding: 10px;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    background-color: var(--color-white);
    cursor: pointer;
}
.form-group .ts-wrapper.single .ts-control:hover {
    border-color: #bbb;
}
.form-group .ts-wrapper.single.focus .ts-control {
    border-color: var(--color-brand);
    box-shadow: 0 0 5px var(--color-brand-focus);
}
.form-group .ts-wrapper .ts-dropdown {
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    margin-top: 2px;
    font-size: 14px;
    font-family: Arial, sans-serif;
}
.form-group .ts-wrapper .ts-dropdown .option.active {
    background-color: var(--color-brand);
    color: var(--color-white);
}
.form-group .ts-wrapper .ts-dropdown .option:hover {
    background-color: #e8f0fe;
    color: #1e293b;
}
.form-group .ts-wrapper .ts-dropdown .option.active:hover {
    background-color: var(--color-brand);
    color: var(--color-white);
}
.form-group .ts-wrapper .ts-control > input {
    font-size: 14px;
    font-family: Arial, sans-serif;
}
.form-group .ts-wrapper .no-results {
    padding: 10px;
    color: #94a3b8;
    text-align: center;
}

/* Paired inputs (e.g., Route / Stop) */
.input-pair {
    display: flex;
    align-items: center;
    gap: 8px;
}
.input-pair .form-control {
    flex: 1;
}
.input-pair-separator {
    color: #94a3b8;
    font-weight: 500;
    flex-shrink: 0;
}

/* Add item form row */
.add-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    align-items: end;
}
.add-item-grid .form-group {
    margin-bottom: 0;
}

/* Form row with 4 columns */
.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}
.form-row-4 .form-group {
    margin-bottom: 0;
}

/* ── Contact Intake ─────────────────────────────── */
.intake-subtitle {
    color: #6b7280;
    margin: 0 0 16px 0;
    font-size: 0.95em;
}

.intake-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.intake-drop-zone:hover {
    border-color: var(--color-brand);
    background: #f8fafc;
}

.intake-drop-zone.intake-drop-active {
    border-color: #16a34a;
    background: #f0fdf4;
}

.intake-drop-icon {
    width: 48px;
    height: 48px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.intake-drop-text {
    font-size: 1em;
    color: #374151;
    margin-bottom: 4px;
}

.intake-drop-hint {
    font-size: 0.85em;
    color: #9ca3af;
}

.intake-camera-row {
    margin-top: 12px;
    text-align: center;
}

.intake-camera-btn {
    display: none;
}

@media (max-width: 768px) {
    .intake-camera-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
}

.intake-file-list {
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.intake-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9em;
}

.intake-file-item:last-child {
    border-bottom: none;
}

.intake-file-icon {
    font-size: 1.2em;
}

.intake-file-name {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.intake-file-remove {
    color: #ef4444;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
}

.intake-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    color: #6b7280;
    font-size: 0.9em;
}

.intake-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

.intake-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.intake-results-table th {
    background: #f8fafc;
    color: #374151;
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.intake-results-table td {
    padding: 6px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.intake-row-dup {
    background: #fffbeb;
}

.intake-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 80px;
}

.intake-input:focus {
    border-color: var(--color-brand);
    outline: none;
}

.intake-input-sm {
    min-width: 60px;
}

.intake-dest-select,
.intake-sub-select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.85em;
    background: var(--color-white);
}

.intake-sub-picker {
    margin-top: 4px;
}

.intake-source {
    font-size: 0.8em;
    color: #9ca3af;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.intake-dup-badge {
    display: inline-block;
    font-size: 0.75em;
    color: #92400e;
    background: #fef3c7;
    padding: 1px 6px;
    border-radius: 10px;
    margin-top: 2px;
    text-decoration: none;
    white-space: nowrap;
}

.intake-dup-badge:hover {
    background: #fde68a;
}

.intake-save-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.intake-optin-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: var(--color-gray-600);
    cursor: pointer;
}

.intake-save-summary {
    font-size: 1.05em;
    margin-bottom: 12px;
}

.intake-save-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.intake-save-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.intake-save-ok a {
    color: #16a34a;
    font-weight: 500;
}

.intake-save-merged a {
    color: #2563eb;
    font-weight: 500;
}

.intake-save-err {
    color: #ef4444;
}


/* ============================================
   Backlog Idea Capture — FAB + Modal + Toast
   ============================================ */

/* Footer Lightbulb Button */
.backlog-footer-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 2px;
    vertical-align: middle;
    line-height: 1;
    transition: color 0.2s;
}

.backlog-footer-btn:hover {
    color: #f59e0b;
}

/* Modal Overlay */
.backlog-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 2500;
    display: none;
    justify-content: center;
    align-items: center;
}

.backlog-modal-overlay.active {
    display: flex;
}

/* Modal Card */
.backlog-modal-card {
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 460px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: backlogModalIn 0.15s ease-out;
}

@keyframes backlogModalIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.backlog-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

.backlog-modal-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    font-weight: 600;
    color: var(--color-brand);
}

.backlog-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.backlog-close-btn:hover {
    color: var(--color-gray-800);
}

.backlog-modal-body {
    padding: 20px;
}

.backlog-form-group {
    margin-bottom: 14px;
}

.backlog-form-group label {
    display: block;
    font-size: 0.85em;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.backlog-required {
    color: #dc2626;
}

.backlog-form-group input[type="text"],
.backlog-form-group textarea,
.backlog-form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95em;
    box-sizing: border-box;
    font-family: inherit;
}

.backlog-form-group input[type="text"]:focus,
.backlog-form-group textarea:focus,
.backlog-form-group select:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px var(--color-brand-subtle);
}

.backlog-input-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15) !important;
}

.backlog-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.backlog-form-row {
    display: flex;
    gap: 12px;
}

.backlog-form-row .backlog-form-group {
    flex: 1;
}

.backlog-context-info {
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    color: #6b7280;
    font-size: 0.8em;
}

.backlog-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e9ecef;
}

.backlog-btn-cancel {
    padding: 8px 16px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
}

.backlog-btn-cancel:hover {
    background: #e5e7eb;
}

.backlog-btn-submit {
    padding: 8px 20px;
    background: var(--color-brand);
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}

.backlog-btn-submit:hover {
    background: var(--color-brand-dark);
}

.backlog-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Toast */
.backlog-toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    background: #16a34a;
    color: var(--color-white);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 2600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: backlogToastIn 0.2s ease-out;
}

.backlog-toast.active {
    display: flex;
}

@keyframes backlogToastIn {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ── Backlog Admin List ─────────────────────── */

.backlog-priority-critical {
    background: #fef2f2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.backlog-priority-high {
    background: #fff7ed;
    color: #ea580c;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.backlog-priority-medium {
    background: #eff6ff;
    color: #2563eb;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.backlog-priority-low {
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.backlog-status-open {
    background: #eff6ff;
    color: #2563eb;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
}

.backlog-status-in_progress {
    background: #fef9c3;
    color: #a16207;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
}

.backlog-status-completed {
    background: #dcfce7;
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
}

.backlog-status-deferred {
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
}

.backlog-status-select {
    padding: 2px 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    background: var(--color-white);
}

.backlog-settings-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.backlog-settings-bar label {
    font-size: 0.85em;
    font-weight: 500;
    color: #475569;
}

.backlog-settings-bar select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85em;
}

.backlog-selected-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.backlog-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 12px;
    font-size: 0.8em;
}

.backlog-member-chip button {
    background: none;
    border: none;
    color: #0369a1;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 2px;
    line-height: 1;
}

.backlog-member-chip button:hover {
    color: #dc2626;
}

.backlog-item-desc-preview {
    color: #6b7280;
    font-size: 0.85em;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Backlog ID badge (detail page) */
.backlog-id-badge {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    font-size: 0.85em;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 6px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Backlog ID link (list page) */
.backlog-id-link {
    font-weight: 700;
    font-size: 1.05em;
}

/* Plan badge on list */
.backlog-plan-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.75em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Plan card header */
.backlog-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.backlog-plan-header .card-title {
    margin: 0;
}

.backlog-plan-actions {
    display: flex;
    gap: 8px;
}

/* Plan content */
.backlog-plan-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    font-size: 0.9em;
    line-height: 1.6;
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.backlog-plan-meta {
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 10px;
}

.backlog-plan-stale {
    color: #d97706;
    font-weight: 600;
}

.backlog-plan-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: #6b7280;
}

.backlog-plan-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Implement section */
.backlog-implement-info {
    font-size: 0.9em;
}

.backlog-implement-info p {
    margin: 0 0 8px;
}

.backlog-cli-command {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e293b;
    color: #e2e8f0;
    padding: 10px 14px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
}

.backlog-cli-command code {
    flex: 1;
    word-break: break-word;
}

.backlog-copy-btn {
    background: none;
    border: 1px solid #475569;
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    flex-shrink: 0;
}

.backlog-copy-btn:hover {
    background: #334155;
    color: #e2e8f0;
}

.backlog-impl-status {
    margin-top: 10px;
    font-weight: 500;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .backlog-fab {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }

    .backlog-modal-card {
        width: 95vw;
        max-height: 85vh;
    }

    .backlog-form-row {
        flex-direction: column;
        gap: 0;
    }

    .backlog-toast {
        bottom: 70px;
        right: 16px;
    }

    .backlog-settings-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Print: hide floating button */
@media print {
    .backlog-fab,
    .backlog-modal-overlay,
    .backlog-toast {
        display: none !important;
    }
}

/* ============================================================
   Staffing Import Page
   ============================================================ */
.import-events-box {
    margin-bottom: 1.5rem;
}

.import-events-list {
    margin: 0.5rem 0 0 1.5rem;
}

.import-preview-source {
    font-size: 0.7em;
    color: var(--color-gray-700);
    font-weight: normal;
}

.import-action-inline {
    display: inline;
}

.import-actions-bar {
    margin-bottom: 1.5rem;
}

.badge-add {
    background: #d4edda;
    color: #155724;
}

.badge-change {
    background: #fff3cd;
    color: #856404;
}

/* Student Volunteer Section on Staffing Page */
.student-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #FFD700;
}

.student-section-header h2 {
    margin: 0;
    color: #B8860B;
    font-size: 1.2em;
}

.student-job-card {
    border-left: 3px solid #FFD700;
}

.student-job-header {
    background-color: #fffbf0 !important;
    border-bottom-color: #f0e8d0 !important;
}

/* Student divider in staffing sidebar */
.staffing-student-divider {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px 4px;
    font-size: 0.8em;
    font-weight: 600;
    color: #B8860B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid #f0e8d0;
    margin-top: 4px;
}

.staffing-sidebar-student {
    border-left: 3px solid #FFD700;
}

.staffing-sidebar-manage-btn {
    padding: 10px 15px;
    border-top: 1px solid var(--color-gray-200);
}

.staffing-manage-link {
    width: 100%;
    justify-content: center;
}

/* ============================================
   Event Jobs List Page
   ============================================ */

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

.ej-header h1 {
    margin: 0;
    color: var(--color-brand);
}

.ej-filter-bar {
    background: var(--color-white);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.ej-filter-bar form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ej-filter-bar label {
    font-weight: 500;
    color: var(--color-gray-800);
}

.ej-filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

/* Grid.js overrides for jobs table */
#jobsGrid .gridjs-td:first-child {
    padding: 4px 2px;
    text-align: center;
}

.ej-drag-handle {
    cursor: grab;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.ej-drag-handle:hover {
    color: #6b7280;
}

.ej-drag-handle:active {
    cursor: grabbing;
}

.ej-dragging {
    opacity: 0.5;
    background: #dbeafe !important;
}

.ej-drag-over {
    border-top: 2px solid var(--color-brand) !important;
}

.ej-job-name {
    font-weight: 600;
    color: var(--color-brand);
    text-decoration: none;
}

.ej-job-name:hover {
    text-decoration: underline;
}

.ej-description {
    color: #555;
    font-size: 0.9em;
    line-height: 1.4;
}

.ej-category-badge {
    display: inline-block;
    padding: 2px 10px;
    background-color: #e3f2fd;
    color: #1565c0;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}


.ej-time {
    font-size: 0.85em;
    color: #555;
}

.ej-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
}

.ej-status-badge:hover {
    transform: scale(1.05);
}

.ej-status-active {
    background-color: #c8e6c9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.ej-status-inactive {
    background-color: #ffcdd2;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.ej-visibility-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
}

.ej-visibility-badge:hover {
    transform: scale(1.05);
}

.ej-visibility-public {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.ej-visibility-internal {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.ej-action-link {
    color: var(--color-brand);
    text-decoration: none;
    font-size: 0.9em;
}

.ej-action-link:hover {
    text-decoration: underline;
}

.ej-action-divider {
    color: #ccc;
    margin: 0 4px;
}

.ej-delete-link {
    color: var(--color-danger);
}

.empty-state-box {
    text-align: center;
    padding: 40px;
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.empty-state-box p {
    color: var(--color-gray-600);
    margin-bottom: 20px;
}

/* ============================================
   Public Pages (standalone, no base template)
   ============================================ */

.public-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: var(--color-gray-800);
    line-height: 1.6;
}

.public-header {
    background: var(--color-brand);
    color: var(--color-white);
    text-align: center;
    padding: 30px 20px 25px;
}

.public-header h1 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.public-header h2 {
    margin: 0;
    font-size: 1.6em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.public-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

.public-intro {
    font-size: 1.05em;
    color: #444;
    margin-bottom: 30px;
    background: var(--color-white);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--color-brand);
}

.public-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.public-job-card {
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.public-job-card-student {
    border-left: 4px solid #FFD700;
}

.public-job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--color-gray-200);
    flex-wrap: wrap;
    gap: 8px;
}

.public-job-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--color-brand);
    display: flex;
    align-items: center;
    gap: 6px;
}

.public-job-time {
    font-size: 0.85em;
    color: var(--color-gray-600);
    background: #e8f0fe;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.public-job-desc {
    padding: 15px 20px;
    margin: 0;
    color: #444;
    white-space: pre-line;
}

.public-job-count {
    display: block;
    padding: 8px 20px 12px;
    font-size: 0.85em;
    color: #888;
}

.public-section {
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 20px;
}

.public-section h3 {
    margin: 0 0 12px 0;
    color: var(--color-brand);
    font-size: 1.15em;
}

.public-section ul {
    margin: 10px 0;
    padding-left: 25px;
}

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

.public-expectations {
    background: #fffbf0;
    border: 1px solid #f0e8d0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
}

.public-expectations h3 {
    margin: 0 0 12px 0;
    color: #B8860B;
    font-size: 1.1em;
}

.public-expectations ul {
    margin: 10px 0 0 0;
    padding-left: 25px;
}

.public-expectations li {
    margin-bottom: 10px;
}

.public-note {
    background: #e8f4fd;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 20px;
    color: #1a5276;
}

.public-note a {
    color: var(--color-brand);
}

.public-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 25px 0;
}

.public-links a {
    color: var(--color-brand);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--color-brand);
    border-radius: 6px;
    font-size: 0.9em;
    transition: all var(--transition-base);
}

.public-links a:hover {
    background: var(--color-brand);
    color: var(--color-white);
}

.public-cta {
    text-align: center;
    margin: 20px 0;
}

.public-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--color-brand);
    color: var(--color-white);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}

.public-btn:hover {
    background: var(--color-brand-dark);
}

.public-footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.85em;
    border-top: 1px solid #ddd;
    margin-top: 20px;
}

/* Print styles for public pages */
@media print {
    .public-page {
        background: var(--color-white);
        font-size: 11pt;
    }
    .public-header {
        padding: 15px 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .public-content {
        max-width: 100%;
        padding: 15px 0;
    }
    .public-section {
        box-shadow: none;
        border: 1px solid var(--color-gray-300);
        padding: 15px;
        margin-bottom: 12px;
        break-inside: avoid;
    }
    .public-note {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        break-inside: avoid;
    }
    .public-cta {
        display: none;
    }
    .public-footer {
        margin-top: 10px;
        border-top: 1px solid #ccc;
    }
}

/* ============================================================
   VIRTUS Guidelines Page
   ============================================================ */
.virtus-print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.virtus-print-header h2 {
    margin: 0 0 4px 0;
}

.virtus-subtitle {
    color: var(--color-gray-600);
    font-size: 0.95em;
    margin: 0;
}

.virtus-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.virtus-disclaimer {
    background: #fff3cd;
    border: 1px solid var(--color-warning);
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 1.5rem;
    font-size: 0.9em;
    line-height: 1.5;
}

.virtus-section {
    background: #fff;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 1.25rem;
}

.virtus-section h3 {
    margin: 0 0 14px 0;
    color: var(--color-brand);
    font-size: 1.15em;
    border-bottom: 2px solid var(--color-brand);
    padding-bottom: 8px;
}

.virtus-section h4 {
    margin: 16px 0 8px 0;
    font-size: 0.95em;
    color: var(--color-gray-800);
}

.virtus-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.virtus-card {
    background: #f0f6fb;
    border: 1px solid #c5d9ea;
    border-radius: 6px;
    padding: 14px 16px;
}

.virtus-card h4 {
    margin: 0 0 6px 0;
    color: var(--color-brand);
    font-size: 0.95em;
}

.virtus-card p {
    margin: 0;
    font-size: 0.88em;
    line-height: 1.45;
    color: #444;
}

.virtus-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.virtus-ok-header {
    color: var(--color-success) !important;
}

.virtus-no-header {
    color: var(--color-danger) !important;
}

.virtus-list {
    margin: 0 0 8px 0;
    padding-left: 20px;
    font-size: 0.9em;
    line-height: 1.6;
}

.virtus-list li {
    margin-bottom: 4px;
}

.virtus-list-ok li::marker {
    color: var(--color-success);
}

.virtus-list-no li::marker {
    color: var(--color-danger);
}

.virtus-warnings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.virtus-warning-item {
    background: #fff8f0;
    border-left: 3px solid #e67e22;
    padding: 10px 14px;
    font-size: 0.88em;
    line-height: 1.45;
    border-radius: 0 4px 4px 0;
}

.virtus-key-principle {
    background: #eef4fa;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 0.9em;
    margin-top: 8px;
}

.virtus-report-box {
    background: var(--color-gray-50);
    border-radius: 6px;
    padding: 16px 20px;
}

.virtus-report-box p {
    font-size: 0.9em;
    line-height: 1.55;
    margin: 0 0 12px 0;
}

.virtus-report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.9em;
}

.virtus-report-table td {
    padding: 10px 14px;
    border: 1px solid var(--color-gray-300);
    vertical-align: top;
}

.virtus-report-table tr:first-child td {
    background: #f8d7da;
}

.virtus-report-table td:first-child {
    width: 200px;
    font-weight: 600;
    background: #f1f3f5;
}

.virtus-report-warning {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px 14px;
    margin-top: 12px;
    margin-bottom: 0;
}

.virtus-boundary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.virtus-boundary-table th {
    background: var(--color-brand);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
}

.virtus-boundary-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-gray-200);
}

.virtus-boundary-table td:first-child {
    font-weight: 600;
    width: 180px;
    color: var(--color-gray-800);
}

.virtus-boundary-table tbody tr:nth-child(even) {
    background: var(--color-gray-50);
}

.virtus-footer-note {
    text-align: center;
    padding: 16px 0;
    color: #888;
    font-size: 0.85em;
}

.virtus-footer-note p {
    margin: 4px 0;
}

/* VIRTUS Print Styles */
@media print {
    .virtus-print-btn,
    .sidebar,
    .navbar,
    .app-footer,
    .backlog-fab {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        max-width: 100% !important;
        padding-top: 0 !important;
    }

    .page-container-wide {
        max-width: 100% !important;
        padding: 0 10px !important;
        margin: 0 !important;
    }

    .virtus-print-header {
        border-bottom: 2px solid #000;
        padding-bottom: 8px;
        margin-bottom: 16px;
    }

    .virtus-section {
        border: 1px solid #ccc;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .virtus-warnings {
        grid-template-columns: 1fr 1fr;
    }

    .virtus-cards {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
   Parish Ledger
   ============================================================ */

.ledger-balance-section {
    margin-bottom: 30px;
}

.ledger-balance-card {
    background: linear-gradient(135deg, #1a5276, #2980b9);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.ledger-balance-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ledger-balance-amount {
    font-size: 48px;
    font-weight: 700;
    margin: 8px 0;
}

.ledger-balance-meta {
    font-size: 13px;
    opacity: 0.8;
}

.ledger-stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ledger-stats-compact {
    margin-bottom: 20px;
}

.ledger-stat-card {
    flex: 1;
    min-width: 140px;
    background: #fff;
    border: 1px solid var(--color-gray-400);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.ledger-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-gray-800);
}

.ledger-stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ledger-stat-credit {
    color: #27ae60;
}

.ledger-stat-debit {
    color: #c0392b;
}

.ledger-actions {
    margin-bottom: var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.ledger-actions .inline-form {
    display: contents;
}

.ledger-debit {
    color: #c0392b;
}

.ledger-credit {
    color: #27ae60;
}

/* Import page */
.ledger-import-section {
    margin-bottom: 30px;
}

.ledger-import-divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.ledger-import-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid #ddd;
}

.ledger-import-divider span {
    background: #f5f5f5;
    padding: 0 16px;
    position: relative;
    color: #888;
    font-weight: 600;
}

.ledger-import-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.ledger-preview-header {
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-400);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
}

.ledger-preview-field strong {
    color: #555;
}

.ledger-raw-text {
    margin-top: 20px;
}

.ledger-raw-text summary {
    cursor: pointer;
    color: #2980b9;
    font-weight: 600;
}

.ledger-raw-text pre {
    background: #f4f4f4;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    padding: 16px;
    max-height: 400px;
    overflow: auto;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .ledger-balance-amount {
        font-size: 36px;
    }

    .ledger-stats-row {
        flex-direction: column;
    }

    .ledger-stat-card {
        min-width: 100%;
    }

    .ledger-preview-header {
        flex-direction: column;
        gap: 8px;
    }
}


/* ============================================================
   Transaction Payment Method Badges
   ============================================================ */

.txn-method-cash,
.txn-method-card,
.txn-method-check,
.txn-method-eft,
.txn-method-other {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
}

.txn-method-cash {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.txn-method-card {
    background-color: #e3f2fd;
    color: #1565c0;
}

.txn-method-check {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.txn-method-eft {
    background-color: #fff3e0;
    color: #e65100;
}

.txn-method-other {
    background-color: var(--color-gray-100);
    color: #616161;
}

/* Meal Counts Summary */
.meal-counts-summary {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 16px 20px;
    margin-bottom: 20px;
}
.meal-counts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.meal-counts-header h3 {
    margin: 0;
    font-size: 1.05em;
    color: var(--color-gray-800);
}
.meal-total-badge {
    font-size: 0.85em;
    color: #555;
    background: #f0f4f8;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.meal-counts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
}
.meal-count-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: var(--color-gray-50);
    border-radius: 4px;
    font-size: 0.9em;
}
.meal-count-name {
    flex: 1;
    color: var(--color-gray-800);
}
.meal-count-qty {
    font-weight: 700;
    color: var(--color-brand);
    min-width: 36px;
    text-align: right;
    margin-right: 12px;
}
.meal-count-rev {
    color: var(--color-gray-600);
    min-width: 70px;
    text-align: right;
}

/* Transaction List Page */
.txn-totals-summary {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}
.txn-total-item {
    padding: 12px 24px;
    border-radius: 8px;
    text-align: center;
    min-width: 140px;
}
.txn-total-income { background-color: #e8f5e9; border: 1px solid #a5d6a7; }
.txn-total-expense { background-color: #ffebee; border: 1px solid #ef9a9a; }
.txn-total-fees { background-color: #fff3e0; border: 1px solid #ffcc80; }
.txn-total-net-income { background-color: #e8f5e9; border: 1px solid #a5d6a7; }
.txn-total-net.net-positive { background-color: #e8f5e9; border: 1px solid #a5d6a7; }
.txn-total-net.net-negative { background-color: #ffebee; border: 1px solid #ef9a9a; }
.txn-total-net { background-color: #e3f2fd; border: 1px solid #90caf9; }
.txn-total-label {
    display: block;
    font-size: 0.85em;
    color: var(--color-gray-600);
    margin-bottom: 4px;
}
.txn-total-value {
    display: block;
    font-size: 1.25em;
    font-weight: 600;
}
.txn-total-income .txn-total-value { color: #2e7d32; }
.txn-total-expense .txn-total-value { color: #c62828; }
.txn-total-fees .txn-total-value { color: #e65100; }
.txn-total-net-income .txn-total-value { color: #2e7d32; }
.txn-total-net.net-positive .txn-total-value { color: #2e7d32; }
.txn-total-net.net-negative .txn-total-value { color: #c62828; }
.txn-amount-income { color: #2e7d32; font-weight: 500; }
.txn-amount-expense { color: #c62828; font-weight: 500; }
.txn-amount-fee { color: #e65100; }
.txn-receipt-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: #6f42c1;
    vertical-align: middle;
}
/* txn-status-badge kept as alias for smaller inline status badges */
.txn-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}
.txn-dashboard-link { margin-left: auto; }
.txn-notes-text { color: var(--color-gray-600); font-style: italic; }
.btn-center-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.btn-center-container .inline-form {
    display: contents;
}
@media (max-width: 768px) {
    .txn-totals-summary {
        flex-direction: column;
        align-items: center;
    }
    .txn-total-item {
        width: 100%;
        max-width: 300px;
    }
    #txnGrid { display: none !important; }
}

/* ============================================================
   BUDGET DASHBOARD
   ============================================================ */

.dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-5);
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h1 {
    margin: 0;
    color: var(--color-gray-800);
    font-size: 1.8em;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.budget-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.budget-selector label {
    font-weight: var(--weight-medium);
    color: #555;
}

.budget-selector select {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: 1em;
    background: var(--color-white);
}

.btn-print {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-gray-50);
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: var(--font-base);
    font-weight: var(--weight-medium);
    transition: all var(--transition-fast);
}

.btn-print:hover {
    background: var(--color-gray-200);
    border-color: #adb5bd;
}

.btn-print svg {
    flex-shrink: 0;
}

/* Budget Info Bar */
.budget-info-bar {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: 15px var(--space-5);
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-dark) 100%);
    color: var(--color-white);
    border-radius: var(--radius-xl);
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.budget-title {
    font-size: 1.3em;
    font-weight: var(--weight-semibold);
}

.budget-dates {
    font-size: 0.95em;
    opacity: 0.9;
}

.budget-status-badge {
    padding: 5px var(--space-3);
    border-radius: 15px;
    font-size: var(--font-sm);
    font-weight: var(--weight-medium);
}

/* Summary Cards */
.budget-summary-section {
    margin-bottom: 30px;
}

.budget-section-title {
    font-size: var(--font-xl);
    color: var(--color-gray-800);
    margin: 0 0 15px 0;
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-brand);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.summary-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: var(--space-5);
    border-top: 4px solid var(--color-gray-300);
}

.summary-card.highlight {
    border-top-color: var(--color-brand);
    background: linear-gradient(180deg, #f8fbff 0%, var(--color-white) 100%);
}

.summary-card .card-header {
    font-size: 1.1em;
    font-weight: var(--weight-semibold);
    color: var(--color-gray-800);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: transparent;
    padding: 0;
    border: none;
}

.summary-card .card-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-card .card-row:last-child {
    border-bottom: none;
}

.summary-card .label {
    color: var(--color-gray-600);
    font-size: 0.95em;
}

.summary-card .value {
    font-weight: var(--weight-semibold);
    font-size: 1.05em;
}

.summary-card .variance-row {
    margin-top: 5px;
    padding-top: 10px;
    border-top: 2px solid var(--color-gray-200);
}

.positive { color: #2e7d32; }
.negative { color: #c62828; }

/* Dashboard Sections */
.budget-section {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: var(--space-5);
    margin-bottom: 25px;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--space-3) 15px;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.data-table th {
    background: var(--color-gray-50);
    font-weight: var(--weight-semibold);
    color: #555;
    font-size: var(--font-base);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.data-table .col-center { text-align: center; }
.data-table .col-right { text-align: right; }

.col-name { white-space: nowrap; width: 1%; }
.col-date { white-space: nowrap; width: 1%; }
.col-type { white-space: nowrap; width: 1%; }
.col-amount { white-space: nowrap; width: 10%; min-width: 100px; }
.col-description { width: auto; }

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

.data-table tfoot .total-row {
    background: #f0f4f8;
    font-weight: var(--weight-semibold);
}

.data-table tfoot .total-row td {
    border-top: 2px solid var(--color-gray-300);
}

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: var(--weight-medium);
}

.type-badge-series { background: var(--color-brand-light); color: #1565c0; }
.type-badge-event { background: var(--color-warning-light); color: #e65100; }
.type-badge-general { background: var(--color-gray-100); color: #616161; }
.type-income { background: #e8f5e9; color: #2e7d32; }
.type-expense { background: #ffebee; color: #c62828; }

.item-link {
    color: var(--color-brand);
    text-decoration: none;
}

.item-link:hover {
    text-decoration: underline;
}

.no-data {
    color: var(--color-gray-500);
    font-style: italic;
    text-align: center;
    padding: var(--space-5);
}

/* General Summary */
.general-summary {
    display: flex;
    gap: 30px;
    margin-top: var(--space-5);
    padding-top: 15px;
    border-top: 1px solid var(--color-gray-200);
    flex-wrap: wrap;
}

.summary-row {
    display: flex;
    gap: 10px;
    font-size: 1em;
}

.summary-row span:first-child {
    color: var(--color-gray-600);
}

.summary-row span:last-child {
    font-weight: var(--weight-semibold);
}

/* Print Styles */
.print-only {
    display: none;
}

@media print {
    .no-print, .no-print-link {
        display: none !important;
    }

    .print-only {
        display: block;
    }

    body {
        font-size: 11pt;
        color: #000;
    }

    .dashboard-container {
        max-width: 100%;
        padding: 0;
    }

    .print-header {
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #000;
    }

    .print-header h1 {
        font-size: 18pt;
        margin: 0 0 5px 0;
    }

    .print-date-range {
        font-size: 12pt;
        margin: 5px 0;
    }

    .budget-info-bar {
        background: #f0f0f0 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .summary-card {
        box-shadow: none;
        border: 1px solid var(--color-gray-300);
        page-break-inside: avoid;
    }

    .summary-card.highlight {
        background: var(--color-gray-100) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .budget-section {
        box-shadow: none;
        border: 1px solid var(--color-gray-300);
        page-break-inside: avoid;
    }

    .budget-section-title {
        border-bottom-color: #000;
    }

    .data-table th {
        background: var(--color-gray-400) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .type-badge {
        border: 1px solid currentColor;
    }

    .positive { color: #006400 !important; }
    .negative { color: #8b0000 !important; }

    .page-break-before {
        page-break-before: always;
    }

    .dashboard-footer {
        text-align: center;
        margin-top: 30px;
        padding-top: 15px;
        border-top: 1px solid var(--color-gray-350);
        font-size: 9pt;
        color: var(--color-gray-600);
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }
}

/* Budget Dashboard Responsive */
@media (max-width: 900px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .budget-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .data-table {
        font-size: var(--font-base);
    }

    .data-table th,
    .data-table td {
        padding: var(--space-2) 10px;
    }
}

/* ==================== BUDGET PAGE (budget.html) ==================== */

/* Header icon */
.budget-header-icon {
    margin-right: var(--space-2);
    vertical-align: middle;
}

/* Back link override */
.budget-page .back-link {
    margin-bottom: var(--space-5);
}

/* Amount hint in edit modal */
.budget-amount-hint {
    color: var(--color-gray-600);
}

/* Source badges for series rollup */
.budget-source-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.8em;
    color: var(--color-gray-600);
    margin-left: var(--space-3);
}

.source-series {
    color: var(--color-brand);
    font-weight: var(--weight-medium);
}

.source-events {
    color: var(--color-gray-700);
    font-weight: var(--weight-medium);
}

.events-only-label {
    font-size: var(--font-xs);
    color: var(--color-gray-500);
    font-style: italic;
    padding: 2px var(--space-2);
    background: var(--color-gray-100);
    border-radius: var(--radius-sm);
}

/* Summary card */
.budget-summary-card {
    background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-gray-200) 100%);
}

.budget-page .budget-summary {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: var(--space-5);
    padding: var(--space-3) 0;
}

.budget-page .summary-item {
    text-align: center;
    padding: var(--space-4) 30px;
    border-radius: var(--radius-xl);
    background: var(--color-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 150px;
}

.budget-page .summary-label {
    display: block;
    font-size: var(--font-sm);
    color: var(--color-gray-600);
    margin-bottom: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-page .summary-value {
    display: block;
    font-size: var(--font-2xl);
    font-weight: var(--weight-bold);
}

.budget-page .summary-item.income .summary-value {
    color: #2e7d32;
}

.budget-page .summary-item.expense .summary-value {
    color: #c62828;
}

.budget-page .summary-item.net.positive .summary-value {
    color: #2e7d32;
}

.budget-page .summary-item.net.negative .summary-value {
    color: #c62828;
}

/* Collapsible sections */
.budget-page .card-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.budget-page .collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
    padding: var(--space-3);
    margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) 0 calc(-1 * var(--space-3));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.budget-page .collapsible-header:hover {
    background-color: var(--color-gray-100);
}

.budget-page .collapse-icon {
    font-size: 0.8em;
    color: var(--color-gray-600);
    transition: transform var(--transition-fast);
    display: inline-block;
    width: 16px;
}

.budget-page .collapse-icon.expanded {
    transform: rotate(90deg);
}

.budget-page .collapsible-content {
    padding-top: var(--space-3);
}

.budget-page .section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    font-weight: var(--weight-bold);
    font-size: 1.1em;
}

.income-icon {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.expense-icon {
    background-color: #ffebee;
    color: #c62828;
}

.budget-page .section-total {
    margin-left: 0 !important;
    margin-right: var(--space-4);
    font-size: 1.1em;
    color: var(--color-gray-600);
}

/* Budget lines */
.budget-lines {
    margin: var(--space-4) 0;
}

.budget-line {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-gray-200);
}

.budget-line:last-child {
    border-bottom: none;
}

.budget-line:hover {
    background-color: var(--color-gray-50);
}

.budget-line-info {
    flex: 1;
    min-width: 0;
}

.budget-category {
    display: block;
    font-weight: var(--weight-medium);
    color: var(--color-gray-800);
}

.budget-calc {
    display: block;
    font-size: var(--font-sm);
    color: var(--color-brand);
    margin-top: 2px;
}

.budget-notes {
    display: block;
    font-size: var(--font-sm);
    color: var(--color-gray-600);
    margin-top: 2px;
}

.budget-line-amount {
    font-weight: var(--weight-bold);
    font-size: 1.1em;
    min-width: 100px;
    text-align: right;
}

.budget-line-amount.income {
    color: #2e7d32;
}

.budget-line-amount.expense {
    color: #c62828;
}

.budget-line-actions {
    display: flex;
    gap: var(--space-1);
}

/* Budget line btn-icon overrides */
.budget-line .btn-icon {
    border: 1px solid var(--color-gray-300);
}

.budget-line .btn-icon:hover {
    background-color: var(--color-gray-100);
    color: var(--color-gray-800);
}

.budget-line .btn-icon-danger:hover {
    background-color: #ffebee;
    color: #c62828;
    border-color: var(--color-danger-light);
}

.budget-page .no-items {
    color: var(--color-gray-500);
    font-style: italic;
    padding: var(--space-5);
    text-align: center;
}

/* Inline edit styles */
.budget-line-view,
.budget-line-edit {
    display: flex;
    align-items: center;
    width: 100%;
    gap: var(--space-4);
}

.budget-line.editing {
    background-color: var(--color-warning-light);
    border-left: 3px solid var(--color-warning);
}

.inline-edit-fields {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
}

.inline-qty,
.inline-unit,
.inline-amount {
    width: 80px;
    padding: 6px var(--space-2);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    text-align: right;
}

.inline-notes {
    flex: 1;
    min-width: 100px;
    padding: 6px var(--space-2);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
}

.inline-amount.readonly {
    background-color: var(--color-gray-100);
}

.inline-edit-fields .calc-symbol {
    color: var(--color-gray-500);
    font-size: var(--font-base);
}

/* Section header actions */
.budget-page .section-title {
    cursor: pointer;
}

.budget-page .section-actions {
    margin-left: auto;
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.btn-edit-section {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: var(--color-gray-100);
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-600);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-sm);
}

.btn-edit-section:hover {
    background: var(--color-gray-200);
    color: var(--color-gray-800);
}

.btn-edit-section svg {
    flex-shrink: 0;
}

.budget-page .section-actions .btn-secondary {
    background: var(--color-gray-100);
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-600);
}

.budget-page .section-actions .btn-secondary:hover {
    background: var(--color-gray-200);
    color: var(--color-gray-800);
}

.budget-page .section-actions .btn-primary {
    background: #2e7d32;
    color: var(--color-white);
    border: none;
}

.budget-page .section-actions .btn-primary:hover {
    background: #1b5e20;
}

/* Add budget line form */
.add-budget-form {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-gray-200);
}

.add-form-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
}

.add-form-select {
    flex: 2;
    min-width: 180px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
}

.add-form-qty {
    width: 70px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    text-align: right;
}

.add-form-unit {
    width: 80px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    text-align: right;
}

.budget-page .calc-symbol {
    color: var(--color-gray-600);
    font-weight: var(--weight-bold);
}

.add-form-amount {
    width: 100px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    text-align: right;
}

.add-form-amount.readonly {
    background-color: var(--color-gray-100);
    color: var(--color-gray-800);
}

.add-form-notes {
    flex: 1;
    min-width: 120px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
}

/* .btn-add — legacy alias, now defined with .btn above */

/* Budget edit modal */
.budget-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-dropdown);
}

.budget-edit-modal .modal-content {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: var(--shadow-xl);
}

.budget-edit-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-gray-200);
}

.budget-edit-modal .modal-header h3 {
    margin: 0;
}

.budget-edit-modal .modal-close {
    background: none;
    border: none;
    font-size: var(--font-2xl);
    cursor: pointer;
    color: var(--color-gray-500);
}

.budget-edit-modal .modal-close:hover {
    color: var(--color-gray-800);
}

.budget-edit-modal form {
    padding: var(--space-5);
}

.budget-edit-modal .form-row {
    display: flex;
    gap: var(--space-4);
}

.budget-edit-modal .form-row .form-group {
    flex: 1;
}

.budget-edit-modal .modal-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    margin-top: var(--space-5);
}

/* Budget page responsive */
@media (max-width: 768px) {
    .budget-page .budget-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .budget-page .summary-item {
        min-width: auto;
    }

    .budget-line-view,
    .budget-line-edit {
        flex-wrap: wrap;
    }

    .budget-line-info {
        flex: 1 1 100%;
        margin-bottom: var(--space-3);
    }

    .budget-line-amount {
        flex: 1;
        text-align: left;
    }

    .inline-edit-fields {
        flex-wrap: wrap;
        width: 100%;
    }

    .inline-qty,
    .inline-unit,
    .inline-amount {
        width: 60px;
    }

    .inline-notes {
        width: 100%;
        margin-top: var(--space-2);
    }

    .add-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .add-form-select,
    .add-form-qty,
    .add-form-unit,
    .add-form-amount,
    .add-form-notes {
        width: 100%;
        min-width: auto;
    }

    .budget-page .calc-symbol {
        display: none;
    }

    .btn-add {
        width: 100%;
    }

    .budget-edit-modal .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ==================== ANNUAL BUDGETS ==================== */

/* Budget link in table */
.budget-link {
    color: var(--color-brand);
    text-decoration: none;
    font-weight: var(--weight-semibold);
    font-size: 1.1em;
}

.budget-link:hover {
    text-decoration: underline;
}

/* Annual budget mobile cards */
.budget-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-4);
    overflow: hidden;
}

.budget-card.inactive-card {
    opacity: 0.7;
}

.card-totals {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-gray-200);
}

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

.total-label {
    display: block;
    font-size: 0.8em;
    color: var(--color-gray-600);
    margin-bottom: 2px;
}

.total-value {
    font-weight: var(--weight-semibold);
}

/* Edit Annual Budget page */
.budget-container {
    max-width: var(--container-default);
    margin: 0 auto;
    padding: var(--space-5);
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.budget-header h1 {
    margin: 0;
    color: var(--color-gray-800);
    font-size: var(--font-2xl);
}

.inactive-badge {
    color: var(--color-gray-500);
    font-size: var(--font-base);
}

/* Budget totals card */
.totals-card {
    background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-gray-200) 100%);
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    text-align: center;
}

.totals-grid .total-item {
    padding: var(--space-4);
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
}

.totals-grid .total-label {
    font-size: var(--font-sm);
    margin-bottom: var(--space-2);
}

.totals-grid .total-value {
    font-size: 1.4em;
}

/* Budget items table */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-5);
}

.items-table th,
.items-table td {
    padding: var(--space-3) var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.items-table th {
    background-color: var(--color-gray-50);
    font-weight: var(--weight-medium);
    color: var(--color-gray-600);
    font-size: var(--font-base);
}

.items-table tr:hover {
    background-color: var(--color-gray-50);
}

.edit-row {
    background-color: #fffde7;
}

.inline-edit-form {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    flex-wrap: wrap;
}

.inline-edit-form select,
.inline-edit-form input {
    flex: 1;
    min-width: 120px;
}

.inline-edit-form .amount-input {
    max-width: 120px;
}

.form-control-sm {
    padding: 6px var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

/* Add item section */
.add-item-section {
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-gray-200);
}

.add-item-section h4 {
    margin: 0 0 var(--space-3) 0;
    color: var(--color-gray-600);
    font-size: var(--font-base);
}

.add-item-form .form-row {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.add-item-form .form-control {
    flex: 1;
    min-width: 150px;
}

.add-item-form .amount-input {
    max-width: 150px;
}

/* Column width utility */
.col-actions { width: 80px; }

/* Document tabs */
.doc-tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
}

.doc-tab {
    padding: var(--space-2) var(--space-4);
    background: var(--color-gray-100);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-base);
}

.doc-tab.active {
    background: var(--color-brand);
    color: var(--color-white);
}

.doc-tab-content .form-row {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.doc-tab-content .form-control {
    flex: 1;
    min-width: 150px;
}

/* Annual budget card-title override */
.budget-container .card-title {
    border-bottom: 2px solid var(--color-brand);
    color: var(--color-gray-800);
}

/* Annual budget audit card */
.budget-container .audit-card {
    background-color: var(--color-gray-50);
}

.budget-container .audit-card .info-value {
    font-size: var(--font-base);
}

/* Annual budget responsive */
@media (max-width: 768px) {
    .budget-container {
        padding: var(--space-3);
    }

    .budget-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .items-table {
        font-size: var(--font-base);
    }

    .items-table th:nth-child(2),
    .items-table td:nth-child(2) {
        display: none;
    }

    .add-item-form .form-row,
    .doc-tab-content .form-row {
        flex-direction: column;
    }

    .add-item-form .amount-input,
    .inline-edit-form .amount-input {
        max-width: 100%;
    }
}

/* ==================== EDIT TRANSACTION (edit_transaction.html) ==================== */

.transaction-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-5);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.transaction-header h1 {
    margin: 0;
    color: var(--color-gray-800);
}

/* SVG icon spacing inside buttons */
.transaction-container .btn svg {
    margin-right: 6px;
}

/* Card title override — dark text instead of brand */
.transaction-container .card-title {
    color: var(--color-gray-800);
}

/* Audit card */
.transaction-container .audit-card {
    background-color: #f9f9f9;
}

.transaction-container .audit-card .info-value {
    color: var(--color-gray-600);
}

/* Info items for read-only view */
.transaction-container .info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.transaction-container .info-item.full-width {
    grid-column: 1 / -1;
}

.transaction-container .info-label {
    font-size: var(--font-sm);
    color: var(--color-gray-600);
    font-weight: var(--weight-medium);
}

.transaction-container .info-value {
    font-size: var(--font-md);
    color: var(--color-gray-800);
}

/* Form grid for edit mode */
.transaction-container .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

/* Input with dollar sign prefix */
.input-with-prefix {
    display: flex;
    align-items: stretch;
}

.input-prefix {
    display: flex;
    align-items: center;
    padding: 0 var(--space-3);
    background-color: var(--color-gray-100);
    border: 1px solid var(--color-gray-300);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--color-gray-600);
    font-weight: var(--weight-medium);
}

.input-with-prefix .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Type toggle (income/expense radio) */
.type-toggle {
    display: flex;
    gap: var(--space-3);
}

.type-option {
    flex: 1;
    cursor: pointer;
}

.type-option input {
    display: none;
}

.type-btn {
    display: block;
    padding: var(--space-3) var(--space-4);
    text-align: center;
    border-radius: var(--radius-sm);
    font-weight: var(--weight-medium);
    transition: all var(--transition-fast);
    font-size: var(--font-base);
    background-color: var(--color-gray-100);
    border: 2px solid var(--color-gray-300);
    color: var(--color-gray-600);
}

.type-option input:checked + .type-income {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.type-option input:checked + .type-expense {
    background-color: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

/* Transaction type badge override (square corners) */
.transaction-container .type-badge {
    border-radius: var(--radius-sm);
}

.type-badge.type-income {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.type-badge.type-expense {
    background-color: #ffebee;
    color: #c62828;
}

/* Entity badges */
.entity-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    font-weight: var(--weight-medium);
}

.entity-event {
    background-color: var(--color-brand-light);
    color: #1565c0;
}

.entity-series {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.entity-general {
    background-color: var(--color-gray-100);
    color: #616161;
}

/* Amount display */
.amount-income {
    color: #2e7d32;
    font-weight: var(--weight-semibold);
    font-size: 1.1em;
}

.amount-expense {
    color: #c62828;
    font-weight: var(--weight-semibold);
    font-size: 1.1em;
}

/* Processing fee value (red) */
.txn-fee-value {
    color: #c62828;
}

/* Finance section spacing */
.fin-section-heading {
    margin-top: var(--space-8);
}

/* Transaction form card */
.transaction-form {
    background: var(--color-white);
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .transaction-form {
        padding: var(--space-4);
    }
}

/* Documents/Receipts */
.documents-list {
    margin-bottom: var(--space-5);
}

.document-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-gray-200);
}

.document-item:last-child {
    border-bottom: none;
}

.doc-icon {
    flex-shrink: 0;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-link {
    color: var(--color-brand);
    text-decoration: none;
    font-weight: var(--weight-medium);
    display: block;
}

.doc-link:hover {
    text-decoration: underline;
}

.doc-filename {
    display: block;
    font-size: var(--font-sm);
    color: var(--color-gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-meta {
    color: var(--color-gray-500);
    font-size: var(--font-sm);
    flex-shrink: 0;
}

.btn-delete-doc {
    background: none;
    border: none;
    color: var(--color-danger);
    font-size: 1.4em;
    cursor: pointer;
    padding: 0 var(--space-1);
    opacity: 0.7;
}

.btn-delete-doc:hover {
    opacity: 1;
}

.txn-delete-receipt-form {
    display: inline;
}

.add-doc-section {
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-gray-200);
}

.doc-form-row {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.doc-form-row .form-control {
    flex: 1;
    min-width: 150px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
}

/* Transaction add button override (green) */
.transaction-container .btn-add {
    background: var(--color-success);
    color: var(--color-white);
    border: none;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.transaction-container .btn-add:hover {
    background: var(--color-success-dark);
}

/* Transaction responsive */
@media (max-width: 768px) {
    .transaction-container {
        padding: var(--space-3);
    }

    .transaction-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .transaction-header .header-actions {
        width: 100%;
    }

    .transaction-container .info-grid,
    .transaction-container .form-grid {
        grid-template-columns: 1fr;
    }

    .transaction-container .info-item.full-width,
    .transaction-container .form-group.full-width {
        grid-column: 1;
    }

    .type-toggle {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .transaction-header .header-actions {
        flex-direction: column;
    }

    .transaction-header .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== SQUARE IMPORT ==================== */

.square-import-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    overflow-y: auto;
    padding: var(--space-4) var(--space-3);
    box-sizing: border-box;
}

.square-import-modal {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    width: 800px;
    max-width: 100%;
    margin: 0 auto;
}

.square-import-upload-area {
    border: 2px dashed var(--color-gray-300);
    border-radius: var(--radius-md);
    padding: var(--space-6) var(--space-4);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.square-import-upload-area:hover,
.square-import-upload-area.drag-over {
    border-color: var(--color-brand);
    background-color: var(--color-gray-50);
}

.square-import-upload-area p {
    margin: var(--space-2) 0 0;
    color: var(--color-gray-600);
}

.square-import-upload-area small {
    color: var(--color-gray-400);
    font-size: 0.8em;
}

.square-import-browse {
    color: var(--color-brand);
    cursor: pointer;
    text-decoration: underline;
}

.square-import-file-name {
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-gray-50);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--color-gray-700);
}

.square-import-error {
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: #fef2f2;
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-sm);
    color: var(--color-danger);
    font-size: 0.9em;
}

.square-import-summary-cards {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.square-import-stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: var(--space-3);
    background: var(--color-gray-50);
    border-radius: var(--radius-md);
}

.square-import-stat-val {
    display: block;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--color-brand);
}

.square-import-stat-label {
    display: block;
    font-size: 0.75em;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.square-import-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin-bottom: var(--space-3);
}

.square-import-preview-table th {
    background: var(--color-gray-100);
    padding: var(--space-2) var(--space-3);
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--color-gray-600);
}

.square-import-preview-table td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-gray-100);
}

.square-import-preview-table tfoot td {
    border-top: 2px solid var(--color-gray-300);
    font-weight: 600;
}

.square-import-warnings {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: #fffbeb;
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}

.square-import-warnings h4 {
    margin: 0 0 var(--space-2);
    color: #92400e;
}

.square-import-warnings ul {
    margin: 0;
    padding-left: var(--space-4);
}

.square-import-warnings li {
    margin-bottom: 2px;
}

.square-import-success {
    text-align: center;
    padding: var(--space-4) 0;
}

.square-import-success h3 {
    color: var(--color-success);
    margin: var(--space-3) 0 var(--space-2);
}

.square-import-success p {
    color: var(--color-gray-500);
}

@media (max-width: 768px) {
    .square-import-overlay {
        padding: var(--space-2);
    }

    .square-import-summary-cards {
        flex-wrap: wrap;
    }

    .square-import-stat {
        min-width: 60px;
        padding: var(--space-2);
    }

    .square-import-preview-table {
        font-size: 0.8em;
    }

    .square-import-preview-table th,
    .square-import-preview-table td {
        padding: var(--space-1) var(--space-2);
    }
}

/* ==================== PHOTO GALLERY ==================== */

/* Public Gallery */
/* ============================================
   PUBLIC PHOTO GALLERY
   ============================================ */
.gp-body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #FAF8F5;
    color: #2C2825;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
.gp-header {
    background: #2C2825;
    padding: 28px 24px;
}
.gp-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}
.gp-logo {
    height: 56px;
    border-radius: 8px;
}
.gp-header-text { min-width: 0; }
.gp-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2em;
    font-weight: 600;
    color: #FAF8F5;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.gp-subtitle {
    font-size: 0.82em;
    color: #A89E93;
    margin: 4px 0 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 500;
}
.gp-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 60px;
}

/* Filters / Navigation */
.gp-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-bottom: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E8E2DB;
}
.gp-nav--sub {
    border-bottom: none;
    margin-bottom: 16px;
    padding-bottom: 0;
}
.gp-nav-link {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 24px;
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 500;
    color: #6B6158;
    background: transparent;
    border: 1.5px solid transparent;
    transition: all 0.25s ease;
}
.gp-nav-link:hover {
    color: #2C2825;
    background: #F0EBE5;
}
.gp-nav-link--active {
    color: #FAF8F5;
    background: #2C2825;
    border-color: #2C2825;
}
.gp-nav-link--active:hover {
    color: #FAF8F5;
    background: #3D3632;
}
.gp-nav-link--sm {
    padding: 5px 14px;
    font-size: 0.82em;
}

/* Photo count divider */
.gp-count-bar {
    text-align: center;
    margin-bottom: 24px;
}
.gp-count {
    font-size: 0.82em;
    color: #A89E93;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
}

/* Masonry Photo Grid */
.gp-grid {
    columns: 4 260px;
    column-gap: 16px;
}
.gp-card {
    break-inside: avoid;
    margin: 0 0 16px;
    padding: 0;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #E8E2DB;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: gpCardIn 0.5s ease both;
}
@keyframes gpCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.gp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(44, 40, 37, 0.12);
}
.gp-card img {
    width: 100%;
    display: block;
    transition: filter 0.3s ease;
}
.gp-card:hover img {
    filter: brightness(0.88);
}
.gp-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 14px 14px;
    background: linear-gradient(to top, rgba(44, 40, 37, 0.85) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gp-card:hover .gp-card-info {
    opacity: 1;
}
.gp-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.gp-card-event {
    color: #FAF8F5;
    font-weight: 600;
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gp-card-date {
    color: rgba(250, 248, 245, 0.7);
    font-size: 0.9em;
}
.gp-card-caption {
    color: rgba(250, 248, 245, 0.85);
    font-size: 1em;
    font-style: italic;
    font-family: 'Cormorant Garamond', Georgia, serif;
}
.gp-card-dl {
    color: #FAF8F5;
    background: rgba(250, 248, 245, 0.15);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    text-decoration: none;
}
.gp-card-dl:hover {
    background: rgba(250, 248, 245, 0.35);
}

/* Empty state */
.gp-empty {
    text-align: center;
    padding: 80px 20px;
    color: #A89E93;
}
.gp-empty p {
    margin-top: 16px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.2em;
    font-style: italic;
}

/* Lightbox */
.gp-lb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    flex-direction: column;
}
.gp-lb.active {
    display: flex;
    animation: gpFadeIn 0.25s ease;
}
@keyframes gpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.gp-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 18, 16, 0.94);
}
.gp-lb-chrome {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.gp-lb-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    flex-shrink: 0;
}
.gp-lb-counter {
    font-size: 0.82em;
    color: rgba(250, 248, 245, 0.5);
    font-weight: 500;
    letter-spacing: 0.04em;
}
.gp-lb-close {
    background: none;
    border: none;
    color: rgba(250, 248, 245, 0.6);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.gp-lb-close:hover {
    color: #FAF8F5;
    background: rgba(250, 248, 245, 0.1);
}
.gp-lb-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 60px;
    position: relative;
}
.gp-lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 100%;
    max-width: 100%;
}
.gp-lb-img-wrap img {
    max-width: 88vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}
.gp-lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(250, 248, 245, 0.08);
    border: none;
    color: rgba(250, 248, 245, 0.6);
    cursor: pointer;
    padding: 14px 10px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    z-index: 2;
}
.gp-lb-arrow:hover {
    background: rgba(250, 248, 245, 0.15);
    color: #FAF8F5;
}
.gp-lb-prev { left: 12px; }
.gp-lb-next { right: 12px; }
.gp-lb-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 16px 20px 24px;
    flex-shrink: 0;
}
.gp-lb-event {
    color: #FAF8F5;
    font-weight: 600;
    font-size: 1.1em;
}
.gp-lb-date {
    color: rgba(250, 248, 245, 0.55);
    font-size: 1em;
}
.gp-lb-caption {
    color: rgba(250, 248, 245, 0.7);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 1.15em;
}
.gp-lb-dl {
    color: rgba(250, 248, 245, 0.7);
    background: rgba(250, 248, 245, 0.1);
    padding: 6px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.82em;
    font-weight: 500;
    transition: all 0.2s;
}
.gp-lb-dl:hover {
    color: #FAF8F5;
    background: rgba(250, 248, 245, 0.2);
}

/* Gallery responsive */
@media (max-width: 1024px) {
    .gp-grid { columns: 3; }
}
@media (max-width: 768px) {
    .gp-header { padding: 20px 16px; }
    .gp-logo { height: 44px; }
    .gp-title { font-size: 1.5em; }
    .gp-main { padding: 16px 16px 40px; }
    .gp-grid { columns: 2; column-gap: 10px; }
    .gp-card { margin-bottom: 10px; border-radius: 8px; }
    .gp-card-info { opacity: 1; padding: 32px 10px 10px; }
    .gp-lb-stage { padding: 0 12px; }
    .gp-lb-arrow { display: none; }
    .gp-lb-img-wrap img { max-width: 96vw; max-height: 70vh; }
}
@media (max-width: 480px) {
    .gp-grid { columns: 1; }
    .gp-header-inner { gap: 12px; }
    .gp-title { font-size: 1.3em; }
    .gp-subtitle { font-size: 0.75em; }
    .gp-nav-link { padding: 6px 14px; font-size: 0.82em; }
}

/* Admin Upload */
.photo-upload-dropzone {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-slow);
    background: var(--color-white);
    margin-bottom: 20px;
}
.photo-upload-dropzone:hover,
.photo-upload-dropzone.dragover {
    border-color: var(--color-brand);
    background: #f0f7ff;
}
.photo-upload-dropzone p {
    margin: 12px 0 0;
    color: var(--color-gray-600);
}
.photo-upload-hint {
    font-size: 0.85em;
    color: var(--color-gray-500);
}
.photo-upload-file-input {
    display: none;
}
.photo-caption-group {
    margin: 16px 0;
}
.photo-caption-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--color-gray-600);
    margin-bottom: 4px;
}
.photo-caption-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    font-size: 0.9em;
}
.photo-upload-summary {
    text-align: center;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
    color: #1565c0;
}

/* Source Tabs */
.photo-source-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-gray-400);
}
.photo-source-tab {
    padding: 10px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--color-gray-600);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-base);
}
.photo-source-tab:hover { color: var(--color-gray-800); }
.photo-source-tab.active {
    color: var(--color-brand);
    border-bottom-color: var(--color-brand);
    font-weight: 600;
}
.photo-tab-content { display: none; }
.photo-tab-content.active { display: block; }

/* Drive Browser */
.photo-drive-browser {
    background: var(--color-white);
    border: 1px solid var(--color-gray-400);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    min-height: 200px;
}
.photo-drive-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 0.9em;
}
.photo-drive-crumb {
    color: var(--color-brand);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}
.photo-drive-crumb:hover { background: #e3f2fd; }
.photo-drive-crumb-current {
    color: var(--color-gray-800);
    font-weight: 600;
    cursor: default;
}
.photo-drive-crumb-current:hover { background: none; }
.photo-drive-crumb-sep { color: var(--color-gray-500); }
.photo-drive-loading { color: var(--color-gray-600); padding: 20px; text-align: center; }
.photo-drive-error { color: #c62828; padding: 8px; }
.photo-drive-folders { margin-bottom: 12px; }
.photo-drive-folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.photo-drive-folder-item:hover { background: #f5f5f5; }
.photo-drive-folder-item span { font-size: 0.9em; }
.photo-drive-files-section { border-top: 1px solid var(--color-gray-200); padding-top: 12px; }
.photo-drive-select-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    padding: 6px 0;
}
.photo-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 600;
    color: #555;
    cursor: pointer;
}
#driveSelectedCount { font-size: 0.85em; color: var(--color-brand); font-weight: 500; }
.photo-drive-file-item {
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.15s;
}
.photo-drive-file-item:hover { background: var(--color-gray-50); }
.photo-drive-file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.88em;
}
.photo-drive-file-name { flex: 1; }
.photo-drive-file-size { color: var(--color-gray-500); font-size: 0.85em; }
.photo-drive-empty { color: var(--color-gray-500); padding: 20px; text-align: center; font-size: 0.9em; }

/* Local file list */
.photo-local-file-list { margin-bottom: 12px; }
.photo-local-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--color-white);
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.88em;
}
.photo-local-file-name { flex: 1; }
.photo-local-file-size { color: var(--color-gray-500); font-size: 0.85em; }

/* Photo Bulk Actions Bar */
.photo-bulk-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-400);
    border-radius: 8px;
    margin-bottom: 16px;
}
#selectedCount { font-size: 0.85em; color: var(--color-brand); font-weight: 500; }
.photo-manage-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}
.photo-manage-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-brand);
}

/* Admin Photo Management */
.photo-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.photo-manage-card {
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}
.photo-manage-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.photo-manage-thumb {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #e0e0e0;
}
.photo-manage-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-manage-details {
    padding: 12px;
}
.photo-manage-filename {
    font-weight: 600;
    font-size: 0.85em;
    color: var(--color-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.photo-manage-event {
    font-size: 0.82em;
    color: var(--color-brand);
    margin-bottom: 4px;
}
.photo-manage-meta {
    font-size: 0.75em;
    color: var(--color-gray-500);
    margin-bottom: 8px;
}
.photo-manage-caption-row {
    margin-bottom: 8px;
}
.photo-manage-caption-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    font-size: 0.85em;
}
.photo-manage-actions {
    display: flex;
    gap: 8px;
}

/* Gallery responsive */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-header h1 {
        font-size: 1.3em;
    }
    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        padding: 12px 8px;
        font-size: 1.5em;
    }
    .photo-assign-table th:nth-child(3),
    .photo-assign-table td:nth-child(3) {
        display: none;
    }
    .photo-assign-thumb {
        width: 40px;
        height: 40px;
    }
}
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-item {
        aspect-ratio: 4/3;
    }
}

/* ===== Event Staffing Page ===== */

.staffing-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-5);
}

.staffing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 2px solid var(--color-gray-200);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.staffing-header .event-info h1 {
    margin: 0 0 var(--space-3) 0;
    color: var(--color-brand);
}

.staffing-header .event-meta {
    color: var(--color-gray-600);
    margin: 0 0 var(--space-3) 0;
}

.staffing-header .event-meta span {
    margin-right: var(--space-5);
}

.staffing-header .category-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background-color: #e3f2fd;
    color: #1565c0;
    border-radius: 12px;
    font-size: var(--font-sm);
    font-weight: var(--weight-medium);
}

.staffing-header .header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* Volunteer Lookup */
.volunteer-lookup {
    position: relative;
    margin-bottom: var(--space-5);
}

.volunteer-lookup-input-wrap {
    position: relative;
}

.lookup-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.volunteer-search-input {
    width: 100%;
    padding: 10px 36px 10px 38px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    box-sizing: border-box;
    background: var(--color-white);
}

.volunteer-search-input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px rgba(40, 116, 181, 0.15);
}

.lookup-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.3em;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}

.lookup-clear:hover {
    color: var(--color-gray-800);
}

.lookup-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 240px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: var(--shadow-lg);
}

.lookup-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lookup-result-item:hover {
    background: #f5f8ff;
}

.lookup-result-item:last-child {
    border-bottom: none;
}

.lookup-result-name {
    font-weight: var(--weight-medium);
    color: var(--color-gray-800);
}

.lookup-result-email {
    font-size: var(--font-xs);
    color: var(--color-gray-500);
    margin-left: auto;
    padding-left: var(--space-3);
}

.lookup-result-hint {
    font-size: var(--font-xs);
    color: var(--color-gray-500);
}

.lookup-summary {
    margin-top: var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    color: var(--color-gray-600);
    overflow: hidden;
    border: 1px solid var(--color-gray-200);
    background: var(--color-gray-50);
}

.lookup-summary > strong {
    display: block;
    padding: 10px 14px 6px;
    color: var(--color-gray-800);
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-100);
}

.lookup-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    background: #7c3aed;
}

.lookup-row.current-row {
    background: #7c3aed;
}

.lookup-row.prior-row {
    background: #6d28d9;
}

.lookup-row-label {
    font-size: var(--font-xs);
    font-weight: var(--weight-semibold);
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: var(--space-1);
}

.lookup-summary .lookup-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}

.lookup-tag:hover {
    opacity: 0.85;
}

.lookup-tag.current,
.lookup-tag.prior {
    background: rgba(255,255,255,0.2);
    color: var(--color-white);
}

/* Highlight matched job cards with purple header */
.job-card.lookup-matched .job-header {
    background: #7c3aed;
    border-bottom-color: #6d28d9;
}

.job-card.lookup-matched .job-title h3 {
    color: var(--color-white);
}

.job-card.lookup-matched .job-stats .stat-label,
.job-card.lookup-matched .job-stats .volunteer-count {
    color: rgba(255,255,255,0.9);
}

.job-card.lookup-matched .job-chevron {
    stroke: rgba(255,255,255,0.9);
}

.member-item.lookup-highlight {
    background: #f3e8ff !important;
    border-left: 3px solid #7c3aed;
    padding-left: 12px;
}

.prior-year-table tr.lookup-highlight td {
    background: #f3e8ff !important;
}

.job-card.lookup-dimmed {
    opacity: 0.35;
    transition: opacity 0.2s;
}

/* No Jobs Warning */
.no-jobs-warning {
    text-align: center;
    padding: var(--space-10);
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-md);
}

.no-jobs-warning h3 {
    color: #856404;
    margin-bottom: var(--space-3);
}

.no-jobs-warning p {
    color: #856404;
    margin-bottom: var(--space-5);
}

/* Jobs List */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.job-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: visible;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-100);
    cursor: pointer;
    user-select: none;
}

.job-header:hover {
    background-color: #eef1f4;
}

.job-header-left {
    flex: 1;
    min-width: 0;
}

.job-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.job-header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-top: 6px;
    padding-left: 22px;
}

.header-volunteer-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f0fe;
    color: #1a56db;
    border-radius: 12px;
    font-size: var(--font-xs);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: var(--transition-fast);
}

.header-volunteer-badge:hover {
    background: #c5d9f7;
}

.header-volunteer-badge.selected {
    background: #1a56db;
    color: var(--color-white);
}

.job-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.job-header.open .job-chevron {
    transform: rotate(90deg);
}

.job-title h3 {
    margin: 0;
    color: var(--color-gray-800);
}

.job-stats {
    text-align: center;
    flex-shrink: 0;
    margin-left: var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.volunteer-count {
    display: block;
    font-size: var(--font-2xl);
    font-weight: var(--weight-bold);
}

.under-staffed {
    color: var(--color-danger);
}

.partial-staffed {
    color: var(--color-warning);
}

.fully-staffed {
    color: var(--color-success);
}

.stat-label {
    font-size: var(--font-xs);
    color: var(--color-gray-600);
}

.full-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background-color: var(--color-success);
    color: var(--color-white);
    border-radius: 12px;
    font-size: var(--font-xs);
    font-weight: var(--weight-semibold);
    margin-top: 5px;
}

.job-title h3[title] {
    cursor: help;
    border-bottom: 1px dotted var(--color-gray-500);
}

/* Assigned Members */
.assigned-members {
    padding: var(--space-4) var(--space-5);
}

.staffing-container .member-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-gray-100);
}

.member-item:last-child {
    border-bottom: none;
}

.member-name {
    font-weight: var(--weight-medium);
    flex: 1;
}

.staffing-container .member-link {
    color: var(--color-brand);
    text-decoration: none;
}

.staffing-container .member-link:hover {
    text-decoration: underline;
}

/* Phone number under member name — hidden on desktop, shown on mobile */
.member-phone {
    display: none;
    font-size: var(--font-xs);
    color: var(--color-gray-500);
    text-decoration: none;
}

.assignment-details {
    color: var(--color-gray-600);
    font-size: var(--font-sm);
    margin-right: var(--space-4);
}

/* Staffing action buttons (circular icon buttons) */
.assigned-email-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.assigned-email-btn:hover {
    background: #1976d2;
    color: var(--color-white);
}

.assigned-email-btn svg {
    stroke: currentColor;
}

.future-assign-wrapper {
    position: relative;
    display: inline-flex;
}

.assign-future-btn {
    width: 28px;
    height: 28px;
    border: none;
    background-color: #e8f5e9;
    color: #2e7d32;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.assign-future-btn:hover {
    background-color: #2e7d32;
    color: var(--color-white);
}

.move-job-btn {
    width: 28px;
    height: 28px;
    border: none;
    background-color: #e3f2fd;
    color: #1565c0;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.move-job-btn:hover {
    background-color: #1565c0;
    color: var(--color-white);
}

.move-menu-link {
    text-decoration: none;
    color: var(--color-gray-800);
    display: block;
}

.move-menu-link:hover {
    color: #1565c0;
}

.future-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 200px;
    margin-top: var(--space-1);
}

.future-menu-header {
    padding: 8px 12px;
    font-weight: var(--weight-semibold);
    font-size: var(--font-sm);
    color: var(--color-gray-800);
    border-bottom: 1px solid var(--color-gray-100);
}

.future-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 12px;
    cursor: pointer;
    font-size: var(--font-sm);
}

.future-menu-item:hover {
    background: var(--color-gray-100);
}

.future-menu-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--color-gray-100);
}

.btn-select-all-future {
    flex: 1;
    padding: 5px 8px;
    font-size: var(--font-xs);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    background: var(--color-gray-50);
    cursor: pointer;
}

.btn-select-all-future:hover {
    background: var(--color-gray-200);
}

.btn-apply-future {
    flex: 1;
    padding: 5px 8px;
    font-size: var(--font-xs);
    border: none;
    border-radius: var(--radius-sm);
    background: #2e7d32;
    color: var(--color-white);
    cursor: pointer;
}

.btn-apply-future:hover {
    background: #1b5e20;
}

.remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    background-color: #ffebee;
    color: var(--color-danger);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.remove-btn:hover {
    background-color: var(--color-danger);
    color: var(--color-white);
}

.no-assignments {
    color: var(--color-gray-500);
    font-style: italic;
    margin: 0;
}

/* Add Member Form */
.add-member-form {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background-color: var(--color-gray-50);
    border-top: 1px solid var(--color-gray-100);
}

.member-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
}

.member-select:focus {
    outline: none;
    border-color: var(--color-brand);
}

/* Prior Year Volunteers */
.prior-year-section {
    border-top: 1px solid var(--color-gray-100);
}

.prior-year-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 10px 20px;
    border: none;
    background: #fffbf0;
    cursor: pointer;
    font-size: var(--font-sm);
    color: #856404;
    font-weight: var(--weight-medium);
    text-align: left;
    transition: var(--transition-fast);
}

.prior-year-toggle:hover {
    background: var(--color-warning-light);
}

.prior-year-arrow {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.prior-year-arrow.open {
    transform: rotate(90deg);
}

.prior-year-count {
    background: var(--color-warning);
    color: #856404;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: var(--font-sm);
    font-weight: var(--weight-semibold);
}

.prior-year-list {
    padding: 0 20px 12px;
    background: #fffbf0;
}

.prior-year-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

.prior-year-table th {
    padding: 8px;
    font-size: var(--font-sm);
}

.prior-year-table .prior-name-col {
    text-align: left;
}

.prior-year-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f0e8d0;
    color: var(--color-gray-600);
}

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

.prior-shifts-col {
    width: 50px;
    text-align: center;
}

.prior-phone-col {
    width: 150px;
    text-align: center;
}

.prior-email-col {
    text-align: center;
}

.prior-action-col {
    width: 70px;
    text-align: center;
}

.prior-contact-link {
    color: var(--color-brand);
    text-decoration: none;
    font-size: var(--font-sm);
}

.prior-contact-link:hover {
    text-decoration: underline;
}

.no-contact {
    color: var(--color-gray-300);
}

.prior-assign-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-success);
    background: #e8f5e9;
    color: var(--color-success);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: var(--weight-bold);
    line-height: 1;
    transition: var(--transition-fast);
}

.prior-assign-btn:hover {
    background: var(--color-success);
    color: var(--color-white);
}

.prior-assign-dropdown {
    position: relative;
    display: inline-block;
}

.assign-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 180px;
    margin-top: var(--space-1);
}

.assign-menu.show {
    display: block;
}

.assign-menu button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: var(--font-sm);
    color: var(--color-gray-800);
}

.assign-menu button:hover {
    background: var(--color-gray-100);
}

.assign-menu button:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.assign-menu button:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: 1px solid var(--color-gray-100);
}

/* Prior year selection checkboxes */
.prior-select-col {
    width: 30px;
    text-align: center;
}

.prior-select-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.prior-action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.prior-email-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #4a90d9;
    background: #e8f4fd;
    color: #4a90d9;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--transition-fast);
}

.prior-email-btn:hover {
    background: #4a90d9;
    color: var(--color-white);
}

.prior-email-btn svg {
    width: 14px;
    height: 14px;
}

/* Email action bar (fixed bottom) */
.email-action-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #313b44;
    color: var(--color-white);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
}

.email-action-bar button {
    background: #4a90d9;
    color: var(--color-white);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-sm);
}

.email-action-bar button:hover {
    background: #3a7bc8;
}

.email-action-bar button:last-child {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
}

.email-action-bar button:last-child:hover {
    background: rgba(255,255,255,0.1);
}

/* Staffing button SVG icon spacing */
.staffing-header .header-actions .btn svg,
.staffing-container .btn svg {
    margin-right: 6px;
    flex-shrink: 0;
}

/* Inline icon alignment for youth/affiliate icons */
.youth-icon {
    vertical-align: middle;
    margin-right: 3px;
}

.staffing-container .affiliate-icon {
    vertical-align: middle;
    margin-right: 3px;
}

/* Visibility badge in job header context — slightly smaller */
.job-title .ej-visibility-badge {
    margin-left: var(--space-2);
    font-size: 0.7em;
}

/* ===== Event Staffing — Mobile ===== */
@media (max-width: 768px) {
    .staffing-container {
        padding: var(--space-3);
    }

    .staffing-header {
        flex-direction: column;
        gap: var(--space-3);
    }

    .staffing-header .header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2);
        width: 100%;
    }

    .staffing-header .header-actions .btn {
        font-size: var(--font-xs);
        padding: 8px 10px;
        justify-content: center;
    }

    .staffing-header .header-actions .btn svg {
        width: 14px;
        height: 14px;
        margin-right: 4px;
    }

    /* Back to Event spans full width */
    .staffing-header .header-actions .btn-secondary {
        grid-column: 1 / -1;
        order: -1;
    }

    .job-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px;
        gap: var(--space-2);
    }

    .job-stats {
        margin-left: 0;
        flex-direction: row;
        align-items: center;
        gap: var(--space-2);
        width: 100%;
    }

    .volunteer-count {
        font-size: var(--font-lg);
    }

    .full-badge {
        margin-top: 0;
    }

    .job-header-badges {
        padding-left: 0;
    }

    .member-item {
        flex-wrap: wrap;
        padding: var(--space-2) 0;
        gap: var(--space-2);
    }

    .member-name {
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    /* Show phone under name on mobile */
    .member-phone {
        display: block;
        color: var(--color-brand);
    }

    /* Keep action buttons from wrapping — group them tight */
    .member-item .assigned-email-btn,
    .member-item .assign-future-btn,
    .member-item .move-job-btn,
    .member-item .remove-btn {
        width: 26px;
        height: 26px;
    }

    /* Show move/future assign as smaller buttons on mobile */
    .member-item .future-assign-wrapper {
        display: inline-flex;
    }

    .assignment-details {
        display: block;
        font-size: var(--font-xs);
        width: 100%;
        padding-left: 18px;
    }

    .assigned-members {
        padding: var(--space-3) var(--space-4);
    }

    .add-member-form {
        flex-direction: column;
        padding: var(--space-3) var(--space-4);
    }

    .prior-phone-col {
        display: none;
    }

    .prior-email-col {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 140px;
    }

    .prior-select-col {
        width: 24px;
    }

    .prior-year-list {
        padding: 0 var(--space-3) var(--space-3);
        overflow-x: auto;
    }

    .email-action-bar {
        left: 10px;
        right: 10px;
        transform: none;
        padding: 10px 14px;
        gap: var(--space-3);
    }

    .email-action-bar button {
        padding: 6px 12px;
        font-size: var(--font-xs);
    }

    .volunteer-lookup {
        margin-bottom: var(--space-3);
    }

    .lookup-row {
        padding: 6px 10px;
    }

    .future-menu {
        position: fixed;
        top: auto;
        bottom: 60px;
        left: 10px;
        right: 10px;
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Quick Email — Recipient Fields (To/CC/BCC)
   ═══════════════════════════════════════════════════════════════ */
.qe-recipient-fields {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--color-gray-200);
    padding-bottom: 8px;
}
.qe-recipient-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}
.qe-field-label {
    min-width: 32px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-gray-500);
    padding-top: 8px;
    text-align: right;
}
.qe-recipient-input-wrap {
    flex: 1;
    min-width: 0;
}
.qe-cc-toggle {
    background: none;
    border: none;
    color: var(--color-gray-400);
    font-size: 0.8em;
    cursor: pointer;
    padding: 8px 4px;
    white-space: nowrap;
}
.qe-cc-toggle:hover {
    color: var(--color-brand);
}
.qe-cc-row {
    display: none;
}
.qe-cc-row.qe-cc-visible {
    display: flex;
}
.qe-bcc-me {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    color: var(--color-gray-500);
    white-space: nowrap;
    padding-top: 6px;
    cursor: pointer;
}
.qe-bcc-me input[type="checkbox"] {
    margin: 0;
}
/* Tom Select inside recipient fields — compact styling */
.qe-recipient-input-wrap .ts-wrapper {
    min-height: 34px;
}
.qe-recipient-input-wrap .ts-wrapper .ts-control {
    padding: 2px 6px;
    min-height: 30px;
    font-size: 0.88em;
}
.qe-recipient-input-wrap .ts-wrapper .ts-control .item {
    padding: 2px 8px;
    margin: 2px;
    border-radius: 12px;
    font-size: 0.85em;
}
/* Badge colors in dropdown results */
.qe-badge {
    display: inline-block;
    font-size: 0.7em;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}
.qe-badge-member { background: #e3f2fd; color: #1565c0; }
.qe-badge-affiliate { background: #e8f5e9; color: #2e7d32; }
.qe-badge-vendor_contact { background: #fff3e0; color: #e65100; }
.qe-badge-parent { background: #fce4ec; color: #c62828; }
/* Dropdown option layout */
.qe-option {
    padding: 6px 8px;
}
.qe-option-name {
    font-weight: 500;
}
.qe-option-email {
    font-size: 0.82em;
    color: var(--color-gray-500);
    margin-top: 1px;
}

/* ==========================================
   Vendor Order Import — Drive Browser
   ========================================== */

.vo-import-browser {
    background: white;
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
}

.vo-import-files-section {
    margin-top: 12px;
}

.vo-import-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-gray-200);
    margin-bottom: 4px;
}

.vo-import-files-count {
    font-size: 0.85em;
    color: var(--color-gray-500);
    font-weight: 500;
}

.vo-import-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.vo-import-file-item:hover {
    background: var(--color-gray-50);
}

.vo-import-file-imported {
    opacity: 0.65;
}

.vo-import-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.vo-import-file-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vo-import-file-name {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--color-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vo-import-file-imported .vo-import-file-name {
    text-decoration: line-through;
    color: var(--color-gray-500);
}

.vo-import-file-meta {
    font-size: 0.78em;
    color: var(--color-gray-500);
    margin-top: 2px;
}

.vo-import-file-actions {
    flex-shrink: 0;
    margin-left: 12px;
}

.vo-import-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--color-brand);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.vo-import-file-btn:hover {
    background: var(--color-brand-hover, #1f5a8f);
}

.vo-import-file-btn:disabled {
    background: var(--color-gray-400);
    cursor: not-allowed;
}

.vo-import-file-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82em;
    font-weight: 500;
    text-decoration: none;
}

.vo-import-status-done {
    color: var(--color-success);
}

.vo-import-status-done:hover {
    text-decoration: underline;
}

.vo-import-empty {
    text-align: center;
    color: var(--color-gray-500);
    padding: 40px 20px;
    font-size: 0.95em;
}

@keyframes vo-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.vo-import-spinner {
    animation: vo-spin 1s linear infinite;
}

/* Mobile */
@media (max-width: 768px) {
    .vo-import-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .vo-import-file-actions {
        margin-left: 28px;
    }
    .vo-import-file-name {
        white-space: normal;
    }
}

/* ============================================
   Fish Fry Dashboard
   ============================================ */

.ff-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: var(--space-5);
}

.ff-dashboard-header h1 {
    margin: 0;
}

.ff-series-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ff-series-picker label {
    font-weight: var(--weight-semibold);
    color: #000;
}

.ff-series-picker select {
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: 0.95em;
    background: var(--color-white);
}

.ff-print-header {
    text-align: center;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid #000;
}

.ff-print-header h1 {
    font-size: 1.6em;
    margin: 0;
}

.ff-print-header p {
    color: var(--color-gray-500);
    margin: var(--space-1) 0 0 0;
    font-size: 1em;
}

.ff-print-footer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 20px;
    font-size: 9px;
    color: var(--color-gray-500);
    border-top: 1px solid var(--color-gray-300);
    justify-content: space-between;
}

/* Summary Tiles */
.ff-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.ff-tile {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: var(--space-5) var(--space-4);
    text-align: center;
    border-top: 4px solid var(--color-brand);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ff-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.ff-tile:nth-child(2) { border-top-color: #4E9F3D; }
.ff-tile:nth-child(3) { border-top-color: #C84B31; }
.ff-tile:nth-child(4) { border-top-color: #D4731A; }

.ff-tile-value {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--color-gray-800);
    line-height: 1.1;
}

.ff-tile-value.positive { color: var(--color-success); }
.ff-tile-value.negative { color: var(--color-danger); }

.ff-tile-label {
    font-size: 0.8em;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
    font-weight: var(--weight-semibold);
}

.ff-tile-subtitle {
    font-size: 0.78em;
    color: var(--color-gray-700);
    margin-top: 8px;
    line-height: 1.4;
}

.ff-tiles-avg {
    margin-top: calc(-1 * var(--space-3));
}
.ff-tiles-avg .ff-tile {
    border-top: 3px solid var(--color-gray-300);
    padding: var(--space-3) var(--space-3);
}
.ff-tiles-avg .ff-tile-value {
    font-size: 1.5em;
}
.ff-tiles-avg .ff-tile-label {
    font-size: 0.75em;
}

/* Expense Breakdown Bar */
.ff-expense-bar {
    display: flex;
    height: 32px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.ff-expense-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.ff-expense-segment span {
    font-size: 0.75em;
    font-weight: var(--weight-semibold);
    color: #fff;
    white-space: nowrap;
    padding: 0 8px;
}

.ff-expense-seg-0 { background: #2874B5; }
.ff-expense-seg-1 { background: #D94E4E; }
.ff-expense-seg-2 { background: #3EAA5F; }
.ff-expense-seg-3 { background: #E8833A; }
.ff-expense-seg-4 { background: #8E6BBF; }

/* Hide expense detail toggle */
.hide-expenses .ff-expense-item,
.hide-expenses .ff-expense-detail { display: none; }
.ff-expense-seg-5 { background: #47A8BD; }

/* Charts Section */
.ff-charts-section {
    margin-bottom: var(--space-6);
}

.ff-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.ff-chart-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: var(--space-4);
}

.ff-chart-card h3 {
    margin: 0 0 var(--space-3) 0;
    font-size: 0.95em;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: var(--weight-semibold);
}

.ff-chart-card canvas {
    max-height: 280px;
}

.ff-chart-narrow canvas {
    max-height: 260px;
}

.ff-echart-pie {
    width: 100%;
    height: 280px;
}

/* Section Title */
.ff-section-title {
    font-size: 1.2em;
    color: var(--color-gray-700);
    margin: var(--space-3) 0 var(--space-4) 0;
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-gray-200);
}

/* Week Cards */
.ff-week-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
@media (max-width: 900px) {
    .ff-week-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .ff-week-cards {
        grid-template-columns: 1fr;
    }
}

.ff-week-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: var(--space-4);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    border-left: 4px solid var(--color-brand);
}

.ff-week-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: inherit;
}

.ff-week-card-header {
    display: flex;
    flex-direction: column;
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-gray-100);
}

.ff-week-card-name {
    font-size: 0.88em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ff-week-card-date {
    color: var(--color-gray-700);
    font-size: 0.82em;
    font-weight: normal;
    margin-top: 2px;
}

.ff-week-card table {
    width: 100%;
    font-size: 0.88em;
    border-collapse: collapse;
    border: none;
}

.ff-week-card table td,
.ff-week-card table th {
    border-left: none;
    border-right: none;
}

.ff-week-card th {
    text-align: center;
    font-size: 0.8em;
    color: var(--color-white);
    background: var(--color-brand);
    padding: 5px 6px;
}

.ff-week-card th:first-child {
    text-align: left;
    border-radius: 4px 0 0 4px;
}

.ff-week-card th:last-child {
    text-align: right;
    border-radius: 0 4px 4px 0;
}

.ff-week-card td {
    padding: 3px 6px;
    color: #000;
    border-left: none;
    border-right: none;
}

.ff-week-card .ff-col-center {
    text-align: center;
}

.ff-week-card td:nth-child(3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ff-week-card .week-total td {
    font-weight: var(--weight-semibold);
    border-top: 2px solid var(--color-gray-200);
    padding-top: 6px;
    color: var(--color-gray-800);
    border-left: none;
    border-right: none;
}

.ff-week-card .week-payment td {
    font-size: 0.85em;
    color: var(--color-gray-700);
    padding-top: 4px;
    border-left: none;
    border-right: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .ff-tiles { grid-template-columns: repeat(2, 1fr); }
    .ff-charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .ff-tiles { grid-template-columns: 1fr; }
    .ff-tile-value { font-size: 1.8em; }
    .ff-dashboard-header { flex-direction: column; align-items: flex-start; }
}

/* Print-only elements use .print-only class for show/hide */

.ff-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.ff-print-table th,
.ff-print-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--color-gray-200);
    text-align: left;
}

.ff-print-table th {
    background: var(--color-gray-100);
    font-weight: var(--weight-semibold);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ff-print-table tfoot td {
    border-top: 2px solid var(--color-gray-400);
}

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

.ff-print-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 16px 12px;
}

.ff-print-grid-cell {
    width: 50%;
    vertical-align: top;
    padding: 0;
}

.ff-print-week-title {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--color-brand);
    border-bottom: 2px solid var(--color-brand);
    padding-bottom: 4px;
    margin-bottom: 6px;
}

/* Print */
@media print {
    .ff-dashboard-header { display: none !important; }

    /* Footer on every page */
    .ff-print-footer {
        display: flex !important;
    }

    /* Leave room for fixed footer */
    .page-container-wide {
        padding-bottom: 30px !important;
    }

    .ff-tile {
        box-shadow: none;
        border: 1px solid var(--color-gray-300);
        border-top-width: 4px;
    }

    .ff-tiles { grid-template-columns: repeat(4, 1fr) !important; }
    .ff-tiles-avg { grid-template-columns: repeat(4, 1fr) !important; }

    .ff-expense-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        overflow: visible !important;
        flex-wrap: wrap;
        height: auto;
        min-height: 32px;
    }
    .ff-expense-segment {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        white-space: nowrap;
        font-size: 9px;
    }

    /* Hide pie charts */
    .ff-chart-narrow { display: none !important; }

    /* Show print-only sections */
    .ff-print-totals,
    .ff-print-weekly {
        display: block !important;
    }

    /* Bar charts: full width, no border, keep h3+canvas together */
    .ff-charts-row {
        display: block !important;
        margin-bottom: 15px;
    }
    .ff-chart-card {
        box-shadow: none;
        border: none !important;
        padding: 10px 0 !important;
        page-break-inside: avoid;
    }
    .ff-charts-section { break-before: page; padding-top: 10px; }

    .ff-print-totals .ff-section-title { break-before: page; }
    .ff-print-weekly .ff-section-title { break-before: page; }

    .ff-tile-value.positive { color: #006400 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ff-tile-value.negative { color: #8b0000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Fish Fry Dashboard — Expand Modal */
.ff-expand-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.ff-expand-card {
    background: var(--color-white);
    border-radius: 0;
    box-shadow: none;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ff-expand-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-gray-200);
    background: var(--color-gray-50);
    flex-shrink: 0;
    position: relative;
}
.ff-expand-toolbar h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-gray-800);
}
.ff-expand-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ff-expand-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    position: absolute;
    right: 20px;
}
.ff-expand-content {
    flex: 1;
    padding: 20px;
    overflow: auto;
    position: relative;
}
.ff-expand-content canvas {
    max-width: 100%;
    max-height: 100%;
}
.ff-expand-split {
    display: flex;
    gap: 40px;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
}
.ff-expand-split-pie {
    flex: 1;
    max-width: 55%;
    height: 80%;
    min-height: 400px;
}
.ff-expand-split-table {
    flex: 0 0 380px;
    overflow-y: auto;
}
.ff-expand-split-table.ff-week-card {
    box-shadow: none;
    padding: 0;
    cursor: default;
    background: transparent;
    border-left: none;
}
.ff-expand-split-table.ff-week-card:hover {
    transform: none;
    box-shadow: none;
}
.ff-expand-split-table.ff-week-card table {
    font-size: 1.15em;
}
.ff-expand-split-table.ff-week-card td,
.ff-expand-split-table.ff-week-card th {
    padding: 8px 10px;
}
@media (max-width: 700px) {
    .ff-expand-split {
        flex-direction: column;
        padding: 0;
    }
    .ff-expand-split-pie {
        max-width: 100%;
    }
    .ff-expand-split-table {
        flex: none;
    }
}
.ff-expand-html {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}
.ff-expand-content .ff-tile-value {
    font-size: 4rem;
}
.ff-expand-content .ff-tile-label {
    font-size: 1.5rem;
}
.ff-expand-content .ff-tile-subtitle {
    font-size: 1.1rem;
    line-height: 1.8;
}
.ff-expand-content .ff-expense-segment {
    padding: 12px 16px;
    font-size: 1rem;
}
.ff-chart-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s;
}
.ff-tile:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s;
}

/* ──────────────── Reconciliation ──────────────── */

.recon-page-container {
    max-width: var(--container-full);
    margin: 0 auto;
    padding: var(--space-5);
}

.recon-split-view {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.recon-split-view > div {
    flex: 1;
    min-width: 0;
}

.recon-stats-row {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.recon-stat-card {
    flex: 1;
    min-width: 120px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    text-align: center;
}

.recon-stat-card .stat-value {
    font-size: var(--font-2xl);
    font-weight: var(--weight-semibold);
    color: var(--color-gray-800);
}

.recon-stat-card .stat-label {
    font-size: var(--font-sm);
    color: var(--color-gray-500);
    margin-top: var(--space-1);
}

.recon-stat-clickable {
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.recon-stat-clickable:hover {
    border-color: var(--color-brand);
    box-shadow: var(--shadow-sm);
}

.recon-stat-clickable.active {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px var(--color-brand-focus);
}

.confidence-bar {
    display: inline-block;
    height: 8px;
    border-radius: var(--radius-sm);
    background: var(--color-gray-200);
    width: 60px;
    position: relative;
    vertical-align: middle;
}

.confidence-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    position: absolute;
    left: 0;
    top: 0;
}

.confidence-high {
    background: var(--color-success);
}

.confidence-med {
    background: var(--color-warning);
}

.confidence-low {
    background: var(--color-danger);
}

.conf-w-5  { width: 5%; }
.conf-w-10 { width: 10%; }
.conf-w-15 { width: 15%; }
.conf-w-20 { width: 20%; }
.conf-w-25 { width: 25%; }
.conf-w-30 { width: 30%; }
.conf-w-35 { width: 35%; }
.conf-w-40 { width: 40%; }
.conf-w-45 { width: 45%; }
.conf-w-50 { width: 50%; }
.conf-w-55 { width: 55%; }
.conf-w-60 { width: 60%; }
.conf-w-65 { width: 65%; }
.conf-w-70 { width: 70%; }
.conf-w-75 { width: 75%; }
.conf-w-80 { width: 80%; }
.conf-w-85 { width: 85%; }
.conf-w-90 { width: 90%; }
.conf-w-95 { width: 95%; }
.conf-w-100 { width: 100%; }

.confidence-text {
    font-size: var(--font-xs);
    color: var(--color-gray-500);
    margin-left: var(--space-1);
    vertical-align: middle;
}

.match-pair-arrow {
    color: var(--color-gray-400);
    font-size: var(--font-xl);
    flex-shrink: 0;
}

.match-source-badge {
    font-size: var(--font-xs);
    padding: 2px var(--space-2);
    border-radius: var(--radius-2xl);
    font-weight: var(--weight-medium);
    display: inline-block;
}

.match-source-rule_engine {
    background: var(--color-info-light);
    color: var(--color-info-dark);
}

.match-source-ai_suggest {
    background: var(--color-purple-light, #f3e5f5);
    color: var(--color-purple);
}

.match-source-ai_override {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.match-source-manual {
    background: var(--color-gray-100);
    color: var(--color-gray-600);
}

.recon-bulk-bar {
    display: none;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-brand-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.recon-bulk-bar.visible {
    display: flex;
}

.recon-bulk-bar .bulk-count {
    font-weight: var(--weight-semibold);
    color: var(--color-brand);
}

.recon-confidence-approve {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.recon-approve-label {
    font-size: var(--font-sm);
    color: var(--color-gray-600);
    margin: 0;
    white-space: nowrap;
}

.recon-section-title {
    font-size: var(--font-lg);
    font-weight: var(--weight-semibold);
    color: var(--color-gray-700);
    margin-bottom: var(--space-3);
}

.recon-hint-text {
    font-size: var(--font-xs);
    color: var(--color-gray-500);
    font-style: italic;
}

.recon-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-gray-200);
    margin-bottom: var(--space-4);
}

.recon-tab {
    padding: var(--space-2) var(--space-5);
    font-size: var(--font-base);
    color: var(--color-gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.recon-tab:hover {
    color: var(--color-gray-800);
}

.recon-tab.active {
    color: var(--color-brand);
    border-bottom-color: var(--color-brand);
    font-weight: var(--weight-medium);
}

.recon-date-range {
    font-size: var(--font-sm);
    color: var(--color-gray-500);
    margin-bottom: var(--space-4);
}

.recon-modal-hidden {
    display: none;
}

.recon-modal-visible {
    display: flex;
}

.recon-modal-wide {
    max-width: 800px;
}

.recon-modal-medium {
    max-width: 550px;
}

.recon-modal-top {
    z-index: var(--z-critical);
}

.recon-modal-msg {
    margin: 0;
    line-height: var(--leading-normal);
}

.recon-modal-detail {
    font-size: var(--font-xs);
    background: var(--color-gray-50);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow: auto;
    margin-top: var(--space-2);
    white-space: pre-wrap;
    word-break: break-word;
}

.recon-tab-content-hidden {
    display: none;
}

.recon-cell-name {
    white-space: nowrap;
}

.recon-cell-meta {
    font-size: var(--font-xs);
    color: var(--color-gray-500);
    white-space: nowrap;
}

.recon-cell-id {
    color: var(--color-gray-350);
}

.recon-table {
    width: 100%;
    border-collapse: collapse;
}

.recon-table thead {
    background: var(--color-brand);
}

.recon-table th {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-sm);
    font-weight: var(--weight-medium);
    color: var(--color-white);
    text-align: center;
    border-bottom: 1px solid var(--color-brand-dark);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.recon-table th:hover {
    background: var(--color-brand-dark);
}


.recon-table td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-gray-100);
    font-size: var(--font-sm);
    vertical-align: top;
}

.recon-table tbody tr:hover {
    background: var(--color-gray-50);
}

.recon-col-cb {
    width: 30px;
}

.recon-col-sm {
    white-space: nowrap;
}

.recon-col-actions {
    white-space: nowrap;
}

.recon-empty-msg {
    color: var(--color-gray-500);
    font-style: italic;
    padding: var(--space-4);
}

.recon-hint-row td {
    padding-top: 0;
    border-bottom: 1px solid var(--color-gray-200);
}

.recon-table tr:has(+ .recon-hint-row) td {
    border-bottom: none;
}

.recon-action-group {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
}

.recon-loading-text {
    color: var(--color-gray-500);
    font-style: italic;
}

.recon-entry-summary {
    margin: 0;
    line-height: var(--leading-normal);
}

.form-control-inline {
    width: auto;
    display: inline-block;
}

.header-actions-group {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

@media (max-width: 900px) {
    .recon-split-view {
        flex-direction: column;
    }
}

/* ── Scripture Favorites ─────────────────────────────────────────── */

.scripture-quote {
    border-left: 4px solid var(--color-brand);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-3) 0;
    font-style: italic;
    background: var(--color-gray-50);
    border-radius: var(--radius-sm);
    line-height: var(--leading-relaxed);
}

.scripture-quote cite {
    display: block;
    margin-top: var(--space-2);
    font-style: normal;
    font-weight: 600;
    color: var(--color-gray-600);
    font-size: var(--font-sm);
}

.scripture-summary {
    color: var(--color-gray-600);
    font-size: var(--font-sm);
    margin-top: var(--space-2);
    line-height: var(--leading-normal);
}

.scripture-shared-by {
    color: var(--color-gray-500);
    font-size: var(--font-xs);
    margin-top: var(--space-2);
}

.scripture-ai-disclaimer {
    color: var(--color-gray-500);
    font-size: var(--font-xs);
    font-style: italic;
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--color-gray-50);
    border-radius: var(--radius-sm);
}

.scripture-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
    margin-bottom: var(--space-4);
}

.scripture-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-brand-light);
    color: var(--color-brand);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-2xl);
    font-size: var(--font-xs);
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
}

.scripture-tag.scripture-tag-season {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.scripture-tag.scripture-tag-use {
    background: var(--color-success-light);
    color: var(--color-success-text);
}

.scripture-tag.scripture-tag-clickable {
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.scripture-tag.scripture-tag-clickable:hover {
    opacity: 0.8;
    text-decoration: none;
}

.scripture-teaching-guide {
    line-height: var(--leading-relaxed);
    color: var(--color-gray-800);
}

.scripture-teaching-guide h4 {
    margin: var(--space-3) 0 var(--space-1) 0;
    color: var(--color-brand);
    font-size: 0.95rem;
}

.scripture-teaching-guide ul {
    margin: var(--space-1) 0;
    padding-left: var(--space-5);
}

.scripture-teaching-guide li {
    margin-bottom: var(--space-1);
}

.scripture-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    padding: var(--space-2) 0;
    color: var(--color-gray-800);
    font-weight: 600;
}

.scripture-section-header:hover {
    color: var(--color-brand);
}

.scripture-section-header .toggle-icon {
    transition: transform var(--transition-fast);
    font-size: var(--font-xs);
}

.scripture-section-header.expanded .toggle-icon {
    transform: rotate(90deg);
}

.scripture-section-content {
    display: none;
    padding-left: var(--space-4);
}

.scripture-section-content.visible {
    display: block;
}

.scripture-book-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-2);
    padding: var(--space-2) 0;
}

.scripture-book-item {
    display: block;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-gray-800);
    text-decoration: none;
    text-align: center;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

a.scripture-chapter-btn {
    text-decoration: none;
}

.scripture-book-item:hover {
    background: var(--color-brand-light);
    border-color: var(--color-brand);
    color: var(--color-brand);
}

.scripture-book-item.active {
    background: var(--color-brand);
    color: var(--color-white);
    border-color: var(--color-brand);
}

.scripture-chapter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3) 0;
}

.scripture-chapter-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--color-white);
    color: var(--color-gray-800);
    font-size: var(--font-sm);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.scripture-chapter-btn:hover {
    background: var(--color-brand-light);
    border-color: var(--color-brand);
    color: var(--color-brand);
}

.scripture-chapter-btn.active {
    background: var(--color-brand);
    color: var(--color-white);
    border-color: var(--color-brand);
}

.scripture-verse-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) 0;
}

.scripture-verse-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    background: var(--color-white);
}

.scripture-verse-item:hover {
    border-color: var(--color-brand);
}

.scripture-verse-num {
    font-weight: 600;
    color: var(--color-brand);
    min-width: 24px;
}

.scripture-verse-text {
    flex: 1;
    line-height: var(--leading-normal);
    color: var(--color-gray-800);
}

.scripture-search-results {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.scripture-search-result {
    padding: var(--space-3);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    background: var(--color-white);
}

.scripture-search-result:hover {
    border-color: var(--color-brand);
}

.scripture-search-ref {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.scripture-search-ref a {
    color: var(--color-brand);
    text-decoration: none;
}

.scripture-search-ref a:hover {
    text-decoration: underline;
}

.scripture-verse-item a.scripture-verse-num {
    text-decoration: none;
}

.scripture-verse-item a.scripture-verse-text {
    text-decoration: none;
    color: var(--color-gray-800);
}

.scripture-verse-item a.scripture-verse-text:hover {
    color: var(--color-brand);
}

.scripture-search-snippet {
    color: var(--color-gray-600);
    font-size: var(--font-sm);
    line-height: var(--leading-normal);
}

.scripture-ref-card {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    background: var(--color-gray-50);
    font-size: var(--font-sm);
}

.scripture-ref-card .remove-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 2px;
}

.scripture-ref-card .remove-btn:hover {
    color: var(--color-danger);
}

/* Save modal for scripture */
.scripture-save-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.scripture-save-modal.visible {
    display: flex;
}

.scripture-save-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: var(--space-6);
}

.scripture-save-card h3 {
    margin: 0 0 var(--space-4) 0;
    color: var(--color-gray-800);
}

.scripture-inline-edit {
    padding: var(--space-2) var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition-fast);
    min-height: 24px;
}

.scripture-inline-edit:hover {
    border-color: var(--color-gray-300);
    background: var(--color-gray-50);
}

.scripture-inline-edit.editing {
    border-color: var(--color-brand);
    background: var(--color-white);
    cursor: text;
}

/* Daily Readings */
.reading-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.reading-reference {
    color: var(--color-brand);
    font-weight: 600;
    font-size: var(--font-sm);
}

.reading-body {
    line-height: var(--leading-relaxed);
    color: var(--color-gray-800);
    margin-top: var(--space-2);
}

.reading-body p {
    margin: var(--space-2) 0;
}

.reading-body em {
    font-style: italic;
}

.reading-body strong {
    font-weight: 600;
    color: var(--color-brand);
}

.reading-day-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-gray-200);
}

.reading-day-link:last-child {
    border-bottom: none;
}

.reading-card {
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.reading-card:hover {
    border-color: var(--color-brand);
}

.reading-save-btn {
    background: none;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.reading-save-btn:hover {
    color: var(--color-brand);
}

.reading-save-btn.saved svg {
    fill: var(--color-brand);
    stroke: var(--color-brand);
}

.reading-save-btn.saved {
    color: var(--color-brand);
}

.reading-day-title {
    color: var(--color-brand);
    text-decoration: none;
    font-weight: 500;
}

.reading-day-title:hover {
    text-decoration: underline;
}

.scripture-footnotes {
    font-size: var(--font-sm);
    color: var(--color-gray-600);
    line-height: var(--leading-relaxed);
}

.scripture-footnote-entry {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-gray-200);
}

.scripture-footnote-entry:last-child {
    border-bottom: none;
}

.scripture-footnote-entry strong {
    color: var(--color-brand);
}

.scripture-crossref-section {
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
    padding-top: var(--space-3);
    border-top: 2px solid var(--color-gray-200);
    color: var(--color-gray-800);
}

.scripture-crossref-table {
    width: 100%;
    margin-top: var(--space-2);
    font-size: var(--font-sm);
    color: var(--color-gray-600);
    border-collapse: collapse;
}

.scripture-crossref-table tr {
    border-bottom: 1px solid var(--color-gray-200);
}

.scripture-crossref-table tr:last-child {
    border-bottom: none;
}

.scripture-crossref-verse {
    font-weight: 600;
    color: var(--color-gray-800);
    white-space: nowrap;
    padding: var(--space-1) var(--space-3) var(--space-1) 0;
    vertical-align: top;
    width: 1%;
}

.scripture-crossref-refs {
    padding: var(--space-1) 0;
    line-height: var(--leading-relaxed);
}

.scripture-footnote-link {
    color: var(--color-brand);
    text-decoration: none;
    font-weight: 500;
}

.scripture-footnote-link:hover {
    text-decoration: underline;
}

/* Scripture sidebar card items */
.scripture-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.scripture-sidebar-item {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-brand);
    background: var(--color-brand-light);
    text-decoration: none;
    color: var(--color-gray-800);
}

.scripture-sidebar-item:hover {
    background: #dce9f5;
}

.scripture-sidebar-ref {
    font-weight: 600;
    font-size: var(--font-xs);
    color: var(--color-brand);
}

.scripture-sidebar-text {
    font-size: var(--font-xs);
    color: var(--color-gray-600);
    line-height: var(--leading-normal);
    margin-top: 2px;
}

/* Scripture reader view */
.scripture-chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
}

.scripture-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-brand);
    text-decoration: none;
    font-size: var(--font-sm);
    font-weight: 500;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.scripture-nav-btn:hover {
    background: var(--color-brand-light);
}

.scripture-nav-placeholder {
    width: 120px;
}

.scripture-chapter-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-gray-800);
}

.scripture-chapter-title-sm {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--color-gray-600);
}

.scripture-chapter-title-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.scripture-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: none;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-2xl);
    padding: 2px var(--space-2);
    font-size: var(--font-xs);
    color: var(--color-gray-600);
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.scripture-view-toggle:hover {
    border-color: var(--color-brand);
    color: var(--color-brand);
}

.scripture-toggle-hidden {
    display: none;
}

.scripture-reader {
    max-width: 700px;
    margin: 0 auto;
}

.scripture-reader-text {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--color-gray-800);
    text-align: justify;
}

.scripture-reader-verse-num {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--color-brand);
    text-decoration: none;
    vertical-align: super;
    margin: 0 2px;
    cursor: pointer;
}

.scripture-reader-verse-num:hover {
    text-decoration: underline;
}

.scripture-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
}

.scripture-page-info {
    font-size: var(--font-sm);
    color: var(--color-gray-600);
}

.scripture-psalms-section {
    margin: var(--space-2) 0;
}

.scripture-psalms-label {
    font-weight: 600;
    color: var(--color-brand);
    margin-bottom: var(--space-2);
    font-size: var(--font-sm);
}

.scripture-search-field {
    flex: 1;
}

.scripture-search-btn-group {
    flex: 0 0 auto;
}

@media (max-width: 768px) {
    .scripture-book-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .scripture-verse-item {
        flex-direction: column;
        gap: var(--space-2);
    }
}
/* ============================================================
   EDIT MEMBER PAGE — template styles scoped to .edit-member-page
   (moved from templates/edit_member.html)
   ============================================================ */
.edit-member-page .is-hidden {
    display: none;
}
.edit-member-page .snooze-modal-overlay.is-hidden {
    display: none;
}
.edit-member-page .modal-overlay.is-hidden {
    display: none;
}
.edit-member-page .profile-hero-photo-area .photo-action-link.is-hidden {
    display: none;
}
.edit-member-page #photoEditBtn.photo-action-link:not(.is-hidden) {
    display: flex;
}

/* Edit member — shared heading / layout helpers (no inline styles in template) */
.edit-member-page .sidebar-heading-icon {
    vertical-align: middle;
    margin-right: var(--space-2);
}
.edit-member-page .sidebar-heading-icon-sm {
    vertical-align: middle;
    margin-right: 6px;
}
.edit-member-page .sidebar-heading-reminder-icon {
    vertical-align: middle;
    margin-left: var(--space-2);
}
.edit-member-page .sidebar-note-reminder-icon {
    vertical-align: middle;
    margin-left: 5px;
}
.edit-member-page .edit-member-inline-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.edit-member-page .edit-member-inline-row-tight {
    display: flex;
    align-items: center;
    gap: 6px;
}
.edit-member-page .btn-margin-top-sm {
    margin-top: var(--space-2);
}
.edit-member-page .member-badges-spaced {
    margin-bottom: 15px;
}
.edit-member-page .credentials-reveal-fields {
    margin-top: 15px;
}
.edit-member-page .legend-dot-1to1 {
    background: var(--color-pink);
}
.edit-member-page .legend-dot-campaign {
    background: #7B1FA2;
}
.edit-member-page .engagement-loading-state {
    text-align: center;
    padding: 1rem;
    color: var(--color-gray-500);
}
.edit-member-page .engagement-badge-row {
    text-align: center;
    margin: 0.5rem 0;
}
.edit-member-page .engagement-footer-link-wrap {
    text-align: center;
    margin-top: 0.5rem;
}
.edit-member-page .engagement-campaigns-link {
    font-size: 0.82em;
    color: var(--color-blue-alt);
    text-decoration: none;
}
.edit-member-page .engagement-empty-state {
    text-align: center;
    padding: 1rem;
    color: var(--color-gray-500);
    font-size: 0.85em;
}
.edit-member-page .engagement-error-text {
    color: var(--color-danger);
    font-size: 0.85em;
}
.edit-member-page .similar-members-header-clickable {
    cursor: pointer;
}
.edit-member-page .ai-analyze-btn-compact {
    font-size: 0.75rem;
    padding: 2px 10px;
}
.edit-member-page .ai-insights-placeholder {
    font-size: 0.85rem;
    padding: 8px 0;
}
.edit-member-page .ai-insights-hint {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 8px;
}
.edit-member-page .ai-suggestions-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6366f1;
    padding: 8px 0 4px;
    border-top: 1px solid var(--color-gray-200);
    margin-top: 8px;
}
.edit-member-page .ai-insights-status-line {
    font-size: 0.8rem;
    padding: 4px 0;
}
.edit-member-page .text-success-check {
    color: var(--color-success);
}

.edit-member-page .map-button{    display: inline-flex;    align-items: center;    justify-content: center;    width: 28px;    height: 28px;    background-color: #2874B5;    color: white;    border-radius: 50%;    margin-left: 10px;    vertical-align: middle;    transition: background-color 0.2s, transform 0.2s;}.edit-member-page .map-button:hover{    background-color: #1f5a8f;    transform: scale(1.1);}.edit-member-page .map-button svg{    width: 16px;    height: 16px;}.edit-member-page .checkbox-group{    margin-top: 10px;}.edit-member-page .checkbox-label{    display: flex;    align-items: center;    gap: 8px;    cursor: pointer;    font-size: 0.95em;    color: #333;}.edit-member-page .checkbox-label input[type="checkbox"]{    width: 18px;    height: 18px;    cursor: pointer;}.edit-member-page .section-action-buttons{    position: absolute;    top: 0;    right: 0;    display: flex;    flex-direction: column;    gap: 4px;    z-index: 10;}.edit-member-page .section-action-buttons .edit-icon-btn{    position: static;    top: auto;    right: auto;}.edit-member-page .contact-icon-btn{    background: white;    border: 1px solid #ddd;    padding: 6px;    cursor: pointer;    opacity: 0.7;    transition: all 0.2s;    border-radius: 50%;    color: #2874B5;    display: flex;    align-items: center;    justify-content: center;    box-shadow: 0 1px 3px rgba(0,0,0,0.1);}.edit-member-page .contact-icon-btn:hover{    opacity: 1;    background: #f0f0f0;    border-color: #2874B5;}.edit-member-page .add-contact-under-photo{    margin-top: 15px;    text-align: center;}.edit-member-page .modal-overlay{    position: fixed;    top: 0;    left: 0;    right: 0;    bottom: 0;    background-color: rgba(0, 0, 0, 0.6);    display: flex;    justify-content: center;    align-items: center;    z-index: 1000;    padding: 20px;}.edit-member-page .modal-content{    background: #f8f9fa;    border-radius: 16px;    padding: 30px;    position: relative;    max-height: 90vh;    overflow-y: auto;    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);}.edit-member-page .modal-close{    position: absolute;    top: 12px;    right: 16px;    background: none;    border: none;    font-size: 28px;    color: #888;    cursor: pointer;    line-height: 1;    padding: 0;    transition: color 0.2s;}.edit-member-page .modal-close:hover{    color: #333;}.edit-member-page .contact-modal{    max-width: 340px;    width: 100%;    text-align: center;    box-sizing: border-box;}.edit-member-page .contact-modal h3{    margin: 0 0 5px 0;    font-size: 1.25em;    color: #333;}.edit-member-page .modal-subtitle{    margin: 0 0 20px 0;    font-size: 0.9em;    color: #666;}.edit-member-page .qr-code-container{    background: white;    padding: 20px;    border-radius: 12px;    margin-bottom: 20px;    display: flex;    justify-content: center;    align-items: center;    min-height: 200px;    overflow: hidden;}.edit-member-page .qr-code-container canvas,
.edit-member-page .qr-code-container img{    border-radius: 8px;    max-width: 100%;    height: auto;}.edit-member-page .qr-loading{    color: #888;    font-size: 0.9em;}.edit-member-page .qr-error{    color: #dc3545;    font-size: 0.9em;    margin: 0;}.edit-member-page .modal-actions{    display: flex;    justify-content: center;}.edit-member-page .modal-actions .btn-download-contact{    display: inline-flex;    align-items: center;    gap: 10px;    padding: 12px 24px;    background: linear-gradient(135deg, #2874B5 0%, #1f5a8f 100%);    color: white;    text-decoration: none;    border: none;    border-radius: 25px;    font-size: 0.95em;    font-weight: 500;    cursor: pointer;    transition: transform 0.2s, box-shadow 0.2s;    box-shadow: 0 4px 15px rgba(40, 116, 181, 0.3);}.edit-member-page .modal-actions .btn-download-contact:hover{    transform: translateY(-2px);    box-shadow: 0 6px 20px rgba(40, 116, 181, 0.4);}.edit-member-page .modal-actions .btn-download-contact:active{    transform: translateY(0);}.edit-member-page .modal-actions .btn-download-contact svg{    flex-shrink: 0;}.edit-member-page .profile-container{    max-width: 900px;    margin: 0 auto;    padding: 20px;}.edit-member-page .photo-with-badge{    display: flex;    align-items: flex-start;    gap: 8px;}.edit-member-page .virtus-badge{    flex-shrink: 0;}.edit-member-page .virtus-badge img{    width: 32px;    height: auto;}.edit-member-page .profile-photo{    width: 100%;    height: 100%;    border-radius: 50%;    object-fit: cover;}.edit-member-page .photo-actions{    margin-top: 12px;    display: flex;    gap: 8px;    justify-content: center;    align-items: center;}.edit-member-page .photo-action-link{    color: #666;    text-decoration: none;    padding: 6px;    border-radius: 50%;    transition: all 0.2s;    display: flex;    align-items: center;    justify-content: center;}.edit-member-page .photo-action-link:first-child{    font-size: 22px;}.edit-member-page .photo-action-link:hover{    color: #2874B5;    background-color: rgba(40, 116, 181, 0.1);}.edit-member-page .photo-save-btn{    color: #28a745;}.edit-member-page .photo-save-btn:hover{    color: #28a745;    background-color: rgba(40, 167, 69, 0.1);}.edit-member-page .photo-cancel-btn{    color: #dc3545;}.edit-member-page .photo-cancel-btn:hover{    color: #dc3545;    background-color: rgba(220, 53, 69, 0.1);}.edit-member-page .contact-section{    flex: 1;}.edit-member-page .info-group{    margin-bottom: 20px;}.edit-member-page .info-group:last-child{    margin-bottom: 0;}.edit-member-page .info-group-title{    font-size: 0.85em;    text-transform: uppercase;    color: #666;    margin: 0 0 8px 0;    font-weight: 600;    letter-spacing: 0.5px;}.edit-member-page .info-item{    margin-bottom: 6px;}.edit-member-page .info-label{    color: #666;    font-size: 0.9em;    margin-right: 8px;}.edit-member-page .info-value{    color: #333;}.edit-member-page .info-value.large{    font-size: 1.2em;    font-weight: 500;}.edit-member-page .info-value.muted{    color: #999;    font-style: italic;}.edit-member-page .profile-details-section{}.edit-member-page .details-card{    background: white;    padding: 20px;    border-radius: 8px;    box-shadow: 0 2px 5px rgba(0,0,0,0.1);    margin-bottom: 15px;}.edit-member-page .card-title{    font-size: 1em;    color: #2874B5;    margin: 0 0 15px 0;    padding-bottom: 10px;    border-bottom: 1px solid #e0e0e0;}.edit-member-page .info-grid{    display: grid;    grid-template-columns: repeat(2, 1fr);    gap: 10px;}.edit-member-page .info-grid .full-width{    grid-column: 1 / -1;}.edit-member-page .social-links{    display: flex;    gap: 15px;    align-items: center;}.edit-member-page .social-link{    display: flex;    align-items: center;    justify-content: center;    width: 40px;    height: 40px;    border-radius: 50%;    background-color: #f0f0f0;    color: #666;    transition: all 0.3s;}.edit-member-page .social-link:hover{    transform: scale(1.1);}.edit-member-page .social-link.linkedin:hover{    background-color: #0077b5;    color: white;}.edit-member-page .social-link.facebook:hover{    background-color: #1877f2;    color: white;}.edit-member-page .social-link.instagram:hover{    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);    color: white;}.edit-member-page .form-row{    display: flex;    gap: 15px;    flex-wrap: wrap;    margin-bottom: 15px;}.edit-member-page .form-row:last-child{    margin-bottom: 0;}.edit-member-page .form-row .form-group{    margin-bottom: 0;}.edit-member-page .form-group{    flex: 1;    min-width: 150px;    margin-bottom: 15px;}.edit-member-page .form-group.small{    flex: 0 0 100px;    min-width: 80px;}.edit-member-page .form-group.flex-2{    flex: 2;}.edit-member-page .form-group label{    display: block;    margin-bottom: 5px;    font-weight: 500;    color: #333;    font-size: 0.9em;}.edit-member-page .form-group input,
.edit-member-page .form-group select,
.edit-member-page .form-group textarea{    width: 100%;    padding: 10px;    border: 1px solid #ddd;    border-radius: 4px;    box-sizing: border-box;    font-size: 14px;}.edit-member-page .form-group input:focus,
.edit-member-page .form-group select:focus,
.edit-member-page .form-group textarea:focus{    outline: none;    border-color: #2874B5;    box-shadow: 0 0 5px rgba(40, 116, 181, 0.3);}.edit-member-page .form-group small{    display: block;    margin-top: 5px;    color: #666;    font-size: 12px;}.edit-member-page .age-display-inline{    display: inline-block;    padding: 10px;    background-color: #f5f5f5;    border-radius: 4px;    font-weight: 500;}.edit-member-page .password-container{    position: relative;}.edit-member-page .password-container input{    padding-right: 40px;}.edit-member-page .password-toggle{    position: absolute;    right: 12px;    top: 50%;    transform: translateY(-50%);    cursor: pointer;    width: 20px;    height: 20px;}.edit-member-page .password-toggle svg{    width: 20px;    height: 20px;    fill: #999;}.edit-member-page .password-toggle:hover svg{    fill: #2874B5;}.edit-member-page .password-status{    padding: 10px;    border-radius: 5px;    margin-bottom: 10px;}.edit-member-page .password-status.success{    background-color: #e8f5e9;    color: #2e7d32;}.edit-member-page .password-status.warning{    background-color: #fff3e0;    color: #e65100;}.edit-member-page .btn{    background-color: #2874B5;    color: white;    padding: 12px 24px;    border: none;    border-radius: 4px;    cursor: pointer;    font-size: 16px;    text-decoration: none;    display: inline-block;    transition: background-color 0.3s;}.edit-member-page .btn:hover{    background-color: #1f5a8f;}.edit-member-page .btn-secondary{    background-color: #666;}.edit-member-page .btn-secondary:hover{    background-color: #555;}.edit-member-page .btn-small{    padding: 8px 16px;    font-size: 14px;}.edit-member-page .form-actions{    margin-top: 20px;    padding-top: 20px;    border-top: 1px solid #e0e0e0;    display: flex;    gap: 10px;}@media (max-width: 768px) {    .edit-member-page .contact-section{        width: 100%;    }    .edit-member-page .info-grid{        grid-template-columns: 1fr;    }    .edit-member-page .form-row{        flex-direction: column;    }    .edit-member-page .form-group.small{        flex: 1;    }}.edit-member-page .collapsible-header{    display: flex;    justify-content: space-between;    align-items: center;    cursor: pointer;    user-select: none;    transition: color 0.2s;}.edit-member-page .collapsible-header:hover{    color: #1f5a8f;}.edit-member-page .collapse-icon{    display: flex;    align-items: center;    transition: transform 0.3s ease;}.edit-member-page .collapse-icon.expanded{    transform: rotate(180deg);}.edit-member-page .collapsible-content{    padding-top: 15px;}.edit-member-page .education-section{    margin-bottom: 20px;    padding-bottom: 15px;    border-bottom: 1px solid #eee;}.edit-member-page .education-section:last-child{    margin-bottom: 0;    padding-bottom: 0;    border-bottom: none;}.edit-member-page .section-label{    display: block;    font-weight: 600;    color: #2874B5;    font-size: 0.9em;    margin-bottom: 10px;}.edit-member-page .record-info-card{    background-color: #f8f9fa;    border: 1px solid #e0e0e0;}.edit-member-page .record-info-card .card-title{    color: #666;    font-size: 0.9em;}.edit-member-page .record-info-card .info-label{    color: #888;}.edit-member-page .record-info-card .info-value{    color: #555;    font-size: 0.9em;}.edit-member-page .engagement-summary{    display: flex;    gap: 0.5rem;    justify-content: center;    padding: 0.5rem 0;}.edit-member-page .engagement-stat{    text-align: center;    flex: 1;}.edit-member-page .engagement-stat-value{    display: block;    font-size: 1.25rem;    font-weight: 700;    color: #333;}.edit-member-page .engagement-stat-label{    display: block;    font-size: 0.72em;    color: #888;    margin-top: 0.1rem;}.edit-member-page .engagement-badge{    display: inline-block;    padding: 0.15rem 0.6rem;    border-radius: 10px;    font-size: 0.78em;    font-weight: 600;}.edit-member-page .engagement-badge.high{ background: #d4edda; color: #155724; }.edit-member-page .engagement-badge.medium{ background: #fff3cd; color: #856404; }.edit-member-page .engagement-badge.low{ background: #f8d7da; color: #721c24; }.edit-member-page .engagement-recent{    margin-top: 0.5rem;}.edit-member-page .engagement-campaign{    display: flex;    align-items: center;    gap: 0.5rem;    padding: 0.35rem 0;    border-bottom: 1px solid #f0f0f0;    font-size: 0.82em;    min-width: 0;}.edit-member-page .engagement-campaign:last-child{ border-bottom: none; }.edit-member-page .engagement-campaign-subject{    flex: 1;    color: #555;    overflow: hidden;    text-overflow: ellipsis;    white-space: nowrap;}.edit-member-page .engagement-campaign-date{    font-size: 0.8em;    font-weight: 600;    white-space: nowrap;    flex-shrink: 0;}.edit-member-page .engagement-date-1to1{ color: #e91e63; }.edit-member-page .engagement-date-campaign{ color: #7B1FA2; }.edit-member-page .engagement-campaign-to{    font-size: 0.85em;    color: #4a90d9;    text-decoration: none;    white-space: nowrap;    flex-shrink: 0;    max-width: 100px;    overflow: hidden;    text-overflow: ellipsis;    font-weight: 600;}.edit-member-page a.engagement-campaign-to:hover{ text-decoration: underline; }.edit-member-page .engagement-campaign-status{    flex-shrink: 0;    display: flex;    align-items: center;    justify-content: center;    width: 20px;}.edit-member-page .engagement-legend{    font-size: 0.65em;    font-weight: 400;    color: #999;    margin-left: 8px;}.edit-member-page .legend-dot{    display: inline-block;    width: 8px;    height: 8px;    border-radius: 50%;    margin-right: 2px;    margin-left: 6px;    vertical-align: middle;}
