/* Simple, shared styles under ~200 lines */
:root {
    --blue: #005b8f;
    --blue-2: #007bbf;
    --light: #f9f9f9;
    --muted: #607d8b;
    --card: #ffffff;
    --border: #dce3e8;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--light);
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
    background: var(--blue);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand img { height: 44px; width: auto; display: block; }
header h1 { font-size: 1.5rem; }

nav ul { list-style: none; display: flex; gap: 1.5rem; }
nav a { color: white; font-weight: 500; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.18s ease;
    text-decoration: none;
}
.btn.primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    color: white;
    box-shadow: var(--shadow);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.btn.secondary {
    background: #eef3f7;
    color: #1a3a52;
    border-color: var(--border);
}
.btn.secondary:hover { background: #e2e9ef; }

/* Hero and feature grid */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--blue-2), #4fc3f7);
    color: white;
}
.hero h2 { font-size: 2rem; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; margin-bottom: 2rem; }
.primary-btn {
    background: white;
    color: var(--blue);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    transition: background 0.2s ease;
}
.primary-btn:hover { background: #e0f7fa; }

.goal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.goal-bulk-form {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}
.feature-card {
    background: var(--card);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}
.feature-card h3 { color: var(--blue-2); margin-bottom: 0.5rem; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.page-indicator {
  flex: 1;
  text-align: center; /* centers the page number */
  font-weight: 600;
}

.page-btn {
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #d0d0d0;
  background: var(--blue);
  color: var(--light);
  text-decoration: none;
  font-weight: 600;
}

button,
.btn,
.primary-btn,
.page-btn {
    cursor: pointer;
}

.page-btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.45;
}

/* Sections */
.section { padding: 2rem; }
.section-title { text-align: center; color: var(--blue-2); margin-bottom: 1rem; }
.list {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.list .item {
    background: var(--card);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.item h4 { color: var(--blue-2); margin-bottom: 0.3rem; }

/* Auth pages */
.auth {
    max-width: 420px;
    margin: 3rem auto;
    background: var(--card);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.auth h2 { text-align: center; color: var(--blue); margin-bottom: 1rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-form label { font-weight: 600; color: var(--blue); }
.auth-form input, .input {
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #cfd8dc;
    font-size: 1rem;
    background: white;
}
.auth-form input:focus, .input:focus { outline: 2px solid #80d8ff; border-color: #80d8ff; }
.error {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #fdecea;
    color: #b42318;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: center;
}
.auth-footer { margin-top: 0.9rem; text-align: center; font-size: 0.9rem; color: #555; }
.auth-footer a { color: var(--blue); font-weight: 600; }

/* Shared layout + cards */
.page {
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: none;   /* remove limit */
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.stack { display: flex; flex-direction: column; gap: 0.4rem; }
.row-between { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.input-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 260px; }
.input-group span { font-weight: 600; color: var(--blue); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--blue); font-size: 0.85rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-shadow: var(--shadow);
}
.card-media {
    height: 150px;
    background: #e0e0e0;
    background-size: cover;
    background-position: center;
}
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.card-links a { color: var(--blue); font-weight: 600; font-size: 0.95rem; }

/* Goals page */
.container {
    max-width: 1040px;
    margin: 2rem auto;
    padding: 0 1.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.page-header {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0,91,143,0.06), rgba(0,123,191,0.12));
    border: 1px solid var(--border);
    border-radius: 12px;
}
.page-header h1 { color: #0f2f47; margin-bottom: 0.35rem; }
.page-header .subtitle { color: var(--muted); font-size: 1.05rem; }

.goal-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
}
.form-row {
    flex: 1 1 240px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.form-row label { font-weight: 700; color: var(--blue); }
.goal-form input,
.goal-form select,
.goal-form textarea,
.visit-form input {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #cfd8dc;
    font-size: 0.98rem;
    background: white;
}
.goal-form input:focus,
.goal-form select:focus,
.goal-form textarea:focus,
.visit-form input:focus {
    outline: 2px solid #80d8ff;
    border-color: #80d8ff;
}

.goals-list { display: flex; flex-direction: column; gap: 1rem; }
.goals-list h2 { color: var(--blue); }
.goal-card { gap: 0.65rem; }
.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.goal-header h3 { color: #0f2f47; }
.status {
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: capitalize;
    background: #eef3f7;
    color: #1a3a52;
}
.goal-meta { color: var(--muted); font-size: 0.95rem; }
.goal-notes {
    background: #f4f8fb;
    border-left: 3px solid var(--blue);
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
}

.progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.5rem 0 0.25rem;
}
.progress-label { font-weight: 700; color: var(--blue); font-size: 0.95rem; }
.progress-bar {
    width: 100%;
    height: 10px;
    background: #edf2f6;
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    border-radius: 999px;
    transition: width 0.2s ease;
}

.visit-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.empty-state {
    padding: 0.9rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #f7fafc;
    color: var(--muted);
}

.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.table th, .table td {
    padding: 0.65rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.table th { background: #f3f6f8; color: #1a3a52; }
.table tr:last-child td { border-bottom: none; }

.pill {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    text-transform: capitalize;
    background: #eef3f7;
    color: #1a3a52;
}
.pill.dedicated { background: #e8f5e9; color: #1b5e20; }
.pill.under_construction { background: #fff8e1; color: #f57f17; }
.pill.announced { background: #ede7f6; color: #5e35b1; }
.pill.completed { background: #e6f4ea; color: #166534; border: 1px solid #9ad1a7; }
.pill.active { background: #e0f7fa; color: #0f2f47; border: 1px solid #b2ebf2; }
.pill.admin { background: #e3f2ff; color: #0f2f47; border: 1px solid #bcdfff; }
.pill.user { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }

.temple-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
    align-items: start;
}

.filters { padding: 1rem; }

.card.filters {
    min-height: auto;
    max-height: 420px;
    overflow: auto;
    align-self: flex-start;
}

@media (max-width: 640px) {
    header { padding: 1rem; }
    .hero { padding: 3rem 1.5rem; }
    .features, .section, .page { padding: 1.25rem; }
    .card-media { height: 130px; }
    .goal-header { align-items: flex-start; flex-direction: column; }
    .visit-form { flex-direction: column; align-items: stretch; }
    .goal-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 800px) {
    .temple-layout { grid-template-columns: 1fr; }
}


/* ===============================
   GOALS PAGES – SHARED STYLES
=============================== */

.container {
    max-width: 900px;
    margin: 90px auto 40px;
    padding: 0 20px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2.1rem;
    margin-bottom: 6px;
    color: #2f3a4a;
}

.subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

/* ===============================
   LAYOUT HELPERS
=============================== */

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

/* ===============================
   BUTTONS
=============================== */

.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease;
}

.btn.primary {
    background: #4f46e5;
    color: #ffffff;
}

.btn.primary:hover {
    background: #4338ca;
}

.btn.secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn.secondary:hover {
    background: #d1d5db;
}

/* ===============================
   GOALS LIST
=============================== */

.goals-list {
    display: grid;
    gap: 16px;
}

.goal-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
}
.goal-card-item.selecting,
.user-card-item.selecting {
    cursor: pointer;
    padding-right: 2.5rem !important;
}
.goal-card-item.selected,
.user-card-item.selected {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: inset 0 0 0 1px #cbd5e1;
}
.goal-checkbox {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: none;
}
.goal-card-item.selecting .goal-checkbox {
    display: block;
}

.goal-dates {
    display: flex;
    gap: 14px;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 10px;
}

.goal-description {
    font-size: 0.95rem;
    color: #1f2937;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
}

/* ===============================
   FOOTER
=============================== */

footer {
    text-align: center;
    padding: 10px;
    background: var(--blue-2);
    color: var(--light);
}

/* ===============================
   FORMS
=============================== */

.form-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 26px;
    max-width: 520px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


/* Mobile cleanup */
@media (max-width: 640px) {
    .goal-card {
        padding: 1rem;
    }

    .goal-header h3 {
        font-size: 1.05rem;
    }
}
