/* School Management System – shared styles (wp-admin + portal app) */

.sms-muted { color: #64748b; }
.sms-fail-text { color: #b42318; font-weight: 600; }
.sms-due { color: #92400e; }
.sms-scroll { overflow-x: auto; max-width: 100%; }

/* Badges */
.sms-badge {
	display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 1.6;
	font-weight: 600; background: #eef0f3; color: #374151; white-space: nowrap; vertical-align: middle;
}
.sms-badge-active, .sms-badge-paid, .sms-badge-yes, .sms-badge-pass, .sms-badge-returned, .sms-badge-present, .sms-badge-approved { background: #dcfce7; color: #166534; }
.sms-badge-inactive, .sms-badge-unpaid, .sms-badge-no, .sms-badge-fail, .sms-badge-lost, .sms-badge-absent, .sms-badge-left, .sms-badge-rejected, .sms-badge-resigned { background: #fee2e2; color: #991b1b; }
.sms-badge-partial, .sms-badge-issued, .sms-badge-late, .sms-badge-leave, .sms-badge-pending, .sms-badge-half_day { background: #fef3c7; color: #92400e; }
.sms-badge-graduated, .sms-badge-cancelled, .sms-badge-teaching, .sms-badge-non_teaching { background: #e0e7ff; color: #3730a3; }

/* Attendance colours */
.sms-att-present  { background: #dcfce7; color: #166534; }
.sms-att-absent   { background: #fee2e2; color: #991b1b; }
.sms-att-late     { background: #fef3c7; color: #92400e; }
.sms-att-leave    { background: #dbeafe; color: #1e40af; }
.sms-att-half_day { background: #fde68a; color: #78350f; }

/* School header */
.sms-school-header { display: flex; align-items: center; gap: 14px; }
.sms-school-logo { width: 64px; height: 64px; object-fit: contain; }
.sms-school-name { font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: .2px; }
.sms-school-tagline { font-size: 13px; font-style: italic; color: #475569; }
.sms-school-meta { font-size: 12.5px; color: #64748b; }

/* Simple table */
.sms-simple-table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: 14px; }
.sms-simple-table th, .sms-simple-table td { border-bottom: 1px solid #e5e7eb; padding: 9px 10px; text-align: left; vertical-align: middle; }
.sms-simple-table thead th { background: #f8fafc; font-weight: 600; color: #334155; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
.sms-simple-table tfoot th { background: #f8fafc; }
.sms-simple-table .num { text-align: right; white-space: nowrap; }
.sms-simple-table .sms-balance th { font-size: 16px; }

/* Timetable */
.sms-tt { width: 100%; border-collapse: collapse; }
.sms-tt th { width: 110px; text-align: left; vertical-align: top; padding: 12px 10px; border-bottom: 1px solid #e5e7eb; }
.sms-tt td { padding: 8px; border-bottom: 1px solid #e5e7eb; }
.sms-periods { display: flex; flex-wrap: wrap; gap: 8px; }
.sms-period { display: flex; flex-direction: column; min-width: 150px; padding: 8px 12px; border-radius: 10px; background: #f0f7f4; border-left: 4px solid #0d7a5f; font-size: 13px; line-height: 1.45; }
.sms-period-time { font-size: 12px; color: #475569; }
.sms-period small { color: #475569; }

/* Report card & payslip */
.sms-report-card, .sms-payslip { background: #fff; color: #111827; max-width: 920px; margin: 0 auto; padding: 28px; border: 1px solid #e5e7eb; border-radius: 12px; box-sizing: border-box; }
.sms-report-card *, .sms-payslip * { box-sizing: border-box; }
.sms-payslip .sms-school-header { justify-content: center; text-align: center; border-bottom: 3px double #111827; padding-bottom: 14px; }
.sms-rc-top { border-bottom: 3px double #0d7a5f; padding-bottom: 14px; }
.sms-rc-top .sms-school-header { justify-content: center; text-align: center; }
.sms-rc-top .sms-school-name { color: #0b5e4a; font-size: 24px; text-transform: uppercase; letter-spacing: .6px; }
.sms-rc-banner { text-align: center; margin: 16px 0 18px; }
.sms-rc-banner .sms-rc-title { display: inline-block; margin: 0; padding: 7px 26px; border-radius: 999px; background: #0d7a5f; color: #fff; font-size: 17px; letter-spacing: 1.5px; text-transform: uppercase; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sms-rc-title { text-align: center; margin: 18px 0 2px; font-size: 21px; letter-spacing: 1px; text-transform: uppercase; }
.sms-rc-sub { display: block; text-align: center; margin: 8px 0 0; color: #475569; font-weight: 600; font-size: 14px; }
.sms-rc-student { display: flex; gap: 18px; align-items: center; border: 1px solid #dbe3ea; border-radius: 12px; padding: 14px 16px; background: #f8fafb; margin-bottom: 16px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sms-rc-photo { width: 78px; height: 92px; flex: none; border-radius: 10px; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.sms-rc-initial { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #14a37f, #0d7a5f); color: #fff; font-size: 34px; font-weight: 800; }
.sms-rc-dl { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
.sms-rc-dl dt { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #64748b; font-weight: 600; }
.sms-rc-dl dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.sms-rc-info { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 14px; }
.sms-rc-info th, .sms-rc-info td { border: 1px solid #cbd5e1; padding: 7px 10px; text-align: left; }
.sms-rc-info th { background: #f1f5f9; width: 18%; font-weight: 600; }
.sms-rc-marks { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 16px; font-size: 14px; border: 1px solid #cbd5e1; border-radius: 10px; overflow: hidden; }
.sms-rc-marks th, .sms-rc-marks td { border-bottom: 1px solid #e2e8f0; padding: 8px 10px; text-align: center; }
.sms-rc-marks th + th, .sms-rc-marks td + td { border-left: 1px solid #e2e8f0; }
.sms-rc-marks thead th { background: #0d7a5f; color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sms-rc-marks tbody tr:nth-child(even) td { background: #f8fafb; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sms-rc-marks tfoot th { background: #ecf8f3; font-size: 14.5px; border-bottom: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sms-rc-marks .sms-rc-subj { text-align: left; font-weight: 600; }
.sms-rc-marks .sms-rc-remark { font-size: 12.5px; color: #475569; }
.sms-rc-show-sm { display: none; }
.sms-rc-failrow td { color: #b42318; }
.sms-rc-failrow td { background: #fff5f5 !important; }
.sms-grade { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 6px; font-weight: 800; font-size: 12.5px; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sms-grade-a { background: #dcfce7; color: #166534; }
.sms-grade-b { background: #dbeafe; color: #1e40af; }
.sms-grade-c { background: #fef3c7; color: #92400e; }
.sms-grade-d { background: #ffedd5; color: #9a3412; }
.sms-grade-f { background: #fee2e2; color: #991b1b; }
.sms-rc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 16px 0; }
.sms-rc-summary > div { border: 1px solid #dbe3ea; border-radius: 10px; padding: 10px 8px; text-align: center; background: #fff; }
.sms-rc-summary span { display: block; font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.sms-rc-summary strong { display: block; font-size: 19px; margin-top: 3px; line-height: 1.25; }
.sms-rc-summary small { display: block; font-size: 11.5px; color: #64748b; margin-top: 1px; }
.sms-rc-result-pass { border-color: #86efac !important; background: #f0fdf4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sms-rc-result-pass strong { color: #15803d; letter-spacing: 1px; }
.sms-rc-result-fail { border-color: #fca5a5 !important; background: #fef2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sms-rc-result-fail strong { color: #b91c1c; letter-spacing: 1px; }
.sms-rc-bottom { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; margin-bottom: 8px; }
.sms-rc-box { border: 1px solid #dbe3ea; border-radius: 10px; padding: 12px 14px; }
.sms-rc-box h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #0b5e4a; }
.sms-rc-box p { margin: 0; font-size: 13.5px; line-height: 1.55; font-style: italic; }
.sms-rc-key { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: #475569; }
.sms-rc-key > span { white-space: nowrap; }
.sms-rc-key .sms-grade { min-width: 28px; padding: 1px 5px; font-size: 11px; }
.sms-rc-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 50px; text-align: center; }
.sms-rc-sign div { border-top: 1px solid #111827; padding-top: 6px; font-size: 13px; font-weight: 600; }
.sms-rc-sign small { display: block; font-weight: 400; color: #64748b; font-size: 12px; }
.sms-rc-date { text-align: center; font-size: 11.5px; color: #6b7280; margin: 18px 0 0; }
.sms-slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sms-slip-net { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px; border: 2px solid #0d7a5f; border-radius: 12px; background: #f0f7f4; margin: 6px 0 14px; }
.sms-slip-net span { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #0d7a5f; font-weight: 700; }
.sms-slip-net strong { font-size: 26px; }
.sms-slip-net small { color: #475569; }

/* Invoice */
.sms-invoice { background: #fff; color: #111827; }
.sms-invoice-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 2px solid #111827; padding-bottom: 14px; margin-bottom: 14px; }
.sms-invoice-meta { text-align: right; font-size: 14px; line-height: 1.7; }
.sms-invoice-title { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.sms-invoice-to { margin-bottom: 10px; line-height: 1.6; }

/* Bank fee challan – 3 copies */
.sms-challan-set { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; background: #fff; color: #111; margin-bottom: 24px; }
.sms-challan { border: 1px solid #111; padding: 10px 12px; font-size: 11.5px; line-height: 1.35; position: relative; }
.sms-challan + .sms-challan { border-left: 1px dashed #111; }
.sms-ch-copy { position: absolute; top: 8px; right: 10px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; border: 1px solid #111; padding: 1px 6px; border-radius: 4px; }
.sms-ch-head { display: flex; gap: 8px; align-items: center; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 6px; padding-right: 70px; }
.sms-ch-head img { width: 38px; height: 38px; object-fit: contain; }
.sms-ch-head strong { display: block; font-size: 13px; }
.sms-ch-head small { display: block; font-size: 10px; color: #333; }
.sms-ch-bank { background: #f3f4f6; padding: 5px 7px; border-radius: 4px; margin-bottom: 6px; }
.sms-ch-info, .sms-ch-fees { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.sms-ch-info th { text-align: left; width: 38%; font-weight: 600; padding: 2px 0; }
.sms-ch-info td { padding: 2px 0; border-bottom: 1px dotted #999; }
.sms-ch-fees th, .sms-ch-fees td { border: 1px solid #555; padding: 3px 5px; text-align: left; }
.sms-ch-fees td:last-child, .sms-ch-fees th:last-child { text-align: right; white-space: nowrap; }
.sms-ch-fees thead th { background: #e5e7eb; }
.sms-ch-fees tfoot th { background: #f3f4f6; }
.sms-ch-words { font-style: italic; font-weight: 600; margin: 4px 0; }
.sms-ch-note { font-size: 10px; color: #333; margin: 4px 0; }
.sms-ch-sign { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; }
.sms-ch-sign span { flex: 1; border-top: 1px solid #111; text-align: center; padding-top: 3px; font-size: 10px; }

/* Print: only the printable block (JS copies it into #sms-print-root) */
#sms-print-root { display: none; }
@media print {
	body.sms-print-mode > *:not(#sms-print-root) { display: none !important; }
	body.sms-print-mode #sms-print-root { display: block !important; }
	body.sms-print-mode { background: #fff !important; margin: 0 !important; padding: 0 !important; }
	.sms-no-print { display: none !important; }
	.sms-printable { border: 0 !important; box-shadow: none !important; margin: 0 auto !important; }
	.sms-scroll, .sms-table-wrap { overflow: visible !important; }
	.sms-challan-set { page: challan; break-after: page; break-inside: avoid; margin: 0; }
	.sms-challan-set:last-child { break-after: auto; }
	/* Report card: one A4 page */
	.sms-report-card { padding: 0 !important; max-width: none !important; font-size: 12.5px; break-inside: avoid; }
	.sms-rc-top .sms-school-name { font-size: 22px; }
	.sms-rc-banner { margin: 10px 0 12px; }
	.sms-rc-student { padding: 10px 12px; margin-bottom: 10px; }
	.sms-rc-marks { font-size: 12.5px; margin-bottom: 10px; }
	.sms-rc-marks th, .sms-rc-marks td { padding: 5px 8px; }
	.sms-rc-summary { margin: 10px 0; }
	.sms-rc-summary strong { font-size: 16px; }
	.sms-rc-sign { margin-top: 40px; }
	.sms-rc-hide-sm { display: table-cell !important; }
	.sms-rc-show-sm { display: none !important; }
	html.wp-toolbar { padding-top: 0 !important; }
	#adminmenumain, #wpadminbar, #wpfooter { display: none !important; }
}
@page { margin: 10mm; }
@page challan { size: A4 landscape; margin: 6mm; }

@media (max-width: 900px) {
	.sms-challan-set { grid-template-columns: 1fr; }
	.sms-challan + .sms-challan { border-left: 1px solid #111; border-top: 1px dashed #111; }
}
@media screen and (max-width: 640px) {
	.sms-report-card, .sms-payslip { padding: 14px 12px; border-radius: 12px; }
	.sms-rc-top .sms-school-header { flex-direction: column; gap: 6px; }
	.sms-rc-top .sms-school-name { font-size: 18px; }
	.sms-rc-banner .sms-rc-title { font-size: 14px; padding: 6px 16px; }
	.sms-rc-student { flex-direction: column; text-align: center; padding: 14px 12px; }
	.sms-rc-photo { width: 72px; height: 72px; border-radius: 50%; }
	.sms-rc-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; text-align: left; gap: 10px 12px; }
	.sms-rc-marks { font-size: 13.5px; }
	.sms-rc-marks th, .sms-rc-marks td { padding: 8px 6px; }
	.sms-rc-hide-sm { display: none; }
	.sms-rc-show-sm { display: block; font-weight: 400; font-size: 11.5px; color: #64748b; }
	.sms-rc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.sms-rc-summary strong { font-size: 17px; }
	.sms-rc-bottom { grid-template-columns: minmax(0, 1fr); }
	.sms-rc-info th { width: auto; }
	.sms-rc-info, .sms-rc-info tbody, .sms-rc-info tr, .sms-rc-info th, .sms-rc-info td { display: block; width: 100%; box-sizing: border-box; }
	.sms-rc-sign { gap: 12px; margin-top: 40px; }
	.sms-rc-sign div { font-size: 11.5px; }
	.sms-slip-cols { grid-template-columns: 1fr; }
	.sms-invoice-meta { text-align: left; }
	.sms-tt th { width: 80px; }
}
