/* ──────────────────────────────────────────────────────────────────────────
   Jacksonville Boosters — theme
   Warm paper background, hairline borders, soft shadows, serif headings.
   All colors/sizes come from the tokens below; large-text.css only changes --base.
   ────────────────────────────────────────────────────────────────────────── */
:root {
    --bg:          #faf9f5;
    --surface:     #ffffff;
    --surface-2:   #f4f2ea;
    --ink:         #141413;
    --ink-2:       #3d3d3a;
    --ink-3:       #5e5d59;
    --line:        #e6e3d8;
    --line-strong: #cdc9ba;
    --accent:      #b4552f;
    --accent-hover:#9a4524;
    --accent-soft: #f6e8e1;
    --danger:      #b3261e;
    --danger-hover:#8f1d17;
    --radius:      6px;
    --radius-sm:   4px;
    --shadow:      0 1px 2px rgba(20,20,19,0.04), 0 4px 18px rgba(20,20,19,0.05);
    --shadow-lift: 0 2px 4px rgba(20,20,19,0.06), 0 10px 30px rgba(20,20,19,0.09);
    --font-sans:   system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif:  Georgia, "Times New Roman", serif;
    --base:        16px;   /* root size: 1rem. Body text is 1.125rem = 18px */
}

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

html { font-size: var(--base); }

body {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; color: var(--ink); }
h1 { font-size: 2rem; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; margin-bottom: 1.25rem; color: var(--ink-2); }
h3 { font-size: 1.25rem; margin-bottom: 1rem; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }

/* ── Layout ── */
.centered-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lift);
    text-align: center;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: var(--ink-2);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--ink);
    background-color: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group select { padding-right: 2.25rem; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ── Buttons ── */
.btn-primary, .btn-secondary, .btn-danger {
    font-family: inherit;
    padding: 0.7rem 1.4rem;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line-strong);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }

.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled { opacity: 0.55; cursor: default; }

/* buttons and link-buttons must measure the same */
.btn-primary, .btn-secondary, .btn-danger { line-height: 1.3; display: inline-flex; align-items: center; justify-content: center; }

.full-width { width: 100%; }

/* ── Alerts ── */
.error-box {
    background: #fdecea;
    border: 1px solid #f1b7b1;
    color: #8f1d17;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.success-box {
    background: #eaf6ec;
    border: 1px solid #b5dcba;
    color: #1d6b30;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.warning-box {
    background: #fbf3dc;
    border: 1px solid #ecd9a0;
    color: #6f5712;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

/* ── Top bar ── */
.top-bar {
    background: var(--surface);
    color: var(--ink);
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(20,20,19,0.02);
}

.top-bar-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 500;
}

.top-bar .btn-secondary,
.top-bar-actions .btn-secondary {
    padding: 0.4rem 0.95rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
}

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

#welcome-msg { color: var(--ink-3); margin-right: 0.5rem; }

/* ── Page content ── */
.page-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Stat cards ── */
.stat-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.75rem;
    flex: 1;
    min-width: 160px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-label { font-size: 0.95rem; color: var(--ink-3); margin-bottom: 0.4rem; }

.stat-number {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--accent);
}

/* ── Toolbar ── */
.toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

/* ── Member table ── */
.member-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.member-table th {
    background: var(--surface-2);
    color: var(--ink-2);
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
}

.member-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
}

/* Dashboard columns the user can drag to resize (see initColumnResize in admin.js) */
.member-table.fixed-cols { table-layout: fixed; }
.member-table.fixed-cols td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-table th { position: relative; }
.col-resizer {
    position: absolute; top: 0; right: 0; bottom: 0; width: 8px;
    cursor: col-resize; user-select: none;
}
.col-resizer::after {
    content: ''; position: absolute; top: 25%; bottom: 25%; right: 3px; width: 1px;
    background: var(--line);
}
.col-resizer:hover::after, .col-resizer.dragging::after { background: var(--ink-2); width: 2px; }

.member-table tr:last-child td { border-bottom: none; }
.member-table tr:hover td { background: var(--surface-2); }

