/* FEA Overseas CRM — navy, crimson & paper, matching the feaoverseas.in redesign */
:root {
  /* Brand palette, shared with the feaoverseas.in redesign */
  --navy-950: #050e22;
  --navy-900: #0a1a3a;
  --navy-800: #0f2550;
  --navy-700: #16326a;
  --navy-600: #1e3f82;
  --blue-900: #0c2152;
  --blue-800: #102b6c;
  --blue-700: #143689;
  --blue-600: #1a44a8;
  --blue-500: #2f5bc7;
  --blue-100: #dce6fb;
  --blue-50: #eff4ff;
  --red-700: #a50d26;
  --red-600: #c8102e;
  --red-300: #f29aa4;
  --red-50: #fef2f3;
  --paper: #f6f7fa;
  --ink: #0a1a3a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: var(--paper);
  --white: #ffffff;
  --ok: #0e7a54;
  --ok-bg: #e4f6ee;
  --warn: #9a5800;
  --warn-bg: #fff3dd;
  --bad: var(--red-600);
  --bad-bg: var(--red-50);
  --info: var(--blue-700);
  --info-bg: var(--blue-50);
  --radius: 2px;
  --shadow: 0 1px 2px rgba(10, 26, 58, 0.04), 0 8px 24px -12px rgba(10, 26, 58, 0.12);
  --sidebar: 256px;
  --font-head: 'Open Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(24px, 1.2rem + 0.8vw, 30px); }
h1 strong, h2 strong { font-weight: 800; }
h2 { font-size: 18px; }
h3 { font-size: 15.5px; }
::selection { background: var(--red-600); color: #fff; }
button, input, select, textarea { font-family: inherit; }

/* Brand primitives */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--red-600);
}
.eyebrow::before { content: ''; width: 24px; height: 1px; background: currentColor; }
.eyebrow.light { color: var(--red-300); }
.rule-red { width: 48px; height: 2px; background: var(--red-600); }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 22px 0 18px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 22px 22px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.brand:hover { text-decoration: none; }
.brand img { height: 46px; width: auto; }
.brand-tag { font-size: 10.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red-600); border: 1px solid var(--red-300); padding: 3px 7px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; border-left: 2px solid transparent;
  color: var(--ink-2); font-weight: 500; font-size: 14.5px;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { background: var(--paper); color: var(--navy-900); text-decoration: none; }
.nav a.active { background: var(--paper); border-left-color: var(--red-600); color: var(--navy-900); font-weight: 600; }
.nav a.active svg { stroke: var(--red-600); }
.nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav .count { margin-left: auto; background: var(--red-600); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 14px 0; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px 10px; }
.avatar { width: 36px; height: 36px; background: var(--navy-900); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 13px; flex: none; }
.me .name { font-weight: 600; font-size: 14px; color: var(--navy-900); }
.me .email { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; max-width: 170px; white-space: nowrap; }

