/* ─────────────────────────────────────────────
   Astana SME Portal — design system
   Light paper palette with teal brand accent.
   Ported from Astana Portal design file.
   ───────────────────────────────────────────── */
:root {
  /* Brand */
  --astana: #008FA5;
  --astana-ink: #006E80;
  --astana-50: #E8F6F8;
  --astana-100: #D4EDF1;
  --astana-200: #A8DBE2;
  --astana-300: #6EC2CC;
  --astana-tint: #F2FAFB;
  --mint: #8FD4C7;
  --mint-glow: #B8E8DE;

  /* Neutrals — warm paper */
  --paper: #FBFAF7;
  --surface: #FFFFFF;
  --surface-2: #F6F5F1;
  --line: #E6E3DC;
  --line-soft: #EFEDE7;
  --ink: #1A1F23;
  --ink-2: #3B4248;
  --muted: #6F7680;
  --muted-2: #9AA0A8;

  /* State */
  --success: #2F9E6A;
  --warn: #C77B1B;
  --danger: #C24646;
  --gold: #B28B3F;

  /* Shape */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-sm: 0 1px 0 rgba(20, 30, 40, 0.04), 0 1px 2px rgba(20, 30, 40, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(20, 30, 40, 0.08), 0 2px 4px rgba(20, 30, 40, 0.04);
  --shadow-lg: 0 24px 48px -16px rgba(0, 110, 128, 0.18), 0 8px 16px -8px rgba(20, 30, 40, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }
a { color: var(--astana-ink); text-decoration: none; }
a:hover { color: var(--astana); }
button { font-family: inherit; }
img { max-width: 100%; }

/* ── App shell ─────────────────────────────── */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 18px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.side-brand .mark {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--astana-50);
  border: 1px solid var(--astana-100);
}
.side-brand .mark img { width: 22px; height: 22px; }
.side-brand .title { font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
.side-brand .sub { font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }

.entity-picker {
  padding: 10px 10px 12px;
  background: var(--astana-tint);
  border: 1px solid var(--astana-100);
  border-radius: var(--r);
  margin: 0 4px 14px;
}
.entity-picker .lbl { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--astana-ink); font-weight: 600; }
.entity-picker select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
  margin-top: 2px;
  background: transparent;
  border: none;
  padding: 0;
  width: 100%;
  cursor: pointer;
}
.entity-picker select:focus { outline: none; }
.entity-picker .meta { display: flex; gap: 6px; margin-top: 6px; align-items: center; flex-wrap: wrap; }

/* Entity-picker custom dropdown (replaces native <select> for a polished feel) */
.ep-dropdown { position: relative; }
.ep-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 4px 6px 4px 0;
  background: transparent; border: none; cursor: pointer;
  font-family: var(--font-serif); font-size: 19px; line-height: 1.2; color: var(--ink);
  text-align: left;
}
.ep-trigger:focus { outline: none; }
.ep-trigger:hover .ep-name { color: var(--astana-ink); }
.ep-trigger .ep-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-trigger .ep-caret {
  font-size: 13px; color: var(--muted);
  transition: transform 0.2s ease;
  font-family: var(--font-sans);
}
.ep-dropdown[data-open] .ep-trigger .ep-caret { transform: rotate(180deg); color: var(--astana); }

