/* ============================================================
   NavkarSoft School CRM — Premium Design System
   One design family: public site, CRM, portal.
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #0ea5e9;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --sidebar-w: 256px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 8px 24px -8px rgba(15, 23, 42, .14);
  --shadow-lg: 0 18px 50px -12px rgba(15, 23, 42, .22);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --transition: .18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5 { color: var(--ink); line-height: 1.25; font-weight: 700; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
::selection { background: var(--primary); color: #fff; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1360px; margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all var(--transition); white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px -4px rgba(79,70,229,.5); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #0284c7; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }
.btn-light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.25); backdrop-filter: blur(4px); }
.btn-light:hover { background: rgba(255,255,255,.24); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 15.5px; border-radius: 12px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge-success { background: var(--success-light); color: #15803d; }
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-danger  { background: var(--danger-light);  color: #b91c1c; }
.badge-info    { background: #ecfeff; color: #0e7490; }
.badge-purple  { background: var(--purple-light); color: #6d28d9; }
.badge-accent  { background: #eff6ff; color: #1d4ed8; }
.badge-muted   { background: #f1f5f9; color: var(--muted); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Forms ---------- */
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.form-control, .form-select, textarea.form-control {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff; transition: border var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); margin: 22px 0 12px; padding-top: 14px; border-top: 1px solid var(--line);
}

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 15.5px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 11px 16px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--faint);
  border-bottom: 1px solid var(--line); background: #fafbfe; white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: #f8faff; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .kpi-grid { grid-template-columns: 1fr; } }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: flex; gap: 14px; align-items: center;
  box-shadow: var(--shadow-sm); transition: all var(--transition); position: relative; overflow: hidden;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 21px; flex-shrink: 0;
}
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.kpi-sub { font-size: 12px; color: var(--faint); }

/* ---------- CRM layout ---------- */
.crm-layout { display: flex; min-height: 100vh; }
.crm-sidebar {
  width: var(--sidebar-w); background: #0f172a; color: #cbd5e1;
  position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column;
  transition: transform var(--transition);
}
.crm-sidebar .brand {
  display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #6366f1, #0ea5e9);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.crm-sidebar .brand-name { color: #fff; font-weight: 700; font-size: 14.5px; line-height: 1.2; }
.crm-sidebar .brand-sub { font-size: 11px; color: #7d8ca3; }
.crm-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.crm-nav::-webkit-scrollbar { width: 5px; }
.crm-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.nav-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #5b6b83; padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8.5px 12px; border-radius: 9px;
  color: #b6c2d4; font-size: 13.5px; font-weight: 500; margin-bottom: 2px; transition: all var(--transition);
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(99,102,241,.08)); color: #fff; }
.nav-item .ico { width: 20px; text-align: center; font-size: 15px; }
.nav-item .count {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
}
.crm-sidebar .side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #7d8ca3; }

.crm-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.crm-topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 10px 22px; min-height: 60px;
}
.crm-topbar .page-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.crm-topbar .spacer { flex: 1; }
.topbar-search { position: relative; width: min(340px, 34vw); }
.topbar-search input {
  width: 100%; padding: 8px 12px 8px 36px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #f8fafc; font: inherit; font-size: 13.5px;
}
.topbar-search input:focus { outline: none; background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.1); }
.topbar-search .s-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary-light); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; border-radius: 20px; }
.topbar-user .u-name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.topbar-user .u-role { font-size: 11.5px; color: var(--muted); }
.menu-btn { display: none; }

