/* =====================================================================
   AJNIFM Recruitment Management Portal — Design System
   ---------------------------------------------------------------------
   Direction: this is a Ministry of Finance institution processing binding
   government service records — the visual language should read like an
   official gazette/circular, not a generic SaaS dashboard. Deliberately
   avoiding the current AI-generic defaults (cream+terracotta, dark+neon,
   glassmorphism cards): instead, a deep institutional navy with a warm
   brass/gold accent (the colour of an official seal), a serif for
   headings that reads like letterhead typography, and a monospace face
   for reference numbers and dates so they read as system-of-record data.

   Signature element: advertisements and applications are genuinely
   sequenced, dated official records, so a "docket strip" — a left rule
   plus a monospace reference block — is used consistently as the one
   memorable device, instead of decorative numbered badges.
   ===================================================================== */

:root {
  /* Colour */
  --ink:        #16213a;   /* near-black navy, body text */
  --navy:       #0b2545;   /* primary institutional navy */
  --navy-700:   #13315c;   /* secondary surfaces, hover */
  --navy-100:   #e8edf5;   /* faint navy tint for hairlines/backgrounds */
  --paper:      #f7f5ef;   /* warm paper background, not sterile white */
  --paper-raised: #ffffff;
  --gold:       #b8863b;   /* seal/brass accent */
  --gold-100:   #f3e6cd;
  --success:    #1e7145;
  --success-100:#e3f0e8;
  --danger:     #9b2c2c;
  --danger-100: #f5e6e6;
  --warning:    #8a5a12;
  --warning-100:#f6ecd9;
  --line:       #d8d3c4;

  /* Type */
  /* "Noto Sans Devanagari" / "Nirmala UI" are appended to display and body
     stacks (not mono, which is reference-number/date content only, never
     free text) so Hindi/Devanagari content -- most notably a Vacancy
     Notice's "Instructions to Applicants" -- renders with correct
     conjunct/ligature shaping instead of depending on whatever the
     browser's own script fallback happens to pick. */
  --font-display: "Source Serif 4", "Noto Sans Devanagari", "Nirmala UI", "Georgia", serif;
  --font-body: "Inter", "Noto Sans Devanagari", "Nirmala UI", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}

code, .font-mono, .ref-code { font-family: var(--font-mono); }

a { color: var(--navy-700); }
a:hover { color: var(--gold); }

::selection { background: var(--gold-100); color: var(--navy); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------- Topbar / masthead ---------------- */

.masthead {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}

.masthead .institute-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--gold);
}

.masthead .institute-sub {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9d4e6;
}

.masthead .nav-link {
  color: #dfe6f2;
  font-size: 0.92rem;
}
.masthead .nav-link:hover, .masthead .nav-link.active { color: #fff; }

.institute-logo-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 5px;
  box-sizing: border-box;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}

.institute-logo-wrap-sm {
  width: 34px;
  height: 34px;
  padding: 3px;
}

.institute-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-copyright {
  border-top: 1px solid rgba(255,255,255,0.12);
  color: #93a2ba;
  font-size: 0.68rem;
  line-height: 1.6;
  text-align: center;
}

.emblem-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* ---------------- Docket strip (the signature element) ---------------- */
/* Used for advertisements and applications: a left brass rule plus a
   monospace reference block, reading like a gazette circular's header. */

.docket {
  border-left: 4px solid var(--gold);
  background: var(--paper-raised);
  padding: 1.1rem 1.4rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: 0 1px 2px rgba(11, 37, 69, 0.06);
}

.docket-ref {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--navy-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docket-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--navy);
  margin: 0.15rem 0 0.35rem;
}

/* ---------------- Cards & surfaces ---------------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.card-header {
  background: var(--navy-100);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: 600;
}

.panel-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  margin-bottom: 1.5rem;
}
.panel-section > .panel-heading {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--navy-100);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-section > .panel-body { padding: 1.25rem; }

/* ---------------- Buttons ---------------- */

.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--navy-700);
  border-color: var(--navy-700);
}

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: #a1782f; border-color: #a1782f; color: #fff; }

