@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap');
:root { --bg:#eef3f8; --surface:#fff; --text:#132435; --muted:#526376; --line:#d0dbe7; --brand:#0f4f80; --brand-soft:#e7f1f8; --danger:#b42318; --shadow:0 10px 28px rgba(15,44,72,.08); }
*{box-sizing:border-box} body{margin:0;font-family:'Source Sans 3',Tahoma,Arial,sans-serif;color:var(--text);background:radial-gradient(1200px 500px at 10% -10%,#ffffff 0%,var(--bg) 55%,#e7eef6 100%);font-size:16px;line-height:1.45}
a{color:var(--brand);text-decoration:none}
.m-header{display:flex;justify-content:space-between;align-items:center;padding:.85rem 1rem;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:10;box-shadow:0 4px 12px rgba(12,42,66,.05)}
.brand{font-weight:700;letter-spacing:.01em}
.user{display:flex;align-items:center;gap:.5rem}
.user-role{display:inline-flex;align-items:center;padding:.15rem .55rem;border-radius:999px;background:var(--brand-soft);border:1px solid #c4d9eb;color:#18496f;font-size:.78rem;font-weight:700}
body.role-admin .user-role{background:#e9f6ee;border-color:#c9e9d5;color:#1d6b40}
.m-wrap{display:grid;grid-template-columns:250px 1fr;min-height:calc(100vh - 58px)}
.m-sidebar{background:#fbfdff;border-right:1px solid var(--line);padding:1rem;display:flex;flex-direction:column;gap:.55rem}
.m-sidebar a{padding:.5rem .6rem;border-radius:10px;color:#273341;font-weight:600;border:1px solid transparent;transition:background .16s ease,border-color .16s ease,color .16s ease}
.m-sidebar a:hover{background:#f2f8fd;border-color:#d4e7f7}
.m-sidebar a.is-active{background:var(--brand-soft);border-color:#c4d9eb;color:#123c5f}
.nav-label{font-size:.74rem;font-weight:700;letter-spacing:.04em;color:#6b7888;text-transform:uppercase;margin-top:.15rem}
.m-main{padding:1.1rem}
.card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:1rem;margin-bottom:1rem;box-shadow:var(--shadow)}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.dashboard-hero{display:flex;align-items:center;justify-content:space-between;gap:1rem;background:linear-gradient(135deg,#f9fcff 0%,#edf5fc 100%)}
.dashboard-hero h1{margin:.1rem 0 .2rem}
.dashboard-hero p{margin:0;color:#445b72}
.dashboard-role{display:inline-flex;align-items:center;padding:.25rem .7rem;border-radius:999px;background:#edf7ef;color:#1d6b40;border:1px solid #cce8d4;font-size:.78rem;font-weight:700;letter-spacing:.03em}
body.role-standard .dashboard-role{background:#e9f1fa;color:#1e4f77;border-color:#c9dced}
.dashboard-card h3{margin:.1rem 0 .2rem}
.dashboard-card p{margin:.1rem 0 .8rem;color:#536678}
.dashboard-actions{margin-top:.4rem}
.dashboard-actions a{min-width:108px}
.section-head h1{margin:.2rem 0 .25rem}
.section-head p{margin:0 0 .7rem}
.stats-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;margin:0 0 1rem}
.stat-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:.8rem .9rem;display:grid;gap:.2rem}
.stat-card strong{font-size:1.15rem;line-height:1.2}
.sec-head h1{margin:.2rem 0 .25rem}
.sec-head p{margin:0 0 .75rem}
.sec-toolbar{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap}
.sec-search{margin-bottom:1rem}
.sec-search .actions{margin-top:.2rem}
.sec-table table tr:hover{background:#f8fbff}
.sec-form h2{margin:.2rem 0 .8rem}
label{display:block;font-weight:600;margin-bottom:.5rem;font-size:.98rem}
input,textarea,select{
  width:100%;
  height:48px;
  padding:.6rem .75rem;
  border:1px solid var(--line);
  border-radius:8px;
  margin-top:.3rem;
  line-height:1.25;
  font-size:1rem;
}
textarea{min-height:120px;height:auto}
button,.btn{
  display:inline-flex;align-items:center;justify-content:center;min-height:48px;border:0;
  background:linear-gradient(135deg,#1a78b6 0%, #165f93 100%);
  color:#fff;padding:.62rem 1rem;border-radius:10px;cursor:pointer;
  font-size:.96rem;font-weight:700;letter-spacing:.01em;
  box-shadow:0 6px 14px rgba(20,92,141,.22);
  transition:transform .12s ease, box-shadow .16s ease, filter .16s ease;
}
button:hover,.btn:hover{transform:translateY(-1px);box-shadow:0 9px 16px rgba(20,92,141,.28);filter:saturate(1.05)}
button:active,.btn:active{transform:translateY(0)}
.btn-danger{background:var(--danger)}
table{width:100%;border-collapse:collapse;font-size:.94rem;background:#fff}th,td{padding:.6rem;border-bottom:1px solid #e9eef4;text-align:left;vertical-align:top}
th{background:#f6fafe;color:#2c4761;font-weight:700}
.table-card table tr:hover{background:#f8fbff}
small,.muted{color:var(--muted)}
.alert{padding:.6rem .7rem;border-radius:8px;background:#e8f7ea;color:#0d6b2f;margin:.7rem 0}
.warn{padding:.6rem .7rem;border-radius:8px;background:#fff4e5;color:#8a4b00;margin:.7rem 0}
.actions{display:flex;gap:.45rem;align-items:center}
.actions a{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:40px;padding:.45rem .7rem;border-radius:8px;
  border:1px solid #cfe0ef;background:#f6fbff;color:#1b5c8d;font-weight:700;
}
.actions a:hover{background:#e9f4fd;border-color:#bad4ea}
.avatar-placeholder{display:inline-flex;align-items:center;justify-content:center;width:52px;height:66px;border:1px dashed #cad5e3;border-radius:6px;font-size:.67rem;color:#748398;background:#f8fbff}
.badge{display:inline-flex;align-items:center;padding:.2rem .5rem;border-radius:999px;font-size:.74rem;font-weight:700;text-transform:capitalize}
.badge-active{background:#e8f7ea;color:#0d6b2f}
.badge-inactive{background:#f2f4f7;color:#445164}
.badge-transfer{background:#fff4e5;color:#8a4b00}
.badge-graduated{background:#e7f0ff;color:#1c4f9b}
.student-hero{display:grid;grid-template-columns:140px 1fr;gap:1rem;align-items:start}
.student-photo-col{display:flex;justify-content:flex-start}
.student-photo-lg{width:124px;height:160px;object-fit:cover;border:1px solid #d7e0ea;border-radius:8px;background:#fff}
.student-photo-empty{width:124px;height:160px;border:1px dashed #cad5e3;border-radius:8px;display:flex;align-items:center;justify-content:center;color:#748398;background:#f8fbff}
.student-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem 1rem}
.phone-row{display:grid;grid-template-columns:minmax(210px,1fr) 1.3fr;gap:.5rem;margin:.2rem 0 .5rem}
.phone-row input,.phone-row select{margin-top:0}
.devotional-panel{background:linear-gradient(180deg,#fcfeff 0%,#f6fbff 100%);border:1px solid #d9e8f5}
.devotional-panel h1{margin:.1rem 0 .45rem;color:#214867}
.devotional-panel .muted{color:#5a7086}
.rte-toolbar{display:flex;gap:.45rem;flex-wrap:wrap;margin:.45rem 0 .65rem;padding:.55rem;border:1px solid #d8e7f4;border-radius:12px;background:#f8fcff}
.rte-toolbar select,.rte-toolbar input[type="color"]{width:auto;min-width:120px;height:42px;padding:.35rem .55rem;margin:0;border:1px solid #cfe0ee;border-radius:10px;background:#fff}
.rte-toolbar button{min-height:42px;padding:.48rem .72rem;border-radius:10px;border:1px solid #cfe0ee;background:#f0f7fd;color:#205175;box-shadow:none;font-weight:700}
.rte-toolbar button:hover{transform:none;filter:none;box-shadow:none;border-color:#bed4e8;background:#e7f1fa}
.rte-editor{min-height:360px;padding:.95rem;border:1px solid #d3e2ef;border-radius:12px;background:#fff;line-height:1.6;font-size:1.04rem}
.rte-editor:focus{outline:2px solid #bfd9ef;outline-offset:1px}
.devotional-save{margin-top:.75rem;background:linear-gradient(135deg,#1a78b6 0%, #165f93 100%);color:#fff;box-shadow:0 8px 16px rgba(20,92,141,.22)}
.devotional-save:hover{transform:translateY(-1px);box-shadow:0 10px 18px rgba(20,92,141,.28);filter:none}
@media (max-width:960px){.m-wrap{grid-template-columns:1fr}.m-sidebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem}.grid{grid-template-columns:1fr}.stats-grid{grid-template-columns:1fr}.student-hero{grid-template-columns:1fr}.student-detail-grid{grid-template-columns:1fr}.dashboard-hero{flex-direction:column;align-items:flex-start}}
@media (max-width:720px){.phone-row{grid-template-columns:1fr}}
