:root{--blue:#14376d;--blue2:#1d4d91;--gold:#e9b949;--ink:#192638;--muted:#66758a;--bg:#eef4fb;--white:#fff;--red:#b42318;--green:#177245;--line:#d8e2ef}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;color:var(--ink);background:var(--bg)}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.top{background:var(--white);border-bottom:5px solid var(--blue);padding:13px max(20px,calc((100% - 1220px)/2));display:flex;align-items:center;gap:13px;position:sticky;top:0;z-index:5}
.top img{width:46px;height:54px;object-fit:contain}
.brand{font-weight:850;color:var(--blue);line-height:1.15}
.brand small{display:block;color:var(--muted);font-weight:500;margin-top:3px}
.spacer{flex:1}
.clock{font-weight:750;color:var(--blue)}
.logout{background:none;border:1px solid var(--line);padding:8px 12px;border-radius:10px}
.page{max-width:1220px;margin:auto;padding:28px 20px 60px}
.hero{background:linear-gradient(130deg,var(--blue),var(--blue2));color:white;border-radius:22px;padding:32px;margin-bottom:24px;box-shadow:0 15px 35px #14376d24}
.hero h1{margin:0 0 8px;font-size:clamp(27px,4vw,42px)}
.hero p{margin:0;opacity:.9}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px}
.card,.panel{background:white;border:1px solid var(--line);border-radius:18px;padding:22px;box-shadow:0 8px 24px #14376d0d}
.module{min-height:190px;display:flex;flex-direction:column}
.module .icon{font-size:35px}
.module h2{color:var(--blue);margin:15px 0 8px}
.module p{color:var(--muted);line-height:1.5;flex:1}
.btn{display:inline-flex;align-items:center;justify-content:center;border:0;background:var(--blue);color:white;padding:11px 17px;border-radius:11px;font-weight:750;text-decoration:none}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn.secondary{background:#e8eff8;color:var(--blue)}
.btn.danger{background:var(--red)}
.btn.gold{background:var(--gold);color:#263244}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.field label{font-weight:700;font-size:14px;color:#35445a}
.field input,.field select,.field textarea{width:100%;padding:11px 12px;border:1px solid #bdcadb;border-radius:10px;background:white}
.field textarea{min-height:90px}
.actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.notice{padding:13px 15px;border-radius:11px;background:#e8f5ee;color:var(--green);margin:13px 0}
.notice.error{background:#fdeceb;color:var(--red)}
.hidden{display:none!important}
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.tabs button{border:0;border-radius:999px;padding:9px 14px;background:#dfe8f4;color:var(--blue);font-weight:750}
.tabs button.active{background:var(--blue);color:white}
table{width:100%;border-collapse:collapse;font-size:14px}
th,td{text-align:left;padding:10px;border-bottom:1px solid var(--line);vertical-align:top}
th{color:var(--blue);background:#f6f9fd}
.table-wrap{overflow:auto}
.badge{display:inline-block;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:800;background:#e8eff8;color:var(--blue)}
.badge.red{background:#fdeceb;color:var(--red)}
.badge.orange{background:#fff0df;color:#a64b00}
.badge.green{background:#e8f5ee;color:var(--green)}
.scanner{max-width:650px;margin:auto;text-align:center}
.scanner input{font-size:28px;text-align:center;padding:16px}
.result{margin-top:20px;padding:24px;border-radius:18px;background:#eef4fb}
.result.good{background:#e8f5ee;color:var(--green)}
.result.bad{background:#fdeceb;color:var(--red)}
.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top,#fff 0,#eaf2fb 55%,#dce8f6 100%)}
.login-card{width:min(470px,100%);background:white;padding:32px;border-radius:24px;box-shadow:0 24px 60px #173b7526}
.login-brand{text-align:center;margin-bottom:25px}
.login-brand img{width:76px}
.login-brand h1{font-size:24px;color:var(--blue);margin:10px 0 3px}
.separator{text-align:center;color:var(--muted);margin:22px 0;position:relative}
.separator:before,.separator:after{content:"";position:absolute;top:50%;width:42%;height:1px;background:var(--line)}
.separator:before{left:0}
.separator:after{right:0}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:20px}
.stat{background:white;border-radius:15px;padding:18px;border:1px solid var(--line)}
.stat b{font-size:28px;color:var(--blue);display:block}
.muted{color:var(--muted)}
.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.subject-checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:9px;padding:15px;border:1px solid var(--line);border-radius:12px;background:#f8fbff}
.subject-checks label{display:flex;align-items:center;gap:9px;padding:10px;border:1px solid var(--line);border-radius:10px;background:white;color:var(--ink);font-weight:700}
.subject-checks input{width:18px;height:18px}
.attendance-roster .student-name{font-size:18px;font-weight:800;color:#172a47}
.attendance-roster td{padding-top:13px;padding-bottom:13px;transition:background-color .15s,color .15s}
.attendance-roster .status{font-size:16px;min-width:190px}
.attendance-roster .minutes{font-size:16px;width:85px}
.attendance-roster tr.attendance-absent td{background:#fdeceb}
.attendance-roster tr.attendance-absent .student-name,.attendance-roster tr.attendance-absent .status{color:var(--red);font-weight:850}
.attendance-roster tr.attendance-absent .status{border-color:#e5a5a0;background:#fff5f4}
.attendance-save-message{margin:12px 0 0;max-width:650px}
.direction-preview{border:1px solid #cfe0f4;background:#f4f8fd;color:var(--blue);line-height:1.5}
.direction-preview.error{background:#fdeceb;color:var(--red);border-color:#efc4c0}
.warning-text{color:#9a4b00;font-weight:700}
.attachment-preview{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 16px}
.attachment-chip{display:inline-flex;align-items:center;padding:8px 11px;border-radius:999px;background:#e8eff8;color:var(--blue);font-size:13px;font-weight:700}
.attendance-report-document{margin-top:24px;border:1px solid var(--line);border-radius:16px;padding:26px;background:#fff}
.report-heading{display:flex;align-items:center;justify-content:center;gap:16px;text-align:left;border-bottom:4px solid var(--blue);padding-bottom:16px;margin-bottom:20px}
.report-heading img{width:58px;height:70px;object-fit:contain}
.report-heading h2{font-size:18px;color:var(--blue);margin:0 0 4px}
.report-heading p,.report-heading small{margin:0;color:var(--muted)}
.report-student{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;background:#f6f9fd;padding:16px;border-radius:12px}
.report-student div{display:flex;flex-direction:column;gap:3px}
.report-student b{font-size:12px;text-transform:uppercase;color:var(--muted)}
.report-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px 0}
.report-summary div{padding:14px;background:#eef4fb;border-radius:12px}
.report-summary b{display:block;font-size:25px;color:var(--blue)}
.report-summary span{font-size:12px;color:var(--muted)}
.report-note{padding:13px 15px;border-left:5px solid var(--gold);background:#fff8e6;border-radius:10px;line-height:1.45}
.attendance-report-document h3{color:var(--blue);margin:25px 0 10px}
.report-signature{width:280px;border-top:1px solid #333;text-align:center;margin:70px auto 10px;padding-top:6px;font-size:12px}
@media(max-width:700px){.two,.three,.report-student,.report-summary{grid-template-columns:1fr}
.top .brand{font-size:13px}
.clock{display:none}
.hero{padding:24px}
.page{padding:20px 13px 50px}
th,td{padding:8px}
.attendance-roster .student-name{font-size:16px}
.attendance-roster .status{min-width:160px}
}

.record-selector{display:grid;grid-template-columns:minmax(180px,1fr) minmax(260px,2fr) auto;gap:14px;align-items:end;margin:18px 0}.record-heading{display:flex;justify-content:space-between;gap:18px;align-items:center;border-bottom:4px solid var(--primary,#173a70);padding:12px 0;margin-bottom:18px}.record-heading h3{font-size:1.6rem;margin:0}.record-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.record-wide{grid-column:1/-1}.guardian-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.guardian-grid fieldset{border:1px solid #cbd9eb;border-radius:16px;padding:16px}.guardian-grid legend{font-weight:800;color:#173a70;padding:0 8px}.record-import{margin-top:26px}.record-print-area{display:none}.record-grid textarea{min-height:88px}.academic-history-row{display:grid;grid-template-columns:1fr 1fr 2fr auto;gap:12px;align-items:end;border-bottom:1px solid var(--line);padding:10px 0}.academic-history-row .field{margin-bottom:0}
@media(max-width:900px){.record-selector,.record-grid,.guardian-grid,.academic-history-row{grid-template-columns:1fr}.record-selector .btn{width:100%}.record-heading{align-items:flex-start;flex-direction:column}}
@media print{body.printing-student-record{background:#fff}body.printing-student-record .top,body.printing-student-record .hero,body.printing-student-record .stats,body.printing-student-record .tabs,body.printing-student-record .panel:not([data-panel="studentRecords"]),body.printing-student-record [data-panel="studentRecords"]>*:not(.record-print-area){display:none!important}body.printing-student-record .page{max-width:none;padding:0}body.printing-student-record [data-panel="studentRecords"]{display:block!important;border:0;box-shadow:none;padding:0}body.printing-student-record .record-print-area{display:block!important}.record-print-area .print-letter{display:block!important;color:#111;background:#fff;font:11pt Arial,sans-serif}.print-letter header{display:flex;align-items:center;gap:16px;border-bottom:4px solid #173a70;padding-bottom:12px}.print-letter header img{width:70px;height:70px;object-fit:contain}.print-letter h1{color:#173a70;font-size:22pt;margin:18px 0 8px}.print-letter h2{color:#173a70;font-size:14pt;margin:18px 0 6px}.print-letter h3{font-size:12pt;margin:14px 0 5px}.print-letter table{width:100%;border-collapse:collapse;break-inside:avoid}.print-letter th,.print-letter td{border:1px solid #8fa5c2;padding:6px;text-align:left;vertical-align:top}.print-letter th{width:32%;background:#eef4fb}.print-note{margin-top:22px;color:#555;font-size:9pt}}
@media print{body.printing-report{background:#fff}
body.printing-report .top,body.printing-report .hero,body.printing-report .stats,body.printing-report .tabs,body.printing-report .panel:not([data-panel="reports"]),body.printing-report #reportControls{display:none!important}
body.printing-report .page{max-width:none;padding:0}
body.printing-report [data-panel="reports"]{display:block!important;border:0;box-shadow:none;padding:0}
body.printing-report .attendance-report-document{border:0;margin:0;padding:0}
body.printing-report .table-wrap{overflow:visible}
body.printing-report table{font-size:10px}
body.printing-report th,body.printing-report td{padding:6px}
body.printing-report .report-summary{break-inside:avoid}
body.printing-report .attendance-report-document h3{break-after:avoid}
body.printing-teacher-attendance{background:#fff}
body.printing-teacher-attendance .top,body.printing-teacher-attendance .hero,body.printing-teacher-attendance .tabs,body.printing-teacher-attendance .panel:not([data-panel="myrecords"]),body.printing-teacher-attendance #myRecordsControls,body.printing-teacher-attendance #myRecordsMessage,body.printing-teacher-attendance #myRecordsSummary{display:none!important}
body.printing-teacher-attendance .page{max-width:none;padding:0}
body.printing-teacher-attendance [data-panel="myrecords"]{display:block!important;border:0;box-shadow:none;padding:0}
body.printing-teacher-attendance .teacher-attendance-document{border:0;margin:0;padding:0}
body.printing-teacher-attendance .table-wrap{overflow:visible}
body.printing-teacher-attendance table{font-size:10px}
body.printing-teacher-attendance th,body.printing-teacher-attendance td{padding:6px}
body.printing-epi-report{background:#fff}
body.printing-epi-report .top,body.printing-epi-report .hero,body.printing-epi-report .tabs,body.printing-epi-report .panel:not([data-panel="monthly"]),body.printing-epi-report #epiMonthlyControls,body.printing-epi-report #epiMonthlyMessage{display:none!important}
body.printing-epi-report .page{max-width:none;padding:0}
body.printing-epi-report [data-panel="monthly"]{display:block!important;border:0;box-shadow:none;padding:0}
body.printing-epi-report .epi-monthly-document{border:0;margin:0;padding:0}
body.printing-epi-report .table-wrap{overflow:visible}
body.printing-epi-report table{font-size:10px}
body.printing-epi-report th,body.printing-epi-report td{padding:6px}
}