.main { min-width: 0; }
.topbar {
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 16px 36px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 5;
}
.topbar strong { font-family: var(--font-head); font-weight: 600; color: var(--navy-900); }
.topbar .menu-btn { display: none; }
.content { padding: 32px 36px 56px; max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1::before { content: ''; display: block; width: 36px; height: 2px; background: var(--red-600); margin-bottom: 14px; }
.page-head p { color: var(--ink-3); margin-top: 6px; }

/* ---------- Cards & grid ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 22px; }
.card-head { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.stat { padding: 20px 22px; border-top: 2px solid var(--navy-900); }
.stat .label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.stat .value { font-family: var(--font-head); font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -0.02em; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.stat.accent { background: var(--navy-900); border-color: var(--navy-900); border-top-color: var(--red-600); color: #fff; }
.stat.accent .value { color: #fff; }
.stat.accent .label { color: var(--red-300); }
.stat.accent .sub { color: rgba(255, 255, 255, 0.7); }

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(100deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-700) 100%);
  border-top: 2px solid var(--red-600);
  color: #fff; border-radius: var(--radius); padding: 30px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.hero h1 { color: #fff; }
.hero p { color: rgba(255, 255, 255, 0.75); margin-top: 8px; max-width: 560px; }

/* ---------- Pipeline ---------- */
.pipeline { display: flex; gap: 0; overflow-x: auto; padding: 4px 0; }
.pipeline .step { flex: 1; min-width: 100px; text-align: center; position: relative; font-size: 12.5px; color: var(--ink-3); }
.pipeline .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--white); margin: 0 auto 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; position: relative; z-index: 1; }
.pipeline .step::before { content: ''; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.pipeline .step:first-child::before { display: none; }
.pipeline .step.done .dot { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.pipeline .step.done::before, .pipeline .step.current::before { background: var(--navy-900); }
.pipeline .step.current .dot { border-color: var(--red-600); background: var(--red-600); color: #fff; box-shadow: 0 0 0 4px var(--red-50); }
.pipeline .step.current { color: var(--navy-900); font-weight: 600; }

.progress { height: 6px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--red-600); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.14em; background: var(--paper); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfd; }
.cell-title { font-weight: 600; color: var(--navy-900); }
.cell-sub { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; white-space: nowrap; letter-spacing: 0.02em; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--red-700); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.primary { background: var(--navy-900); color: #fff; }
.badge.muted { background: #eef1f6; color: var(--ink-2); }

/* ---------- Forms & buttons ---------- */
label { display: block; font-size: 13.5px; font-weight: 500; color: var(--navy-900); margin-bottom: 7px; }
.field { margin-bottom: 18px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--radius);
  font: inherit; color: var(--navy-900); background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-900); box-shadow: 0 0 0 1px var(--navy-900); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.check input { width: 16px; height: 16px; accent-color: var(--navy-900); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; cursor: pointer; background: #fff; color: var(--ink-2); transition: border-color 0.15s, background 0.15s, color 0.15s; }
.chip span:hover { border-color: var(--navy-900); color: var(--navy-900); }
.chip input:checked + span { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--red-600); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius); border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--navy-900); color: #fff; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--navy-600); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--red-600); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.red { background: var(--red-600); }
.btn.red:hover { background: var(--red-700); }
.btn.secondary { background: transparent; color: var(--navy-900); border-color: var(--navy-900); }
.btn.secondary:hover { background: var(--navy-900); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--paper); color: var(--navy-900); }
.btn.danger { background: var(--white); color: var(--red-600); border-color: var(--red-300); }
.btn.danger:hover { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.btn.light { background: #fff; color: var(--navy-900); }
.btn.light:hover { background: var(--blue-50); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-700); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red-600); }
.link-btn.small { font-size: 13px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters select { width: auto; min-width: 150px; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 18px; border-left: 2px solid; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.alert.success { background: var(--ok-bg); border-color: var(--ok); color: #0b6044; }
.alert.error { background: var(--red-50); border-color: var(--red-600); color: var(--red-700); }
.alert.info { background: var(--blue-50); border-color: var(--blue-700); color: var(--blue-800); }
.alert ul { margin: 0; padding-left: 18px; }

.lock {
  border: 1px solid var(--line); border-top: 2px solid var(--red-600); background: var(--white); border-radius: var(--radius);
  padding: 22px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.lock .icon { width: 44px; height: 44px; background: var(--navy-900); display: grid; place-items: center; flex: none; }
.lock .icon svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; }

.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- Program cards ---------- */
.programs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.program { display: flex; flex-direction: column; padding: 20px; transition: border-color 0.2s, box-shadow 0.2s; }
.program:hover { border-color: var(--line-2); box-shadow: 0 1px 2px rgba(10, 26, 58, 0.04), 0 16px 32px -16px rgba(10, 26, 58, 0.2); }
.uni-line, .program .uni { font-size: 11.5px; color: var(--red-600); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.program h3 { margin-top: 6px; }
.program .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.program .meta b { color: var(--ink-3); font-weight: 500; }
.program .foot { margin-top: auto; padding-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pill { font-size: 11.5px; font-weight: 600; padding: 3px 9px; background: var(--paper); color: var(--navy-900); border: 1px solid var(--line); }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pager a, .pager span { padding: 7px 13px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--navy-900); }
.pager a:hover { border-color: var(--navy-900); text-decoration: none; }
.pager .current { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 11px 14px; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--navy-900); border-color: var(--red-600); }
.tabs a:hover { text-decoration: none; color: var(--navy-900); }

dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 12px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--ink-3); }
dl.kv dd { margin: 0; font-weight: 500; color: var(--navy-900); }

details.inline summary { cursor: pointer; color: var(--blue-700); font-weight: 600; font-size: 13px; list-style: none; }
details.inline summary::-webkit-details-marker { display: none; }
details.inline[open] summary { margin-bottom: 10px; }

pre.instructions { white-space: pre-wrap; font: inherit; background: var(--paper); border-left: 2px solid var(--navy-900); padding: 12px 16px; margin: 0; }

/* ---------- Documents ---------- */
.stat-label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.doc-progress-value { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--navy-900); margin-top: 4px; }
.doc-progress-value .muted { font-size: 15px; font-weight: 500; font-family: var(--font-body); }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 16px; align-items: start; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.doc-item:last-child { border-bottom: 0; }
.doc-item:target { background: var(--blue-50); }
.doc-status { margin-top: 2px; }
.doc-files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.doc-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; }
.doc-name { font-weight: 500; word-break: break-all; }
.remarks { flex-basis: 100%; list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.remarks li { background: var(--paper); border-left: 2px solid var(--navy-900); padding: 7px 12px; font-size: 13px; }
.remarks.rejected li:last-child { background: var(--red-50); border-left-color: var(--red-600); }
.doc-files .remarks li { display: block; }
.remark-meta { font-size: 11.5px; color: var(--ink-3); }
.remark-meta strong { color: var(--navy-900); font-weight: 600; }
.remark-text { color: var(--ink); margin-top: 2px; white-space: pre-line; }
.doc-group-title { background: var(--paper); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding: 8px 22px; border-bottom: 1px solid var(--line); }
.doc-review-item { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.doc-review-item:target { background: var(--blue-50); }
.remark-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.remark-form input { flex: 1; min-width: 220px; padding: 7px 12px; font-size: 13.5px; }
.remark-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-upload label.btn { margin: 0; cursor: pointer; }
.doc-panel { gap: 0; }
.doc-panel > .doc-attention { border-left: 1px solid var(--line); }
.doc-todo { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 2px; }
.doc-todo li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.doc-todo li:last-child { border-bottom: 0; }

.order-btns { display: inline-flex; gap: 2px; }
.order-btns button { width: 28px; height: 28px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 12px; line-height: 1; }
.order-btns button:hover:not(:disabled) { border-color: var(--navy-900); color: var(--navy-900); }
.order-btns button:disabled { opacity: 0.35; cursor: default; }
tr.group-row td { background: var(--paper); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding: 8px 18px; }
tr.group-row a { text-transform: none; letter-spacing: 0; font-weight: 500; }
tr.retired td { opacity: 0.6; }
tr:target td { background: var(--blue-50); }
.admin-upload { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.admin-upload .full { grid-column: 1 / -1; }
.doc-admin-actions { display: flex; gap: 14px; align-items: center; margin-top: 8px; }

/* ---------- Agreements ---------- */
.agreement-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.sign-card { position: sticky; top: 84px; }
.letter { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--navy-900); box-shadow: var(--shadow); padding: 40px 48px 48px; font-size: 15px; line-height: 1.7; color: #1e293b; }
.letter-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--navy-900); }
.letter-head img { height: 54px; }
.letter-office { text-align: right; font-size: 12.5px; line-height: 1.5; color: var(--blue-700); }
.letter-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.letter-meta strong { color: var(--navy-900); }
.letter-title { margin-top: 26px; font-size: 22px; }
.letter-title::after { content: ''; display: block; width: 40px; height: 2px; background: var(--red-600); margin-top: 10px; }
.letter-dear { margin-top: 20px; color: var(--navy-900); }
.letter section { margin-top: 18px; }
.letter h3 { font-size: 15.5px; margin-bottom: 6px; }
.letter p { margin: 0 0 10px; text-align: justify; }
.letter ul { margin: 4px 0 12px; padding-left: 20px; }
.letter li { margin: 2px 0; }
.letter strong { color: var(--navy-900); }
.blank { display: inline-block; min-width: 120px; padding: 0 6px; border-bottom: 1.5px dashed var(--red-600); background: var(--red-50); color: var(--red-700); font-weight: 600; }
.blank.filled { border-bottom-style: solid; border-bottom-color: var(--navy-900); background: var(--blue-50); color: var(--navy-900); }
.letter-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 36px; }
.sign-label { font-size: 12px; color: var(--ink-3); }
.sign-img { height: 70px; border-bottom: 1px solid var(--line-2); display: flex; align-items: flex-end; }
.sign-img img { max-height: 66px; max-width: 100%; }
.sign-name { font-weight: 600; color: var(--navy-900); margin-top: 6px; }
.sign-date { font-size: 12.5px; color: var(--ink-3); }
.sig-pad { position: relative; border: 1px solid var(--line-2); background: #fff; height: 160px; touch-action: none; }
.sig-pad canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.sig-pad::after { content: ''; position: absolute; left: 20px; right: 20px; bottom: 36px; border-bottom: 1px dashed var(--line-2); pointer-events: none; }
.sig-hint { position: absolute; left: 20px; bottom: 14px; font-size: 12px; color: #94a3b8; pointer-events: none; }
.sig-pad.signed .sig-hint { display: none; }
.sig-pad.invalid { border-color: var(--red-600); box-shadow: 0 0 0 1px var(--red-600); }
.action-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--red-600); padding: 20px 24px; box-shadow: var(--shadow); }