.btn-outline-primary {
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline-primary:hover {
  background: var(--navy);
  border-color: var(--navy);
}

/* ---------------- Status badges ---------------- */

.status-pill {
  display: inline-block;
  padding: 0.28em 0.75em;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-draft            { background: var(--navy-100); color: var(--navy-700); }
.status-submitted        { background: var(--gold-100); color: var(--warning); }
.status-under_scrutiny   { background: var(--gold-100); color: var(--warning); }
.status-correction_required { background: var(--danger-100); color: var(--danger); }
.status-shortlisted      { background: var(--success-100); color: var(--success); }
.status-interview_scheduled { background: var(--success-100); color: var(--success); }
.status-selected          { background: var(--success-100); color: var(--success); }
.status-offer_issued      { background: var(--success-100); color: var(--success); }
.status-offer_accepted    { background: var(--success-100); color: var(--success); }
.status-appointed         { background: var(--success-100); color: var(--success); }
.status-waitlisted        { background: var(--gold-100); color: var(--warning); }
.status-not_shortlisted   { background: var(--danger-100); color: var(--danger); }
.status-rejected          { background: var(--danger-100); color: var(--danger); }
.status-offer_declined    { background: var(--danger-100); color: var(--danger); }
.status-withdrawn         { background: #eee; color: #666; }
/* Rolling Engagement module -- statuses not already covered above */
.status-under_review     { background: var(--gold-100); color: var(--warning); }
.status-recommended      { background: var(--gold-100); color: var(--warning); }
.status-engaged           { background: var(--success-100); color: var(--success); }
.status-not_selected      { background: var(--danger-100); color: var(--danger); }
/* Applies to both advertisements.status and rolling_advertisements.status */
.status-archived          { background: #eee; color: #666; }

/* ---------------- Eligibility banner ---------------- */

.eligibility-banner {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  border: 1px solid;
  font-size: 0.94rem;
}
.eligibility-pass { background: var(--success-100); border-color: #bfe0cc; color: #164a2e; }
.eligibility-fail { background: var(--gold-100); border-color: #e6cd9c; color: var(--warning); }

/* ---------------- Forms ---------------- */

label.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--navy-700);
}
.form-control, .form-select {
  border-color: var(--line);
  border-radius: var(--radius);
}
.form-control:focus, .form-select:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 0.2rem rgba(11, 37, 69, 0.12);
}
.required-mark { color: var(--danger); }

/* ---------------- Tables ---------------- */

.table-institute thead th {
  background: var(--navy);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
}
.table-institute td, .table-institute th { vertical-align: middle; }

/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--navy);
  color: #c9d4e6;
  font-size: 0.78rem;
  border-top: 3px solid var(--gold);
}
.site-footer a { color: #e8edf5; }

/* ---------------- Utility ---------------- */

.text-navy { color: var(--navy); }
.text-gold { color: var(--gold); }
.bg-paper { background: var(--paper); }
.hairline-top { border-top: 1px solid var(--line); }
.small-caps { font-variant: small-caps; letter-spacing: 0.03em; }

/* Admin nav */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--navy);
  color: #dfe6f2;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: block;
  padding: 0.65rem 1.25rem;
  color: #c9d4e6;
  border-left: 3px solid transparent;
  font-size: 0.92rem;
}
.admin-sidebar a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.admin-sidebar a.active { border-left-color: var(--gold); color: #fff; background: rgba(255,255,255,0.06); }
.admin-content { flex: 1; padding: 1.75rem; min-width: 0; }

@media (max-width: 767px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}

/* ---------------------------------------------------------------------
   Print — the practical route to a hard copy of an official record (merit
   list, application detail) without a server-side PDF library, which isn't
   installable without Composer access in this environment. The browser's
   own "Print to PDF" does the actual PDF generation; this just makes the
   printed page look like a document rather than a web app.
--------------------------------------------------------------------- */
@media print {
  .masthead, .site-footer, .admin-sidebar, nav, form button, .btn,
  form:not(.print-keep), [data-autodismiss] {
    display: none !important;
  }
  .admin-shell { display: block; }
  .admin-content { padding: 0; }
  body { background: #fff; color: #000; }
  .panel-section { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  .docket { border-color: #000; }
  a[href]::after { content: ""; }
  table { font-size: 0.85rem; }
}
