/* ═══════════════════════════════════════════════════════════
   Washington Lodge — Shared Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Base ─────────────────────────────────────────────────── */
* {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #2c2c2c;
}

h1 {
    color: #2c2c2c;
    border-bottom: 2px solid #8B0000;
    padding-bottom: 10px;
}

h2 {
    color: #2c2c2c;
}

/* ── Navigation ───────────────────────────────────────────── */
nav {
    background-color: #2c2c2c;
    padding: 0;
    margin-bottom: 30px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

nav ul li a {
    display: block;
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    font-size: 15px;
}

nav ul li a:hover {
    background-color: #444;
}

nav ul li a.active {
    background-color: #8B0000;
}

nav ul li.nav-right {
    margin-left: auto;
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px 25px;
    margin-bottom: 25px;
}

.card h2 {
    margin-top: 0;
    border-bottom: 2px solid #2c2c2c;
    padding-bottom: 10px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    padding: 7px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    margin-right: 4px;
}

.btn-dark {
    background: #2c2c2c;
    color: white;
}
.btn-dark:hover { background: #8B0000; }

.btn-red {
    background: #8B0000;
    color: white;
}
.btn-red:hover { background: #6a0000; }

.btn-danger {
    background: #c0392b;
    color: white;
}
.btn-danger:hover { background: #922b21; }

.btn-green {
    background: #4CAF50;
    color: white;
}
.btn-green:hover { background: #388E3C; }

.btn-gray {
    background: #888;
    color: white;
}
.btn-gray:hover { background: #666; }

.btn-blue {
    background: #2980b9;
    color: white;
}
.btn-blue:hover { background: #1a6a9a; }

/* ── Tables ───────────────────────────────────────────────── */
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ccc;
    padding: 8px 12px;
    text-align: left;
}

th {
    background-color: #2c2c2c;
    color: white;
}

tbody tr:hover {
    filter: brightness(0.96);
}

/* Member status rows */
tr.deceased { background-color: #f5a8a9; }
tr.suspended { background-color: #f5d08a; }
tr.expelled { background-color: #222; color: white; }
tr.expelled a { color: #aaa; }
tr.paid-row { background-color: #e8f5e9; }
tr.paid-row:hover { background-color: #d4edda; }
tr.officer-row { background-color: #fff8e1; }
tr.officer-row:hover { background-color: #fff0b3; }

/* ── Forms ────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 30px;
}

.form-grid .full-width {
    grid-column: span 2;
}

.form-grid label {
    display: block;
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 0.9em;
}

.form-grid textarea {
    height: 80px;
}

.form-section-title {
    grid-column: span 2;
    font-size: 1em;
    font-weight: bold;
    color: #8B0000;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-top: 10px;
}

.form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-row label {
    display: block;
    font-weight: bold;
    margin-bottom: 3px;
}

/* ── Stats Dashboard ──────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}

.stat-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.stat-card .number {
    font-size: 1.8em;
    font-weight: bold;
}

.stat-card .label {
    font-size: 0.8em;
    color: #666;
    margin-top: 4px;
}

.stat-card.green .number { color: #4CAF50; }
.stat-card.red .number   { color: #c0392b; }
.stat-card.blue .number  { color: #2980b9; }
.stat-card.gold .number  { color: #e67e22; }
.stat-card.orange .number { color: #e67e22; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-block;
    background: #8B0000;
    color: white;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    margin-left: 6px;
}

.badge-admin {
    background: #8B0000;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.badge-readonly {
    background: #888;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

/* ── Legend ───────────────────────────────────────────────── */
.legend {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

/* ── Search Bar ───────────────────────────────────────────── */
.search-bar {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Year Selector ────────────────────────────────────────── */
.year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.year-selector input[type="number"] {
    width: 100px;
}

/* ── Inline Edit Forms ────────────────────────────────────── */
.edit-form {
    padding: 15px;
    background: #fff8e1;
    border-top: 2px solid #f0a500;
}

.edit-form h3 {
    margin-top: 0;
}

.edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.edit-grid label {
    display: block;
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 3px;
}

/* ── Member Detail Panel ──────────────────────────────────── */
.detail-panel {
    padding: 15px;
    background: #f9f9f9;
    border-top: 2px solid #ccc;
}

.detail-panel h3 {
    margin-top: 0;
}

.detail-panel-edit {
    padding: 15px;
    background: #fff8e1;
    border-top: 2px solid #f0a500;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    margin-top: 12px;
}

.detail-grid label,
.detail-grid strong {
    font-weight: bold;
}

/* ── Export Cards ─────────────────────────────────────────── */
.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.export-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
}

.export-card h3 {
    margin-top: 0;
    color: #2c2c2c;
}

.export-card p {
    color: #666;
    font-size: 0.9em;
}

/* ── Messages ─────────────────────────────────────────────── */
.message-success {
    color: #4CAF50;
    font-weight: bold;
    margin-bottom: 15px;
}

.message-error {
    color: #c0392b;
    font-weight: bold;
    margin-bottom: 15px;
}

/* ── Add Member Section ───────────────────────────────────── */
.add-member-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 25px;
    margin-top: 10px;
}

.add-member-section h2 {
    margin-top: 0;
    border-bottom: 2px solid #2c2c2c;
    padding-bottom: 10px;
}

.submit-btn {
    margin-top: 20px;
    background: #2c2c2c;
    color: white;
    border: none;
    padding: 10px 30px;
    font-size: 1em;
    border-radius: 4px;
    cursor: pointer;
}

.submit-btn:hover {
    background: #8B0000;
}

/* ── Login Page ───────────────────────────────────────────── */
body.login-page {
    background: #2c2c2c;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.login-box h1 {
    margin-top: 0;
    color: #2c2c2c;
    font-size: 1.5em;
    text-align: center;
    border-bottom: 2px solid #8B0000;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.login-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 18px;
    font-size: 15px;
}

.login-box button {
    width: 100%;
    padding: 10px;
    background: #8B0000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover { background: #6a0000; }

.login-error {
    background: #fdecea;
    color: #c0392b;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.lodge-name {
    text-align: center;
    color: #888;
    font-size: 0.85em;
    margin-top: 20px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid .full-width {
        grid-column: span 1;
    }
    .form-section-title {
        grid-column: span 1;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    nav ul {
        flex-direction: column;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
