* {
    box-sizing: border-box;
}

:root {
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #155eef;
    --primary-dark: #0f4acb;
    --danger: #c62828;
    --success: #2e7d32;
    --warning: #b26a00;
    --border: #d9e0eb;
    --sidebar: #0f172a;
    --sidebar-text: #d5d9e4;
    --sidebar-active: #1e293b;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    line-height: 1.45;
}

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

a:hover {
    text-decoration: underline;
}

hr.separator {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 270px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    gap: 24px;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.brand strong,
.sidebar .user-card strong {
    color: #fff;
}

.brand small,
.sidebar .user-card small {
    display: block;
    color: #94a3b8;
    margin-top: 2px;
}

.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
}

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

.menu a {
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--sidebar-text);
    font-weight: 600;
}

.menu a.active,
.menu a:hover {
    background: var(--sidebar-active);
    color: #fff;
    text-decoration: none;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.logout-link {
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 600;
    justify-content: center;
}

.content {
    flex: 1;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-content {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    justify-content: center;
}

.page-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0 0 4px;
    font-size: 28px;
}

.page-header p {
    margin: 0;
    color: var(--muted);
}

.card {
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 22px;
    border: 1px solid var(--border);
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    background: var(--card);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-card small {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card strong {
    font-size: 32px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    background: #eef4ff;
    color: #2143a6;
}

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

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

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

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

.btn,
button,
input[type="submit"] {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn-secondary {
    background: #e7edf7;
    color: #132238;
}

.btn-secondary:hover {
    background: #d7e2f2;
}

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

.btn-danger:hover {
    background: #9f1d1d;
}

.inline-form {
    display: inline;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input[type="file"] {
    padding: 10px;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.muted {
    color: var(--muted);
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 700;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success);
}

.alert-error {
    background: #fdecec;
    color: var(--danger);
}

.alert-warning {
    background: #fff4db;
    color: var(--warning);
}

.login-box {
    padding: 30px;
}

.login-box h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.login-box p {
    margin: 0 0 20px;
    color: var(--muted);
}

.kpi-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.kpi-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.kpi-list.compact-list li {
    align-items: flex-start;
}

.section-title {
    margin: 0 0 14px;
    font-size: 18px;
}

.danger-zone {
    border-color: #f2c7c7;
    background: #fffafa;
}

.footer {
    margin-top: auto;
    text-align: center;
    color: var(--muted);
    padding: 14px 0 0;
}

.empty-state {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 960px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .stats,
    .grid-2,
    .grid-3,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.section-nested {
    padding: 20px;
    background: #fbfcfe;
}

.note-box {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 16px;
    background: #f9fbff;
}

.note-box p {
    margin-bottom: 0;
}

.hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero-card h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.hero-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.calendar-header,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.calendar-header {
    margin-bottom: 10px;
}

.calendar-header > div {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.calendar-day {
    min-height: 140px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-day-outside {
    background: #f7f8fb;
}

.calendar-day-today {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.calendar-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.calendar-day-head strong {
    font-size: 18px;
}

.calendar-day-head small {
    color: var(--muted);
    font-weight: 700;
}

.calendar-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.calendar-items li {
    display: grid;
    gap: 2px;
    border-radius: 10px;
    padding: 8px;
    background: #f8fbff;
    border: 1px solid #e4edff;
}

.calendar-items li strong {
    font-size: 12px;
}

.calendar-items li span {
    font-size: 12px;
    color: var(--muted);
}

.calendar-empty {
    margin-top: auto;
    color: var(--muted);
    font-size: 12px;
}

.compact-grid {
    grid-template-columns: 2fr 1fr;
}

code {
    background: #eff3f8;
    border-radius: 6px;
    padding: 2px 6px;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
}

@media (max-width: 960px) {
    .calendar-header,
    .calendar-grid,
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        min-height: auto;
    }
}


.stack-list { display:flex; flex-direction:column; gap:1rem; }
.list-item { display:flex; justify-content:space-between; gap:1rem; padding:1rem 0; border-bottom:1px solid #e5e7eb; }
.list-item:last-child { border-bottom:none; padding-bottom:0; }
.list-item-main { flex:1; }
.checkbox-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:.5rem 1rem; padding:.5rem 0; }
.checkbox-grid label { display:flex; align-items:center; gap:.45rem; font-size:.95rem; }
.full-width { grid-column:1 / -1; }


.prayer-item { align-items: flex-start; }
.prayer-actions { min-width: 220px; justify-content: flex-end; }
.prayer-status-form {
    display: grid;
    gap: 8px;
    min-width: 220px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbff;
}
.prayer-status-form label {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.prayer-status-form select,
.prayer-status-form button {
    width: 100%;
}
@media (max-width: 960px) {
    .prayer-actions,
    .prayer-status-form {
        min-width: 0;
        width: 100%;
    }
}