.pay-online label { margin-bottom: 4px; }
.ti-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ti-actions details[open] { align-self: stretch; }
.doc-cancel { display: flex; gap: 6px; margin-top: 6px; min-width: 280px; }
.doc-cancel input { padding: 6px 10px; font-size: 13px; }

/* ---------- Notifications ---------- */
.bell { position: relative; display: grid; place-items: center; width: 38px; height: 38px; color: var(--ink-2); border: 1px solid transparent; }
.bell:hover, .bell.active { color: var(--navy-900); background: var(--paper); text-decoration: none; }
.bell svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-count { position: absolute; top: 3px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; background: var(--red-600); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums; }
.notes { list-style: none; margin: 0; padding: 0; }
.note { border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note a { display: flex; gap: 14px; align-items: flex-start; padding: 14px 22px; color: inherit; border-left: 2px solid transparent; }
.note a:hover { background: var(--paper); text-decoration: none; }
.note.unread a { border-left-color: var(--red-600); background: #fbfcfe; }
.note-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: none; background: var(--blue-50); color: var(--blue-700); }
.note-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.note-icon.document_verified { background: var(--ok-bg); color: var(--ok); }
.note-icon.document_rejected { background: var(--red-50); color: var(--red-600); }
.note-icon.document_removed { background: var(--red-50); color: var(--red-600); }
.note-icon.agreement_issued { background: var(--warn-bg); color: var(--warn); }
.note-icon.agreement_signed { background: var(--ok-bg); color: var(--ok); }
.note-icon.agreement_voided { background: var(--paper); color: var(--ink-3); }
.note-icon.tax_invoice_issued { background: var(--ok-bg); color: var(--ok); }
.note-icon.document_requested { background: var(--warn-bg); color: var(--warn); }
.note-icon.shortlist_shared { background: var(--warn-bg); color: var(--warn); }
.note-icon.application_update { background: var(--ok-bg); color: var(--ok); }
.note-icon.document_uploaded { background: var(--paper); color: var(--navy-900); }
.note-text { flex: 1; min-width: 0; }
.note-title { display: block; font-size: 14px; color: var(--ink-2); }
.note.unread .note-title { color: var(--navy-900); font-weight: 600; }
.note-body { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 60%, var(--navy-700) 100%);
  color: #fff; padding: 52px 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art > * { position: relative; }
.auth-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 10%, rgba(200, 16, 46, 0.18), transparent 45%);
}
.auth-art h1 { color: #fff; font-size: clamp(28px, 1.25rem + 1.6vw, 40px); line-height: 1.12; max-width: 480px; margin-top: 22px; }
.auth-art p { color: rgba(255,255,255,0.75); margin-top: 18px; max-width: 440px; font-size: 16.5px; line-height: 1.6; }
.auth-art .eyebrow { font-size: 11.5px; margin-top: 0; }
.auth-art ul { list-style: none; padding: 26px 0 0; margin: 30px 0 0; display: grid; gap: 14px; border-top: 1px solid rgba(255,255,255,0.15); max-width: 460px; }
.auth-art li { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,0.88); }
.auth-art li::before { content: ''; width: 6px; height: 6px; background: var(--red-600); flex: none; }
.auth-art .logo-chip { background: #fff; padding: 10px 16px; display: inline-block; }
.auth-art .logo-chip img { height: 48px; display: block; }
.auth-art .small { color: rgba(255,255,255,0.5); font-size: 12.5px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form .box { width: 100%; max-width: 410px; }
.auth-form h2 { font-size: clamp(26px, 1.45rem + 0.6vw, 30px); margin-top: 14px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-2); margin: 26px 0; }
.role-switch a { text-align: center; padding: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.role-switch a + a { border-left: 1px solid var(--line-2); }
.role-switch a.active { background: var(--navy-900); color: #fff; }
.role-switch a:hover { text-decoration: none; }
.role-switch a:not(.active):hover { color: var(--navy-900); background: var(--paper); }

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--paper); }
.error-page .card { border-top: 2px solid var(--red-600); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agreement-layout { grid-template-columns: 1fr; }
  .sign-card { position: static; }
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar); z-index: 20; transform: translateX(-100%); transition: transform 0.2s; box-shadow: 0 40px 80px -20px rgba(5, 14, 34, 0.6); }
  body.nav-open .sidebar { transform: none; }
  .topbar { padding: 12px 16px; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 22px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 20px; }
  .auth-art h1 { font-size: 26px; }
  .auth-art ul { display: none; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  .doc-item { grid-template-columns: 1fr auto; padding: 14px 16px; }
  .doc-item .doc-status { grid-column: 2; grid-row: 1; }
  .doc-item .doc-upload { grid-column: 1 / -1; }
  .doc-panel > .doc-attention { border-left: 0; border-top: 1px solid var(--line); }
  .admin-upload { grid-template-columns: 1fr; }
  .letter { padding: 24px 18px 28px; font-size: 14.5px; }
  .letter-head { flex-direction: column; }
  .letter-office { text-align: left; }
  .letter-signs { grid-template-columns: 1fr; gap: 24px; }
  dl.kv dd { margin-bottom: 8px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
  .programs { grid-template-columns: 1fr; }
  .filters select { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Shortlisting sheet & applications ---------- */
.sheet { font-size: 12.5px; }
.sheet th { white-space: nowrap; }
.sheet td { min-width: 110px; max-width: 220px; vertical-align: top; }
.sheet td:first-child { min-width: 0; color: var(--ink-3); }
.sheet .sticky { position: sticky; left: 0; z-index: 1; background: var(--white); min-width: 220px; box-shadow: 1px 0 0 var(--line); }
.sheet thead .sticky { background: var(--blue-50); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
tr.phase-opted-in > td { background: var(--ok-bg); }
tr.phase-opted-out > td { background: var(--bad-bg); }
.sheet tr.phase-opted-in > td.sticky { background: var(--ok-bg); }
.sheet tr.phase-opted-out > td.sticky { background: var(--bad-bg); }
tr.phase-opted-in > td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
tr.phase-opted-out > td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.phase-draft > td, tr.phase-suggested > td { color: var(--ink-2); }

.counsel { background: var(--blue-50); border-left: 3px solid var(--blue-600); padding: 12px 14px; display: grid; gap: 8px; font-size: 13.5px; }
.counsel-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--blue-700); }
.answer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.answer input[type=text] { min-width: 200px; }
.choice { display: inline-flex; border: 1px solid var(--line-2); flex: none; }
.choice label { margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 9px 18px; font-weight: 600; color: var(--ink-2); background: var(--white); }
.choice label + label span { border-left: 1px solid var(--line-2); }
.choice .yes input:checked + span { background: var(--ok); color: #fff; }
.choice .no input:checked + span { background: var(--bad); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--blue-500); outline-offset: -2px; }
.answer-card:has(.yes input:checked) { border-left: 3px solid var(--ok); }
.answer-card:has(.no input:checked) { border-left: 3px solid var(--bad); }
.answer-bar { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 18px; }
.timeline li { position: relative; }
.timeline li::before { content: ''; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--blue-600); }
.timeline li:first-child::before { background: var(--blue-600); }
.timeline .badge { margin-right: 6px; }
.timeline-remark { margin-top: 6px; white-space: pre-wrap; }
.shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.shot { display: block; width: 120px; height: 84px; border: 1px solid var(--line); overflow: hidden; background: var(--paper); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot:hover { border-color: var(--blue-500); }
.shot.file { display: grid; place-content: center; text-align: center; font-weight: 700; color: var(--red-600); padding: 6px; }
.shot.file span { display: block; font-size: 11px; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 106px; }
@media (max-width: 860px) {
  .answer-bar { position: static; }
  .answer-bar .row { width: 100%; }
  .answer-bar .btn { flex: 1; }
}

/* ---------- Calendar ---------- */
.agenda-day { border-bottom: 1px solid var(--line); }
.agenda-day:last-child { border-bottom: 0; }
.agenda-date { display: flex; align-items: center; gap: 10px; padding: 12px 22px 6px; font-family: var(--font-head); font-weight: 700; font-size: 13.5px; color: var(--navy-900); }
.agenda-day.today .agenda-date { color: var(--blue-700); }
.agenda-add { margin-left: auto; font-family: var(--font-body); font-weight: 500; opacity: 0; transition: opacity 0.15s; }
.agenda-day:hover .agenda-add, .agenda-add:focus { opacity: 1; }
.agenda-empty { padding: 0 22px 12px; font-size: 13px; color: var(--ink-3); }
.event { display: flex; align-items: center; gap: 14px; padding: 10px 22px; border-left: 3px solid transparent; }
.event + .event { border-top: 1px dashed var(--line); }
.event.crm { border-left-color: var(--blue-600); background: var(--blue-50); }
.event-time { flex: none; width: 150px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.event-main { flex: 1; min-width: 0; }
.event-main .cell-title { overflow-wrap: anywhere; }
.event-actions { display: flex; gap: 6px; flex: none; }
tr.faded td { opacity: 0.6; }
.steps { padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.ticks li::before { content: '✓'; color: var(--ok); font-weight: 700; margin-right: 8px; }
.copy-box { display: block; background: var(--paper); border: 1px solid var(--line); padding: 8px 10px; font-size: 12.5px; overflow-wrap: anywhere; white-space: pre-wrap; margin: 4px 0 0; }
.note-icon.meeting_scheduled { background: var(--blue-50); color: var(--blue-700); }
.note-icon.meeting_cancelled { background: var(--red-50); color: var(--red-600); }
@media (max-width: 640px) {
  .event { flex-wrap: wrap; gap: 4px 12px; padding: 10px 16px; }
  .event-time { width: auto; flex-basis: 100%; }
  .agenda-date { padding: 12px 16px 6px; }
  .agenda-add { opacity: 1; }
  .agenda-empty { padding: 0 16px 12px; }
}
.cal-nav { flex-wrap: nowrap; flex: none; gap: 4px; }
@media (max-width: 640px) { .cal-title { font-size: 16px; } }

.note-icon.mailbox_mail { background: var(--blue-50); color: var(--blue-700); }
.note-icon.mailbox_error { background: var(--red-50); color: var(--red-600); }

/* ---------- Shortlisting panel ---------- */
.filter-cards { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.fcard { background: var(--white); border: 1px solid var(--line); border-top: 2px solid var(--line-2); padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
.fcard:hover { box-shadow: var(--shadow); }
.fcard.active { border-top-color: var(--navy-900); background: var(--blue-50); }
.fcard.alert-card { border-top-color: var(--red-600); }
.fcard.alert-card .fcard-n { color: var(--red-600); }
.fcard-n { font-family: var(--font-head); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.fcard-l { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.toolbar { display: flex; gap: 8px; align-items: center; }
.pips { display: flex; flex-wrap: wrap; gap: 5px; }
.pip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--paper); color: var(--ink-2); }
.pip.muted { background: var(--paper); color: var(--ink-3); }
.pip.warn { background: var(--warn-bg); color: var(--warn); }
.pip.info { background: var(--info-bg); color: var(--info); }
.pip.ok { background: var(--ok-bg); color: var(--ok); }
.pip.bad { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 1100px) { .filter-cards { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .filter-cards { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Dialog + program picker ---------- */
dialog { border: none; border-radius: 4px; padding: 0; width: min(760px, 94vw); max-height: 88vh; box-shadow: 0 24px 60px -20px rgba(10, 26, 58, 0.5); color: var(--ink); }
dialog::backdrop { background: rgba(10, 26, 58, 0.45); }
.picker form { display: flex; flex-direction: column; max-height: 88vh; }
.picker-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.picker-head h2 { margin: 0; }
.icon-btn { border: none; background: var(--paper); width: 30px; height: 30px; border-radius: 4px; cursor: pointer; color: var(--ink-2); font-size: 15px; flex: none; }
.icon-btn:hover { background: var(--line); }
.picker-filters { display: flex; gap: 8px; padding: 14px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.picker-filters .grow { min-width: 180px; }
.picker-list { overflow-y: auto; padding: 6px 12px; flex: 1; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 4px; cursor: pointer; }
.pick:hover { background: var(--blue-50); }
.pick input { width: 17px; height: 17px; flex: none; }
.pick-main { flex: 1; min-width: 0; }
.pick-name { font-weight: 600; display: block; color: var(--navy-900); }
.pick-tags { display: flex; gap: 5px; flex: none; }
.picker-none { padding: 24px; text-align: center; }
.picker-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--paper); }
@media (max-width: 560px) { .pick-tags { display: none; } .picker-filters .grow { flex-basis: 100%; } }

/* ---------- University logo ---------- */
.logo-field { display: flex; gap: 14px; align-items: flex-start; }
.logo-preview { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 4px; flex: none; }
.uni-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid var(--line); padding: 2px; flex: none; }
.uni-logo.sm { width: 26px; height: 26px; }
.cell-with-logo { display: flex; align-items: center; gap: 10px; }
.mb-2 { margin-bottom: 10px; }

/* ---------- User control (RBAC) ---------- */
.perm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; }
.perm { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 13.5px; }
.perm:hover { background: var(--blue-50); border-color: var(--line-2); }
.perm input { width: 16px; height: 16px; flex: none; }
.role-badge { display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--warn); background: var(--warn-bg); padding: 1px 7px; border-radius: 3px; }
@media (max-width: 760px) { .perm-grid { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ */
/* Data protection: discourage copy/selection and tile a per-user      */
/* watermark so any screenshot is traceable to the account. Deterrent   */
/* only — the web cannot truly block OS screenshots.                    */
/* ------------------------------------------------------------------ */
body.protected {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Keep real form controls selectable/usable. */
body.protected input,
body.protected textarea,
body.protected select,
body.protected [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
body.protected img { -webkit-user-drag: none; user-drag: none; }

/* Discourage clean printouts (Ctrl/Cmd+P) of sensitive pages. */
@media print {
  body.protected .main { display: none !important; }
  body.protected::after {
    content: "Printing is disabled for this page.";
    display: block;
    padding: 40px;
    font: 600 16px 'Open Sans', sans-serif;
    color: #0A1A3A;
  }
}

/* HR status pills (leave / employee / document / attendance states). */
.pill.pending { background: #fef3c7; color: #92400e; }
.pill.approved, .pill.active, .pill.signed, .pill.present { background: #dcfce7; color: #166534; }
.pill.rejected, .pill.absent, .pill.void, .pill.exited { background: #fee2e2; color: #991b1b; }
.pill.cancelled, .pill.sent, .pill.onboarding, .pill.half_day, .pill.on_leave, .pill.holiday { background: #e2e8f0; color: #334155; }
