/* ============================================================
   Training & Placement Cell — stylesheet
   Palette: ink green / paper / marigold  ·  system fonts only
   (no external font requests — works on offline intranets)
   ============================================================ */

:root {
  --ink:        #1B3A2F;   /* deep register green  */
  --ink-soft:   #2C5245;
  --paper:      #FAF9F5;   /* warm paper           */
  --card:       #FFFFFF;
  --text:       #24312B;
  --muted:      #6B7A72;
  --line:       #DCE3DE;
  --accent:     #E8A020;   /* marigold             */
  --accent-ink: #7A5205;
  --ok:         #2E7D4F;
  --ok-bg:      #E7F3EC;
  --bad:        #B3402F;
  --bad-bg:     #F9ECE9;
  --warn-bg:    #FBF3DF;
  --info:       #2F5FA3;
  --info-bg:    #EAF0F9;
  --serif: Georgia, 'Times New Roman', serif;
  --sans:  system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
}

a { color: var(--ink-soft); }
a:hover { color: var(--ink); }

/* ---------------- Masthead ---------------- */
.masthead {
  background: var(--ink);
  border-bottom: 3px solid var(--accent);   /* the marigold rule */
  color: #F2F0E9;
}

.masthead-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-seal {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  width: 42px;
  height: 42px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--serif); font-size: 17px; letter-spacing: 0.2px; }
.brand-text small  { font-size: 11.5px; color: #C8CFC3; }

.topnav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }

.topnav a {
  color: #E4E2D8;
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 4px;
  font-size: 13.5px;
}
.topnav a:hover  { background: var(--ink-soft); color: #fff; }
.topnav a.active { background: var(--accent); color: var(--ink); font-weight: 600; }

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #C8CFC3;
}
.userbox .username { color: #fff; font-weight: 600; }
.userbox a { color: #E4E2D8; }
.userbox a.logout { color: var(--accent); font-weight: 600; }

/* ---------------- Layout ---------------- */
.container {
  max-width: 1120px;
  margin: 26px auto 40px;
  padding: 0 20px;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  padding: 18px;
}

.page-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  margin: 0 0 6px;
  color: var(--ink);
}

h2 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--ink);
}
h3 { font-size: 15px; margin: 0 0 4px; }

.muted  { color: var(--muted); }
.small  { font-size: 13px; }
.center { text-align: center; }
.mt     { margin-top: 22px; }

/* ---------------- Cards & grids ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.card-head h2 { margin-bottom: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }
.grid-2.align-top, .grid-3.align-top { align-items: start; gap: 20px; }
.span-2 { grid-column: span 2; }

/* ---------------- Stats ---------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.stat-attn { border-color: var(--accent); background: var(--warn-bg); }
.stat-attn .stat-num { color: var(--accent-ink); }

/* ---------------- Tables ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }

.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
  padding: 8px 10px;
  white-space: nowrap;
}

.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}

.table tbody tr:hover { background: #F4F6F2; }
.table .num { text-align: right; }
.table-wide td { vertical-align: middle; }

/* ---------------- Stamp badges ---------------- */
.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}
.b-ok      { color: var(--ok);        background: var(--ok-bg); }
.b-bad     { color: var(--bad);       background: var(--bad-bg); }
.b-warn    { color: var(--accent-ink);background: var(--warn-bg); }
.b-info    { color: var(--info);      background: var(--info-bg); }
.b-neutral { color: var(--muted);     background: #F1F2EF; }

.tally { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 14px; font-size: 13px; }
.tally span { display: flex; align-items: center; gap: 6px; }

/* ---------------- Flash messages ---------------- */
.flash {
  padding: 11px 14px;
  border-radius: 5px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid;
}
.flash-success { background: var(--ok-bg);   border-color: var(--ok);    color: #1E5637; }
.flash-error   { background: var(--bad-bg);  border-color: var(--bad);   color: #7E2C1F; }
.flash-warn    { background: var(--warn-bg); border-color: var(--accent);color: var(--accent-ink); }

/* ---------------- Forms ---------------- */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}

label input, label select, label textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  border: 1px solid #B9C4BC;
  border-radius: 5px;
}

input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

textarea { resize: vertical; }

.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.filterbar input, .filterbar select {
  padding: 8px 10px;
  border: 1px solid #B9C4BC;
  border-radius: 5px;
  font: inherit;
  background: #fff;
}
.filterbar input[name="q"] { min-width: 240px; }

.branchset {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 14px 6px;
  margin: 0 0 16px;
}
.branchset legend { font-size: 13px; font-weight: 600; color: var(--ink); padding: 0 4px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px 8px 0;
  font-weight: 400;
}
.check input { width: auto; margin: 0; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid #A9B6AD;
  border-radius: 5px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { background: #F0F2EE; color: var(--ink); }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: var(--ink-soft); color: #fff; }

.btn-danger { color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }

.btn-small { padding: 4px 9px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }

.inline { display: inline-block; margin: 0; }
.inline button { vertical-align: middle; }

/* ---------------- Auth pages ---------------- */
.auth-wrap { display: flex; justify-content: center; padding: 30px 0; }
.auth-card { width: 100%; max-width: 460px; }

/* ---------------- Detail grid (student view) ---------------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 26px;
  margin: 14px 0 18px;
}
.detail-grid .dt { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.detail-grid .dd { display: block; font-size: 14.5px; }

/* ---------------- Notices ---------------- */
.notice { border-bottom: 1px solid var(--line); padding: 12px 0; }
.card > .notice:last-child, .notice.card { border-bottom: none; }
.notice.card { padding: 20px; }
.notice-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.notice-body { margin: 6px 0; white-space: normal; }
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.notice-list li:last-child { border-bottom: none; }

/* ---------------- Drive cards ---------------- */
.drive .card-head h2 { margin-bottom: 2px; }
.drive-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.drive-desc {
  margin: 8px 0;
  padding: 10px 14px;
  background: #F6F7F4;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 14px;
}
.ineligible-why { color: var(--accent-ink); }

/* ---------------- Per-row status form ---------------- */
.statusform { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.statusform select { padding: 6px 8px; border: 1px solid #B9C4BC; border-radius: 4px; font: inherit; }
.statusform input[name="offer_package"] { width: 92px; }
.statusform input[name="remarks"] { width: 150px; }
.statusform input { padding: 6px 8px; border: 1px solid #B9C4BC; border-radius: 4px; font: inherit; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .grid-2, .grid-3, .detail-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .masthead-inner { gap: 10px; }
  .topnav { margin-left: 0; width: 100%; order: 3; }
  .userbox { margin-left: auto; }
  .card { padding: 16px; overflow-x: auto; }
  .table { min-width: 560px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------- Four pillars (student dashboard) ---------------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.pillar {
  position: relative;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: 6px;
  padding: 20px 18px 16px;
  text-decoration: none;
  color: var(--text);
}
.pillar:hover {
  border-top-color: var(--accent);
  box-shadow: 0 2px 10px rgba(27, 58, 47, 0.09);
  color: var(--text);
}

.pillar-num {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--line);
  line-height: 1;
}

.pillar h2 {
  font-size: 19px;
  margin: 0 0 2px;
  padding-right: 40px;
}
.pillar h2 small {
  display: block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.pillar-line {
  margin: 6px 0 10px;
  font-size: 13.5px;
  color: var(--accent-ink);
  font-weight: 600;
}

.pillar-facts { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.pillar-facts li { padding: 3px 0; line-height: 1.5; }

@media (max-width: 560px) {
  .pillars { grid-template-columns: 1fr; }
}

/* ---------------- Cohort bifurcation ---------------- */
.crumbs { font-size: 13px; margin: 0 0 14px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumb-sep { margin: 0 8px; color: var(--line); }
.crumb-here, .crumb-fixed { color: var(--ink); font-weight: 600; }

.cohort-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
  margin-bottom: 6px;
}

.cohort-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 5px;
  padding: 12px 13px;
  text-decoration: none;
  color: var(--text);
}
.cohort-cell:hover { border-left-color: var(--accent); background: #F7F8F5; color: var(--text); }

.cohort-label { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.cohort-count { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.cohort-sub { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }

.chip, .chip-attn, .chip-quiet {
  font-size: 11px; padding: 1px 7px; border-radius: 10px; white-space: nowrap;
}
.chip { background: var(--info-bg); color: var(--info); }
.chip-attn { background: var(--warn-bg); color: var(--accent-ink); font-weight: 700; }
.chip-quiet { background: #F1F2EF; color: var(--muted); }

/* ---------------- Request log trail ---------------- */
.logtrail { list-style: none; margin: 10px 0 0; padding: 0; border-left: 2px solid var(--line); }
.logtrail li { position: relative; padding: 7px 0 7px 16px; font-size: 13px; }
.logtrail li::before {
  content: ''; position: absolute; left: -5px; top: 13px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.logtrail li:last-child::before { background: var(--ok); }
.log-when { display: block; font-size: 11.5px; color: var(--muted); }
.log-what { display: block; }

/* ---------------- Ledger ---------------- */
.ledger-total { display: flex; gap: 22px; flex-wrap: wrap; margin: 10px 0 4px; }
.ledger-total div { font-size: 13px; }
.ledger-total strong { display: block; font-family: var(--serif); font-size: 19px; color: var(--ink); }
.ledger-due strong { color: var(--bad); }
.ledger-clear strong { color: var(--ok); }

.logbox { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.logbox summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.logbox summary:hover { color: var(--ink); }
a.stat { color: inherit; }
a.stat:hover { border-color: var(--accent); }

/* ---------------- Round-wise pop-ups ---------------- */
.popup-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.popup {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--ink); color: #F2F0E9; border-left: 4px solid var(--accent);
  border-radius: 6px; padding: 12px 12px 12px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.popup-body { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.popup-body strong { font-size: 13.5px; }
.popup-body span { color: #C8CFC3; }
.popup-body a { color: var(--accent); font-weight: 600; }
.popup-x { background: none; border: none; color: #C8CFC3; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.popup-x:hover { color: #fff; }
@media (max-width: 560px) { .popup-wrap { left: 12px; right: 12px; max-width: none; } }

/* ---------------- Drive highlight points ---------------- */
.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 10px; margin: 12px 0; }
.hl { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 5px; padding: 8px 11px; background: #FCFBF7; }
.hl .hl-k { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.hl .hl-v { display: block; font-size: 13.5px; color: var(--text); }
.hl-main { border-left-color: var(--ink); background: #F4F6F2; }

/* ---------------- "Where does this go?" ---------------- */
.routeline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin: 10px 0; font-size: 12.5px;
}
.routeline-k {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; margin-right: 2px;
}
.route-stop { padding: 2px 9px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.route-arrow { color: var(--line); }
.route-done { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.route-here { border-color: var(--accent); color: var(--accent-ink); background: var(--warn-bg); font-weight: 700; }
.route-stopped { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); font-weight: 700; }

/* ---------------- Section sub-navigation ---------------- */
.subnav {
  display: flex; gap: 3px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin: 0 0 20px; padding-bottom: 0;
}
.subnav a {
  padding: 7px 12px; font-size: 13px; text-decoration: none; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600;
}
.subnav a:hover { color: var(--ink); }
.subnav a.on { color: var(--ink); border-bottom-color: var(--accent); }