.ep-menu {
  position: absolute; top: calc(100% + 6px); left: -6px; right: -6px; z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: 320px; overflow-y: auto;
  opacity: 0; transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ep-dropdown[data-open] .ep-menu {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ep-item {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: transparent; border: none; border-radius: 8px;
  cursor: pointer; color: var(--ink-2);
  font-family: var(--font-sans); font-size: 13px;
  transition: background 0.1s;
}
.ep-item:hover { background: var(--astana-tint); color: var(--astana-ink); }
.ep-item.active { background: var(--astana-50); color: var(--astana-ink); font-weight: 600; }
.ep-item .ep-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-item .ep-item-uen {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted);
  padding: 2px 6px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.ep-item .ep-check { color: var(--astana); font-weight: 700; margin-left: 4px; }

.pill {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  letter-spacing: 0.02em; display: inline-block;
}
.pill.teal { background: var(--astana-50); border-color: var(--astana-100); color: var(--astana-ink); }
.pill.green { background: #EAF6EF; border-color: #CFE6D8; color: #1E6B46; }
.pill.amber { background: #FBF2DE; border-color: #EED8A6; color: #8A5A11; }
.pill.slate { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.pill.danger { background: #FBEBEB; border-color: #EFCFCF; color: #873232; }

/* Legacy badges — remap to new pill classes */
.badge { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); letter-spacing: 0.02em; display: inline-block; font-weight: 500; }
.badge-blue, .badge-teal { background: var(--astana-50); border-color: var(--astana-100); color: var(--astana-ink); }
.badge-green { background: #EAF6EF; border-color: #CFE6D8; color: #1E6B46; }
.badge-gold { background: #FBF2DE; border-color: #EED8A6; color: #8A5A11; }
.badge-grey { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.badge-warn { background: #FBF2DE; border-color: #EED8A6; color: #8A5A11; }

.nav-group { padding: 6px 4px 4px; }
.nav-label, .nav-title {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-2); padding: 10px 10px 4px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-size: 13px; font-weight: 500;
  margin-bottom: 1px; cursor: pointer;
  border-left: 2px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active {
  color: var(--astana-ink); background: var(--astana-50);
  border-left-color: var(--astana);
}
.nav-item .num { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); width: 14px; }
.nav-item.active .num { color: var(--astana); }
.nav-item .nav-icon { width: 14px; display: inline-flex; justify-content: center; color: var(--muted-2); }
.nav-item.active .nav-icon { color: var(--astana); }

.side-foot, .sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding: 12px 8px 2px;
  display: flex; align-items: center; gap: 10px;
  flex-direction: column;
  align-items: stretch;
}
.side-foot .user-row { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--astana) 0%, var(--mint) 100%);
  color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
  flex-shrink: 0;
}
.side-foot .who { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.side-foot .mail, .sidebar-footer .small { font-size: 11px; color: var(--muted); }

/* ── Main area ─────────────────────────────── */
.main { min-width: 0; background: var(--paper); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; border-bottom: 1px solid var(--line-soft);
  background: rgba(251, 250, 247, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs .sep { opacity: 0.4; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: all 0.15s ease;
  background: var(--astana); color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  text-decoration: none;
}
.btn:hover { background: var(--astana-ink); color: #fff; transform: none; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.btn-primary { background: var(--astana); color: #fff; }
.btn-outline, .btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-outline:hover, .btn.ghost:hover { background: var(--astana-tint); border-color: var(--astana-200); color: var(--astana-ink); }
.btn.subtle { background: var(--surface-2); color: var(--ink-2); }
.btn.subtle:hover { background: var(--astana-50); color: var(--astana-ink); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #24835a; color: #fff; }
.btn-gold, .btn.ai {
  background: linear-gradient(135deg, #0a8396 0%, #14b8a6 60%, #67e8d0 100%);
  color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 6px 20px -8px rgba(0, 143, 165, 0.6);
}
.btn-gold:hover, .btn.ai:hover { color: #fff; }
.btn.ai::before, .btn-gold::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: shimmer 3.2s ease-in-out infinite;
}
@keyframes shimmer { 40% { transform: translateX(120%); } 100% { transform: translateX(120%); } }
.btn-danger { background: #FBEBEB; color: #873232; border: 1px solid #EFCFCF; }
.btn-sm, .btn.sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Forms ─────────────────────────────── */
/* Use plain `input` with :not() exclusions so form fields that omit type="text" still pick up the full-width style. */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="range"]),
select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: inset 0 1px 0 rgba(20, 30, 40, 0.02);
}
input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover, textarea:hover { border-color: var(--astana-200); }
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus {
  border-color: var(--astana);
  box-shadow: 0 0 0 3px rgba(0, 143, 165, 0.15);
  background: var(--surface);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236F7680' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
input[type="file"] { padding: 8px 12px; cursor: pointer; }
input[type="file"]::-webkit-file-upload-button {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  padding: 5px 12px;
  border-radius: 6px;
  margin-right: 12px;
  cursor: pointer;
}
input[type="file"]::-webkit-file-upload-button:hover { background: var(--astana-50); border-color: var(--astana-200); color: var(--astana-ink); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--astana); cursor: pointer; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.help, .small { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Page ─────────────────────────────── */
.page { padding: 28px 32px 120px; max-width: 1160px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1, .page-title { font-family: var(--font-serif); font-size: 38px; line-height: 1.05; color: var(--ink); letter-spacing: -0.005em; margin: 0; font-weight: 400; }
.page-head p, .page-sub { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 540px; }

/* ── Cards ─────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 17px; font-weight: 600; color: var(--ink); margin: 0 0 4px; letter-spacing: -0.005em; }
.card h3 { font-size: 14px; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
.card h4 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 10px 0 4px; }
.card p { font-size: 14px; color: var(--ink-2); margin: 0 0 8px; }
.card p:last-child { margin-bottom: 0; }
.card.tinted { background: var(--astana-tint); border-color: var(--astana-100); }

/* ── Grids ─────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Flash ─────────────────────────────── */
.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13.5px;
  border: 1px solid;
}
.flash.success { background: #EAF6EF; border-color: #CFE6D8; color: #1E6B46; }
.flash.error { background: #FBEBEB; border-color: #EFCFCF; color: #873232; }

/* ── Default (transactional, list-like) tables ─────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; background: transparent; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); white-space: nowrap; }
tr.needs-review { background: #FBF2DE; }
tbody tr:hover { background: var(--astana-tint); }

/* ── About / hero strip ─────────────────────────────── */
.about {
  position: relative; overflow: hidden;
  border: 1px solid var(--astana-100);
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 88% -10%, rgba(143, 212, 199, 0.45), transparent 45%),
    radial-gradient(circle at 5% 120%, rgba(0, 143, 165, 0.12), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #F2FAFB 100%);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.about-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.about .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--astana-ink); font-weight: 600;
}
.about h2 {
  font-family: var(--font-serif); font-size: 30px; line-height: 1.08;
  margin: 10px 0 0; color: var(--ink); letter-spacing: -0.005em;
  max-width: 18ch; font-weight: 400;
}
.about h2 em { font-style: italic; color: var(--astana); font-weight: 400; }
.about p { color: var(--ink-2); font-size: 14.5px; margin-top: 10px; max-width: 52ch; }
.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.about-stat { padding: 14px; background: rgba(255,255,255,0.7); border: 1px solid var(--astana-100); border-radius: var(--r); }
.about-stat .v { font-family: var(--font-serif); font-size: 24px; color: var(--astana-ink); line-height: 1; }
.about-stat .k { font-size: 11.5px; color: var(--muted); margin-top: 6px; letter-spacing: 0.02em; }
@media (max-width: 900px) {
  .about-row { grid-template-columns: 1fr; }
}

/* ── AI assist card ─────────────────────────────── */
.ai-card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(600px 120px at 10% 0%, rgba(143, 212, 199, 0.35), transparent 60%),
    linear-gradient(180deg, #ffffff, #F2FAFB);
  border: 1px solid var(--astana-100);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.ai-card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--astana), var(--mint));
}
.ai-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--astana-ink); font-weight: 600; margin-bottom: 4px; }
.ai-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--astana); box-shadow: 0 0 0 3px rgba(0,143,165,0.2); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.85); } }

/* ── Financial-statement tables ─────────────────────────────── */
.fs-block { padding: 4px 4px 8px; }
.fs-block .fs-title, .fs-title {
  font-family: var(--font-serif); font-size: 24px;
  text-align: center; color: var(--ink); letter-spacing: -0.005em;
  margin: 0; font-weight: 400;
}
.fs-block .fs-title::after, .fs-title::after {
  content: ""; display: block; width: 40px; height: 1px;
  background: var(--astana); margin: 10px auto 0;
}
.fs-block .fs-subtitle, .fs-subtitle { text-align: center; font-size: 12.5px; color: var(--muted); margin: 6px 0 14px; font-style: italic; }
.fs-footer { text-align: center; font-size: 11.5px; color: var(--muted); font-style: italic; margin-top: 24px; }

.fs-table {
  width: 100%; border-collapse: collapse; margin-top: 8px;
  font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.fs-table th, .fs-table td { padding: 5px 12px; vertical-align: baseline; line-height: 1.65; border: none; background: transparent; }
.fs-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid var(--line); text-align: left; font-family: var(--font-sans); }
.fs-table th.num, .fs-table td.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; min-width: 96px; }
.fs-table td.note { text-align: center; color: var(--muted); width: 52px; font-family: var(--font-mono); font-size: 11.5px; }
.fs-table .indent-1 { padding-left: 28px; }
.fs-table .indent-2 { padding-left: 52px; }
.fs-table .section-head td { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11.5px; color: var(--astana-ink); padding-top: 18px; padding-bottom: 6px; }
.fs-table .group-head td { font-weight: 600; color: var(--ink); padding-top: 12px; padding-bottom: 4px; }
.fs-table .subtotal td { font-weight: 600; border-top: 1px solid var(--line); padding-top: 6px; }
.fs-table .total td { font-weight: 700; color: var(--ink); border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); padding-top: 8px; padding-bottom: 8px; }
.fs-table .muted-amount { color: var(--muted); font-weight: 400; }
.fs-table tbody tr:hover { background: transparent; }

/* Note sub-tables — full-width justified */
.fs-note-table {
  width: 100%; border-collapse: collapse; margin: 6px 0 14px;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.fs-note-table th, .fs-note-table td {
  padding: 5px 12px; border: none; text-align: left; vertical-align: top;
}
.fs-note-table thead td, .fs-note-table thead th {
  font-style: italic; color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
}
.fs-note-table td.num, .fs-note-table th.num {
  text-align: right; font-family: var(--font-mono); white-space: nowrap; min-width: 110px;
}
.fs-note-table tfoot td {
  border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink);
  padding-top: 6px; padding-bottom: 6px; font-weight: 700; color: var(--ink);
}
.fs-note-table tbody tr:hover { background: transparent; }

/* Directors' Interests table — full-width with top/bottom ink rules */
.fs-interests {
  width: 100%; border-collapse: collapse; margin: 8px 0 0;
  font-size: 13px; font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  table-layout: fixed;
}
.fs-interests th, .fs-interests td { padding: 6px 14px; border: none; text-align: left; }
.fs-interests th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: transparent;
}
.fs-interests td.num, .fs-interests th.num {
  text-align: right; font-family: var(--font-mono); white-space: nowrap; width: 150px;
}
.fs-interests .sub-head td {
  font-style: italic; color: var(--muted); font-size: 12px;
  padding-top: 10px; padding-bottom: 4px; border: none;
}

/* Opinion list — (a) / (b) bullets */
ol.opinions, ul.opinions { list-style: none; padding: 0; margin: 6px 0 0; }
ol.opinions li, ul.opinions li {
  padding: 6px 0 6px 36px; position: relative;
  font-size: 14px; color: var(--ink-2);
}
ol.opinions li::before, ul.opinions li::before {
  content: attr(data-m); position: absolute; left: 0; width: 28px;
  color: var(--muted); font-family: var(--font-mono); font-size: 12px;
}

/* Signature block */
.fs-signature-block { margin-top: 56px; padding: 0 40px; }
.fs-signature-block .label { font-weight: 700; margin-bottom: 56px; }
.fs-signature-block .sig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.fs-signature-block .sig-cell { text-align: center; padding-top: 60px; }
.fs-signature-block .sig-line { border-top: 1px solid var(--ink); padding-top: 6px; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.fs-signature-block .sig-title { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; margin-top: 2px; }
.fs-signature-block .sig-date { margin-top: 32px; color: var(--ink-2); font-size: 12.5px; }
@media (max-width: 720px) {
  .fs-signature-block .sig-row { grid-template-columns: 1fr; gap: 40px; }
}

/* Notes typography */
.notes-wrap h3 { font-family: var(--font-serif); font-size: 20px; color: var(--ink); margin: 22px 0 8px; letter-spacing: -0.005em; font-weight: 400; }
.notes-wrap h4 { font-size: 13px; color: var(--ink); font-weight: 600; margin: 12px 0 4px; }
.notes-wrap p { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; margin-bottom: 6px; }

/* Entity cards on dashboard */
.entity-card {
  display: block; padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font: inherit;
  transition: all 0.15s;
}
.entity-card:hover { border-color: var(--astana-200); background: var(--astana-tint); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.entity-card.active { border-color: var(--astana); background: var(--astana-tint); box-shadow: 0 0 0 3px rgba(0, 143, 165, 0.1); }
.entity-card h3 { font-family: var(--font-serif); font-size: 20px; color: var(--ink); margin: 0 0 6px; font-weight: 400; }
.entity-card .meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }

/* Steps wizard */
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.step {
  flex: 1; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em;
}
.step.active { border-color: var(--astana); background: var(--astana-tint); color: var(--astana-ink); }
.step.done { border-color: var(--success); background: #EAF6EF; color: #1E6B46; }

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--astana-ink); border-bottom-color: var(--astana); }

/* Utility */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
details { margin: 8px 0 12px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 0; }
details summary:hover { color: var(--astana-ink); }

/* Auth pages */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper);
}
.auth-side {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 80% 20%, rgba(143, 212, 199, 0.35), transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(0, 143, 165, 0.15), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--astana-tint) 100%);
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid var(--astana-100);
}
.auth-side .brand-line { display: flex; align-items: center; gap: 10px; }
.auth-side .brand-line .mark { width: 36px; height: 36px; border-radius: 9px; background: var(--astana-50); border: 1px solid var(--astana-100); display: grid; place-items: center; }
.auth-side .brand-line .mark img { width: 22px; height: 22px; }
.auth-side .brand-line .ti { font-size: 16px; font-weight: 700; }
.auth-side .brand-line .sb { font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.auth-side h1 { font-family: var(--font-serif); font-size: 44px; line-height: 1.05; color: var(--ink); letter-spacing: -0.01em; margin: 0; font-weight: 400; max-width: 18ch; }
.auth-side h1 em { font-style: italic; color: var(--astana); font-weight: 400; }
.auth-side .tag { color: var(--ink-2); font-size: 15px; margin-top: 14px; max-width: 40ch; }
.auth-side .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--astana-ink); font-weight: 600; margin-bottom: 20px; }
.auth-side .bullets { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; color: var(--ink-2); }
.auth-side .bullets .b { display: flex; gap: 10px; }
.auth-side .bullets .b::before { content: "•"; color: var(--astana); font-weight: 900; }
.auth-side footer { font-size: 11.5px; color: var(--muted); }
.auth-body { padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; margin: 0 auto; }
.auth-body h2 { font-family: var(--font-serif); font-size: 30px; color: var(--ink); letter-spacing: -0.005em; font-weight: 400; margin: 0 0 4px; }
.auth-body .lead { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-body { padding: 32px 24px; }
}

