/* BNSD SIS - dense admin look: teal banners, maroon section headers, gray grids */
:root {
  --navy: #17323d;
  --teal-dark: #1e5e6a;
  --teal: #2a8495;
  --teal-mid: #3b97a7;
  --teal-light: #e3f2f5;
  --maroon: #6b1d1d;
  --maroon-dark: #521414;
  --grid-head: #e7eaec;
  --grid-line: #d5dadd;
  --row-alt: #f6f8f9;
  --row-hover: #fff8dc;
  --text: #222;
  --muted: #667;
  --blue: #3a7fc1;
  --blue-dark: #2c67a0;
  --red: #c9443f;
  --green: #2e7d32;
  --amber: #b26a00;
  --bg: #eef1f3;
  --focus-future: #7b4fb0;
  --focus-past: #8a6d3b;
  font-size: 13px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Segoe UI", Tahoma, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border: 1px solid #b9c0c5; border-radius: 3px;
  background: linear-gradient(#fff, #eceff1); color: #333; cursor: pointer; text-decoration: none;
  line-height: 1.5; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: linear-gradient(#fff, #e0e5e8); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--blue); border-color: var(--blue-dark); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-danger  { background: var(--red); border-color: #a83430; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a83430; }
.btn-sm { padding: 1px 7px; font-size: 12px; }
.btn-icon { padding: 3px 8px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 3px 0 0 3px; margin-left: 0; }
.btn-group .btn:last-child  { border-radius: 0 3px 3px 0; }

/* ---------- landing ---------- */
body.landing { display: flex; flex-direction: column; min-height: 100vh;
  background: linear-gradient(160deg, var(--teal-dark) 0%, var(--navy) 60%); }
.landing-top { padding: 14px 24px; }
.landing-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.landing-card { width: 100%; max-width: 440px; background: #fff; border-radius: 4px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.landing-card-head { background: var(--teal); color: #fff; padding: 22px 26px 18px; border-bottom: 4px solid var(--maroon); }
.landing-card-head h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.landing-card-head p { margin: 0; opacity: .9; }
.landing-card-body { padding: 22px 26px 26px; }
.landing-card-body p { margin: 0 0 16px; }
.btn-ms { width: 100%; justify-content: center; padding: 9px 12px; font-size: 14px; font-weight: 600;
  background: #fff; border: 1px solid #8c8c8c; color: #333; }
.btn-ms:hover { background: #f3f3f3; }
.landing-fine { margin-top: 18px !important; font-size: 12px; color: var(--muted); }
.landing-foot { color: rgba(255,255,255,.6); text-align: center; padding: 14px; font-size: 12px; }

/* ---------- brand / top bar ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark { background: var(--maroon); color: #fff; font-weight: 700; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 3px; font-size: 13px; }
.brand-text { font-size: 15px; font-weight: 600; }

.topbar { height: 46px; display: flex; align-items: center; gap: 16px; padding: 0 14px;
  background: var(--navy); border-bottom: 3px solid var(--teal); position: sticky; top: 0; z-index: 20; }
.focus-btn { display: flex; align-items: center; gap: 8px; margin-left: 12px; padding: 5px 12px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); border-radius: 3px;
  color: #fff; cursor: pointer; max-width: 60vw; }
.focus-btn:hover { background: rgba(255,255,255,.16); }
.focus-label { text-transform: uppercase; font-size: 10px; letter-spacing: 1px; opacity: .7; }
#focus-text { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { opacity: .7; font-size: 10px; }
.year-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 1px 6px; border-radius: 2px; background: var(--green); }
.year-badge.future { background: var(--focus-future); }
.year-badge.past { background: var(--focus-past); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; color: #cfe3e8; }
.topbar-link { color: #fff; text-decoration: none; opacity: .85; }
.topbar-link:hover { opacity: 1; text-decoration: underline; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: calc(100vh - 46px); }
.sidenav { width: 190px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--grid-line); padding-top: 8px; }
.sidenav a { display: flex; align-items: center; gap: 9px; padding: 8px 14px; color: #333; text-decoration: none;
  border-left: 3px solid transparent; }
.sidenav a:hover { background: var(--teal-light); }
.sidenav a.active { background: var(--teal-light); border-left-color: var(--teal); font-weight: 600; color: var(--teal-dark); }
.sidenav .ico { width: 16px; text-align: center; color: var(--teal); }
.nav-sep { height: 1px; background: var(--grid-line); margin: 8px 12px; }
.view { flex: 1; min-width: 0; padding: 12px 16px 40px; outline: none; }

/* ---------- page title + toolbar (Synergy-style) ---------- */
.page-title { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.page-title h1 { margin: 0; font-size: 22px; font-weight: 700; color: #1d1d1d; }
.page-title .sub { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px;
  background: #fafbfb; border: 1px solid var(--grid-line); border-bottom: none; border-radius: 3px 3px 0 0; }
.toolbar .spacer { flex: 1; }
.toolbar .sep { width: 1px; height: 22px; background: var(--grid-line); margin: 0 4px; }

/* ---------- panels / sections ---------- */
.panel { background: #fff; border: 1px solid var(--grid-line); border-radius: 0 0 3px 3px; padding: 10px; }
.panel + .panel { margin-top: 12px; border-radius: 3px; }
.section { margin-top: 12px; border: 1px solid #c9b3b3; background: #fff; }
.section-head { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--maroon); color: #fff; font-weight: 600; }
.section-head .count { font-weight: 400; opacity: .8; }
.section-head .actions { margin-left: auto; display: flex; gap: 6px; }
.section-head .btn { border-color: #fff; }
.section-body { padding: 8px; }
.section-body.flush { padding: 0; }

/* ---------- student banner + tabs ---------- */
.student-banner { background: var(--teal); color: #fff; padding: 8px 12px 0; border: 1px solid var(--teal-dark); border-top: none; }
.banner-fields { display: flex; flex-wrap: wrap; gap: 6px 26px; padding-bottom: 8px; }
.banner-fields div { white-space: nowrap; }
.banner-fields b { font-weight: 600; opacity: .85; margin-right: 5px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tabs a { padding: 6px 14px; color: #fff; text-decoration: none; border: 1px solid transparent; border-bottom: none;
  border-radius: 3px 3px 0 0; margin-bottom: -1px; }
.tabs a:hover { background: rgba(255,255,255,.15); }
.tabs a.active { background: #fff; color: #111; border-color: var(--teal-dark); font-weight: 600; outline: 2px solid var(--maroon); outline-offset: -3px; }
.tab-body { background: #fff; border: 1px solid var(--grid-line); border-top: none; padding: 10px; }

/* ---------- alerts ---------- */
.alert-strip { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border-radius: 3px; border: 1px solid; }
.alert .tag { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: 2px; color: #fff; white-space: nowrap; }
.alert.info { background: #eef6fc; border-color: #b9d7ef; }  .alert.info .tag { background: var(--blue); }
.alert.warning { background: #fff7e6; border-color: #f1cf8b; } .alert.warning .tag { background: var(--amber); }
.alert.critical { background: #fdecec; border-color: #ef9f9c; } .alert.critical .tag { background: var(--red); }
.alert .meta { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; }
.form-grid .wide { grid-column: span 2; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 11.5px; color: #333; margin-bottom: 2px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 3px 6px; border: 1px solid #b7bec3; border-radius: 2px; background: #fff;
  border-bottom: 2px solid #4a90c2; min-height: 26px; }
.field textarea { min-height: 70px; resize: vertical; }
.field input:disabled, .field select:disabled, .field textarea:disabled, .field input[readonly] {
  background: #f3f4f5; color: #444; border-bottom-color: #c3c9cd; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #9cc7e6; outline-offset: 0; }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.field.check label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin-top: 18px; }
.field.check input { width: auto; min-height: 0; }
.pin-box { display: flex; gap: 4px; }
.pin-box input { font-family: Consolas, monospace; letter-spacing: 2px; min-width: 110px; flex: 1; }
.dirty-note { color: var(--amber); font-weight: 600; }

/* ---------- grids ---------- */
.grid-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; }
.grid th { background: var(--grid-head); text-align: left; font-weight: 600; padding: 5px 8px; border: 1px solid var(--grid-line);
  white-space: nowrap; position: sticky; top: 0; }
.grid td { padding: 4px 8px; border: 1px solid var(--grid-line); vertical-align: top; }
.grid tbody tr:nth-child(even) td { background: var(--row-alt); }
.grid tbody tr.clickable { cursor: pointer; }
.grid tbody tr.clickable:hover td { background: var(--row-hover); }
.grid tr.focus-row td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.grid tr.year-head td { background: var(--teal-light) !important; font-weight: 700; color: var(--teal-dark); }
.grid .num { text-align: right; }
.grid .actions { white-space: nowrap; }
.grid .sub-row td { background: #fffbea !important; color: #6b5200; font-size: 12px; }
.empty { padding: 18px; text-align: center; color: var(--muted); }

/* ---------- chips ---------- */
.chip { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 2px; border: 1px solid; line-height: 17px; white-space: nowrap; }
.chip.enrolled    { color: var(--green); border-color: #9ccc9f; background: #eef7ee; }
.chip.preenrolled { color: var(--focus-future); border-color: #c8b2e3; background: #f5f0fb; }
.chip.transferred { color: var(--blue-dark); border-color: #a9c7e5; background: #eef5fc; }
.chip.withdrawn, .chip.inactive, .chip.notenrolled { color: #777; border-color: #ccc; background: #f4f4f4; }
.chip.graduated   { color: #7a5b00; border-color: #e3cf8a; background: #fdf8e6; }
.chip.completed   { color: #555; border-color: #ccc; background: #f4f4f4; }
.chip.review { color: #8a4b00; border-color: #f0c27a; background: #fff4e0; }
.chip.cf { color: var(--teal-dark); border-color: #9fd0d9; background: var(--teal-light); }
.chip.alert { color: #fff; border-color: var(--red); background: var(--red); }
.chip.tech { color: #fff; border-color: var(--maroon); background: var(--maroon); }

/* ---------- home ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.card { background: #fff; border: 1px solid var(--grid-line); border-top: 3px solid var(--teal); padding: 10px 12px; }
.card .n { font-size: 26px; font-weight: 700; color: var(--teal-dark); }
.card .l { color: var(--muted); }
.card.warn { border-top-color: var(--amber); } .card.warn .n { color: var(--amber); }
.card.bad  { border-top-color: var(--red); }   .card.bad .n  { color: var(--red); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

.banner-note { padding: 8px 10px; border: 1px solid; border-radius: 3px; margin-bottom: 10px; }
.banner-note.future { background: #f5f0fb; border-color: #c8b2e3; color: #4b2a77; }
.banner-note.past   { background: #faf4ea; border-color: #dcc8a3; color: #5e4a22; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,30,36,.55); display: flex; align-items: flex-start;
  justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; }
.modal { background: #fff; width: 100%; max-width: 560px; border-radius: 3px; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.modal.wide { max-width: 900px; }
.modal-head { background: var(--teal); color: #fff; padding: 9px 14px; font-weight: 600; font-size: 14px; display: flex; align-items: center; }
.modal-head .x { margin-left: auto; background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
.modal-body { padding: 14px; }
.modal-foot { padding: 10px 14px; border-top: 1px solid var(--grid-line); display: flex; justify-content: flex-end; gap: 8px; background: #fafbfb; }
.modal-error { display: none; margin-bottom: 10px; padding: 7px 10px; background: #fdecec; border: 1px solid #ef9f9c; color: #8c1d18; border-radius: 3px; }
.modal-error.show { display: block; }
.modal .note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

/* ---------- toast / misc ---------- */
.toast-root { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--navy); color: #fff; padding: 9px 14px; border-radius: 3px; box-shadow: 0 6px 20px rgba(0,0,0,.3);
  border-left: 4px solid var(--teal-mid); max-width: 380px; }
.toast.error { border-left-color: var(--red); }
.loading { padding: 30px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: Consolas, monospace; }
.search-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.search-row .field { min-width: 160px; }
.search-row .field.grow { flex: 1; min-width: 240px; }
.inline-check { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.signed-out { max-width: 460px; margin: 10vh auto; background: #fff; border: 1px solid var(--grid-line); padding: 24px; text-align: center; }

@media (max-width: 760px) {
  .sidenav { display: none; }
  .brand-text { display: none; }
  .form-grid .wide { grid-column: auto; }
}
