/* =========================================================
   Medicred Portal — style.css
   Light Medicred Liquid Glass edition
   Brand: #009FDA
   Font: DM Sans + DM Mono via Google Fonts
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font: Omnes-Pro, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: Omnes-Pro, ui-monospace, SFMono-Regular, Menlo, monospace;

  --brand: #009FDA;
  --brand-dark: #007eaf;
  --brand-soft: rgba(0, 159, 218, 0.10);
  --brand-glow: rgba(0, 159, 218, 0.22);

  --sky: #eaf8ff;
  --aqua: #d7f4ff;
  --blue-wash: #f3fbff;

  --ink: #122033;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;

  --glass: rgba(255,255,255,0.62);
  --glass-strong: rgba(255,255,255,0.82);
  --glass-dim: rgba(255,255,255,0.42);
  --glass-border: rgba(255,255,255,0.82);
  --line: rgba(148, 163, 184, 0.24);
  --line-strong: rgba(148, 163, 184, 0.38);

  --green-t: #057a55; --green-bg: rgba(16, 185, 129, 0.12); --green-br: rgba(16, 185, 129, 0.22);
  --amber-t: #a15c07; --amber-bg: rgba(245, 158, 11, 0.14); --amber-br: rgba(245, 158, 11, 0.25);
  --red-t: #b42318; --red-bg: rgba(239, 68, 68, 0.10); --red-br: rgba(239, 68, 68, 0.22);
  --info-t: #075985; --info-bg: rgba(14, 165, 233, 0.11); --info-br: rgba(14, 165, 233, 0.24);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-pill: 999px;

  --shadow-card: 0 18px 50px rgba(15, 35, 55, 0.08), 0 1px 0 rgba(255,255,255,0.95) inset;
  --shadow-soft: 0 8px 26px rgba(15, 35, 55, 0.06), 0 1px 0 rgba(255,255,255,0.85) inset;
  --shadow-btn: 0 8px 24px rgba(0,159,218,0.22), 0 1px 0 rgba(255,255,255,0.32) inset;
  --shadow-btn-h: 0 12px 34px rgba(0,159,218,0.30), 0 1px 0 rgba(255,255,255,0.34) inset;

  --topbar-h: 64px;
}

html {
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background:
    radial-gradient(ellipse 55% 50% at 12% 0%, rgba(0,159,218,0.20) 0%, transparent 58%),
    radial-gradient(ellipse 48% 48% at 90% 8%, rgba(111, 210, 245, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 65% 55% at 60% 95%, rgba(198, 238, 250, 0.48) 0%, transparent 62%),
    linear-gradient(135deg, #f7fcff 0%, #eef8fd 42%, #f8fbff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { min-height: 100vh; color: var(--ink); }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: none; }

h1 { font-size: clamp(1.75rem, 3vw, 2.65rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; color: var(--ink); }
h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
p { line-height: 1.6; color: var(--ink-2); }
.muted { color: var(--muted); font-size: 0.9rem; }

.container {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 72px;
}
.container.narrow { max-width: 780px; }

/* Topbar */
.topbar {
  min-height: var(--topbar-h);
  background: rgba(255,255,255,0.66);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border-bottom: 1px solid rgba(255,255,255,0.84);
  box-shadow: 0 1px 0 rgba(148,163,184,0.12), 0 12px 30px rgba(15,35,55,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 26px;
  gap: 16px;
}

.topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-brand::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #65cdf1);
  box-shadow: 0 10px 26px var(--brand-glow);
  flex: 0 0 auto;
}
.topbar-brand strong { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.topbar-brand .muted {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-brand .muted::before { content: "·"; margin: 0 9px; color: #b5c3d1; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 15px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(255,255,255,0.82);
  box-shadow: 0 8px 22px rgba(15,35,55,0.05);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}
.nav-pill:hover {
  transform: translateY(-1px);
  color: var(--brand-dark);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 14px 34px rgba(15,35,55,0.09);
}
.nav-pill-ghost { color: var(--muted); background: transparent; border-color: transparent; box-shadow: none; }
.nav-pill-ghost:hover { color: var(--red-t); background: rgba(254, 226, 226, 0.55); }

/* Page heading */
.page-heading { margin-bottom: 28px; }
.page-heading p.muted { margin-top: 8px; }

.split-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.split-heading .pill-stack { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 4px; }

/* Cards */
.detail-card,
.panel-form,
.summary-card,
.table-card,
.alert {
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
}

.detail-card {
  border-radius: var(--r-xl);
  padding: 26px 30px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.detail-card::before,
.panel-form::before,
.table-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.92), transparent);
  pointer-events: none;
}
.detail-card h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--brand-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-card h2::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(0,159,218,0.18);
}

/* Details */
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px 28px; }
.details-grid dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 5px;
}
.details-grid dd { font-size: 1rem; font-weight: 600; color: var(--ink); }

/* Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgba(255,255,255,0.56);
  border: 1px solid rgba(255,255,255,0.78);
  color: var(--ink-2);
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
}
.status-pill.neutral { color: var(--muted); background: rgba(241,245,249,0.76); }
.status-pill.submitted,
.status-pill.success { background: var(--green-bg); border-color: var(--green-br); color: var(--green-t); }
.status-pill.pending,
.status-pill.warning { background: var(--amber-bg); border-color: var(--amber-br); color: var(--amber-t); }
.status-pill.failed,
.status-pill.danger { background: var(--red-bg); border-color: var(--red-br); color: var(--red-t); }
.status-pill.info { background: var(--info-bg); border-color: var(--info-br); color: var(--info-t); }

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 20px;
}
.alert-info { background: rgba(239,248,255,0.72); color: var(--info-t); border-color: var(--info-br); }
.alert-error { background: rgba(255,241,240,0.78); color: var(--red-t); border-color: var(--red-br); }
.alert-success { background: rgba(236,253,243,0.76); color: var(--green-t); border-color: var(--green-br); }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 24px;
  transition: transform 150ms ease, color 150ms ease;
}
.back-link:hover { transform: translateX(-2px); color: var(--brand); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.button,
a.button,
button[type="submit"],
.button-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
  text-decoration: none;
  border: none;
  background: linear-gradient(135deg, #20b7ec, var(--brand));
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.button-small { min-height: 32px; padding: 0 14px; font-size: 0.8rem; }
.button:hover, a.button:hover, button[type="submit"]:hover, .button-small:hover {
  color: #fff;
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow: var(--shadow-btn-h);
}
.button:active, a.button:active, button[type="submit"]:active, .button-small:active { transform: scale(0.99); }
button[type="submit"] { width: 100%; border-radius: var(--r-lg); min-height: 48px; margin-top: 4px; }

/* Summary */
.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
  max-width: 920px;
}
.summary-card {
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.summary-card::after {
  content: "";
  position: absolute;
  top: -34px;
  right: -28px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--brand-soft);
}
.summary-card span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--muted);
}
.summary-card strong {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--ink);
}
.summary-card.warning { background: rgba(255,251,235,0.72); border-color: var(--amber-br); }
.summary-card.warning span,
.summary-card.warning strong { color: var(--amber-t); }

/* Table */
.table-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,159,218,0.62) rgba(255,255,255,0.54);
}
.table-card::-webkit-scrollbar { height: 13px; }
.table-card::-webkit-scrollbar-track {
  margin: 0 22px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.54);
  border: 1px solid rgba(255,255,255,0.82);
  box-shadow: inset 0 1px 2px rgba(15,35,55,0.05);
}
.table-card::-webkit-scrollbar-thumb {
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, rgba(0,159,218,0.76), rgba(105,208,242,0.92));
  border: 3px solid rgba(255,255,255,0.78);
  box-shadow: 0 6px 18px rgba(0,159,218,0.16);
}
.table-card::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(0,126,175,0.95), rgba(0,159,218,0.95));
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  font-size: 0.91rem;
}
thead { background: rgba(255,255,255,0.32); }
thead th {
  padding: 13px 18px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid rgba(148,163,184,0.20);
  transition: background 120ms ease;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(0,159,218,0.055); }
tbody td {
  padding: 16px 18px;
  color: var(--ink-2);
  vertical-align: middle;
}
tbody td:nth-child(6),
tbody td:nth-child(7),
tbody td:nth-child(8),
tbody td:nth-child(9) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.application-link {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--brand-dark);
  letter-spacing: -0.01em;
  background: rgba(0,159,218,0.11);
  border: 1px solid rgba(0,159,218,0.22);
  padding: 6px 12px;
  border-radius: 10px;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.application-link:hover,
tbody tr:hover .application-link {
  background: rgba(0,159,218,0.17);
  border-color: rgba(0,159,218,0.34);
  box-shadow: 0 8px 22px rgba(0,159,218,0.12);
  transform: translateY(-1px);
}
.application-link span { display: none; }

.date-nowrap { white-space: nowrap; display: inline-block; }
.figure { font-family: var(--mono); font-size: 0.88rem; color: var(--ink-2); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 15px; }
.form label,
.panel-form label,
.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
}

input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="range"]),
textarea,
select {
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--ink);
  background: rgba(255,255,255,0.66);
  border: 1px solid rgba(255,255,255,0.86);
  border-radius: var(--r-md);
  padding: 0 14px;
  min-height: 44px;
  width: 100%;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.85) inset, 0 1px 4px rgba(15,35,55,0.04);
}
textarea {
  min-height: 118px;
  height: auto;
  padding: 11px 14px;
  resize: vertical;
  line-height: 1.55;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
input:focus,
textarea:focus,
select:focus {
  background: rgba(255,255,255,0.88);
  border-color: rgba(0,159,218,0.48);
  box-shadow: 0 0 0 4px rgba(0,159,218,0.12), 0 1px 0 rgba(255,255,255,0.95) inset;
}
input::placeholder,
textarea::placeholder { color: #9ca3af; }

/* Panel form */
.panel-form {
  border-radius: var(--r-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.readonly-summary {
  background: rgba(255,255,255,0.44);
  border: 1px solid rgba(255,255,255,0.74);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px 22px;
}
.readonly-summary > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.readonly-summary span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.readonly-summary strong {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Fieldsets */
fieldset {
  border: 1px solid rgba(255,255,255,0.74);
  border-radius: var(--r-md);
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: rgba(255,255,255,0.42);
}
fieldset legend {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 0 7px;
  margin-bottom: 4px;
}
label.inline {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  padding: 2px 0;
}
label.inline input[type="radio"],
label.inline input[type="checkbox"],
label.required-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  flex-shrink: 0;
  cursor: pointer;
}
label.required-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--ink-2);
  cursor: pointer;
}

/* Auth */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  background: rgba(255,255,255,0.68);
  backdrop-filter: blur(38px) saturate(170%);
  -webkit-backdrop-filter: blur(38px) saturate(170%);
  border: 1px solid rgba(255,255,255,0.86);
  border-radius: var(--r-2xl);
  padding: 44px 40px 40px;
  width: 100%;
  max-width: 430px;
  box-shadow: 0 22px 70px rgba(15,35,55,0.12), 0 1px 0 rgba(255,255,255,0.96) inset;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,159,218,0.55), transparent);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 8px; }
.auth-card > .muted { margin-bottom: 28px; display: block; line-height: 1.55; }

/* Responsive */
@media (max-width: 900px) {
  .container { width: min(100% - 32px, 760px); padding-top: 28px; }
  .topbar { align-items: flex-start; flex-direction: column; height: auto; padding: 12px 18px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .topbar-brand { width: 100%; flex-wrap: wrap; }
  .topbar-brand .muted::before { display: none; }
  .summary-row { max-width: none; }
}

@media (max-width: 640px) {
  .container { width: min(100% - 24px, 640px); padding-bottom: 48px; }
  .auth-card { padding: 32px 24px 28px; }
  .detail-card { padding: 22px 18px; }
  .panel-form { padding: 22px 18px; }
  .summary-row { grid-template-columns: 1fr; }
  .split-heading { flex-direction: column; }
  h1 { font-size: 1.55rem; }
  thead th, tbody td { padding: 12px 14px; }
  table { min-width: 980px; }
}


/* Dashboard column update: hide removed finance columns and keep light table usable */
.table-card table {
  min-width: 880px;
}

.table-card th:nth-child(1), .table-card td:nth-child(1) { width: 17%; }
.table-card th:nth-child(2), .table-card td:nth-child(2) { width: 21%; }
.table-card th:nth-child(3), .table-card td:nth-child(3) { width: 22%; }
.table-card th:nth-child(4), .table-card td:nth-child(4) { width: 18%; }
.table-card th:nth-child(5), .table-card td:nth-child(5) { width: 14%; }
.table-card th:nth-child(6), .table-card td:nth-child(6) { width: 8%; }

.table-card td:nth-child(5),
.table-card td:nth-child(6) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1180px) {
  .table-card table {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .table-card table {
    min-width: 860px;
  }
}


/* Logo topbar update */
.topbar-brand::before {
  display: none;
}

.topbar-logo {
  display: block;
  width: auto;
  height: 34px;
  max-width: 170px;
  object-fit: contain;
  border-radius: 0;
}

.topbar-brand {
  gap: 16px;
}

.topbar-brand .muted {
  padding-left: 14px;
  border-left: 1px solid rgba(148, 163, 184, 0.26);
  font-weight: 600;
}

.topbar-brand .muted::before {
  display: none;
}

@media (max-width: 640px) {
  .topbar-logo {
    height: 30px;
    max-width: 145px;
  }

  .topbar-brand .muted {
    padding-left: 0;
    border-left: 0;
    width: 100%;
  }
}

/* Application page GDPR clean-up */
.detail-card .details-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Terminal/closed application confirmation state */
.status-pill.not-applicable,
.status-pill.na {
  background: rgba(241, 245, 249, 0.76);
  border-color: rgba(148, 163, 184, 0.24);
  color: #64748b;
}


/* ─── Finance summary cards ───────────────────────────── */
.summary-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-width: 1180px;
}

.summary-card.finance-card {
  border-color: rgba(0, 159, 218, 0.18);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.72), rgba(255,255,255,0.50)),
    rgba(0, 159, 218, 0.055);
}

.summary-card.finance-card span {
  color: rgba(0, 126, 175, 0.78);
}

.summary-card.finance-card strong {
  color: #007eaf;
  font-size: clamp(1.55rem, 2vw, 2rem);
  letter-spacing: -0.045em;
  white-space: nowrap;
}

/* ─── Stage / confirmation colours ────────────────────── */
.status-pill.not-applicable,
.status-pill.na {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.18);
  color: #64748b;
}

.status-pill.stage-pill {
  border-width: 1px;
}

.status-pill.stage-approved {
  background: rgba(0, 159, 218, 0.11);
  border-color: rgba(0, 159, 218, 0.23);
  color: #007eaf;
}

.status-pill.stage-live {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.24);
  color: #047857;
}

.status-pill.stage-action {
  background: rgba(245, 158, 11, 0.13);
  border-color: rgba(245, 158, 11, 0.25);
  color: #a15c07;
}

.status-pill.stage-received {
  background: rgba(99, 102, 241, 0.10);
  border-color: rgba(99, 102, 241, 0.20);
  color: #4f46e5;
}

.status-pill.stage-terminal {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.22);
  color: #b42318;
}

.status-pill.stage-neutral {
  background: rgba(241, 245, 249, 0.82);
  border-color: rgba(148, 163, 184, 0.22);
  color: #475569;
}

tbody td,
.summary-card strong,
.application-link,
.status-pill {
  font-family: var(--font);
}


/* Medicred fee summary card */
.summary-card.finance-card strong {
  white-space: nowrap;
}


/* ─── Summary layout refinement ───────────────────────── */
.summary-row-status {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  max-width: 920px;
}

.summary-row-finance {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  max-width: 920px;
  margin-bottom: 26px;
}

.summary-card.finance-card-large {
  min-height: 126px;
  padding: 22px 24px;
}

.summary-card.finance-card-large strong {
  font-size: clamp(2rem, 3vw, 2.65rem);
  line-height: 1;
  margin-top: 2px;
}

.summary-card.finance-card-large small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  margin-top: 8px;
  max-width: 320px;
}

@media (max-width: 900px) {
  .summary-row-status,
  .summary-row-finance {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .summary-row-finance {
    margin-top: 0;
  }
}


/* ─── Dashboard overview with graph ───────────────────── */
.dashboard-overview {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 26px;
}

.overview-left {
  min-width: 0;
}

.dashboard-overview .summary-row {
  max-width: none;
}

.dashboard-overview .summary-row-status {
  margin-bottom: 14px;
}

.dashboard-overview .summary-row-finance {
  margin-bottom: 0;
}

.chart-card {
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 20px 22px 18px;
  min-height: 270px;
  position: relative;
  overflow: hidden;
}

.chart-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.92), transparent);
  pointer-events: none;
}

.chart-card::after {
  content: "";
  position: absolute;
  top: -38px;
  right: -32px;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  background: var(--brand-soft);
  pointer-events: none;
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.chart-card-header span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  color: rgba(0, 126, 175, 0.78);
  margin-bottom: 8px;
}

.chart-card-header strong {
  display: block;
  font-size: clamp(1.65rem, 2.2vw, 2.25rem);
  line-height: 1;
  color: #007eaf;
  letter-spacing: -0.045em;
}

.chart-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.52);
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: var(--r-pill);
  box-shadow: 0 1px 0 rgba(255,255,255,0.75) inset;
  position: relative;
  z-index: 2;
}

.chart-tabs button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.chart-tabs button.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 6px 18px rgba(15,35,55,0.08);
}