/* Small screens — collapse sidebar */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--astana-200); }

/* Dynamic rows (directors / shareholders inputs) */
.rows-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.row-card {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
}
.row-card .form-group { flex: 1; margin: 0; }
.row-card label { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.row-card input { font-size: 13.5px; padding: 9px 12px; }
.row-card .remove-btn {
  width: 34px; height: 38px; border-radius: 8px;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  cursor: pointer; display: grid; place-items: center; padding: 0;
  font-size: 16px; line-height: 1; flex-shrink: 0;
}
.row-card .remove-btn:hover { border-color: var(--danger); color: var(--danger); background: #FBEBEB; }
.add-row-btn {
  align-self: flex-start;
  background: var(--astana-tint); color: var(--astana-ink);
  border: 1px dashed var(--astana-200);
  padding: 8px 14px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.add-row-btn:hover { background: var(--astana-50); border-style: solid; }
.rows-wrap > label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }

/* AI loading — bottom shimmer bar + inline button spinner */
.ai-progress {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: 3px; background: var(--astana-100); overflow: hidden;
  opacity: 0; transition: opacity 0.2s ease;
  pointer-events: none;
}
.ai-progress.active { opacity: 1; }
.ai-progress::before {
  content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--astana) 20%, var(--mint) 80%, transparent);
  animation: ai-slide 1.3s ease-in-out infinite;
}
@keyframes ai-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.ai-overlay-note {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--astana-100);
  border-radius: 999px; padding: 10px 20px; z-index: 200;
  font-size: 12.5px; color: var(--astana-ink); font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: none; align-items: center; gap: 10px;
}
.ai-overlay-note.active { display: inline-flex; }
.ai-overlay-note .spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--astana-100); border-top-color: var(--astana);
  animation: ai-spin 0.8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-form button[disabled] { opacity: 0.9; cursor: progress; }
.ai-form button[disabled] .spin {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: ai-spin 0.7s linear infinite; margin-right: 6px;
  vertical-align: -2px;
}

/* ── Drag-and-drop zone for multi-file uploads ──────────────────── */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 28px 18px;
  text-align: center;
  background: var(--surface);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.dropzone .dz-hint {
  font-size: 14px;
  color: var(--ink-2);
}
.dropzone .dz-files:not(:empty) {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.dropzone.dz-hover {
  background: color-mix(in srgb, var(--astana) 8%, var(--surface));
  border-color: var(--astana);
}