.badge {
    display: inline-block;
    padding: 0.15rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-active   { background: #e6f4e8; color: #1d6b30; }
.badge-inactive { background: #fbf0d4; color: #8a5a06; }
.badge-lapsed   { background: #fbe4e1; color: #a1281f; }
.badge-yes      { background: #e6f4e8; color: #1d6b30; }
.badge-no       { background: #fbe4e1; color: #a1281f; }

/* ── Form sections (cards) ── */
.form-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.form-section h3 {
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.6rem;
    margin-bottom: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 180px;
}

/* ── Breadcrumb ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--ink-3);
}

.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--line-strong); }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

/* ── Password toggle ── */
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 2.75rem; }

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-3);
    font-size: 1.1rem;
    padding: 0;
    line-height: 1;
}
.password-toggle:hover { color: var(--accent); }

/* ── Dynamic field rows ── */
.dynamic-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.dynamic-row .type-select,
.dynamic-row .value-input {
    font-family: inherit;
    color: var(--ink);
    background-color: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
}

.dynamic-row .type-select {
    width: 130px;
    flex-shrink: 0;
    padding: 0.6rem 0.5rem;
    font-size: 1rem;
}

.dynamic-row .value-input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    font-size: 1.05rem;
}

.dynamic-row .type-select:focus,
.dynamic-row .value-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.remove-btn {
    background: var(--surface);
    color: var(--danger);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}
.remove-btn:hover { background: #fdecea; border-color: #f1b7b1; }

.add-row-btn {
    font-family: inherit;
    background: none;
    border: 1px dashed var(--line-strong);
    color: var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.4rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.25rem;
    display: inline-block;
}
.add-row-btn:hover { background: var(--accent-soft); border-color: var(--accent); }

.dynamic-label {
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: block;
}

/* ── Tabs ── */
.tab-bar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }

.tab-btn {
    font-family: inherit;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink-2);
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-btn:hover:not(.active) { background: var(--surface-2); }

/* ── Role badges ── */
.badge-chair    { background: #e8eef9; color: #234f8f; }
.badge-co-chair { background: #fbeadb; color: #9a4b0e; }
.badge-member   { background: #efede4; color: #3d3d3a; }
.badge-lifetime { background: #efe5f8; color: #5e2a85; }
.badge-honorary { background: #e3eef8; color: #1f4f7a; }

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.page-btn {
    font-family: inherit;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink-2);
    padding: 0.4rem 0.85rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    min-width: 2.5rem;
    text-align: center;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Filter tabs ── */
.filter-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    font-family: inherit;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink-2);
    padding: 0.55rem 1.15rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.filter-tab .tab-count {
    background: rgba(255,255,255,0.25);
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.55rem;
    font-size: 0.85rem;
}
.filter-tab:not(.active) .tab-count { background: var(--surface-2); color: var(--ink-3); }

/* ── Search with icon ── */
.search-wrapper { position: relative; flex: 1; max-width: 420px; }

.search-wrapper input {
    width: 100%;
    padding: 0.6rem 2.75rem 0.6rem 0.8rem;
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--ink-3);
    padding: 0;
    line-height: 1;
}
.search-icon-btn:hover { color: var(--accent); }

/* ── Status filter ── */
.status-filter {
    font-family: inherit;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
}
.status-filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── Dropdown arrow: drawn by us so it sits 8px in from the right edge ── */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235e5d59' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 0.8em auto;
}

/* ── Header select (inside table header) ── */
.header-select {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.3rem 1.5rem 0.3rem 0.5rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
}

/* ── Text-size toggle (added by /js/ui.js) ── */
#text-size-btn { white-space: nowrap; }
.text-size-float {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 900;
    box-shadow: var(--shadow-lift);
}

/* ── Header menu (built by /js/ui.js) ── */
.menu-wrap { position: relative; }

.menu-btn {
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    cursor: pointer;
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--surface-2); }
.menu-btn svg { width: 1.3rem; height: 1.3rem; }

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 13rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    padding: 0.35rem;
    z-index: 1000;
}
.menu-panel[hidden] { display: none; }

.menu-panel a {
    display: block;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
    font-size: 1rem;
    white-space: nowrap;
}
.menu-panel a:hover, .menu-panel a:focus { background: var(--surface-2); color: var(--ink); outline: none; }
.menu-panel hr { border: none; border-top: 1px solid var(--line); margin: 0.35rem 0.4rem; }

/* old header buttons are replaced by the menu */
.top-bar.has-menu .top-bar-actions > *:not(.menu-wrap):not(#text-size-btn):not(#welcome-msg),
.top-bar.has-menu > a.btn-secondary { display: none !important; }

.top-bar-actions #text-size-btn,
.top-bar-actions .menu-btn {
    box-sizing: border-box;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.top-bar-actions #text-size-btn { min-width: 2.75rem; padding: 0 0.8rem; font-weight: 600; font-size: 1rem; }
#text-size-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Counts inside toolbar buttons ── */
.btn-secondary .tab-count {
    background: var(--surface-2);
    color: var(--ink-3);
    border-radius: var(--radius-sm);
    padding: 0.05rem 0.5rem;
    font-size: 0.85rem;
    margin-left: 0.4rem;
}

/* ── Navigation tabs (Boards / Committees) sit at the right end of the tab line ── */
.filter-tab.tab-nav { background: var(--surface-2); }
.filter-tab.first-nav { margin-left: auto; }

/* ── Member rows open on double-click ── */
.member-row { cursor: pointer; }

/* "Go to" links on Email / Website labels: the label text and icon are one link; orange on hover */
.go-link { text-decoration: none; color: inherit; }
.go-link:not([href]) { pointer-events: none; cursor: default; }
.go-ic { margin-left: 0.4rem; color: var(--accent); font-weight: 600; }
.go-link[href]:hover { color: var(--accent); }
.go-bare { margin-left: 0.4rem; color: var(--accent); }

/* Contacts: Email and Phone side by side, each with its Add button on the heading line */
.contact-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1.5rem; align-items: start; margin-bottom: 0.5rem; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; min-height: 2rem; }
.col-head label, .col-head .dynamic-label { margin: 0; }
.col-head .add-row-btn { margin: 0; padding: 0.25rem 0.7rem; white-space: nowrap; }
.contact-col { min-width: 0; }
.contact-col .form-group { margin-bottom: 0.5rem; }
@media (max-width: 700px) { .contact-cols { grid-template-columns: minmax(0, 1fr); } }
