:root {
  --blue-900: #0d2e6e;
  --blue-800: #123f8c;
  --blue-700: #1e4fa3;
  --blue-100: #eaf2ff;
  --blue-050: #f6f9ff;
  --white: #ffffff;
  --ink: #1a1a1a;
  --muted: #5f6776;
  --border: #d9e1f2;
  --danger: #a81919;
  --success: #1f7a1f;
  --warning-bg: #fff8dd;
  --warning-border: #ead387;
  --shadow: 0 14px 38px rgba(13, 46, 110, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  color: var(--ink);
  background: var(--blue-050);
  line-height: 1.55;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.site-header {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: var(--white);
  border-bottom: 5px solid rgba(255,255,255,.12);
}
.brand-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand-logo { width: 112px; height: 112px; object-fit: contain; background: white; border-radius: 50%; padding: 6px; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.brand-copy h1 { margin: 2px 0 4px; font-size: clamp(28px, 4vw, 42px); line-height: 1.15; }
.eyebrow, .section-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; }
.eyebrow { margin: 0; opacity: .85; }
.system-title { margin: 0; font-size: 18px; opacity: .94; }

.page-shell { max-width: 1180px; margin: 0 auto; padding: 36px 24px 60px; }
.landing-shell { display: grid; gap: 28px; }
.hero-card, .section-block, .form-section, .dashboard-panel, .auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 16px;
}
.hero-card { padding: 34px; display: grid; grid-template-columns: 1.5fr .8fr; gap: 28px; align-items: center; }
.hero-copy h2, .section-heading-row h2 { color: var(--blue-900); margin: 5px 0 12px; }
.hero-copy p { margin: 0; font-size: 18px; color: #343b49; }
.notice-box { background: var(--blue-100); border-left: 5px solid var(--blue-700); padding: 20px; display: grid; gap: 6px; border-radius: 10px; }
.notice-box span { color: var(--muted); }
.section-block { padding: 30px; }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-heading-row h2 { margin-bottom: 0; }
.section-kicker { color: var(--blue-700); }
.batch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.batch-card {
  text-decoration: none;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, white, #f8fbff);
  display: grid;
  gap: 8px;
  min-height: 180px;
  transition: .2s ease;
}
.batch-card:hover { transform: translateY(-4px); border-color: var(--blue-700); box-shadow: 0 12px 24px rgba(13,46,110,.12); }
.batch-year { font-size: 36px; font-weight: 700; color: var(--blue-900); }
.batch-prefix { font-size: 17px; color: var(--muted); }
.batch-action { margin-top: auto; color: var(--blue-700); font-weight: 700; }
.site-footer { background: var(--blue-900); color: white; min-height: 74px; padding: 20px 24px; display: flex; align-items: center; justify-content: center; gap: 24px; text-align: center; }
.site-footer p { margin: 0; }
.site-footer a { color: white; }

.compact-header { background: var(--blue-900); color: white; }
.compact-brand { max-width: 1180px; margin: auto; padding: 16px 24px; display: flex; align-items: center; gap: 14px; text-decoration: none; }
.compact-brand img { width: 58px; height: 58px; object-fit: contain; background: white; border-radius: 50%; padding: 4px; }
.compact-brand div { display: grid; }
.compact-brand strong { font-size: 20px; }
.compact-brand span { opacity: .85; }
.form-page-shell { max-width: 1040px; }
.form-intro { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.form-intro h1 { color: var(--blue-900); margin: 4px 0 8px; }
.form-intro p { margin: 0; color: var(--muted); max-width: 760px; }
.batch-badge { background: var(--blue-900); color: white; padding: 12px 18px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
#student-form { display: grid; gap: 22px; }
.form-section { padding: 26px; }
.form-section-head { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.form-section-head h2 { color: var(--blue-900); margin: 0 0 4px; font-size: 24px; }
.form-section-head p { margin: 0; color: var(--muted); }
.step-number { background: var(--blue-900); color: white; width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.split-head { justify-content: space-between; align-items: center; }
.head-left { display: flex; gap: 16px; align-items: flex-start; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; }
.field > span, fieldset legend { font-weight: 700; color: #242b36; }
.field b, fieldset b, .declaration-check b { color: var(--danger); }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field input, .field select, .field textarea, .toolbar-controls input, .toolbar-controls select {
  width: 100%;
  border: 1px solid #cbd5e8;
  background: white;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .toolbar-controls input:focus, .toolbar-controls select:focus { border-color: var(--blue-700); box-shadow: 0 0 0 3px rgba(30,79,163,.12); }
.field small { color: var(--muted); }
.roll-input-wrap { display: flex; align-items: stretch; border: 1px solid #cbd5e8; border-radius: 8px; overflow: hidden; background: white; }
.roll-input-wrap span { background: var(--blue-100); padding: 11px 12px; color: var(--blue-900); font-weight: 700; border-right: 1px solid #cbd5e8; }
.roll-input-wrap input { border: 0; border-radius: 0; box-shadow: none !important; }
.checkbox-fieldset, .radio-fieldset { border: 0; padding: 0; margin: 0; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.checkbox-grid label, .radio-fieldset label { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fbfdff; }
.radio-fieldset { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-fieldset legend { width: 100%; margin-bottom: 8px; }
.top-gap { margin-top: 18px; }
.upload-field input[type=file] { padding: 12px; background: var(--blue-050); border-style: dashed; }
.passport-preview-wrap { display: flex; gap: 14px; align-items: center; margin-top: 8px; background: var(--blue-050); border: 1px solid var(--border); padding: 12px; border-radius: 10px; }
.passport-preview-wrap img { width: 86px; height: 104px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border); }
.passport-preview-wrap div { display: grid; gap: 4px; }
.passport-preview-wrap span { color: var(--muted); font-weight: 400; }
.repeat-list { display: grid; gap: 16px; }
.repeat-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: #fbfdff; }
.repeat-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.repeat-card-head h3 { margin: 0; color: var(--blue-900); }
.text-danger { border: 0; background: transparent; color: var(--danger); text-decoration: underline; }
.empty-state { border: 1px dashed var(--border); padding: 18px; border-radius: 10px; color: var(--muted); text-align: center; background: #fcfdff; }
.inline-actions { display: flex; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.inline-actions p { margin: 0; color: var(--muted); }
.internship-summary { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.internship-summary span { background: var(--blue-100); border: 1px solid var(--border); color: var(--blue-900); padding: 8px 12px; border-radius: 999px; }
.declaration-check { display: flex; align-items: flex-start; gap: 12px; background: var(--blue-050); border: 1px solid var(--border); padding: 16px; border-radius: 10px; }
.declaration-check input { margin-top: 5px; }
.form-actions { display: flex; justify-content: space-between; gap: 16px; }
.btn { border-radius: 8px; padding: 11px 16px; font-weight: 700; border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--blue-900); color: white; border-color: var(--blue-900); }
.btn-primary:hover { background: #092456; }
.btn-secondary { background: white; color: var(--blue-900); border-color: var(--border); }
.btn-outline { background: white; color: var(--blue-900); border-color: var(--blue-700); }
.btn-full { width: 100%; }
.alert { padding: 13px 15px; border-radius: 9px; border: 1px solid var(--border); background: white; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.alert-success { background: #ecf9ee; border-color: #9bd6a5; color: #145b20; }
.alert-error { background: #fff0f0; border-color: #e6aaaa; color: #851919; }

.admin-auth-body { min-height: 100vh; background: linear-gradient(135deg, var(--blue-900), var(--blue-700)); display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(470px, 100%); }
.auth-card { padding: 32px; text-align: center; }
.auth-logo { width: 100px; height: 100px; object-fit: contain; }
.auth-card h1 { color: var(--blue-900); margin: 4px 0 3px; }
.auth-card p { color: var(--muted); margin: 0 0 20px; }
.auth-card form { display: grid; gap: 16px; text-align: left; }
.auth-back { display: inline-block; margin-top: 18px; color: var(--blue-700); }

.dashboard-body { min-height: 100vh; background: #f5f8fd; }
.dashboard-sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; background: var(--blue-900); color: white; padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.16); }
.sidebar-brand img { width: 56px; height: 56px; background: white; border-radius: 50%; padding: 3px; object-fit: contain; }
.sidebar-brand div { display: grid; }
.sidebar-brand span { opacity: .75; font-size: 14px; }
.sidebar-nav { display: grid; gap: 8px; }
.nav-item { text-align: left; border: 1px solid transparent; background: transparent; color: white; padding: 11px 12px; border-radius: 8px; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.16); }
.dashboard-sidebar .btn { margin-top: auto; }
.dashboard-main { margin-left: 260px; padding: 28px; }
.dashboard-topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.dashboard-topbar h1 { margin: 4px 0 0; color: var(--blue-900); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: 0 7px 18px rgba(13,46,110,.06); display: grid; gap: 6px; }
.stat-card span { color: var(--muted); }
.stat-card strong { color: var(--blue-900); font-size: 28px; }
.dashboard-panel { padding: 22px; }
.panel-toolbar { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 18px; }
.panel-toolbar h2 { margin: 0; color: var(--blue-900); }
.panel-toolbar p { margin: 4px 0 0; color: var(--muted); }
.toolbar-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar-controls input { min-width: 300px; }
.table-wrap { overflow-x: auto; }
.student-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.student-table th { background: var(--blue-900); color: white; text-align: left; padding: 12px; }
.student-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.student-table tr:hover td { background: #f8fbff; }
.student-thumb { width: 44px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #eef3fb; }
.table-empty { text-align: center; color: var(--muted); padding: 28px !important; }
.table-action { color: var(--blue-700); border: 0; background: transparent; text-decoration: underline; }
.student-dialog { width: min(900px, 94vw); max-height: 90vh; overflow: auto; border: 0; border-radius: 14px; padding: 0; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.student-dialog::backdrop { background: rgba(4,16,38,.62); }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: white; z-index: 2; }
.dialog-head h2 { margin: 2px 0 0; color: var(--blue-900); }
.dialog-close { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: white; font-size: 25px; }
#student-detail-content { padding: 22px; }
.profile-top { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: start; }
.profile-photo { width: 150px; height: 180px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: #eef3fb; }
.profile-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.fact { background: var(--blue-050); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.fact span { display: block; color: var(--muted); font-size: 14px; }
.detail-section { margin-top: 22px; }
.detail-section h3 { color: var(--blue-900); border-bottom: 1px solid var(--border); padding-bottom: 7px; }
.detail-list { display: grid; gap: 10px; }
.detail-card { border: 1px solid var(--border); border-radius: 9px; padding: 12px; background: #fbfdff; }
.detail-card p { margin: 3px 0; }

@media (max-width: 980px) {
  .batch-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-card { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-sidebar { position: static; width: auto; }
  .dashboard-main { margin-left: 0; }
  .dashboard-body { display: block; }
  .sidebar-nav { grid-template-columns: repeat(5, minmax(140px,1fr)); overflow-x: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .brand-shell { align-items: flex-start; }
  .brand-logo { width: 84px; height: 84px; }
  .form-grid.two-col, .profile-facts { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .form-intro, .split-head, .inline-actions, .dashboard-topbar, .panel-toolbar { align-items: stretch; flex-direction: column; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .batch-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .toolbar-controls { flex-direction: column; }
  .toolbar-controls input { min-width: 0; }
  .profile-top { grid-template-columns: 1fr; }
  .profile-photo { width: 120px; height: 145px; }
}

/* Student profile extended form and program differentiation */
.chairperson-line {margin:.15rem 0 .65rem; font-size:17px; color:var(--blue-900); font-weight:bold;}
.batch-programs {display:block; font-size:14px; color:#536480; margin:7px 0;}
.subsection-tools {display:flex; justify-content:space-between; gap:15px; align-items:center; margin:24px 0 12px; padding-top:14px; border-top:1px solid var(--border);}
.subsection-tools h3 {margin:0 0 4px; color:var(--blue-900); font-size:19px;}
.subsection-tools p {margin:0; color:var(--muted); font-size:15px;}
.subsection-tools em {font-size:14px; font-weight:normal; color:var(--muted);}
@media (max-width:700px){.subsection-tools{align-items:flex-start;flex-direction:column}.batch-programs{font-size:13px}}

.roll-input-wrap span{white-space:nowrap;flex:0 0 auto;min-width:max-content;display:flex;align-items:center}
.roll-input-wrap input{min-width:0;flex:1 1 auto}
@media(max-width:700px){.form-intro h1{font-size:clamp(25px,7vw,31px)}}

/* Flexible historical batch selection (2000 to current year). */
.batch-selector-panel { margin-top: 26px; padding: 24px; background: var(--blue-050); border: 1px solid var(--border); border-radius: 12px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 25px; align-items: center; }
.batch-selector-panel h3 { margin: 0 0 6px; font-size: 23px; color: var(--blue-900); }
.batch-selector-panel p { margin: 0; color: var(--muted); }
.batch-picker { display: grid; gap: 8px; }
.batch-picker > label { color: var(--blue-900); font-weight: bold; }
.batch-picker-controls { display: flex; gap: 12px; align-items: stretch; }
.batch-picker-controls select { min-width: 120px; flex: 1; border-radius: 8px; border: 1px solid #bdcbe4; background: white; color: var(--ink); padding: 11px 12px; }
.sidebar-select-label { color: white; font-weight: bold; display: block; margin-bottom: 8px; }
.sidebar-batch-select { display: block; width: 100%; border: 1px solid #bed1f6; border-radius: 8px; background: white; color: var(--blue-900); padding: 11px; }
.sidebar-hint { color: #d6e3fa; font-size: 13px; line-height: 1.45; }
@media (max-width: 800px) { .batch-selector-panel { grid-template-columns: 1fr; } }
@media (max-width: 540px) { .batch-picker-controls { flex-direction: column; } .batch-picker-controls .btn { width: 100%; } }

.photo-missing { display:inline-flex; width:50px; height:54px; align-items:center; justify-content:center; padding:4px; background:#edf2fa; color:#3f5276; border:1px dashed #abb9d1; border-radius:6px; font: 12px/1.2 "Times New Roman",serif; text-align:center; }

/* Department branding and record management enhancements */
.site-footer { flex-direction:column; gap:3px; padding:17px 24px; }
.developer-credit { font-size:13px; letter-spacing:.03em; opacity:.88; }
.auth-logo { display:block; margin:0 auto 18px; width:100px; height:110px; object-fit:contain; }
.auth-card { background:white; border-radius:15px; border:1px solid var(--border); box-shadow:var(--shadow); padding:34px; text-align:center; }
.auth-shell { width:min(470px,100%); }
.admin-auth-body { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; }
.auth-credit { color:#eaf2ff; font-size:13px; letter-spacing:.025em; text-align:center; }
.sidebar-credit { text-align:center; font-size:13px; opacity:.8; margin:0; padding-top:6px; }
.export-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:9px; }
.export-label { font-weight:bold; color:var(--blue-900); }
.export-actions select, .student-dialog-actions select { background:#fff; border:1px solid var(--border); border-radius:7px; min-height:44px; padding:8px; color:var(--ink); }
.student-dialog-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; border-bottom:1px solid var(--border); padding:15px 22px; background:var(--blue-050); }
.student-dialog-actions label { color:var(--blue-900); font-weight:bold; }
.edit-dialog { width:min(960px,96vw); }
.edit-form { padding:22px; }
.edit-notice { padding:13px 16px; background:var(--blue-050); border:1px solid var(--border); border-radius:8px; margin-bottom:18px; color:var(--blue-900); }
.edit-form .field textarea { width:100%; }
.edit-form-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:22px; }
.edit-form .field input, .edit-form .field select, .edit-form .field textarea { max-width:100%; }
.edit-section-title { grid-column:1/-1; color:var(--blue-900); border-bottom:1px solid var(--border); margin:8px 0 0; font-size:20px; }
.detail-card button { margin-top:8px; }
@media(max-width:700px){.auth-card{padding:22px}.student-dialog-actions{align-items:stretch;flex-direction:column}.edit-form-actions{flex-wrap:wrap}.export-actions{justify-content:flex-start}}

/* Administrator record management; existing form and theme remain unchanged. */
.btn-danger { background:#b42318; border:1px solid #b42318; color:white; }
.btn-danger:hover { background:#8f1e14; color:white; }
.delete-dialog-body { padding:22px; display:grid; gap:16px; }
.delete-target { margin:0; padding:14px; background:#fff4f2; border:1px solid #f4b5ae; border-radius:9px; color:#8f1e14; font-weight:700; }
.delete-dialog-body p { line-height:1.5; }
.delete-dialog-body .edit-form-actions { margin-top:0; }
.student-table .row-trash td { background:#fff8f6; }
