/* ============================================
   u3a Members System — Stylesheet
   ============================================ */

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

body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.6;
    background: #f5f4f0;
    color: #2c2c2a;
}

/* ---- Navigation ---- */

.navbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #2c4a6e;
    color: #fff;
    padding: 0.75rem 1.5rem;
}

.nav-brand {
    font-size: 1.1rem;
    font-weight: bold;
    margin-right: auto;
    letter-spacing: 0.02em;
    color: #ffffff;
}

.navbar .nav-brand a,
.navbar .nav-brand a:link,
.navbar .nav-brand a:visited {
    color: #ffffff !important;
    text-decoration: none;
}

.nav-brand a:hover {
    color: #d0dcea;
}

.nav-links { display: flex; gap: 1rem; }

.nav-links a {
    color: #d0dcea;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.nav-links a:hover { background: rgba(255,255,255,0.15); color: #fff; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #b0c4d8;
    margin-left: auto;
}

.nav-user span {
    color: #b0c4d8;
    font-size: 0.85rem;
}

/* ---- Layout ---- */

.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h2 {
    font-size: 1.4rem;
    font-weight: normal;
    margin-bottom: 1.5rem;
    color: #2c2c2a;
    border-bottom: 1px solid #d3d1c7;
    padding-bottom: 0.5rem;
}

/* ---- Summary cards (dashboard) ---- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: #fff;
    border: 1px solid #d3d1c7;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
}

.summary-label {
    font-size: 0.8rem;
    color: #888780;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c4a6e;
}

/* ---- Buttons ---- */

.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border-radius: 5px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn-primary   { background: #2c4a6e; color: #fff; border-color: #2c4a6e; }
.btn-primary:hover { background: #1e3550; }
.btn-secondary { background: #fff; color: #2c4a6e; border-color: #2c4a6e; }
.btn-secondary:hover { background: #eef2f7; }
.btn-danger    { background: #a32d2d; color: #fff; border-color: #a32d2d; }
.btn-danger:hover  { background: #791f1f; }
.btn-small     { padding: 0.25rem 0.65rem; font-size: 0.8rem; }
.btn-full      { display: block; width: 100%; text-align: center; }

.action-links  { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }

/* ---- Alerts ---- */

.alert {
    padding: 0.75rem 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-success { background: #eaf3de; color: #27500a; border-color: #97c459; }
.alert-danger  { background: #fcebeb; color: #791f1f; border-color: #f09595; }
.alert-info    { background: #e6f1fb; color: #0c447c; border-color: #85b7eb; }

/* ---- Forms ---- */

.form-card {
    background: #fff;
    border: 1px solid #d3d1c7;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    max-width: 700px;
}

.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e8e6df;
}

.form-section:last-child { border-bottom: none; margin-bottom: 0; }

.form-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888780;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

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

label {
    display: block;
    font-size: 0.85rem;
    color: #5f5e5a;
    margin-bottom: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1px solid #b4b2a9;
    border-radius: 5px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: #2c2c2a;
    transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2c4a6e;
    box-shadow: 0 0 0 3px rgba(44,74,110,0.12);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] { width: auto; }

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e8e6df;
}

.medical-section {
    background: #faeeda;
    border: 1px solid #fac775;
    border-radius: 6px;
    padding: 1rem 1.25rem;
}

.medical-section .form-section-title { color: #854f0b; }

/* ---- Member list table ---- */

.table-wrapper {
    background: #fff;
    border: 1px solid #d3d1c7;
    border-radius: 8px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    background: #f1efe8;
    padding: 0.65rem 1rem;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5f5e5a;
    border-bottom: 1px solid #d3d1c7;
    white-space: nowrap;
}

tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #e8e6df;
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f7f6f2; }

.table-actions { display: flex; gap: 0.4rem; }

.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.search-bar input[type="text"] { max-width: 300px; }

/* ---- Login page ---- */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f4f0;
}

.login-box {
    background: #fff;
    border: 1px solid #d3d1c7;
    border-radius: 10px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-box h1 {
    font-size: 1.5rem;
    color: #2c4a6e;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.85rem;
    color: #888780;
    margin-bottom: 1.5rem;
}

.login-box .form-group { text-align: left; }
.login-box .alert { text-align: left; }

/* ---- Responsive ---- */

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .navbar { flex-wrap: wrap; }
    .nav-user { width: 100%; justify-content: flex-end; }
}

/* ---- Status filter pills (members_list.php) ---- */
.status-pill {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    border: 1px solid #b4b2a9;
    background: #f7f6f2;
    color: #3d3c38;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.status-pill:hover {
    background: #edecea;
    border-color: #888780;
    color: #1a1918;
}
.status-pill.active {
    background: #2c4a6e;
    border-color: #2c4a6e;
    color: #ffffff;
}

/* ---- Dashboard (index.php) ---- */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.dash-card {
    background: #fff;
    border: 1px solid #d3d1c7;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    transition: box-shadow 0.15s;
}
.dash-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.1); }
.dash-card .count {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.3rem;
}
.dash-card .label {
    font-size: 0.88rem;
    color: #5f5e5a;
}
.quick-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }

