/* ============================================
   LUDUS · Sistema Financeiro
   Design tokens
   ============================================ */
:root {
  /* Brand */
  --brand-900: #1f2d24;
  --brand-800: #243329;
  --brand-700: #2a3b30;
  --brand-600: #324636;       /* Primary */
  --brand-500: #3f5644;
  --brand-400: #5a7363;
  --brand-300: #8aa094;
  --brand-200: #c0cdc4;
  --brand-100: #e3eae5;

  /* Neutrals — bone palette */
  --bone-50:  #faf8f4;
  --bone-100: #f3efe8;
  --bone-200: #e7e4de;       /* Brand neutral */
  --bone-300: #d6d2c9;
  --bone-400: #b8b3a8;
  --bone-500: #8c8a82;
  --bone-600: #5e5d57;
  --bone-700: #3a3a36;
  --bone-800: #232320;

  /* Semantics */
  --success: #4f8a5d;
  --success-bg: #e6efe6;
  --warning: #c08a3a;
  --warning-bg: #fbf0d9;
  --danger:  #b14545;
  --danger-bg: #f5dede;
  --info:    #5a7faa;
  --info-bg: #e3ecf5;

  /* Surfaces */
  --bg:        #f3efe8;
  --surface:   #ffffff;
  --surface-2: #faf8f4;
  --surface-sunk: #ede9e1;
  --border:    #e2ddd2;
  --border-strong: #cfc9bb;

  /* Text */
  --text-1: #1f2d24;
  --text-2: #4d574f;
  --text-3: #7d847e;
  --text-on-brand: #f3efe8;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(31, 45, 36, 0.04), 0 1px 1px rgba(31, 45, 36, 0.03);
  --shadow-2: 0 4px 12px rgba(31, 45, 36, 0.06), 0 2px 4px rgba(31, 45, 36, 0.04);
  --shadow-3: 0 12px 32px rgba(31, 45, 36, 0.10), 0 4px 8px rgba(31, 45, 36, 0.05);

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h: 64px;

  /* Type */
  --font-sans: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================
   App shell
   ============================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--brand-600);
  color: var(--text-on-brand);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid rgba(231, 228, 222, 0.12);
}
.sidebar__brand svg { width: 22px; height: 22px; color: var(--bone-200); }
.sidebar__brand-text { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.sidebar__brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.55;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.company-switch {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(231, 228, 222, 0.10);
  border-radius: var(--r-md);
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.company-switch button {
  background: transparent;
  border: 0;
  color: rgba(231, 228, 222, 0.72);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 8px;
  border-radius: 8px;
  letter-spacing: -0.005em;
  transition: all 0.15s;
}
.company-switch button.active {
  background: var(--bone-200);
  color: var(--brand-600);
}
.company-switch button.consolidated {
  grid-column: 1 / -1;
  font-size: 11px;
  opacity: 0.7;
  padding: 5px;
}
.company-switch button.consolidated.active { opacity: 1; }

.nav__group { display: flex; flex-direction: column; gap: 1px; }
.nav__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(231, 228, 222, 0.42);
  padding: 12px 10px 6px;
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: rgba(231, 228, 222, 0.78);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav__item:hover { background: rgba(231, 228, 222, 0.06); color: var(--bone-200); }
.nav__item.active { background: rgba(231, 228, 222, 0.12); color: var(--bone-100); }
.nav__item svg { width: 16px; height: 16px; opacity: 0.85; flex-shrink: 0; }
.nav__item .badge {
  margin-left: auto;
  background: var(--warning);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  font-weight: 600;
}
.nav__item .badge--danger { background: var(--danger); }

.sidebar__user {
  margin-top: auto;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(231, 228, 222, 0.12);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--brand-400);
  color: var(--bone-100);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.sidebar__user .name { font-size: 13px; font-weight: 500; }
.sidebar__user .role { font-size: 11px; opacity: 0.6; }

/* Main */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar__crumb {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: -0.005em;
}
.topbar__crumb b { color: var(--text-1); font-weight: 600; }
.topbar__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-1);
}
.topbar__spacer { flex: 1; }
.topbar__search {
  position: relative;
  flex: 0 1 320px;
}
.topbar__search input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
}
.topbar__search input:focus { border-color: var(--brand-400); background: #fff; }
.topbar__search svg {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-3);
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-2);
  position: relative;
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-1); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* ============================================
   Content area
   ============================================ */
.page {
  padding: 28px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.page__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page__title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text-1);
}
.page__sub {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 13px;
}
.page__actions { display: flex; gap: 8px; align-items: center; }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn--primary {
  background: var(--brand-600);
  color: var(--bone-100);
}
.btn--primary:hover { background: var(--brand-700); }
.btn--secondary {
  background: var(--surface);
  color: var(--text-1);
  border-color: var(--border);
}
.btn--secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn--ghost {
  background: transparent;
  color: var(--text-2);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text-1); }
.btn--danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: transparent;
}
.btn--sm { padding: 5px 9px; font-size: 12px; }

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card--brand {
  background: var(--brand-600);
  color: var(--bone-100);
  border-color: transparent;
  position: relative;
  overflow: hidden;
}
.card--brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(231, 228, 222, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.18) 0%, transparent 50%);
  pointer-events: none;
}
.card--brand > * { position: relative; z-index: 1; }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.card__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-1);
}
.card--brand .card__title { color: var(--bone-100); }
.card__subtitle {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* KPI tile */
.kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: -0.005em;
}
.kpi__label .ico {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--surface-sunk);
  border-radius: 6px;
  color: var(--text-2);
}
.kpi__label .ico svg { width: 12px; height: 12px; }
.kpi__value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-1);
  font-feature-settings: "tnum";
}
.kpi__value--display {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.035em;
  font-size: 32px;
}
.kpi__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  width: fit-content;
}
.kpi__delta.up { color: var(--success); background: var(--success-bg); }
.kpi__delta.down { color: var(--danger); background: var(--danger-bg); }
.card--brand .kpi__label { color: rgba(231, 228, 222, 0.7); }
.card--brand .kpi__label .ico { background: rgba(0,0,0,0.20); color: var(--bone-200); }
.card--brand .kpi__value { color: var(--bone-100); }

/* ============================================
   Pills, badges, status
   ============================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.pill--success { background: var(--success-bg); color: var(--success); }
.pill--warning { background: var(--warning-bg); color: var(--warning); }
.pill--danger { background: var(--danger-bg); color: var(--danger); }
.pill--info { background: var(--info-bg); color: var(--info); }
.pill--neutral { background: var(--surface-sunk); color: var(--text-2); }
.pill--brand { background: var(--brand-100); color: var(--brand-600); }
.pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag-company {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
}
.tag-company--ludus { background: var(--brand-100); color: var(--brand-600); }
.tag-company--health { background: #e0ebe2; color: #2f5a3d; }

/* ============================================
   Tables
   ============================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.table .num {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.table .actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.table .cell-primary { font-weight: 500; }
.table .cell-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* ============================================
   Forms
   ============================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: -0.005em;
}
.field__label .req { color: var(--danger); }
.field__hint {
  font-size: 11px;
  color: var(--text-3);
}
.input, .select, .textarea {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(50, 70, 54, 0.10);
}
.textarea { resize: vertical; min-height: 80px; }
.input--lg { padding: 12px 14px; font-size: 15px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.form-grid .span-2 { grid-column: 1 / -1; }

.input-currency {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.input-currency:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(50, 70, 54, 0.10);
}
.input-currency span {
  background: var(--surface-2);
  padding: 0 12px;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  border-right: 1px solid var(--border);
}
.input-currency input {
  border: 0;
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  outline: none;
  font-feature-settings: "tnum";
  font-size: 14px;
  font-weight: 500;
}

/* Segmented control */
.segmented {
  display: inline-flex;
  background: var(--surface-sunk);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 1px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  border-radius: 7px;
  letter-spacing: -0.005em;
}
.segmented button.active {
  background: var(--surface);
  color: var(--text-1);
  box-shadow: var(--shadow-1);
}

/* ============================================
   Date filter (must-have)
   ============================================ */
.datefilter {
  display: inline-flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
}
.datefilter__seg {
  display: flex;
  border-right: 1px solid var(--border);
}
.datefilter__seg button {
  border: 0;
  background: transparent;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: -0.005em;
  position: relative;
}
.datefilter__seg button.active { color: var(--brand-600); }
.datefilter__seg button.active::after {
  content: '';
  position: absolute;
  inset: auto 8px 2px;
  height: 2px;
  background: var(--brand-600);
  border-radius: 2px;
}
.datefilter__display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: -0.005em;
}
.datefilter__display svg { width: 14px; height: 14px; color: var(--text-3); }
.datefilter__nav {
  display: flex;
  border-left: 1px solid var(--border);
}
.datefilter__nav button {
  border: 0;
  background: transparent;
  padding: 0 8px;
  color: var(--text-3);
  width: 30px;
}
.datefilter__nav button:hover { background: var(--surface-2); color: var(--text-1); }
.datefilter__nav button + button { border-left: 1px solid var(--border); }

.datefilter__pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  padding: 14px;
  z-index: 50;
  min-width: 320px;
}
.datefilter__pop h5 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 600;
}
.datefilter__pop .quicks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.datefilter__pop .quicks button {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-1);
  font-weight: 500;
}
.datefilter__pop .quicks button:hover { border-color: var(--brand-500); background: var(--surface-2); }
.datefilter__pop .range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

/* ============================================
   Misc
   ============================================ */
.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 16px 0;
}

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
}
.empty svg { width: 36px; height: 36px; opacity: 0.5; }
.empty h4 { margin: 12px 0 4px; font-size: 14px; color: var(--text-1); font-weight: 600; }

.scroll-y { overflow-y: auto; }

/* Status dots */
.dot-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-status.success { background: var(--success); }
.dot-status.warning { background: var(--warning); }
.dot-status.danger { background: var(--danger); }
.dot-status.neutral { background: var(--bone-400); }

/* Progress bar */
.progress {
  background: var(--surface-sunk);
  height: 6px;
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress > div {
  height: 100%;
  background: var(--brand-600);
  border-radius: var(--r-pill);
  transition: width 0.3s;
}
.progress--success > div { background: var(--success); }
.progress--warning > div { background: var(--warning); }

/* ============================================
   Modal / drawer
   ============================================ */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(31, 45, 36, 0.36);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.18s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-3);
  animation: pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal--lg { max-width: 720px; }
.modal--xl { max-width: 920px; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal__head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.modal__head p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.modal__body { padding: 22px; overflow-y: auto; }
.modal__foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.drawer-bg {
  position: fixed;
  inset: 0;
  background: rgba(31, 45, 36, 0.36);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.18s;
}
.drawer {
  background: var(--bg);
  width: 100%;
  max-width: 720px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-3);
  animation: slideR 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes slideR { from { transform: translateX(40px); opacity: 0; } }
.drawer__head {
  padding: 18px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.drawer__body { flex: 1; overflow-y: auto; padding: 24px; }
.drawer__foot {
  padding: 14px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* ============================================
   Toast / notif
   ============================================ */
.toast-stack {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--brand-700);
  color: var(--bone-100);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  box-shadow: var(--shadow-3);
  display: flex;
  gap: 10px;
  align-items: center;
  pointer-events: all;
  animation: slideR 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast .ico { color: var(--success); display: grid; place-items: center; }

/* Charts */
.chart-svg { width: 100%; height: auto; display: block; }

/* Utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.grow { flex: 1; }
.text-1 { color: var(--text-1); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-display { font-family: var(--font-display); font-weight: 400; }
.text-mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.tnum { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Stepper for contracts */
.stepper {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}
.step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.step.done::before { background: var(--brand-500); }
.step__bullet {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  position: relative;
  z-index: 1;
}
.step.done .step__bullet {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: var(--bone-100);
}
.step.active .step__bullet {
  background: var(--surface);
  border-color: var(--brand-600);
  color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(50, 70, 54, 0.12);
}
.step__body { padding-top: 4px; }
.step__title { font-size: 13px; font-weight: 500; color: var(--text-1); }
.step.done .step__title, .step.active .step__title { color: var(--text-1); }
.step:not(.done):not(.active) .step__title { color: var(--text-3); }
.step__meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.step__meta b { color: var(--text-1); font-weight: 500; }

/* Notification list */
.notif-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item__ico {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
}
.notif-item__ico svg { width: 14px; height: 14px; }
.notif-item__ico.danger { background: var(--danger-bg); color: var(--danger); }
.notif-item__ico.warning { background: var(--warning-bg); color: var(--warning); }
.notif-item__ico.success { background: var(--success-bg); color: var(--success); }
.notif-item__ico.info { background: var(--info-bg); color: var(--info); }
.notif-item__title { font-size: 13px; font-weight: 500; color: var(--text-1); }
.notif-item__meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* PJ card mini */
.pj-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.pj-card__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-600);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 4px;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: -0.005em;
  position: relative;
  border-radius: 0;
}
.tabs button:hover { color: var(--text-1); }
.tabs button.active { color: var(--brand-600); }
.tabs button.active::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px 0;
  height: 2px;
  background: var(--brand-600);
  border-radius: 2px 2px 0 0;
}
.tabs button .count {
  margin-left: 6px;
  background: var(--surface-sunk);
  color: var(--text-2);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  font-weight: 600;
}
.tabs button.active .count { background: var(--brand-100); color: var(--brand-600); }

/* Filter chips row */
.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-1); }
.chip.active { background: var(--brand-600); color: var(--bone-100); border-color: var(--brand-600); }
.chip svg { width: 12px; height: 12px; }
