/* ===== E-Raport SMKS 1 Pembangunan Kota Bengkulu ===== */
@font-face { font-family: 'Poppins'; font-weight: 400; src: url('../fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; src: url('../fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; src: url('../fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; src: url('../fonts/poppins-latin-700-normal.woff2') format('woff2'); }

:root {
    --navy: #2e2b55;
    --navy-2: #3d3970;
    --indigo: #34318a;
    --accent: #6c5ce7;
    --accent-2: #4f6fdc;
    --bg: #f1f2f7;
    --card: #ffffff;
    --text: #2b2d42;
    --muted: #8a8ca3;
    --line: #e6e7ef;
    --blue: #5b7fe0;
    --red: #e05252;
    --green: #7cb518;
    --green-d: #5e9410;
    --yellow: #f2c94c;
    --dark: #2d3142;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Poppins', Arial, sans-serif; font-size: 13px; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; flex-shrink: 0; color: #e8e6ff;
    background: linear-gradient(180deg, var(--navy-2) 0%, var(--navy) 55%, #25233f 100%);
    min-height: 100vh;
}
.sidebar nav, .sidebar-title { position: relative; }
.sidebar-inner { position: sticky; top: 0; }
.sidebar-title {
    text-align: center; font-weight: 700; letter-spacing: 5px; font-size: 14px; padding: 20px 0 16px;
    border-bottom: 2px solid #8a7ff0; margin-bottom: 14px; color: #fff;
    background: linear-gradient(180deg, #4a4590, var(--navy-2));
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 8px;
    font-size: 12.5px; color: #d7d4f5; border: 1px solid transparent; transition: background .15s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); }
.sidebar nav a .dot { width: 5px; height: 5px; border-radius: 50%; background: #a9a3e8; }
.sidebar nav a.active {
    background: linear-gradient(90deg, #6656c9, #5168d6); color: #fff; font-weight: 500;
    border-color: #9d93ff; box-shadow: 0 3px 10px rgba(80, 90, 220, .35);
}
.sidebar nav a.active .dot { background: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 56px; background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
}
.burger { border: none; background: none; font-size: 18px; color: #9a9cb0; cursor: pointer; }
.topbar-user { display: flex; gap: 16px; align-items: center; font-size: 12px; }
.topbar-user .who { color: var(--indigo); font-weight: 600; }
.topbar-user .logout { color: var(--red); font-weight: 600; }
.content { padding: 24px 26px 40px; }
.page-title { font-size: 20px; color: var(--indigo); margin: 0 0 18px; font-weight: 700; }

/* ---------- Card ---------- */
.card { background: var(--card); border-radius: 12px; box-shadow: 0 2px 10px rgba(30, 30, 80, .06); padding: 20px 22px; margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 14.5px; font-weight: 700; color: var(--indigo); margin: 0; }
.section-title { font-size: 12.5px; font-weight: 700; color: var(--text); letter-spacing: .5px; text-transform: uppercase; margin: 0 0 10px; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stats.two { grid-template-columns: repeat(2, 1fr); }
.stat { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(30, 30, 80, .06); border-left: 4px solid var(--accent); }
.stat:nth-child(2) { border-left-color: #4f9bd8; }
.stat:nth-child(3) { border-left-color: #f2994a; }
.stat:nth-child(4) { border-left-color: #27ae60; }
.stat .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 700; margin: 4px 0 2px; color: var(--text); }
.stat .sub { font-size: 10.5px; color: var(--muted); }

.welcome { background: #fff; border-radius: 12px; padding: 18px 22px; box-shadow: 0 2px 10px rgba(30, 30, 80, .06); }
.welcome h3 { margin: 0 0 6px; font-size: 14px; }
.welcome p { margin: 0; color: #5d6075; font-size: 12.5px; line-height: 1.7; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #fafaff; }
.tbl.dark-head th { background: var(--navy-2); color: #fff; border: none; }
.tbl.dark-head th:first-child { border-radius: 8px 0 0 8px; }
.tbl.dark-head th:last-child { border-radius: 0 8px 8px 0; }
.tbl.yellow-head th { background: var(--yellow); color: var(--text); border: none; }
.tbl .empty { text-align: center; color: var(--red); font-style: italic; padding: 18px; }
.tbl .aksi { white-space: nowrap; display: flex; gap: 6px; }
.tbl .nisn-link { color: var(--accent-2); text-decoration: underline; }
.nilai-pred { color: var(--muted); font-size: 11px; }

/* ---------- Buttons & badges ---------- */
.btn { display: inline-block; border: none; cursor: pointer; font-family: inherit; font-size: 11.5px; font-weight: 600; padding: 7px 14px; border-radius: 6px; color: #fff; line-height: 1.3; }
.btn-sm { padding: 4px 11px; font-size: 11px; border-radius: 5px; }
.btn-dark { background: var(--dark); }
.btn-blue { background: var(--blue); }
.btn-red { background: var(--red); }
.btn-green { background: var(--green); }
.btn-green:hover { background: var(--green-d); }
.btn-primary { background: linear-gradient(90deg, #5a4fcf, #4f6fdc); }
.btn-light { background: #eceef5; color: var(--text); }
.btn-link { background: none; color: var(--text); }
.btn[disabled], .btn.disabled { background: #d5d7e2; color: #9a9cb0; cursor: not-allowed; pointer-events: none; }
.btn:not([disabled]):hover { filter: brightness(1.07); }
form.inline { display: inline; margin: 0; }

.badge { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge-admin { background: #fde8c8; color: #a0611a; }
.badge-guru { background: #e3f2c8; color: #4d7a11; }
.badge-walikelas { background: #ecf5b9; color: #6c7a12; }
.badge-aktif { background: #d8f5df; color: #1e8b46; }
.badge-nonaktif { background: #eee; color: #888; }
.badge-lengkap { background: #e5f6cf; color: #4b8a0c; border: 1px solid #c4e79a; }
.badge-belum { background: #fde4e4; color: #c0392b; border: 1px solid #f5b5b5; }

/* ---------- Forms ---------- */
.form-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 11.5px; font-weight: 600; color: #4a4d63; }
.field input, .field select, .tbl input[type=number] {
    font-family: inherit; font-size: 12.5px; padding: 8px 11px; border: 1px solid #d9dbe7; border-radius: 6px; background: #fff; color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .tbl input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108, 92, 231, .12); }
.field input[readonly] { background: #f3f4f8; }
.tbl input[type=number] { width: 90px; padding: 6px 9px; }
.tbl input.invalid { border-color: var(--red); background: #fff5f5; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.hint { font-size: 11px; color: var(--muted); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 12.5px; margin-bottom: 16px; }
.alert-success { background: #e2f6e7; color: #1e7a3e; border: 1px solid #bfe7cb; }
.alert-error { background: #fde7e7; color: #a93226; border: 1px solid #f5c0c0; }
.alert-info { background: #eef0ff; color: #3d3a8c; border: 1px solid #d6d9ff; }
.note { background: #fff8e1; border: 1px solid #f3dc8f; color: #7a5d00; padding: 9px 13px; border-radius: 8px; font-size: 11.5px; margin-bottom: 14px; }
.subtitle { font-size: 11.5px; color: var(--accent); margin: -12px 0 16px; font-weight: 500; }

/* ---------- Modal ---------- */
dialog.modal { border: none; border-radius: 12px; padding: 0; width: 440px; max-width: 94vw; box-shadow: 0 20px 60px rgba(20, 20, 60, .3); }
dialog.modal::backdrop { background: rgba(25, 23, 50, .45); }
.modal-head { background: linear-gradient(90deg, var(--navy-2), var(--navy)); color: #fff; padding: 14px 20px; font-weight: 600; font-size: 14px; }
.modal-body { padding: 18px 20px 6px; }
.modal-foot { padding: 6px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Chart ---------- */
.chart { display: flex; gap: 10px; height: 230px; padding: 0 6px 0 34px; position: relative; }
.chart .grid { position: absolute; left: 34px; right: 6px; top: 0; bottom: 26px; }
.chart .grid span { position: absolute; left: -34px; right: 0; border-top: 1px dashed #e8e9f1; font-size: 9.5px; color: var(--muted); }
.chart .grid span i { font-style: normal; position: absolute; top: -7px; left: 0; width: 26px; text-align: right; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; z-index: 1; }
.chart .bar { width: 64%; max-width: 84px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #6c5ce7, #3d3970); position: relative; }
.chart .bar b { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--indigo); }
.chart .day { height: 26px; line-height: 26px; font-size: 10.5px; color: var(--muted); }

/* ---------- Progress & info ---------- */
.info-grid { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 40px; font-size: 12px; justify-content: start; margin-bottom: 16px; }
.info-grid span { color: var(--muted); display: inline-block; min-width: 118px; }
.info-grid b { font-weight: 600; }
.progress-row { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--muted); }
.progress { flex: 1; height: 10px; background: #eceef5; border-radius: 10px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #a8d33f, #d4c11c); border-radius: 10px; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e9eaf5, #d9dcef); padding: 20px; }
.login-card { width: 360px; max-width: 100%; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px rgba(40, 40, 100, .18); }
.login-head { background: linear-gradient(160deg, var(--navy-2), var(--navy)); color: #fff; text-align: center; padding: 26px 20px 22px; }
.login-head img { width: 58px; height: 58px; }
.login-head h1 { margin: 10px 0 2px; font-size: 18px; letter-spacing: 2px; }
.login-head p { margin: 0; font-size: 11px; color: #cfcbf5; }
.login-body { padding: 22px 26px 26px; }
.login-body .btn { width: 100%; padding: 11px; font-size: 13px; letter-spacing: 1px; margin-top: 8px; background: linear-gradient(90deg, var(--navy-2), #4a4ab0); }

/* ---------- Raport (pratinjau) ---------- */
.preview-page { background: #5a5468; min-height: 100vh; }
.preview-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: #2e2b45; color: #fff; }
.preview-bar .title { font-weight: 600; font-size: 13px; }
.preview-wrap { padding: 26px 16px 50px; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.raport-sheet { background: #fff; width: 794px; min-height: 1100px; max-height: 1115px; overflow: hidden; max-width: 100%; padding: 34px 44px 28px; font-family: 'Times New Roman', Times, serif; color: #000; font-size: 11px; line-height: 1.25; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.rs-id { width: 100%; border-collapse: collapse; margin-bottom: 8px; font-weight: bold; font-size: 11px; }
.rs-id td { padding: 1px 3px; vertical-align: top; }
.rs-id td.l { width: 118px; } .rs-id td.l2 { width: 88px; } .rs-id td.c { width: 10px; }
.rt { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.rt th, .rt td { border: 1px solid #000; padding: 2px 5px; vertical-align: top; }
.rt th { background: #ffeb3b; text-align: center; font-weight: bold; }
.rt td.c { text-align: center; vertical-align: middle; }
.rt td.desk { font-size: 9.5px; line-height: 1.2; text-align: justify; }
.rt tr.grp td { font-weight: bold; }
.rt-gap { margin-top: 8px; }
.rs-row { display: grid; grid-template-columns: 38% 1fr; gap: 50px; margin-top: 8px; align-items: start; }
.rt-abs td { border-left: none; border-right: none; } .rt-abs td:first-child { border-left: 1px solid #000; } .rt-abs td:last-child { border-right: 1px solid #000; }
.rt-cat td { height: 36px; vertical-align: middle; font-size: 9.5px; }
.rt-tanggapan td { height: 36px; }
.rs-ttd { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; font-size: 11px; row-gap: 4px; }
.rs-ttd .ortu { padding-top: 18px; }
.rs-ttd .ortu .line { width: 130px; border-top: 1px solid #000; margin-top: 62px; }
.rs-ttd .wali { padding-left: 120px; }
.rs-ttd .nm { margin-top: 48px; font-weight: bold; text-decoration: underline; }
.rs-ttd .kepsek { grid-column: 1 / span 2; padding-left: 230px; }
.rs-ttd .kepsek .nm { margin-top: 44px; }
.rs-ket { margin-top: 12px; font-size: 8.5px; font-style: italic; }
/* Raport Mid */
.kop { display: flex; align-items: center; gap: 12px; }
.kop img { height: 78px; width: auto; object-fit: contain; }
.kop-t { flex: 1; text-align: center; font-family: Arial, Helvetica, sans-serif; line-height: 1.2; }
.kop-t .k1 { font-weight: bold; font-size: 15px; } .kop-t .k2 { font-size: 15px; } .kop-t .k3 { font-size: 13px; }
.kop-t .k4 { font-size: 12px; color: #2f6fd6; text-decoration: underline; }
.kop-line { border-top: 3px solid #000; border-bottom: 1px solid #000; height: 3px; margin: 6px 0 12px; }
.rm-title { text-align: center; font-size: 15px; text-decoration: underline; margin: 0 0 12px; }
.rm-id { font-size: 11.5px; margin-bottom: 4px; } .rm-id td.l { width: 140px; }
.rm-sub { text-align: center; font-size: 13px; margin: 6px 0 6px; }
.rt.rm th { background: #f6c99a; }
.rt.rm td { padding: 3px 6px; }
.rt.rm-small { width: 70%; margin-top: 12px; }
.rm-ttd { margin-top: 22px; }
.rm-ttd .ortu { padding-top: 20px; }
.rs-ttd .nm-plain { text-decoration: none; }
@media print {
    .preview-bar { display: none; }
    .preview-page { background: #fff; }
    .raport-sheet { box-shadow: none; page-break-after: always; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .sidebar { position: fixed; left: -230px; z-index: 20; transition: left .2s; }
    .sidebar.open { left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .content { padding: 18px 16px 30px; }
    .topbar { padding: 0 16px; }
}
@media (min-width: 901px) { .burger { visibility: visible; } }

/* ---------- Input nilai, catatan & tab raport ---------- */
.tbl-nilai textarea, .modal textarea { font-family: inherit; font-size: 11.5px; padding: 6px 8px; border: 1px solid #d9dbe7; border-radius: 6px; width: 100%; resize: vertical; }
.tbl-nilai td:last-child { min-width: 280px; }
.tbl-nilai input[type=number] { width: 70px; }
.desk-cell { font-size: 11px; color: #4a4d63; max-width: 380px; }
dialog.modal.modal-wide { width: 620px; }
.field-label { font-size: 11.5px; font-weight: 600; color: #4a4d63; display: block; margin-bottom: 5px; }
.eks-row { display: grid; grid-template-columns: 1.2fr 1fr 1.6fr; gap: 8px; margin-bottom: 8px; }
.eks-row input, .eks-row select { font-family: inherit; font-size: 12px; padding: 7px 9px; border: 1px solid #d9dbe7; border-radius: 6px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: 9px 16px; border-radius: 8px; background: #fff; color: var(--muted); font-weight: 600; font-size: 12px; box-shadow: 0 2px 8px rgba(30, 30, 80, .06); }
.tabs a.active { background: linear-gradient(90deg, #5a4fcf, #4f6fdc); color: #fff; }

/* ---------- Pemilih semester, pencarian, siswa ---------- */
.topbar { gap: 16px; }
.ta-picker { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 18px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ta-picker select { font-family: inherit; font-size: 12px; padding: 6px 10px; border: 1px solid #d9dbe7; border-radius: 6px; background: #f7f7fc; color: var(--indigo); font-weight: 600; }
.search-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search-bar input[type=search], .search-bar select { font-family: inherit; font-size: 12px; padding: 8px 11px; border: 1px solid #d9dbe7; border-radius: 6px; background: #fff; }
.search-bar input[type=search] { min-width: 260px; flex: 1; max-width: 380px; }
.pred { display: inline-block; min-width: 22px; text-align: center; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: 4px; }
.pred-A { background: #d8f5df; color: #1e8b46; } .pred-B { background: #e3ecff; color: #2f55c4; }
.pred-C { background: #fff3cd; color: #9a6b00; } .pred-D { background: #fde4e4; color: #c0392b; }
.raport-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.raport-card { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(30, 30, 80, .06); border-top: 4px solid var(--accent); }
.raport-card.sem { border-top-color: #f2c94c; }
.raport-card h3 { margin: 0 0 6px; font-size: 14px; color: var(--indigo); }
.raport-card p { margin: 0 0 12px; color: #5d6075; font-size: 12px; line-height: 1.6; }
.id-table td { padding: 5px 10px 5px 0; font-size: 12.5px; } .id-table td:first-child { color: var(--muted); width: 150px; }
@media (max-width: 900px) { .raport-cards { grid-template-columns: 1fr; } .ta-picker label { display: none; } }

/* ---------- Mapel diampu guru ---------- */
.mapel-check { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 10px 12px; border: 1px solid #d9dbe7; border-radius: 8px; background: #fafaff; }
.mapel-check label { display: flex; gap: 7px; align-items: flex-start; font-size: 11.5px; font-weight: 500; color: var(--text); cursor: pointer; line-height: 1.35; }
.mapel-check input { margin-top: 2px; accent-color: var(--accent); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: #eef0ff; color: var(--indigo); border: 1px solid #d6d9ff; border-radius: 20px; padding: 4px 11px; font-size: 11.5px; font-weight: 600; }
