/* ============================================================
   Catechists CMS — layout, sidebar, cards, tables, forms.
   Extends assets/css/style.css (which remains the base).
   ============================================================ */

.cms-body {
    background: #f1f4f9;
    margin: 0;
    min-height: 100vh;
}
/* ============================================================
   PHASE 5 — Finance, Reports, Student Portal
   ============================================================ */
.cms-badge-success { background: #bbf7d0; color: #14532d; }
.cms-badge-info    { background: #dbeafe; color: #1e40af; }

/* Portal sidebar brand text — match student role */
.cms-sidebar-brand-text small { max-width: 160px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ---------- Layout grid ---------- */
.cms-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.cms-sidebar {
    background: #0f2038;
    color: #c9d3e4;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.cms-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #1c2f4d;
}
.cms-sidebar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--gold, #c9a227);
    color: #0f2038;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}
.cms-sidebar-brand-text strong { display: block; font-size: 14px; color: #fff; letter-spacing: .4px; }
.cms-sidebar-brand-text small  { display: block; font-size: 11px; color: #7f93b3; }

.cms-nav {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cms-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    color: #c9d3e4;
    font-size: 13.5px;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.cms-nav a:hover { background: #1a3052; color: #fff; text-decoration: none; }
.cms-nav a.active { background: var(--gold, #c9a227); color: #0f2038; font-weight: 600; }
.cms-nav-icon { font-size: 15px; width: 20px; text-align: center; }

.cms-sidebar-foot {
    border-top: 1px solid #1c2f4d;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cms-user-chip { display: flex; align-items: center; gap: 10px; }
.cms-user-text strong { display: block; font-size: 13px; color: #fff; }
.cms-user-text small  { display: block; font-size: 11px; color: #7f93b3; }
.cms-logout {
    display: block;
    text-align: center;
    background: #1a3052;
    color: #e6ecf7;
    padding: 8px;
    border-radius: 6px;
    font-size: 12.5px;
    text-decoration: none;
}
.cms-logout:hover { background: #24416b; color: #fff; text-decoration: none; }

/* ---------- Avatar ---------- */
.cms-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gold, #c9a227);
    color: #0f2038;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.cms-avatar-sm { width: 30px; height: 30px; font-size: 11px; }

/* ---------- Main area ---------- */
.cms-main { display: flex; flex-direction: column; min-width: 0; }

.cms-topbar {
    background: #fff;
    border-bottom: 1px solid #e1e6ef;
    padding: 14px 26px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.cms-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #1a3a6b;
    padding: 0;
}
.cms-page-title {
    font-size: 18px;
    margin: 0;
    color: #1a3a6b;
    flex: 1;
    font-weight: 600;
}
.cms-topbar-right { display: flex; align-items: center; gap: 14px; }
.cms-topbar-link { font-size: 12.5px; color: #6b7280; text-decoration: none; }
.cms-topbar-link:hover { color: #1a3a6b; text-decoration: none; }
.cms-topbar-user { font-size: 12.5px; color: #6b7280; text-align: right; }
.cms-topbar-user small { display: block; font-size: 11px; color: #9aa4b5; }

.cms-content { padding: 24px 26px 40px; max-width: 1300px; width: 100%; }

/* ---------- Cards ---------- */
.cms-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.cms-card {
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.cms-card-stat {
    display: flex;
    align-items: center;
    gap: 16px;
}
.cms-card-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: #eef3fb;
    color: #1a3a6b;
    font-size: 20px;
    flex-shrink: 0;
}
.cms-stat-value { display: block; font-size: 24px; font-weight: 700; color: #122a4f; line-height: 1.1; }
.cms-stat-label { display: block; font-size: 12.5px; color: #6b7280; margin-top: 2px; }

/* ---------- Panels ---------- */
.cms-panel {
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
}
.cms-panel > h2,
.cms-panel-head {
    padding: 14px 18px;
    border-bottom: 1px solid #eef1f7;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.cms-panel > h2,
.cms-panel-head h2 {
    font-size: 14.5px;
    color: #1a3a6b;
    margin: 0;
    font-weight: 600;
}
.cms-panel > p,
.cms-panel > ul,
.cms-panel > table,
.cms-panel > form { padding: 18px; }
.cms-panel > table { padding: 0; }

.cms-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) { .cms-grid-2 { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.cms-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.cms-table th {
    background: #f6f8fc;
    color: #334155;
    text-align: left;
    padding: 10px 14px;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid #e1e6ef;
}
.cms-table td {
    padding: 11px 14px;
    font-size: 13.5px;
    border-bottom: 1px solid #eef1f7;
    vertical-align: middle;
}
.cms-table tr:last-child td { border-bottom: none; }
.cms-table tr:hover td { background: #f9fbfe; }
.cms-table-actions { text-align: right; white-space: nowrap; }
.cms-table-actions .cms-link { margin-left: 10px; font-size: 12.5px; }
.cms-center { text-align: center; }

/* ---------- Links ---------- */
.cms-link { color: #1a3a6b; font-size: 13px; text-decoration: none; }
.cms-link:hover { text-decoration: underline; }
.cms-link-warn { color: #b45309; }
.cms-link-danger { color: #b91c1c; }

/* ---------- Badges ---------- */
.cms-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    background: #eef2f8;
    color: #1a3a6b;
    letter-spacing: .2px;
}
.cms-badge-ok      { background: #dcfce7; color: #166534; }
.cms-badge-muted   { background: #f1f5f9; color: #64748b; }
.cms-badge-success { background: #dcfce7; color: #166534; }

/* ---------- Alerts ---------- */
.cms-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.cms-alert-ok   { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.cms-alert-err  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.cms-alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ---------- Forms ---------- */
.cms-form { background: #fff; border: 1px solid #e1e6ef; border-radius: 10px; padding: 22px; }
.cms-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.cms-form-wide { grid-column: 1 / -1; }
.cms-form label,
.cms-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.cms-form input[type=text],
.cms-form input[type=email],
.cms-form input[type=password],
.cms-form input[type=number],
.cms-form select,
.cms-form textarea {
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #1f2937;
    font-weight: normal;
}
.cms-form input:focus,
.cms-form select:focus,
.cms-form textarea:focus {
    outline: 2px solid #1a3a6b;
    outline-offset: -1px;
    border-color: #1a3a6b;
}
.cms-form small { font-size: 11.5px; color: #6b7280; font-weight: normal; }
.cms-form-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 18px;
}
.cms-check {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: normal;
    color: #334155;
    cursor: pointer;
}
.cms-form-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.cms-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    text-align: center;
    transition: filter .15s, background .15s, color .15s;
}
.cms-btn:hover { text-decoration: none; }
.cms-btn-primary { background: #1a3a6b; color: #fff; border-color: #1a3a6b; }
.cms-btn-primary:hover { background: #122a4f; color: #fff; }
.cms-btn-ghost { background: #fff; color: #1a3a6b; border-color: #cbd5e1; }
.cms-btn-ghost:hover { background: #eef2f8; }

/* ---------- Page actions header ---------- */
.cms-page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.cms-page-actions h2 { margin: 0; color: #1a3a6b; font-size: 18px; }

/* ---------- Lists ---------- */
.cms-list { list-style: none; padding: 14px 18px; margin: 0; }
.cms-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef1f7;
}
.cms-list li:last-child { border-bottom: none; }
.cms-list strong { display: block; font-size: 13.5px; color: #122a4f; }
.cms-list small  { display: block; font-size: 11.5px; color: #6b7280; }
.cms-list-plain { padding-left: 20px; font-size: 13.5px; line-height: 1.8; color: #334155; }

.cms-muted { color: #6b7280; font-size: 13px; padding: 16px 18px; margin: 0; }

/* ---------- Login ---------- */
.cms-login-body {
    background: linear-gradient(135deg, #0f2038 0%, #1a3a6b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}
.cms-login-card {
    background: #fff;
    border-radius: 14px;
    padding: 34px 30px 26px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.cms-login-brand { text-align: center; margin-bottom: 24px; }
.cms-login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #c9a227;
    color: #0f2038;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}
.cms-login-brand h1 { font-size: 20px; color: #1a3a6b; margin: 0; letter-spacing: .5px; }
.cms-login-brand p  { font-size: 12.5px; color: #6b7280; margin: 2px 0 0; }
.cms-login-form { display: flex; flex-direction: column; gap: 14px; }
.cms-login-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.cms-login-form input {
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
.cms-login-form input:focus {
    outline: 2px solid #1a3a6b;
    outline-offset: -1px;
    border-color: #1a3a6b;
}
.cms-login-form .cms-btn { margin-top: 6px; padding: 12px; font-size: 15px; }
.cms-login-foot { text-align: center; margin-top: 20px; font-size: 12.5px; }
.cms-login-foot a { color: #6b7280; text-decoration: none; }
.cms-login-foot a:hover { color: #1a3a6b; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .cms-layout { grid-template-columns: 1fr; }
    .cms-sidebar {
        position: fixed;
        top: 0; left: 0;
        width: 250px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .2s ease;
        z-index: 100;
        box-shadow: 4px 0 20px rgba(0,0,0,.15);
    }
    body.cms-sidebar-open .cms-sidebar { transform: translateX(0); }
    body.cms-sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15,32,56,.5);
        z-index: 90;
    }
    .cms-menu-btn { display: block; }
    .cms-content { padding: 18px 16px 40px; }
    .cms-topbar { padding: 12px 16px; }
    .cms-topbar-user { display: none; }
}
/* ---------- Footer bar ---------- */
.cms-footer {
    background: #0f2038;
    color: #9fb1cc;
    padding: 12px 26px;
    font-size: 12px;
    margin-top: auto;
    border-top: 1px solid #1c2f4d;
}
.cms-footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.cms-footer-inner strong { color: #e6ecf7; }
@media (max-width: 700px) {
    .cms-footer-inner { justify-content: center; text-align: center; }
}
/* ============================================================
   PHASE 2 — Admissions
   ============================================================ */

/* ---------- Filter bar ---------- */
.cms-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.cms-filter-bar input,
.cms-filter-bar select {
    padding: 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    min-width: 150px;
}
.cms-filter-bar input[type=text] { flex: 1; min-width: 200px; }

/* ---------- Detail lists ---------- */
.cms-dl {
    margin: 0;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 40% 60%;
    row-gap: 6px;
    font-size: 13.5px;
}
.cms-dl dt { color: #6b7280; font-weight: normal; }
.cms-dl dd { margin: 0; color: #122a4f; font-weight: 500; }

/* ---------- Inline status form ---------- */
.cms-inline-form {
    display: flex;
    gap: 12px;
    padding: 16px 18px;
    flex-wrap: wrap;
    align-items: flex-end;
    background: #f9fbfe;
    border-bottom: 1px solid #eef1f7;
}
.cms-inline-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    min-width: 160px;
}
.cms-inline-form input,
.cms-inline-form select {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    font-weight: normal;
}

/* ---------- Documents ---------- */
.doc-list { list-style: none; margin: 0; padding: 8px 18px; }
.doc-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef1f7;
}
.doc-list li:last-child { border-bottom: none; }
.doc-icon { font-size: 20px; }
.doc-info { flex: 1; min-width: 0; }
.doc-info strong { display: block; font-size: 13.5px; color: #122a4f; }
.doc-info small  { display: block; font-size: 11.5px; color: #6b7280;
                   word-break: break-all; }
.doc-actions { display: flex; gap: 12px; }

/* ---------- Pagination ---------- */
.cms-pagination {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.cms-pagination a {
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1a3a6b;
    font-size: 13px;
    text-decoration: none;
}
.cms-pagination a:hover { background: #eef2f8; }
.cms-pagination a.active { background: #1a3a6b; color: #fff; border-color: #1a3a6b; }

/* ---------- Badges: extra colours ---------- */
.cms-badge-warn    { background: #fef3c7; color: #92400e; }
.cms-badge-info    { background: #dbeafe; color: #1e40af; }
.cms-badge-danger  { background: #fee2e2; color: #991b1b; }

/* ============================================================
   PUBLIC APPLY / STATUS PAGES
   ============================================================ */
.apply-page { max-width: 860px; margin: 0 auto; }
.apply-intro { text-align: center; margin-bottom: 24px; }
.apply-intro h1 { color: #1a3a6b; font-size: 26px; margin: 0 0 6px; }
.apply-intro p  { color: #6b7280; font-size: 14px; max-width: 620px; margin: 0 auto; }

.apply-form { display: flex; flex-direction: column; gap: 20px; }
.apply-section {
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    padding: 22px 22px 20px;
}
.apply-section h2 {
    color: #1a3a6b; font-size: 15px; margin: 0 0 16px;
    border-bottom: 2px solid #eef1f7; padding-bottom: 8px;
}
.apply-subhead { color: #1a3a6b; font-size: 13.5px; margin: 18px 0 10px;
                 font-weight: 600; }
.apply-hint { color: #6b7280; font-size: 12.5px; margin: -8px 0 12px; }
.apply-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.apply-field { display: flex; flex-direction: column; gap: 6px; }
.apply-field.apply-wide { grid-column: 1 / -1; }
.apply-field span { font-size: 13px; font-weight: 600; color: #334155; }
.apply-field input,
.apply-field select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.apply-field input:focus,
.apply-field select:focus {
    outline: 2px solid #1a3a6b; outline-offset: -1px; border-color: #1a3a6b;
}
.apply-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Confirmation */
.apply-success {
    text-align: center; max-width: 560px; margin: 40px auto;
    background: #fff; border: 1px solid #e1e6ef; border-radius: 14px;
    padding: 40px 30px;
}
.apply-success-icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: #dcfce7; color: #166534;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; margin: 0 auto 16px;
}
.apply-success h1 { color: #1a3a6b; font-size: 24px; margin: 0 0 12px; }
.apply-appno {
    display: inline-block;
    background: #eef3fb; color: #1a3a6b;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 22px; font-weight: 700; letter-spacing: 1px;
    padding: 12px 22px; border-radius: 8px; margin: 8px 0 16px;
}
.apply-success-note { color: #6b7280; font-size: 13px; }
.apply-success-actions { display: flex; gap: 12px; justify-content: center;
                         flex-wrap: wrap; margin-top: 20px; }

/* Status card */
.apply-status-card {
    background: #fff; border: 1px solid #e1e6ef; border-radius: 12px;
    padding: 26px 24px; margin-top: 22px;
}
.apply-status-card h2 { color: #1a3a6b; margin: 0 0 18px; font-size: 20px; }
.apply-status-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.apply-status-meta .label {
    display: block; font-size: 11.5px; color: #6b7280;
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px;
}
.apply-status-meta strong { color: #122a4f; font-size: 14.5px; }
.apply-status-notes {
    margin-top: 20px; padding: 14px 16px; border-radius: 8px;
    background: #fffbeb; border: 1px solid #fde68a;
    color: #78350f; font-size: 13.5px;
}
.apply-status-notes p { margin: 4px 0 0; }

@media (max-width: 640px) {
    .apply-section { padding: 18px 16px; }
    .apply-appno { font-size: 17px; padding: 10px 16px; }
}
/* ============================================================
   PHASE 3 — Academics & Exams
   ============================================================ */
.cms-form textarea {
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    background: #fff;
}
.cms-form textarea:focus {
    outline: 2px solid #1a3a6b; outline-offset: -1px;
}
.cms-form .cms-check { white-space: nowrap; }
.cms-dl dt { font-size: 12.5px; }
.mark-input {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13.5px;
}
.mark-input:focus {
    outline: 2px solid #1a3a6b; outline-offset: -1px;
}
/* ============================================================
   PHASE 4 — Transcripts & Certificates
   ============================================================ */
.transcript-card {
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(16,24,40,.06);
    margin-bottom: 20px;
}
.cms-dl code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12.5px;
    background: #eef2f8;
    padding: 2px 6px;
    border-radius: 4px;
    color: #1a3a6b;
}
@media (max-width: 780px) {
    .transcript-card { padding: 16px; }
}
</style>