:root { --brand: #0b4f8a; --brand-dark: #083a66; --brand-soft: #e8f1fa; }
body { font-family: 'Kantumruy Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: #f4f6f9; font-size: 15px; }
.kh-title { font-family: 'Moul', 'Kantumruy Pro', serif; font-weight: normal; }
.bg-brand { background: var(--brand) !important; }
.text-brand { color: var(--brand) !important; }
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); color: #fff; border-color: var(--brand-dark); }
.sidebar { width: 240px; background: #fff; border-right: 1px solid #e3e7ed; min-height: calc(100vh - 56px); }
@media (min-width: 992px) { .sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; flex-shrink: 0; } }
.sidebar .nav-link { color: #334; display: flex; align-items: center; gap: .6rem; padding: .55rem 1.1rem; border-left: 3px solid transparent; }
.sidebar .nav-link:hover { background: var(--brand-soft); }
.sidebar .nav-link.active { background: var(--brand-soft); color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.main-content { min-width: 0; }
.card { border: 1px solid #e3e7ed; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-header { background: #fff; }
.stat-card { color: inherit; transition: transform .1s; }
.stat-card:hover { transform: translateY(-2px); }
.bar { height: 10px; background: var(--brand); border-radius: 5px; opacity: .8; }
tr.clickable { cursor: pointer; }
.table th { font-weight: 600; font-size: .85rem; color: #556; white-space: nowrap; }
.student-photo { width: 120px; height: 160px; object-fit: cover; border-radius: 6px; border: 1px solid #dde; }
.student-photo-sm { width: 64px; height: 84px; object-fit: cover; border-radius: 4px; }
.placeholder-photo { display: inline-flex; align-items: center; justify-content: center; background: #eef1f5; font-size: 3rem; color: #aab; }
.doc-thumb { width: 120px; color: inherit; }
.doc-thumb img { width: 120px; height: 120px; object-fit: cover; border-radius: 4px; border: 1px solid #dde; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, #f4f6f9 30%); padding: 1rem 0 .5rem; z-index: 5; }
.att-group .btn { min-width: 2.6rem; }
.att-report td, .att-report th { padding: .2rem .35rem; font-size: .8rem; }
.att-report .att-A { background: #f8d7da; } .att-report .att-L { background: #fff3cd; } .att-report .att-E { background: #cff4fc; }
.letterhead { border-bottom: 2px solid var(--brand); padding-bottom: .5rem; }
/* landscape-ish width for score sheets */
.paper.paper-wide { max-width: 297mm; }
.grade-table .form-control.is-invalid { background-image: none; padding-right: .5rem; }
.paper { background: #fff; max-width: 210mm; margin: 0 auto; padding: 12mm 14mm; box-shadow: 0 0 6px rgba(0,0,0,.12); }
.receipt { max-width: 160mm; }
.filter-bar .form-control, .filter-bar .form-select { font-size: .9rem; }
.ss-wrap { position: relative; flex: 1; }
.ss-results { position: absolute; z-index: 20; left: 0; right: 0; background: #fff; border: 1px solid #ccd; border-radius: 4px; max-height: 260px; overflow: auto; }
.ss-results div { padding: .35rem .6rem; cursor: pointer; } .ss-results div:hover { background: var(--brand-soft); }
.ss-chips .badge { font-weight: normal; }
@media print {
  body { background: #fff; font-size: 12pt; }
  .paper { box-shadow: none; padding: 0; max-width: none; }
  .card { border: none; box-shadow: none; }
  a { color: inherit; text-decoration: none; }
  .main-content { padding: 0 !important; }
}
@media (max-width: 575px) { .att-group .btn { min-width: 2.2rem; padding: .25rem .4rem; } h1.h4 { font-size: 1.15rem; } }
.d-flex > .badge { align-self: center; }
.person-thumb { width: 36px; height: 46px; object-fit: cover; border-radius: 4px; border: 1px solid #dde; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; vertical-align: middle; }
/* v1.8.30 grouped sidebar */
.sidebar .nav-group-btn { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .6rem 1.1rem; border: 0; background: none; color: #1d3557; font-weight: 600; font-size: .95rem; border-left: 3px solid transparent; }
.sidebar .nav-group-btn:hover { background: var(--brand-soft); }
.sidebar .nav-group-btn .nav-caret { font-size: .75rem; transition: transform .2s; }
.sidebar .nav-group-btn.collapsed .nav-caret { transform: rotate(-90deg); }
.sidebar .nav-group-btn:not(.collapsed) .nav-group-badge { display: none; }
.sidebar .nav-group + .nav-group, .sidebar .nav-item + .nav-group { border-top: 1px solid #eef1f5; }
.sidebar .nav-link.nav-sub { padding: .42rem 1.1rem .42rem 2.1rem; font-size: .92rem; }
.sidebar .nav-link.nav-sub i { font-size: .9rem; opacity: .8; }
/* Dashboard (v1.8.33) */
.dash-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-radius: 14px; color: #fff; background: linear-gradient(120deg, var(--brand) 0%, #1c6fb5 100%); box-shadow: 0 4px 14px rgba(11,79,138,.18); }
.dash-hello { font-size: 1.2rem; font-weight: 600; }
.dash-date { opacity: .85; font-size: .9rem; }
.dash-hero .btn-brand { background: #fff; color: var(--brand); border-color: #fff; }
.dash-hero .btn-outline-secondary { color: #fff; border-color: rgba(255,255,255,.6); }
.dash-hero .btn-outline-secondary:hover { background: rgba(255,255,255,.15); color: #fff; }
.dash-section { background: #fff; border: 1px solid #e6eaf0; border-top: 4px solid var(--sec); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(16,24,40,.04); }
.dash-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .85rem; }
.dash-head h2 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.dash-head-ico { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--sec); background: color-mix(in srgb, var(--sec) 12%, #fff); }
.dash-tile { position: relative; display: flex; flex-direction: column; height: 100%; padding: .8rem .9rem .75rem; border-radius: 10px; background: #f7f9fc; border: 1px solid #edf0f5; color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
a.dash-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.08); border-color: var(--sec); color: inherit; }
.dash-ico { position: absolute; top: .7rem; right: .8rem; font-size: 1.25rem; color: var(--sec); opacity: .85; }
.dash-val { font-size: 1.55rem; font-weight: 700; line-height: 1.2; padding-right: 1.8rem; word-break: break-word; }
.dash-lbl { font-size: .85rem; color: #5b6676; }
.dash-sub { font-size: .78rem; color: #8a94a3; margin-top: .15rem; }
.dash-alert { background: #fff4f4; border-color: #f6caca; }
.dash-alert .dash-val, .dash-alert .dash-ico { color: #c2414b; }
.dash-warn { background: #fff8ec; border-color: #f3dcb0; }
.dash-warn .dash-val { color: #b96d00; }
.dash-panel { background: #fbfcfe; border: 1px solid #edf0f5; border-radius: 10px; padding: .9rem 1rem; }
.dash-panel-title { font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: #5b6676; margin-bottom: .6rem; }
.dash-bar-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; font-size: .86rem; }
.dash-bar-name { width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-bar-track { flex: 1; height: 10px; background: #eaeef4; border-radius: 6px; overflow: hidden; }
.dash-bar { height: 100%; background: linear-gradient(90deg, var(--sec), color-mix(in srgb, var(--sec) 60%, #fff)); border-radius: 6px; }
.dash-bar-n { width: 3.2em; text-align: right; font-weight: 600; }
.dash-stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #eaeef4; }
.dash-stack span { display: block; height: 100%; }
.dash-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .84rem; }
.dash-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; }
.dash-cols { display: flex; align-items: flex-end; gap: .5rem; height: 150px; padding-top: .3rem; }
.dash-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-decoration: none; color: inherit; }
.dash-col-bar { width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, color-mix(in srgb, var(--sec) 70%, #fff), var(--sec)); transition: opacity .12s; }
.dash-col:hover .dash-col-bar { opacity: .8; }
.dash-col-n { font-size: .75rem; font-weight: 600; margin-bottom: .15rem; }
.dash-col-lbl { font-size: .75rem; color: #5b6676; margin-top: .25rem; }
@media (max-width: 575px) { .dash-val { font-size: 1.25rem; } .dash-section { padding: .75rem; } .dash-bar-name { width: 45%; } }