.chart-plot {
  height: 142px;
  display: flex;
  align-items: end;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.chart-bar-wrap {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 20px 1fr 18px;
  gap: 6px;
  align-items: end;
}

.chart-bar-value {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-track {
  height: 100%;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.54);
  border: 1px solid rgba(255,255,255,0.78);
  display: flex;
  align-items: end;
  overflow: hidden;
}

.chart-bar {
  width: 100%;
  min-height: 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, #31bdeb 0%, var(--brand) 100%);
  box-shadow: 0 8px 20px rgba(0,159,218,0.18);
  transition: height 220ms ease;
}

.chart-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.chart-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 1100px) {
  .dashboard-overview {
    grid-template-columns: 1fr;
  }

  .chart-card {
    min-height: 250px;
  }
}

@media (max-width: 640px) {
  .chart-card-header {
    flex-direction: column;
  }

  .chart-plot {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .chart-bar-wrap {
    min-width: 46px;
  }
}


/* ─── Line graph refinement ───────────────────────────── */
.dashboard-overview {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  align-items: stretch;
  gap: 20px;
}

.overview-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-overview .summary-row-status,
.dashboard-overview .summary-row-finance {
  margin-bottom: 0;
}

.dashboard-overview .summary-row-status {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-overview .summary-row-finance {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.dashboard-overview .summary-card {
  min-height: 110px;
}

.dashboard-overview .finance-card-large {
  min-height: 148px;
}

.chart-card {
  min-height: 100%;
  padding: 24px 26px 22px;
  display: flex;
  flex-direction: column;
}

.chart-card-header {
  margin-bottom: 14px;
}

.chart-plot-line {
  position: relative;
  height: 235px;
  display: block;
  padding: 10px 4px 30px;
  margin-top: 4px;
  border-radius: 20px;
  background:
    linear-gradient(rgba(0, 159, 218, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 159, 218, 0.06) 1px, transparent 1px);
  background-size: 100% 25%, 16.666% 100%;
  overflow: visible;
}

.line-chart-svg {
  position: absolute;
  inset: 10px 6px 30px 6px;
  width: calc(100% - 12px);
  height: calc(100% - 40px);
  overflow: visible;
}

.line-chart-area {
  fill: url(#loanLineFill);
  stroke: none;
}

.line-chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 8px 12px rgba(0, 159, 218, 0.18));
}

.line-chart-points {
  position: absolute;
  inset: 10px 6px 30px 6px;
  pointer-events: none;
}

.line-chart-point {
  position: absolute;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid #fff;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(0, 159, 218, 0.24);
  pointer-events: auto;
  cursor: default;
  padding: 0;
}

.line-chart-point span {
  position: absolute;
  left: 50%;
  bottom: 17px;
  transform: translateX(-50%);
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(18, 32, 51, 0.86);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.line-chart-point:hover span {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.line-chart-axis {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 22px;
}

.line-chart-axis span {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.chart-note {
  margin-top: auto;
  padding-top: 14px;
}

/* Hide old bar chart elements if cached markup ever appears */
.chart-bar-wrap,
.chart-bar-track,
.chart-bar,
.chart-bar-value,
.chart-label {
  display: none;
}

@media (max-width: 1180px) {
  .dashboard-overview {
    grid-template-columns: 1fr;
  }

  .chart-card {
    min-height: 320px;
  }
}

@media (max-width: 720px) {
  .dashboard-overview .summary-row-status,
  .dashboard-overview .summary-row-finance {
    grid-template-columns: 1fr;
  }

  .chart-plot-line {
    height: 220px;
    overflow-x: auto;
  }

  .line-chart-axis span {
    font-size: 0.62rem;
  }
}


/* ─── Nav update: reset password link ─────────────────── */
.nav-pill.active {
  color: var(--brand-dark);
  background: rgba(0,159,218,0.10);
  border-color: rgba(0,159,218,0.22);
  box-shadow: 0 8px 22px rgba(0,159,218,0.08);
}

/* ─── Dashboard table fee column ──────────────────────── */
.table-card table {
  min-width: 1040px;
}

.table-card th:nth-child(6),
.table-card td:nth-child(6),
.table-card th:nth-child(7),
.table-card td:nth-child(7) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.table-card td:nth-child(7) {
  color: var(--brand-dark);
  font-weight: 700;
}


/* ─── Contact page ────────────────────────────────────── */
.contact-two-col,
.two-col.contact-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 700px) {
  .contact-two-col,
  .two-col.contact-two-col {
    grid-template-columns: 1fr;
  }
}

/* ─── Security/admin audit logs ───────────────────────── */
.audit-filter-form {
  margin-bottom: 22px;
}

.audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.audit-table-card table {
  min-width: 1120px;
}

.audit-table-card td {
  vertical-align: top;
}

@media (max-width: 800px) {
  .audit-filter-grid {
    grid-template-columns: 1fr;
  }
}