.crm-content { padding: 22px; }
@media (max-width: 992px) {
  .crm-sidebar { transform: translateX(-100%); }
  .crm-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .crm-main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar-search { width: 100%; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; }
.page-head .crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.page-head .desc { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 150px; }
.filter-bar .grow { flex: 1; min-width: 200px; }

/* ---------- Pipeline ---------- */
.pipeline { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; }
.pipe-col { min-width: 210px; flex: 1; background: #f1f4f9; border-radius: 12px; padding: 10px; }
.pipe-col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 10px; }
.pipe-col-head .p-title { font-size: 12.5px; font-weight: 700; color: var(--ink); display: flex; gap: 7px; align-items: center; }
.pipe-col-head .p-count { font-size: 11.5px; background: #fff; border: 1px solid var(--line); padding: 1px 8px; border-radius: 999px; color: var(--muted); }
.lead-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px;
  cursor: pointer; transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.lead-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.lead-card .l-name { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.lead-card .l-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.lead-card .l-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before {
  content: ''; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 3px solid var(--primary);
}
.tl-item .tl-time { font-size: 11.5px; color: var(--faint); }
.tl-item .tl-title { font-weight: 600; color: var(--ink); font-size: 13.5px; margin-top: 1px; }
.tl-item .tl-desc { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; }

/* ---------- Stat / progress ---------- */
.progress { height: 8px; background: #e8edf5; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--success); transition: width .4s ease; }
.progress.warn > span { background: var(--warning); }
.progress.bad > span { background: var(--danger); }

/* ---------- Attendance grid ---------- */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.att-student {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: #fff;
  transition: all var(--transition);
}
.att-student.selected-p { border-color: var(--success); background: var(--success-light); }
.att-student.selected-a { border-color: var(--danger); background: var(--danger-light); }
.att-student.selected-l { border-color: var(--accent); background: #ecfeff; }
.att-student.selected-t { border-color: var(--warning); background: var(--warning-light); }
.att-student .a-head { display: flex; gap: 10px; align-items: center; margin-bottom: 9px; }
.att-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.att-status label {
  text-align: center; padding: 5px 0; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); transition: all var(--transition);
}
.att-status input { display: none; }
.att-status input:checked + span, .att-status label:has(input:checked) {
  background: var(--ink); color: #fff; border-color: var(--ink);
}

/* ---------- Grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-31 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.grid-13 { display: grid; grid-template-columns: 2fr 3fr; gap: 16px; }
@media (max-width: 1024px) { .grid-2, .grid-3, .grid-31, .grid-13 { grid-template-columns: 1fr; } }

/* ---------- Alerts / notices ---------- */
.alert { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; border: 1px solid transparent; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--success-light); color: #166534; border-color: #bbf7d0; }
.alert-error   { background: var(--danger-light); color: #991b1b; border-color: #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: var(--warning-light); color: #92400e; border-color: #fde68a; }

/* ---------- Flash container ---------- */
.flash-wrap { position: sticky; top: 66px; z-index: 30; margin-bottom: 4px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; gap: 6px; padding: 14px 4px 4px; flex-wrap: wrap; }
.pagination-info { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.page-link { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text); background: #fff; }
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link.disabled { opacity: .45; pointer-events: none; }

/* ---------- Action center ---------- */
.action-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff;
  transition: all var(--transition);
}
.action-item:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateX(2px); }
.action-item .a-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.action-item .a-text { flex: 1; font-size: 13.5px; color: var(--ink); }
.action-item .a-text b { font-weight: 700; }
.action-item .a-count { font-size: 19px; font-weight: 800; color: var(--ink); min-width: 34px; text-align: center; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-state .e-ico { font-size: 40px; margin-bottom: 10px; opacity: .6; }
.empty-state h4 { margin-bottom: 5px; }
.empty-state p { font-size: 13.5px; max-width: 420px; margin: 0 auto; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 9px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-radius: 9px 9px 0 0; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tab:hover { color: var(--ink); background: #f1f5f9; }
.tab.active { color: var(--primary); border-color: var(--primary); }

/* ---------- Profile header ---------- */
.profile-header {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(120deg, #1e1b4b, #312e81 55%, #0c4a6e); color: #fff;
  border-radius: var(--radius); padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.profile-header h2 { color: #fff; font-size: 22px; }
.profile-header .p-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #c7d2fe; margin-top: 6px; }
.profile-header .p-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.profile-header .avatar-xl { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px;
  backdrop-filter: blur(2px); overflow-y: auto;
}
.modal-backdrop.show { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; box-shadow: var(--shadow-lg); animation: modalIn .2s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h4 { font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-close { background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }

/* ---------- Dropdown ---------- */
.dd { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; z-index: 60; display: none;
}
.dd.open .dd-menu { display: block; }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 11px; border-radius: 8px; font-size: 13.5px; color: var(--text); background: none; border: none; font: inherit; cursor: pointer; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--primary-light); color: var(--primary); }
.dd-menu .dd-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------- WhatsApp button ---------- */
.btn-wa { background: #16a34a; color: #fff; }
.btn-wa:hover { background: #15803d; color: #fff; }

/* ---------- Charts ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 8px; }
.chart-bars .bar { flex: 1; background: linear-gradient(180deg, #6366f1, #818cf8); border-radius: 6px 6px 0 0; min-height: 4px; position: relative; transition: height .5s ease; }
.chart-bars .bar:hover { filter: brightness(1.1); }
.chart-bars .bar span {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; color: var(--muted); white-space: nowrap;
}
.chart-bars .bar b {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; color: var(--ink); opacity: 0; transition: opacity var(--transition);
}
.chart-bars .bar:hover b { opacity: 1; }
.chart-wrap { padding-bottom: 24px; }

/* ---------- Receipt / report card print ---------- */
.print-sheet { background: #fff; max-width: 860px; margin: 0 auto; padding: 34px 40px; border: 1px solid var(--line); border-radius: var(--radius); }
.print-head { display: flex; gap: 16px; align-items: center; border-bottom: 3px double var(--ink); padding-bottom: 14px; margin-bottom: 18px; }
.print-head .ph-name { font-size: 21px; font-weight: 800; color: var(--ink); }
.print-head .ph-sub { font-size: 12.5px; color: var(--muted); }
@media print {
  body { background: #fff; }
  .no-print, .crm-sidebar, .crm-topbar, .crm-content .page-head, .flash-wrap { display: none !important; }
  .crm-main { margin: 0; }
  .crm-content { padding: 0; }
  .print-sheet { border: none; padding: 0; max-width: none; }
  .card { border: none; box-shadow: none; }
}

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: linear-gradient(150deg, #1e1b4b 0%, #312e81 45%, #0c4a6e 100%); color: #fff;
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h2 { color: #fff; font-size: 30px; line-height: 1.25; margin: 18px 0 12px; }
.auth-side p { color: #c7d2fe; font-size: 15px; max-width: 440px; }
.auth-side .feature { display: flex; gap: 12px; margin-top: 22px; align-items: flex-start; }
.auth-side .feature .f-ico { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 17px; }
.auth-side .feature b { display: block; font-size: 14px; }
.auth-side .feature span { font-size: 12.5px; color: #a5b4fc; }
.auth-form-col { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand-row { display: flex; gap: 10px; align-items: center; margin-bottom: 26px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ============================================================
   PUBLIC WEBSITE
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 80; background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner { display: flex; align-items: center; gap: 26px; height: 70px; }
.site-brand { display: flex; align-items: center; gap: 11px; }
.site-brand .logo-badge { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #0ea5e9); display: grid; place-items: center; color: #fff; font-size: 19px; font-weight: 800; }
.site-brand .b-name { font-weight: 800; color: var(--ink); font-size: 15.5px; line-height: 1.2; }
.site-brand .b-tag { font-size: 11px; color: var(--muted); }
.site-nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.site-nav a.nl, .site-nav .sub-toggle {
  padding: 9px 13px; border-radius: 9px; color: var(--text); font-weight: 600; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; background: none; border: 0; cursor: pointer; font-family: inherit;
}
.site-nav a.nl:hover, .site-nav a.nl.active,
.site-nav .sub-toggle:hover, .site-nav .nav-item.open > .sub-toggle, .site-nav .nav-item.active > .sub-toggle { color: var(--primary); background: var(--primary-light); }
.site-nav .nav-cta { margin-left: 10px; white-space: nowrap; }
.nav-item { position: relative; }
.sub-toggle::after { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; opacity: .65; transition: transform var(--transition); }
.nav-item.open > .sub-toggle::after { transform: rotate(-135deg) translateY(-1px); }
.sub-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 262px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 90;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.sub-menu::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.nav-item:hover > .sub-menu, .nav-item.open > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.sub-link { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 10px; }
.sub-link:hover { background: var(--primary-light); }
.sub-link .sl-t { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.sub-link .sl-d { font-size: 11.5px; color: var(--muted); }
.sub-link.active .sl-t { color: var(--primary); }
.site-burger { display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; padding: 11px 12px; flex-direction: column; justify-content: space-between; }
.site-burger span { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: all .25s ease; }
.site-burger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.site-burger.active span:nth-child(2) { opacity: 0; }
.site-burger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
.mobile-nav {
  position: absolute; top: 100%; left: 0; right: 0; display: none; background: #fff; border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg); padding: 6px 18px 18px; max-height: calc(100vh - 70px); overflow-y: auto;
}
.mobile-nav.show { display: block; animation: mnavIn .22s ease; }
@keyframes mnavIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.mobile-nav > a { display: block; padding: 13px 4px; font-weight: 600; color: var(--ink); border-bottom: 1px solid #f1f5f9; }
.mobile-nav > a.active { color: var(--primary); }
.mobile-nav .m-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 13px 4px;
  font-weight: 600; font-size: 14.5px; color: var(--ink); background: none; border: 0; border-bottom: 1px solid #f1f5f9; cursor: pointer; font-family: inherit;
}
.mobile-nav .m-toggle::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease; }
.mobile-nav .m-group.open .m-toggle::after { transform: rotate(-135deg); }
.mobile-nav .m-sub { display: none; padding: 4px 0 8px 14px; border-bottom: 1px solid #f1f5f9; }
.mobile-nav .m-group.open .m-sub { display: block; }
.mobile-nav .m-sub a { display: block; padding: 10px 4px; font-size: 13.5px; color: var(--text); font-weight: 500; }
.mobile-nav .m-sub a.active { color: var(--primary); font-weight: 600; }
.mobile-nav .btn { width: 100%; margin-top: 16px; justify-content: center; }
@media (max-width: 1180px) {
  .site-header .inner { gap: 14px; }
  .site-nav a.nl, .site-nav .sub-toggle { padding: 9px 10px; font-size: 13px; }
  .site-nav .nav-cta { margin-left: 6px; }
}
@media (max-width: 991px) {
  .site-nav { display: none; }
  .site-burger { display: flex; }
}

/* Hero */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #0c4a6e 100%);
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(700px 340px at 85% 15%, rgba(14,165,233,.35), transparent 60%),
    radial-gradient(600px 380px at 10% 90%, rgba(99,102,241,.4), transparent 60%);
}
.hero .inner { position: relative; z-index: 2; padding: 92px 0 100px; max-width: 680px; }
.hero .kicker { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.hero h1 { color: #fff; font-size: clamp(34px, 5.4vw, 56px); line-height: 1.12; margin: 18px 0 14px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #a5b4fc, #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { font-size: clamp(15px, 2vw, 18px); color: #c7d2fe; max-width: 560px; }
.hero .cta-row { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats .hs b { font-size: 26px; display: block; }
.hero-stats .hs span { font-size: 12.5px; color: #a5b4fc; }

/* Sections */
.section { padding: 74px 0; }
.section.alt { background: #fff; border-block: 1px solid #eef1f6; }
.section-head { max-width: 660px; margin-bottom: 40px; }
.section-head .kicker { color: var(--primary); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; }
.section-head h2 { font-size: clamp(24px, 3.2vw, 34px); margin: 8px 0 10px; letter-spacing: -.01em; }
.section-head p { color: var(--muted); font-size: 15px; }
.section-head.center { margin-inline: auto; text-align: center; }

.feature-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; transition: all var(--transition); height: 100%; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #c7d2fe; }
.feature-card .f-ico { width: 48px; height: 48px; border-radius: 13px; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
.feature-card h3 { font-size: 16.5px; margin-bottom: 6px; }
.feature-card p { font-size: 13.5px; color: var(--muted); }

.stat-strip { background: linear-gradient(120deg, #312e81, #0c4a6e); color: #fff; border-radius: 20px; padding: 34px; display: flex; justify-content: space-around; flex-wrap: wrap; gap: 22px; }
.stat-strip .s b { font-size: 30px; display: block; }
.stat-strip .s span { font-size: 13px; color: #c7d2fe; }

.program-card { position: relative; border-radius: 16px; overflow: hidden; min-height: 210px; display: flex; align-items: flex-end; color: #fff; transition: all var(--transition); border: 1px solid var(--line); }
.program-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.program-card .pc-body { position: relative; z-index: 2; padding: 20px; width: 100%; }
.program-card .pc-body h3 { color: #fff; font-size: 18px; }
.program-card .pc-body p { font-size: 12.5px; color: #e0e7ff; }
.program-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,23,42,.05) 20%, rgba(15,23,42,.82) 100%); z-index: 1; }
.pc-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.pc-2 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.pc-3 { background: linear-gradient(135deg, #10b981, #0d9488); }
.pc-4 { background: linear-gradient(135deg, #f59e0b, #ea580c); }

.class-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px; transition: all var(--transition); }
.class-chip:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.class-chip b { font-size: 17px; color: var(--ink); }
.class-chip span { font-size: 11px; color: var(--faint); }

.step-card { text-align: center; padding: 26px 18px; position: relative; }
.step-card .s-num { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; box-shadow: 0 6px 16px -6px rgba(79,70,229,.6); }
.step-card h4 { font-size: 15.5px; margin-bottom: 5px; }
.step-card p { font-size: 13px; color: var(--muted); }

.testimonial { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; height: 100%; }
.testimonial .stars { color: #f59e0b; letter-spacing: 2px; margin-bottom: 10px; }
.testimonial p { font-size: 14px; color: var(--text); font-style: italic; }
.testimonial .t-who { display: flex; gap: 11px; align-items: center; margin-top: 16px; }
.testimonial .t-who .avatar { background: var(--purple-light); color: var(--purple); }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.gallery-item { border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; position: relative; border: 1px solid var(--line); }
.gallery-item img, .gallery-item .gi-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item .gi-ph { display: grid; place-items: center; font-size: 34px; color: #fff; }
.gallery-item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px; background: linear-gradient(180deg, transparent, rgba(15,23,42,.75)); color: #fff; font-size: 12.5px; font-weight: 600; }

.news-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: all var(--transition); height: 100%; display: flex; flex-direction: column; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.news-card .n-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.news-card .n-date { font-size: 11.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.news-card h3 { font-size: 15.5px; }
.news-card p { font-size: 13px; color: var(--muted); flex: 1; }

.cta-band {
  background: linear-gradient(120deg, #4f46e5, #6d28d9); border-radius: 22px; color: #fff;
  padding: 46px; display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); max-width: 560px; }
.cta-band p { color: #e0e7ff; margin-top: 6px; }

.site-footer { background: #0f172a; color: #94a3b8; margin-top: 80px; }
.site-footer .inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 34px; padding: 54px 0 30px; }
.site-footer h5 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.site-footer a { color: #94a3b8; display: block; padding: 4px 0; font-size: 13.5px; }
.site-footer a:hover { color: #fff; }
.site-footer .f-bottom { border-top: 1px solid rgba(255,255,255,.09); padding: 18px 0; font-size: 12.5px; display: flex; justify-content: between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-contact li { list-style: none; display: flex; gap: 9px; padding: 4px 0; font-size: 13.5px; }
@media (max-width: 900px) { .site-footer .inner { grid-template-columns: 1fr 1fr; } }

.floating-actions { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.fab {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  color: #fff; box-shadow: var(--shadow-lg); transition: all var(--transition);
}
.fab:hover { transform: scale(1.08); }
.fab-wa { background: #16a34a; }
.fab-call { background: var(--primary); }
.fab-adm { width: auto; border-radius: 999px; padding: 0 18px; font-size: 14px; font-weight: 700; background: var(--warning); height: 52px; }

/* Page hero (inner pages) */
.page-hero { background: linear-gradient(135deg, #1e1b4b, #312e81 55%, #0c4a6e); color: #fff; padding: 56px 0 62px; }
.page-hero h1 { color: #fff; font-size: clamp(26px, 4vw, 38px); }
.page-hero p { color: #c7d2fe; max-width: 640px; margin-top: 8px; }

/* Info list */
.info-list { display: grid; gap: 0; }
.info-list .row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed #e8edf5; font-size: 13.5px; }
.info-list .row:last-child { border-bottom: none; }
.info-list .row .k { color: var(--muted); }
.info-list .row .v { color: var(--ink); font-weight: 600; text-align: right; }

/* Chips (tags) */
.chip { display: inline-flex; align-items: center; gap: 5px; background: #f1f5f9; color: var(--text); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; }
.chip-primary { background: var(--primary-light); color: var(--primary); }

/* Segment pills */
.seg-pill { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 600; color: var(--text); transition: all var(--transition); }
.seg-pill:hover, .seg-pill.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* Mini stat rows */
.mini-stat { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed #e8edf5; font-size: 13.5px; }
.mini-stat:last-child { border: none; }
.mini-stat b { color: var(--ink); }

/* Parent portal */
.portal-nav { display: flex; gap: 6px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; }
.portal-nav a { padding: 8px 15px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.portal-nav a.active { background: var(--primary); color: #fff; }

/* Utilities */
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 26px; }
.text-muted { color: var(--muted); } .text-danger { color: var(--danger); } .text-success { color: var(--success); } .text-warning { color: var(--warning); }
.fw-700 { font-weight: 700; } .fw-800 { font-weight: 800; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-125 { font-size: 12.5px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.uppercase { text-transform: uppercase; letter-spacing: .05em; }
.muted { color: var(--muted); }
