/* BITS Pilani onboarding: one stylesheet for the joiner portal, the HR console and administration.
   Direction: institutional navy on a cool paper ground; one warm tint, kept for "do this next". */

:root {
  --ink: #14233b;
  --ink-soft: #4a5a72;
  --brand: #1f4e79;
  --brand-deep: #163a5c;
  --brand-wash: #e8f0f9;
  --paper: #f3f5f8;
  --panel: #ffffff;
  --line: #d3dae5;
  --line-soft: #e6ebf2;
  --sun: #fff3e3;
  --sun-line: #efc89c;
  --sun-ink: #8a3412;
  --ok: #1d6a43;      --ok-wash: #e4f2ea;
  --bad: #a1301c;     --bad-wash: #fbe9e4;
  --mute: #46546a;    --mute-wash: #e8ecf2;
  --radius: 6px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; max-width: 70ch; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }
small, .small { font-size: .82rem; color: var(--ink-soft); }
:focus-visible { outline: 3px solid #3b82c4; outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }  /* classes that set display would otherwise win over the hidden attribute */
.muted { color: var(--ink-soft); }

/* ---- top bar ---- */
.topbar { background: var(--brand); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.25rem; padding: .65rem 1.25rem; }
.topbar a { color: #fff; text-decoration: none; padding: .15rem 0; border-bottom: 2px solid transparent; }
.topbar a:hover, .topbar a[aria-current="page"] { border-bottom-color: #fff; }
.topbar .brand { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; margin-right: .75rem; border: 0; }
.topbar .spacer { margin-left: auto; }
.topbar .who { font-size: .85rem; opacity: .92; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.topbar form { margin: 0; }
.topbar .linkish { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* ---- page frames ---- */
.page { max-width: 76rem; margin: 0 auto; padding: 1.25rem; }
.page-narrow { max-width: 30rem; margin: 3rem auto; padding: 0 1.25rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.shell { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.split-wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.split-wide-right { grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr); }
.master-detail { display: grid; grid-template-columns: 25rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.grid-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1rem; }
@media (max-width: 62rem) { .shell, .split, .split-wide-left, .split-wide-right, .master-detail { grid-template-columns: minmax(0, 1fr); } }

/* ---- surfaces ---- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { padding: .7rem 1.1rem; background: var(--line-soft); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; font-weight: 600; }
.panel-body { padding: 1rem 1.1rem; }
.banner { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); padding: .7rem 1rem; background: var(--panel); }
.banner-info { background: var(--brand-wash); border-color: #b8cfe6; border-left-color: var(--brand); }
.banner-warn { background: var(--sun); border-color: var(--sun-line); border-left-color: #d9822b; }
.banner-bad { background: var(--bad-wash); border-color: #efbdb2; border-left-color: var(--bad); }
.banner-ok { background: var(--ok-wash); border-color: #b4d8c3; border-left-color: var(--ok); }
.banner :last-child { margin-bottom: 0; }
.messages { margin-bottom: 1rem; display: grid; gap: .5rem; }

/* ---- tiles (numbers) ---- */
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.tile .label { font-size: .8rem; color: var(--ink-soft); }
.tile .figure { font-family: var(--serif); font-size: 2.1rem; font-weight: 600; line-height: 1.1; margin: .15rem 0; }
.tile .caption { font-size: .8rem; color: var(--ink-soft); }
.tile.is-bad .figure { color: var(--bad); } .tile.is-ok .figure { color: var(--ok); } .tile.is-brand .figure { color: var(--brand); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--radius); padding: .42rem .85rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--line-soft); color: var(--ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-danger { color: var(--bad); border-color: #e3b3a8; }
.btn-sm { padding: .2rem .55rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; font: inherit; }
form.inline { display: inline; margin: 0; }

/* ---- pills and chips ---- */
.pill { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 0 .6rem; font-size: .78rem; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--mute-wash); color: var(--mute); }
.pill-ok { background: var(--ok-wash); color: var(--ok); border-color: #b4d8c3; }
.pill-bad { background: var(--bad-wash); color: var(--bad); border-color: #efbdb2; }
.pill-warn { background: var(--sun); color: var(--sun-ink); border-color: var(--sun-line); }
.pill-info { background: var(--brand-wash); color: var(--brand); border-color: #b8cfe6; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid #b8cfe6; background: var(--brand-wash); color: var(--brand); border-radius: 999px; padding: .1rem .65rem; font-size: .85rem; font-weight: 600; text-decoration: none; }
.chip:hover { background: #d6e5f5; }
.chip-bad { background: var(--bad-wash); border-color: #efbdb2; color: var(--bad); }

/* ---- progress ---- */
.progress-figure { font-family: var(--serif); font-size: 3rem; line-height: 1; font-weight: 600; color: var(--ink); }
.progress-figure small { font-family: var(--sans); font-weight: 400; font-size: .9rem; }
.meter { height: .6rem; background: var(--line); border-radius: 999px; overflow: hidden; margin: .6rem 0 1rem; }
.meter > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: .55rem; align-items: baseline; padding: .22rem 0; font-size: .92rem; color: var(--ink-soft); }
.steps li .mark { width: 1.1rem; text-align: center; flex: none; }
.steps li.done { color: var(--ink); } .steps li.done .mark { color: var(--ok); font-weight: 700; }
.steps li.current { color: var(--ink); font-weight: 700; } .steps li.current .mark { color: var(--brand); }
.steps a { color: inherit; text-decoration: none; } .steps a:hover { text-decoration: underline; }

.steps-details > summary { display: none; cursor: pointer; font-weight: 600; margin-bottom: .4rem; }
@media (max-width: 62rem) { .steps-details > summary { display: list-item; } }

/* ---- the "do this next" card: the one warm element ---- */
.next-card { background: var(--sun); border: 1px solid var(--sun-line); border-radius: var(--radius); padding: 1rem 1.15rem; }
.next-card h2 { color: var(--sun-ink); margin-bottom: .35rem; }
.next-card details { margin-top: .75rem; } .next-card summary { cursor: pointer; font-weight: 600; color: var(--sun-ink); }

/* ---- attention list ---- */
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; flex-wrap: wrap; gap: .35rem .75rem; align-items: center; justify-content: space-between; padding: .55rem 0; border-top: 1px solid var(--line-soft); }
.attention li:first-child { border-top: 0; }
.attention .what { flex: 1 1 18rem; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.table th, .table td { padding: .5rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.table th { background: var(--line-soft); font-weight: 600; color: var(--ink-soft); font-size: .82rem; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr.group th { background: var(--brand-wash); color: var(--brand); font-size: .85rem; }
.table tbody tr:hover td { background: #fafbfd; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table input[type=text] { width: 100%; min-width: 9rem; }
.compare td.differs { color: var(--bad); font-weight: 600; }

/* ---- forms ---- */
label { font-weight: 600; font-size: .88rem; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=month], input[type=password], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #b8c3d3; border-radius: var(--radius); padding: .4rem .55rem; }
input[type=file] { font: inherit; max-width: 100%; }
textarea { resize: vertical; min-height: 4.2rem; height: 4.2rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--brand); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem 1rem; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field.check { flex-direction: row; align-items: center; gap: .5rem; }
.field.check input { width: auto; } .field.check label { font-weight: 500; }
.req { color: var(--bad); font-weight: 700; }
.field .help { font-size: .8rem; color: var(--ink-soft); }
.field .error, .errorlist li { color: var(--bad); font-size: .85rem; font-weight: 600; }
.errorlist { list-style: none; margin: 0; padding: 0; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.entry { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; background: #fcfdfe; }
.entry + .entry { margin-top: .75rem; }
.entry-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; font-weight: 600; font-family: var(--serif); }
.form-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.save-state { font-size: .85rem; color: var(--ink-soft); }
.save-state[data-state="saved"] { color: var(--ok); } .save-state[data-state="error"] { color: var(--bad); }
fieldset.group { border: 0; padding: 0; margin: 0 0 1.5rem; }
fieldset.group > legend { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; padding: 0; margin-bottom: .6rem; }

/* ---- paper preview (wireframe 2) ---- */
.paper-frame { background: #e3e8ef; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; position: sticky; top: 1rem; }
.paper-frame iframe { width: 100%; height: 34rem; border: 0; background: #fff; box-shadow: 0 1px 2px rgba(20,35,59,.18), 0 6px 16px rgba(20,35,59,.12); display: block; }
.paper-frame .caption { margin-top: .5rem; }

/* ---- bars (dashboard) ---- */
.bars { display: grid; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 2.5rem; gap: .6rem; align-items: center; font-size: .9rem; }
.bar-row .track { height: .8rem; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--brand); }
.bar-row .track i.closed { background: var(--ok); }
.bar-row .count { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- tabs ---- */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1rem; }
.tab { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: .2rem .85rem; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; }
.tab[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab.alert { background: var(--bad-wash); border-color: #efbdb2; color: var(--bad); }
.tab.alert[aria-current="page"] { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ---- master/detail lists ---- */
.case-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.case-list a { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: .6rem .8rem; text-decoration: none; color: var(--ink); }
.case-list a:hover { border-color: #9db4cf; }
.case-list a[aria-current="true"] { border-color: var(--brand); background: var(--brand-wash); }
.case-list .title { font-weight: 700; display: block; } .case-list .sub { font-size: .85rem; color: var(--ink-soft); display: block; margin-bottom: .3rem; }
.compare-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.compare-card { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; background: var(--panel); }
.compare-card .value { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin: .15rem 0; }
.compare-card.differs .value { color: var(--bad); }
.source-doc { border: 1px dashed #9db4cf; border-radius: var(--radius); background: #f7f9fc; min-height: 12rem; display: grid; place-items: center; overflow: hidden; }
.source-doc img, .source-doc iframe { max-width: 100%; width: 100%; border: 0; display: block; }
.source-doc iframe { height: 26rem; }
@media (max-width: 40rem) { .compare-cards { grid-template-columns: minmax(0, 1fr); } .bar-row { grid-template-columns: 5rem minmax(0, 1fr) 2rem; } }

@media (prefers-reduced-motion: no-preference) {
  .meter > i, .bar-row .track i { transition: width .5s ease; }
}
@media print { .topbar, .btn, .tabs { display: none; } body { background: #fff; } }
