/* ============================================================
   DirVes — Design System
   Palette: dark navy nav · white cards · indigo accent
   ============================================================ */

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

:root {
  /* Surfaces */
  --c-bg:          #ffffff;
  --c-bg-alt:      #f8fafc;
  --c-bg-section:  #f1f5f9;
  --c-surface:     #ffffff;

  /* Borders */
  --c-border:      #e2e8f0;
  --c-border-dark: #cbd5e1;

  /* Text */
  --c-text:        #0f172a;
  --c-text-sub:    #334155;
  --c-text-muted:  #64748b;
  --c-text-faint:  #94a3b8;

  /* Accent (indigo-blue) */
  --c-accent:       #2563eb;
  --c-accent-hover: #1d4ed8;
  --c-accent-light: #eff6ff;
  --c-accent-ring:  rgba(37,99,235,.2);

  /* Semantic */
  --c-positive:     #059669;
  --c-positive-bg:  #ecfdf5;
  --c-negative:     #dc2626;
  --c-negative-bg:  #fef2f2;
  --c-warning:      #d97706;
  --c-warning-bg:   #fffbeb;

  /* Nav */
  --c-nav-bg:      #0f172a;
  --c-nav-border:  rgba(255,255,255,.06);
  --c-nav-text:    #94a3b8;
  --c-nav-active:  #ffffff;

  /* Misc */
  --font-ui:   'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --transition: .15s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-ui);
  background: var(--c-bg-alt);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--c-accent); text-decoration: none; }
a:hover { color: var(--c-accent-hover); text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ── Top Nav ────────────────────────────────────────────────── */
.topnav {
  background: var(--c-nav-bg);
  border-bottom: 1px solid var(--c-nav-border);
  position: sticky;
  top: 0;
  z-index: 200;
}
.topnav-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 56px;
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  margin-right: 32px;
  flex-shrink: 0;
}
.brand-dir {
  font-size: 1.2rem;
  font-weight: 800;
  color: #60a5fa;
  letter-spacing: -.5px;
}
.brand-ves {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -.5px;
}
.brand-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #60a5fa;
  margin: 0 1px 3px;
  flex-shrink: 0;
  align-self: flex-end;
}

.nav-menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.nav-menu-toggle:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(96,165,250,.35);
}
.nav-menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-menu-toggle.open span:nth-child(2) { opacity: 0; }
.nav-menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.nav-link {
  color: var(--c-nav-text);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: .83rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-link:hover  { background: rgba(255,255,255,.07); color: #e2e8f0; text-decoration: none; }
.nav-link.active { background: rgba(96,165,250,.15); color: #93c5fd; font-weight: 600; }

/* Nav search */
.nav-search-wrap {
  margin-left: auto;
  position: relative;
  flex-shrink: 0;
}
.nav-search-input {
  width: 220px;
  padding: 6px 12px 6px 34px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  color: #e2e8f0;
  font-family: var(--font-ui);
  font-size: .82rem;
  outline: none;
  transition: all var(--transition);
  caret-color: #60a5fa;
}
.nav-search-input::placeholder { color: #475569; }
.nav-search-input:focus {
  width: 280px;
  background: rgba(255,255,255,.11);
  border-color: rgba(96,165,250,.5);
  color: #fff;
}
.nav-search-input:focus::placeholder { color: #64748b; }
.nav-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #475569;
  pointer-events: none;
  line-height: 1;
}
.nav-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  overflow: hidden;
  display: none;
  z-index: 300;
}
.nav-search-dropdown.open { display: block; }
.nav-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background var(--transition);
  text-decoration: none;
}
.nav-search-item:last-child { border-bottom: none; }
.nav-search-item:hover { background: rgba(96,165,250,.12); }
.nav-search-kode {
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 600;
  color: #60a5fa;
  min-width: 48px;
}
.nav-search-nama {
  font-size: .8rem;
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-search-sektor {
  font-size: .7rem;
  color: #475569;
  margin-left: auto;
  white-space: nowrap;
}
.nav-search-empty {
  padding: 16px;
  text-align: center;
  font-size: .8rem;
  color: #475569;
}

@media (max-width: 1180px) {
  .topnav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 18px;
    row-gap: 8px;
  }
  .nav-brand {
    margin-right: 20px;
  }
  .nav-search-wrap {
    order: 2;
    margin-left: auto;
  }
  .nav-links {
    order: 3;
    flex: 0 0 100%;
    overflow-x: auto;
    padding: 0 0 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.45) transparent;
  }
  .nav-links::-webkit-scrollbar { height: 4px; }
  .nav-links::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,.45);
    border-radius: 999px;
  }
  .nav-link {
    padding: 7px 12px;
    font-size: .8rem;
  }
  .nav-search-input {
    width: min(280px, 36vw);
  }
  .nav-search-input:focus {
    width: min(340px, 42vw);
  }
}

@media (max-width: 760px) {
  .topnav-inner {
    padding: 8px 14px 10px;
    gap: 10px;
  }
  .nav-brand {
    margin-right: auto;
  }
  .nav-menu-toggle {
    display: inline-flex;
    order: 2;
  }
  .nav-search-wrap {
    order: 3;
    width: 100%;
    margin-left: 0;
  }
  .nav-search-input,
  .nav-search-input:focus {
    width: 100%;
    height: 38px;
    border-radius: var(--radius);
  }
  .nav-search-dropdown {
    width: 100%;
    right: auto;
    left: 0;
    max-height: min(360px, 70vh);
    overflow-y: auto;
  }
  .nav-links {
    order: 4;
    display: none;
    flex: 0 0 100%;
    width: 100%;
    overflow-x: visible;
    padding: 6px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-lg);
    flex-direction: column;
    gap: 4px;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-link {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: .86rem;
  }
}

@media (max-width: 420px) {
  .topnav-inner {
    padding-left: 10px;
    padding-right: 10px;
  }
  .brand-dir,
  .brand-ves {
    font-size: 1.08rem;
  }
  .nav-search-item {
    gap: 8px;
    padding: 9px 10px;
  }
  .nav-search-sektor {
    display: none;
  }
}

/* ── Page Wrapper ───────────────────────────────────────────── */
.page-wrapper {
  flex: 1;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

/* ── Page Title ─────────────────────────────────────────────── */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 20px;
  letter-spacing: -.3px;
}
.page-title .subtitle {
  font-size: .85rem;
  font-weight: 400;
  color: var(--c-text-muted);
  margin-left: 10px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 20px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}
.card-body { padding: 20px; }

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.stat-label  { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-muted); }
.stat-value  { font-size: 1.75rem; font-weight: 800; color: var(--c-text); margin-top: 6px; letter-spacing: -.5px; }
.stat-detail { font-size: .73rem; color: var(--c-text-faint); margin-top: 3px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--c-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--c-accent-hover); color: #fff; }
.btn-secondary {
  background: var(--c-bg);
  color: var(--c-text-sub);
  border-color: var(--c-border);
}
.btn-secondary:hover { background: var(--c-bg-section); }
.btn-danger {
  background: var(--c-bg);
  color: var(--c-negative);
  border-color: #fecaca;
}
.btn-danger:hover { background: var(--c-negative-bg); }
.btn-sm { padding: 5px 12px; font-size: .78rem; border-radius: var(--radius-sm); }
.btn-xs { padding: 3px 9px; font-size: .73rem; border-radius: var(--radius-sm); }

/* ── Filter Bar ─────────────────────────────────────────────── */
.filter-bar {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  display: flex;
  flex-wrap: nowrap;   /* satu baris, tidak wrap */
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  overflow-x: auto;    /* scroll jika layar sangat sempit */
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;        /* biarkan menyusut */
  flex-shrink: 1;
}
/* Emiten dropdown lebih lebar karena nama emiten panjang */
.filter-group:first-of-type { flex: 0 1 220px; min-width: 160px; }
/* Filter lainnya lebih kecil */
.filter-group:not(:first-of-type) { flex: 0 1 130px; min-width: 90px; }
.filter-label {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-text-muted);
  white-space: nowrap;
}
.filter-select {
  padding: 6px 24px 6px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg-alt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E") no-repeat right 8px center;
  -webkit-appearance: none;
  font-family: var(--font-ui);
  font-size: .81rem;
  color: var(--c-text);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;          /* ikuti lebar filter-group */
  min-width: 0;
}
.filter-select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-ring);
}

/* ── Emiten Search Autocomplete ─────────────────────────────── */
.emiten-search-wrap {
  position: relative;
  width: 100%;
}
.emiten-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 28px 6px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg-alt);
  font-family: var(--font-ui);
  font-size: .81rem;
  color: var(--c-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.emiten-search-input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-ring);
}
.emiten-search-input::placeholder { color: var(--c-text-faint); }
/* Ikon search kecil */
.emiten-search-wrap::after {
  content: '⌕';
  position: absolute;
  right: 7px; top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  color: var(--c-text-faint);
  pointer-events: none;
}
.emiten-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: max(100%, 280px);
  max-height: 260px;
  overflow-y: auto;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
}
.emiten-dropdown.open { display: block; }
.emiten-dropdown-item {
  padding: 7px 12px;
  cursor: pointer;
  font-size: .82rem;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: baseline;
  gap: 8px;
  transition: background var(--transition);
}
.emiten-dropdown-item:last-child { border-bottom: none; }
.emiten-dropdown-item:hover,
.emiten-dropdown-item.active { background: var(--c-bg-alt); }
.emiten-dropdown-item .edi-kode {
  font-weight: 700;
  font-size: .81rem;
  color: var(--c-text);
  min-width: 48px;
}
.emiten-dropdown-item .edi-name {
  color: var(--c-text-sub);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emiten-dropdown-empty {
  padding: 10px 12px;
  color: var(--c-text-muted);
  font-size: .8rem;
  text-align: center;
}

.period-rate {
  display: block;
  margin-top: 3px;
  color: var(--c-text-muted);
  font-size: .68rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Data Table (generic) ───────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.data-table thead th {
  background: var(--c-bg-alt);
  border-bottom: 2px solid var(--c-border);
  padding: 9px 14px;
  text-align: left;
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--c-text-muted);
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--c-border);
  transition: background var(--transition);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--c-bg-alt); }
.data-table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--c-text-sub);
}

/* ── Financial Table ────────────────────────────────────────── */
.table-wrap-outer {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  background: var(--c-bg);
  /* Tidak pakai overflow-x di sini — diatur di .fin-table-scroll */
}
.fin-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.table-meta-bar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-bg);
  flex-wrap: wrap;
  gap: 8px;
}
.table-meta-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--c-text);
}
.table-meta-sub {
  font-size: .78rem;
  color: var(--c-text-muted);
}
.fin-table {
  width: 100%;
  border-collapse: separate;  /* perlu untuk sticky + border */
  border-spacing: 0;
  font-size: .82rem;
}
.fin-table .col-label { min-width: 260px; max-width: 340px; }
.fin-table .col-val   { width: 130px; min-width: 110px; }

/* ── Sticky kolom pertama (label) ─── */
.fin-table thead th:first-child,
.fin-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--c-bg);
}
.fin-table thead th:first-child {
  z-index: 3;  /* lebih tinggi agar tidak tertutup body sticky */
}
/* Shadow tipis di sisi kanan sticky column sebagai visual separator */
.fin-table thead th:first-child::after,
.fin-table tbody td:first-child::after {
  content: '';
  position: absolute;
  top: 0; right: -4px;
  width: 4px; height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,.06), transparent);
  pointer-events: none;
}
/* Baris hover: juga update sticky cell */
.fin-table tbody tr:hover td:first-child {
  background: var(--c-bg-alt);
}

.fin-table thead th {
  background: var(--c-bg);
  border: none;
  border-bottom: 2px solid var(--c-border);
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fin-table thead th:first-child { text-align: left; min-width: 260px; }
.fin-table thead th:not(:first-child) {
  text-align: right;
  border-left: 1px solid var(--c-border);
}
.fin-table tbody tr { border-bottom: 1px solid var(--c-border); }
.fin-table tbody tr:hover { background: var(--c-bg-alt); }
.fin-table tbody td {
  border: none;
  padding: 6px 14px;
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--c-text-sub);
}
.fin-table tbody td:first-child {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--c-text);
}
.fin-table tbody td:not(:first-child) {
  text-align: right;
  border-left: 1px solid rgba(0,0,0,.05);  /* lebih tipis dari header */
}
/* Hover: border tetap kelihatan */
.fin-table tbody tr:hover td:not(:first-child) {
  border-left-color: rgba(0,0,0,.08);
}
.fin-table tr.row-section-header td {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .82rem;
  color: var(--c-text);
  padding-top: 16px;
}
.fin-table tr.row-bold td { font-weight: 700; color: var(--c-text); }
.fin-table tr.row-before-bold td:not(:first-child) { border-bottom: 1px solid var(--c-text); }
.fin-table tr.row-final-total td:not(:first-child) { border-bottom: 3px double var(--c-text); }

.val-negative { color: var(--c-negative); }
.val-positive { color: var(--c-text-sub); }
.dash         { color: var(--c-text-faint); }
.fin-table .col-prior { opacity: .75; }

/* ── Collapsible Group Headers ──────────────────────────────── */
.row-beban-header,.row-pbl-header,.row-pajak-header,
.row-oci-header,.row-lba-header,.row-lka-header {
  cursor: pointer; user-select: none;
}
.row-beban-header:hover td,.row-pbl-header:hover td,.row-pajak-header:hover td,
.row-oci-header:hover td,.row-lba-header:hover td,.row-lka-header:hover td {
  background: var(--c-bg-alt);
}
.beban-toggle-icon,.pbl-toggle-icon,.pajak-toggle-icon,
.oci-toggle-icon,.lba-toggle-icon,.lka-toggle-icon {
  display: inline-block; width: 14px; font-size: .6rem;
  color: var(--c-text-faint); margin-right: 5px; vertical-align: middle;
}
.beban-usaha-child td:first-child,.pbl-child td:first-child,
.pajak-child td:first-child,.oci-child td:first-child,
.lba-child td:first-child,.lka-child td:first-child {
  color: var(--c-text-muted); padding-left: 28px;
}

/* ── Key Ratios Table ───────────────────────────────────────── */
.ratio-section { margin-top: 28px; }
.ratio-section .card-header { background: var(--c-bg-alt); }
.ratio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.ratio-table th {
  background: var(--c-bg-alt);
  border-bottom: 2px solid var(--c-border);
  padding: 9px 14px;
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 700;
  text-align: right;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ratio-table th:first-child { text-align: left; }
.ratio-table td {
  border-bottom: 1px solid var(--c-border);
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: .78rem;
  text-align: right;
  color: var(--c-text-sub);
}
.ratio-table td:first-child {
  text-align: left;
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--c-text);
}
.ratio-table tr:hover td { background: var(--c-bg-alt); }

.ratio-section-header td {
  background: var(--c-bg-alt);
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 6px 14px;
  border-top: 2px solid var(--c-border);
}
.ratio-section-header:hover td { background: var(--c-bg-alt); }

.ratio-ann-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 600;
  background: var(--c-accent);
  color: #fff;
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
  opacity: .8;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 3px solid;
  margin-bottom: 16px;
  font-size: .85rem;
}
.alert-success { background: var(--c-positive-bg); border-color: var(--c-positive); color: #065f46; }
.alert-danger  { background: var(--c-negative-bg); border-color: var(--c-negative); color: #991b1b; }
.alert-info    { background: var(--c-accent-light); border-color: var(--c-accent);   color: #1e40af; }
.alert-warning { background: var(--c-warning-bg);   border-color: var(--c-warning);  color: #92400e; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-success { background: var(--c-positive-bg); color: #047857; }
.badge-danger  { background: var(--c-negative-bg); color: #b91c1c; }
.badge-info    { background: var(--c-accent-light); color: #1d4ed8; }
.badge-warning { background: var(--c-warning-bg);   color: #b45309; }

/* ── Upload Zone ────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--c-accent);
  background: var(--c-accent-light);
}
.upload-zone input[type=file] { display: none; }
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-zone p { font-size: .85rem; color: var(--c-text-muted); margin-top: 8px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group   { margin-bottom: 16px; }
.form-label   { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 6px; color: var(--c-text-sub); }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: .875rem;
  color: var(--c-text);
  background: var(--c-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-ring);
}

/* ── Period Tabs ────────────────────────────────────────────── */
.period-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 4px;
}
.period-tab {
  flex: 1;
  text-align: center;
  padding: 7px 6px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--c-text-muted);
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  border: none;
}
.period-tab:hover { background: var(--c-bg-alt); color: var(--c-text); }
.period-tab.active { background: var(--c-accent); color: #fff; font-weight: 700; }

/* ── Period Override Box ────────────────────────────────────── */
.period-override-box {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.period-override-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.override-title { font-size: .875rem; font-weight: 600; color: var(--c-text); white-space: nowrap; }
.override-hint  { font-size: .78rem; color: var(--c-text-muted); line-height: 1.4; }
.override-hint code {
  background: rgba(0,0,0,.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .75rem;
}
.period-override-fields { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.period-preview {
  padding: 7px 14px;
  background: var(--c-accent-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  font-size: .82rem;
  color: #1e40af;
  align-self: flex-end;
  white-space: nowrap;
}

/* ── Two-col layout ─────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--c-text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h2 { font-size: 1.1rem; font-weight: 700; color: var(--c-text); margin-bottom: 8px; }
.empty-state p  { font-size: .875rem; max-width: 380px; margin: 0 auto 20px; }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(37,99,235,.15);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ─────────────────────────────────────────────────── */
.app-footer {
  background: var(--c-nav-bg);
  border-top: 1px solid var(--c-nav-border);
  margin-top: auto;
  padding: 16px 24px;
}
.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand-name {
  font-size: .85rem;
  font-weight: 700;
}
.footer-tagline {
  font-size: .73rem;
  color: #60a5fa;
  font-style: italic;
  letter-spacing: .01em;
}
.footer-meta {
  font-size: .73rem;
  color: #334155;
  text-align: right;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .two-col              { grid-template-columns: 1fr; }
  .filter-bar           { flex-direction: column; align-items: stretch; }
  .filter-group         { min-width: auto; }
  .topnav-inner         { padding: 0 14px; gap: 0; }
  .nav-links            { gap: 0; }
  .nav-link             { padding: 6px 10px; font-size: .78rem; }
  .page-wrapper         { padding: 16px 14px 32px; }
  .fin-table .col-label { min-width: 180px; }
  .nav-search-wrap      { display: none; }
}

/* ── Investment Dashboard Shell ─────────────────────────────── */
.investment-shell {
  background: #eef2f6;
}
.invest-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #111827;
}
.invest-app > .invest-main {
  flex: 1 1 auto;
  width: 100%;
  padding: 24px clamp(18px, 4vw, 54px) 48px;
}
.invest-topbar {
  position: sticky;
  top: 0;
  z-index: 250;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(148,163,184,.18);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(15,23,42,.04);
}
.invest-topbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.invest-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}
.invest-topbar-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #fff;
  font-size: .88rem;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(15,23,42,.14);
}
.invest-topbar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.invest-topbar-brand-text strong {
  font-size: 1rem;
  line-height: 1.1;
  color: #0f172a;
}
.invest-topbar-brand-text small {
  color: #64748b;
  font-size: .76rem;
  line-height: 1.15;
}
.invest-topbar-menu {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.18);
  background: #fff;
  color: #334155;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}
.invest-topbar-menu span { width: 16px; }
.invest-topbar-links {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.invest-topbar-links::-webkit-scrollbar { display: none; }
.invest-topbar .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  color: #334155;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.invest-topbar .nav-link:hover {
  background: rgba(37,99,235,.08);
  color: #0f172a;
  text-decoration: none;
}
.invest-topbar .nav-link.active {
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.12);
}
.nav-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
.nav-link-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}
.invest-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.invest-global-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: #64748b;
  font-size: .78rem;
}
.invest-global-breadcrumbs a { color: #1d4ed8; text-decoration: none; }
.invest-global-breadcrumbs a:hover { text-decoration: underline; }
.invest-main {
  padding: 56px clamp(18px, 4vw, 54px);
}
.dash-ref-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.dash-ref-header h1 {
  font-size: 1.45rem;
  margin: 0 0 6px;
}
.dash-ref-header p {
  color: #64748b;
  font-size: .86rem;
}
.dash-ref-meta {
  margin-top: 6px;
  color: #475569;
  font-size: .78rem;
  font-weight: 600;
}
.dash-price-updated {
  color: #94a3b8;
  font-size: .70rem;
  font-weight: 400;
  line-height: 1.15;
  display: block;
  margin-top: 2px;
}
.dash-ref-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-ref-actions label {
  color: #64748b;
  font-size: .78rem;
  font-weight: 800;
}
.dash-ref-actions select {
  height: 38px;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 12px;
  background: #fff;
  color: #111827;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-weight: 700;
  min-width: 210px;
}
.dash-ref-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.dash-ref-kpi-card {
  min-height: 72px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15,23,42,.04);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
}
.dash-ref-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: 0 0 34px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  position: relative;
}
.dash-ref-kpi-icon::after {
  content: '$';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #3b82f6;
  font-weight: 900;
  font-size: .95rem;
}
.dash-ref-kpi-icon.income::after { content: '◷'; }
.dash-ref-kpi-icon.return::after { content: '↗'; }
.dash-ref-kpi-icon.market::after { content: '▥'; }
.dash-ref-kpi-icon.pl::after { content: '±'; }
.dash-ref-kpi-card.neg .dash-ref-kpi-icon {
  background: #fef2f2;
}
.dash-ref-kpi-card.neg .dash-ref-kpi-icon::after {
  color: #dc2626;
}
.dash-ref-kpi-card.pos .dash-ref-kpi-icon {
  background: #dcfce7;
}
.dash-ref-kpi-card.pos .dash-ref-kpi-icon::after,
.dash-ref-kpi-card.pos .dash-ref-kpi-value {
  color: #059669;
}
.dash-ref-kpi-card.neg .dash-ref-kpi-value {
  color: #dc2626;
}
.dash-ref-kpi-label {
  color: #475569;
  font-size: .76rem;
  line-height: 1.1;
  margin-bottom: 6px;
}
.dash-ref-kpi-value {
  color: #020617;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
}
.dash-ref-chart-stack {
  display: grid;
  gap: 12px;
  margin: 18px 0 26px;
}
.dash-ref-analytics-grid {
  display: grid;
  grid-template-columns: minmax(330px, 1.25fr) minmax(300px, .9fr) minmax(300px, .9fr);
  gap: 12px;
  align-items: stretch;
  margin: 18px 0 26px;
}
.dash-ref-analytics-grid .dash-ref-chart-stack {
  margin: 0;
}
.dash-ref-chart-card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 4px;
  padding: 18px 14px 10px;
  box-shadow: 0 10px 24px rgba(15,23,42,.035);
}
.dash-ref-equity-return-card,
.dash-ref-allocation-card {
  min-height: 100%;
}
.dash-ref-chart-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 0 2px;
}
.dash-ref-chart-title h2 {
  margin: 0 0 6px;
  color: #1f2937;
  font-size: .92rem;
  line-height: 1.2;
}
.dash-ref-chart-title strong {
  display: block;
  color: #111827;
  font-size: 1.25rem;
  line-height: 1.1;
  font-weight: 900;
}
.dash-ref-return-title {
  justify-content: flex-start;
  align-items: center;
}
.dash-ref-return-title span {
  width: 14px;
  height: 14px;
  border: 1px solid #9ca3af;
  border-radius: 999px;
  color: #6b7280;
  display: inline-grid;
  place-items: center;
  font-size: .62rem;
  font-weight: 800;
}
.dash-ref-label {
  color: #111827;
  font-size: .88rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.dash-ref-total {
  font-size: 1.7rem;
  font-weight: 900;
  color: #020617;
  letter-spacing: 0;
  line-height: 1.05;
}
.dash-ref-change {
  margin-top: 4px;
  color: #64748b;
  font-size: .8rem;
  font-weight: 800;
}
.dash-ref-change.pos { color: #059669; }
.dash-ref-change.neg { color: #dc2626; }
.dash-ref-ranges {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.dash-ref-ranges button {
  border: 0;
  background: transparent;
  color: #111827;
  font-family: var(--font-ui);
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}
.dash-ref-ranges button.active {
  color: #10b981;
  border-bottom: 2px solid #10b981;
  padding-bottom: 5px;
}
.dash-ref-chart-wrap {
  height: 168px;
  position: relative;
}
.dash-ref-chart-wrap-lg {
  height: 172px;
}
.dash-ref-return-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 6px;
}
.dash-ref-return-legend > div {
  min-height: 34px;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 4px;
  padding: 8px 10px;
  color: #374151;
  font-size: .76rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-ref-return-legend span.portfolio,
.dash-ref-return-legend span.benchmark {
  width: 2px;
  height: 18px;
  display: inline-block;
  border-radius: 999px;
}
.dash-ref-return-legend span.portfolio { background: #10b981; }
.dash-ref-return-legend span.benchmark { background: #8b5cf6; }
.dash-ref-return-legend strong {
  margin-left: auto;
  font-weight: 900;
}
.dash-ref-return-legend strong.pos { color: #059669; }
.dash-ref-return-legend strong.neg { color: #dc2626; }
.dash-ref-segment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px;
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 999px;
  background: #fff;
}
.dash-ref-segment button {
  border: 0;
  background: transparent;
  color: #6b7280;
  height: 26px;
  padding: 0 16px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: .74rem;
  font-weight: 800;
  cursor: pointer;
}
.dash-ref-segment button.active {
  background: #ecfdf5;
  color: #059669;
  box-shadow: inset 0 0 0 1px #10b981;
}
.dash-ref-segment button:disabled {
  cursor: not-allowed;
  opacity: .62;
}
.dash-ref-equity-return-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 10px;
}
.dash-ref-equity-return-controls select {
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 999px;
  background: #fff;
  color: #374151;
  height: 30px;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: .74rem;
  font-weight: 800;
}
.dash-ref-equity-return-scroll {
  max-height: 520px;
  overflow: auto;
  margin: 0 -14px -10px;
}
.dash-ref-equity-return-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}
.dash-ref-equity-return-table th,
.dash-ref-equity-return-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(148,163,184,.16);
  white-space: nowrap;
}
.dash-ref-equity-return-table th {
  color: #374151;
  text-align: left;
  font-weight: 900;
  font-size: .72rem;
}
.dash-ref-equity-return-table th:nth-child(2),
.dash-ref-equity-return-table th:nth-child(3),
.dash-ref-equity-return-table td:nth-child(2),
.dash-ref-equity-return-table td:nth-child(3) {
  text-align: right;
}
.dash-ref-allocation-tabs {
  margin: 12px 0 10px;
}
.dash-ref-donut-wrap {
  height: 230px;
  position: relative;
  margin: 6px 0 16px;
}
.dash-ref-donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}
.dash-ref-donut-center strong {
  color: #111827;
  font-size: 1rem;
  font-weight: 900;
}
.dash-ref-donut-center span {
  margin-top: 4px;
  color: #6b7280;
  font-size: .8rem;
  font-weight: 700;
}
.dash-ref-allocation-list {
  display: grid;
  gap: 10px;
  max-height: 255px;
  overflow: auto;
  padding-right: 3px;
}
.dash-ref-allocation-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.dash-ref-allocation-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .62rem;
  font-weight: 900;
}
.dash-ref-allocation-avatar.color-0 { background: #10b981; }
.dash-ref-allocation-avatar.color-1 { background: #35cdb9; }
.dash-ref-allocation-avatar.color-2 { background: #315aa6; }
.dash-ref-allocation-avatar.color-3 { background: #1f78b4; }
.dash-ref-allocation-avatar.color-4 { background: #ef4444; }
.dash-ref-allocation-avatar.color-5 { background: #f59e0b; }
.dash-ref-allocation-main {
  min-width: 0;
}
.dash-ref-allocation-main > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}
.dash-ref-allocation-main strong {
  color: #374151;
  font-size: .82rem;
  font-weight: 900;
}
.dash-ref-allocation-main span {
  color: #7b7f87;
  font-size: .78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-ref-allocation-bar {
  height: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  margin-top: 7px;
  overflow: hidden;
}
.dash-ref-allocation-bar span {
  display: block;
  height: 100%;
  background: #10b981;
}
.dash-ref-allocation-weight {
  color: #2f343b;
  font-size: .8rem;
  font-weight: 900;
}
.dash-ref-table-panel {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15,23,42,.04);
  overflow: hidden;
}
.dash-ref-table-scroll {
  overflow-x: auto;
}
.dash-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.dash-ref-table th {
  text-align: left;
  color: #475569;
  font-size: .72rem;
  font-weight: 800;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(148,163,184,.2);
  white-space: nowrap;
}
.dash-ref-table th.dash-sortable {
  cursor: pointer;
  user-select: none;
}
.dash-ref-table th.dash-sortable::after {
  content: " ^v";
  color: #94a3b8;
  font-size: .62rem;
  font-weight: 900;
  margin-left: 5px;
}
.dash-ref-table th.dash-sortable.active {
  color: #059669;
}
.dash-ref-table th.dash-sortable.active.asc::after {
  content: " ^";
  color: #059669;
}
.dash-ref-table th.dash-sortable.active.desc::after {
  content: " v";
  color: #059669;
}
.dash-ref-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148,163,184,.16);
  color: #020617;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
.dash-ref-table tr:last-child td {
  border-bottom: 0;
}
.dash-ref-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}
.dash-ref-logo {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 900;
  overflow: hidden;
  position: relative;
  flex: 0 0 30px;
}
.dash-ref-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
  z-index: 1;
}
.dash-ref-logo img[src=''],
.dash-ref-logo img:not([src]) {
  display: none;
}
.dash-ref-logo em {
  font-style: normal;
}
.dash-ref-ticker strong,
.dash-ref-ticker small {
  display: block;
}
.dash-ref-ticker small {
  color: #64748b;
  font-size: .68rem;
  font-weight: 600;
  margin-top: 2px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-ref-yield {
  display: inline-flex;
  border: 1px solid #10b981;
  color: #047857;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: .72rem;
  font-weight: 900;
}
@media (max-width: 1180px) {
  .dash-ref-kpis {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
  .dash-ref-analytics-grid {
    grid-template-columns: 1fr;
  }
  .dash-ref-equity-return-scroll,
  .dash-ref-allocation-list {
    max-height: 360px;
  }
}
@media (max-width: 760px) {
  .invest-main {
    padding: 34px 16px 40px;
  }
  .dash-ref-header {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-ref-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .dash-ref-actions select {
    min-width: 0;
    width: 100%;
  }
  .dash-ref-kpis {
    grid-template-columns: 1fr;
  }
  .dash-ref-chart-wrap {
    height: 170px;
  }
  .dash-ref-chart-wrap-lg {
    height: 174px;
  }
  .dash-ref-ranges {
    justify-content: space-between;
    gap: 8px;
  }
  .dash-ref-return-legend {
    grid-template-columns: 1fr;
  }
  .dash-ref-equity-return-controls {
    align-items: flex-start;
    flex-direction: column;
  }
  .dash-ref-equity-return-controls select {
    width: 100%;
  }
  .dash-ref-donut-wrap {
    height: 210px;
  }
}
@media (prefers-color-scheme: dark) {
  .investment-shell .dash-ref-header h1,
  .investment-shell .dash-ref-chart-title h2,
  .investment-shell .dash-ref-chart-title strong,
  .investment-shell .dash-ref-label,
  .investment-shell .dash-ref-total,
  .investment-shell .dash-ref-table td,
  .investment-shell .dash-ref-ranges button,
  .investment-shell .dash-ref-actions select,
  .investment-shell .dash-ref-kpi-value {
    color: #e5e7eb;
  }
  .investment-shell .dash-ref-header p,
  .investment-shell .dash-ref-kpi-label,
  .investment-shell .dash-ref-donut-center span,
  .investment-shell .dash-ref-allocation-main span,
  .investment-shell .dash-ref-table th,
  .investment-shell .dash-ref-ticker small,
  .investment-shell .dash-ref-actions label {
    color: #94a3b8;
  }
  .investment-shell .dash-ref-kpi-card,
  .investment-shell .dash-ref-chart-card,
  .investment-shell .dash-ref-segment,
  .investment-shell .dash-ref-equity-return-controls select,
  .investment-shell .dash-ref-return-legend > div,
  .investment-shell .dash-ref-table-panel,
  .investment-shell .dash-ref-actions select {
    background: rgba(15,23,42,.78);
    border-color: rgba(148,163,184,.18);
  }
  .investment-shell .dash-ref-table th,
  .investment-shell .dash-ref-table td,
  .investment-shell .dash-ref-equity-return-table th,
  .investment-shell .dash-ref-equity-return-table td {
    border-bottom-color: rgba(148,163,184,.14);
  }
  .investment-shell .dash-ref-equity-return-table th,
  .investment-shell .dash-ref-allocation-main strong,
  .investment-shell .dash-ref-allocation-weight,
  .investment-shell .dash-ref-donut-center strong {
    color: #e5e7eb;
  }
  .investment-shell .dash-ref-allocation-bar {
    background: rgba(148,163,184,.16);
  }
}
.invest-main-global {
  min-width: 0;
}
.invest-app-global .invest-sidebar-nav {
  gap: 8px;
}
.invest-global-header {
  align-items: flex-start;
  margin-bottom: 18px;
}
.invest-global-header h1 {
  margin-bottom: 14px;
}
.invest-search-wrap {
  margin-left: 0;
}
.invest-search-wrap .nav-search-input {
  width: 250px;
  height: 36px;
  background: rgba(255,255,255,.84);
  border-color: rgba(148,163,184,.28);
  color: #111827;
  border-radius: 12px;
}
.invest-search-wrap .nav-search-input::placeholder {
  color: #94a3b8;
}
.invest-search-wrap .nav-search-input:focus {
  width: 300px;
  background: #fff;
  color: #111827;
  border-color: rgba(37,99,235,.42);
}
.invest-search-wrap .nav-search-dropdown {
  background: #fff;
  border-color: rgba(148,163,184,.28);
  box-shadow: 0 18px 40px rgba(15,23,42,.14);
}
.invest-search-wrap .nav-search-item {
  border-bottom-color: rgba(148,163,184,.16);
}
.invest-search-wrap .nav-search-item:hover {
  background: #f8fafc;
}
.invest-search-wrap .nav-search-nama {
  color: #334155;
}
.invest-search-wrap .nav-search-sektor {
  color: #94a3b8;
}
.app-sidebar-layout .page-wrapper {
  max-width: none;
  padding: 0 0 42px;
}
.app-sidebar-layout .page-title {
  display: none;
}
.app-sidebar-layout .card,
.app-sidebar-layout .stat-card,
.app-sidebar-layout .filter-bar,
.app-sidebar-layout .table-wrap-outer,
.app-sidebar-layout .period-tabs,
.app-sidebar-layout .div-filter-card,
.app-sidebar-layout .invest-panel {
  border-color: rgba(148,163,184,.25);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15,23,42,.04);
}
.app-sidebar-layout .card {
  padding: 18px;
}
.app-sidebar-layout .card-header {
  margin: -18px -18px 16px;
  padding: 16px 18px;
  background: transparent;
  border-bottom-color: rgba(148,163,184,.2);
}
.app-sidebar-layout .card-title {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}
.app-sidebar-layout .stats-grid {
  gap: 12px;
}
.app-sidebar-layout .stat-card {
  padding: 18px;
}
.app-sidebar-layout .stat-label {
  color: #64748b;
  text-transform: none;
  letter-spacing: 0;
  font-size: .76rem;
}
.app-sidebar-layout .stat-value {
  font-size: 1.65rem;
  letter-spacing: 0;
}
.app-sidebar-layout .btn {
  border-radius: 12px;
}
.app-sidebar-layout .btn-primary {
  background: #111827;
}
.app-sidebar-layout .btn-primary:hover {
  background: #020617;
}
.app-sidebar-layout .data-table thead th {
  background: #f8fafc;
  border-bottom-color: rgba(148,163,184,.28);
}
.app-sidebar-layout .data-table tbody tr {
  border-bottom-color: rgba(148,163,184,.18);
}
.app-sidebar-layout .filter-select,
.app-sidebar-layout .form-control,
.app-sidebar-layout .emiten-search-input {
  border-radius: 12px;
}
.invest-header {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.invest-header h1 {
  font-size: 1.22rem;
  line-height: 1.1;
  margin-bottom: 6px;
}
.invest-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid rgba(148,163,184,.28);
}
.invest-global-tabs {
  flex-wrap: wrap;
  gap: 10px 18px;
}
.invest-tabs a {
  padding: 0 0 12px;
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}
.invest-tabs a.active {
  color: #111827;
  box-shadow: inset 0 -2px 0 #111827;
}
.invest-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.invest-filter-btn,
.invest-ai-btn,
.invest-user {
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.28);
  background: rgba(255,255,255,.84);
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.invest-filter-btn svg,
.invest-ai-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.invest-ai-btn {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.invest-user {
  padding: 5px 10px 5px 5px;
}
.invest-user:hover,
.invest-ai-btn:hover {
  text-decoration: none;
}
.invest-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .72rem;
  font-weight: 800;
}
.invest-user span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.invest-user small {
  color: #64748b;
  font-size: .68rem;
  font-weight: 600;
}
.invest-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.invest-summary-card,
.invest-skeleton {
  min-height: 102px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: 0 10px 30px rgba(15,23,42,.04);
}
.invest-summary-card[href] {
  display: block;
  color: inherit;
  text-decoration: none;
}
.invest-summary-card[href]:hover {
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 14px 34px rgba(37,99,235,.08);
}
.invest-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.5), rgba(255,255,255,.95), rgba(255,255,255,.5));
  background-size: 240% 100%;
  animation: investPulse 1.1s linear infinite;
}
@keyframes investPulse { to { background-position: -240% 0; } }
.invest-summary-label {
  font-size: .72rem;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 8px;
}
.invest-summary-value {
  font-size: 1.55rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}
.invest-summary-change {
  margin-top: 8px;
  font-size: .72rem;
  color: #64748b;
  font-weight: 700;
}
.invest-pos { color: #059669; }
.invest-neg { color: #dc2626; }
.invest-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .78fr);
  grid-auto-flow: dense;
  gap: 12px;
}
.invest-panel {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15,23,42,.04);
}
.invest-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.invest-panel-head h2 {
  font-size: .88rem;
  font-weight: 800;
  color: #111827;
}
.invest-panel-head a,
.invest-panel-head span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}
.invest-panel-performance { min-height: 308px; }
.invest-chart-wrap {
  position: relative;
  width: 100%;
}
.invest-performance-chart { height: 230px; }
.invest-mini-chart { height: 118px; margin: 10px 0; }
.invest-chart-legend {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.invest-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.invest-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
}
.invest-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.invest-chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
  border: 1px solid rgba(148,163,184,.22);
}
.invest-holdings-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.invest-holding-row {
  display: grid;
  grid-template-columns: 1fr 64px 90px 52px;
  align-items: center;
  gap: 10px;
}
.invest-asset {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.invest-asset-logo {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .66rem;
  font-weight: 900;
}
.invest-asset strong,
.invest-mover-row strong {
  display: block;
  font-size: .78rem;
  line-height: 1.1;
}
.invest-asset small,
.invest-mover-row small {
  display: block;
  color: #64748b;
  font-size: .66rem;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invest-num {
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 700;
  text-align: right;
}
.invest-progress {
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.invest-progress span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: #10b981;
  border-radius: inherit;
}
.invest-pl {
  justify-self: end;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: .68rem;
  font-weight: 800;
  background: #ecfdf5;
  color: #059669;
}
.invest-pl.neg {
  background: #fef2f2;
  color: #dc2626;
}
.invest-allocation-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0;
}
.invest-metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.invest-metric {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px;
}
.invest-metric small {
  display: block;
  color: #64748b;
  font-size: .66rem;
  margin-bottom: 4px;
}
.invest-metric strong {
  font-size: .9rem;
}
.invest-movers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.invest-mover-col h3 {
  font-size: .66rem;
  color: #059669;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.invest-mover-col.loss h3 { color: #dc2626; }
.invest-mover-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
}
.invest-news-panel { grid-column: 2; }
.invest-news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invest-news-item {
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 12px;
  padding: 12px;
}
.invest-news-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #94a3b8;
  font-size: .64rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.invest-news-title {
  color: #334155;
  font-size: .79rem;
  line-height: 1.45;
}

/* ── Dividend Tracking Page ────────────────────────────────── */
.div-page {
  max-width: 1360px;
  margin: 0 auto;
}
.div-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.div-back {
  color: #64748b;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}
.div-hero h1 {
  font-size: 1.7rem;
  margin: 6px 0;
}
.div-hero p {
  color: #64748b;
  max-width: 620px;
}
.div-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.div-filter-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}
.div-filter-group {
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.div-filter-group label,
.div-manual-form label {
  font-size: .72rem;
  font-weight: 800;
  color: #64748b;
}
.div-filter-group select,
.div-manual-form input,
.div-manual-form select,
.div-manual-form textarea {
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-ui);
  font-size: .84rem;
  padding: 9px 10px;
  outline: none;
}
.div-filter-group select:focus,
.div-manual-form input:focus,
.div-manual-form select:focus,
.div-manual-form textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-ring);
}
.div-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.div-chart-grid,
.div-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .62fr);
  gap: 12px;
  margin-bottom: 12px;
}
.div-allocation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.div-allocation-panel {
  overflow: hidden;
}
.div-allocation-content {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.div-allocation-donut {
  height: 260px;
  margin: 0;
}
.div-allocation-list {
  max-height: 285px;
}
.div-chart-wrap {
  position: relative;
  height: 270px;
}
.div-history-panel {
  padding: 0;
  overflow: hidden;
}
.div-history-panel .invest-panel-head {
  padding: 18px 18px 0;
}
.div-table-scroll {
  overflow-x: auto;
  padding: 0 18px 18px;
}
.div-table td,
.div-table th {
  white-space: nowrap;
}
.div-transaction-history-panel .invest-panel-head {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px 14px;
  border-bottom: 1px solid rgba(148,163,184,.18);
}
.div-history-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.div-history-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.div-history-title-wrap h2 {
  margin: 0;
  white-space: nowrap;
}
.div-history-tabs button {
  height: 34px;
  min-width: 64px;
  border: 1px solid transparent;
  background: transparent;
  color: #9ca3af;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}
.div-history-tabs button.active {
  border-color: rgba(148,163,184,.34);
  background: #fff;
  color: #059669;
}
.div-history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.div-history-search {
  position: relative;
  display: block;
}
.div-history-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.div-history-search input,
.div-history-controls select {
  height: 32px;
  border: 1px solid rgba(148,163,184,.34);
  border-radius: 3px;
  background: #fff;
  color: #2f343b;
  font-family: var(--font-ui);
  font-size: .8rem;
  font-weight: 700;
  outline: none;
}
.div-history-search input {
  width: 335px;
  padding: 0 12px 0 32px;
  background-image: linear-gradient(transparent, transparent);
}
.div-history-search::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 1.7px solid #9ca3af;
  border-radius: 999px;
  transform: translateY(-56%);
  pointer-events: none;
}
.div-history-search::after {
  content: '';
  position: absolute;
  left: 22px;
  top: 19px;
  width: 6px;
  height: 1.7px;
  background: #9ca3af;
  transform: rotate(45deg);
  pointer-events: none;
}
.div-history-controls select {
  min-width: 132px;
  padding: 0 10px;
}
.div-transaction-history-panel .div-table-scroll {
  padding: 0;
}
.div-transaction-table {
  font-size: .88rem;
}
.div-transaction-table thead th {
  padding: 20px 16px;
  color: #1f2937;
  font-size: .86rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid rgba(148,163,184,.24);
}
.div-transaction-table tbody td {
  padding: 13px 16px;
  border-bottom: 0;
  color: #2f343b;
  font-weight: 500;
}
.div-transaction-table th:not(:first-child),
.div-transaction-table td:not(:first-child) {
  text-align: right;
}
.div-transaction-table th:first-child,
.div-transaction-table td:first-child {
  text-align: left;
}
.div-transaction-table td:first-child strong {
  display: block;
  font-size: .86rem;
  font-weight: 900;
}
.div-transaction-table td:first-child small {
  display: block;
  margin-top: 3px;
  color: #9ca3af;
  font-size: .7rem;
}
.div-icon-delete {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(220,38,38,.14);
  border-radius: 6px;
  background: rgba(254,242,242,.72);
  color: #dc2626;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  opacity: .72;
}
.div-icon-delete svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.div-icon-delete:hover {
  background: #fee2e2;
  border-color: rgba(220,38,38,.28);
  opacity: 1;
}
.div-icon-delete:disabled {
  cursor: wait;
  opacity: .45;
}
.div-icon-delete.is-loading {
  animation: div-delete-pulse .75s ease-in-out infinite alternate;
}
@keyframes div-delete-pulse {
  from { transform: scale(1); }
  to { transform: scale(.92); }
}
.div-transaction-month td {
  background: #f3f4f6;
  color: #8a9099 !important;
  font-size: .82rem;
  font-weight: 800 !important;
  text-align: left !important;
  padding: 12px 16px !important;
}
.div-side-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.div-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.div-timeline-item {
  position: relative;
  border-left: 2px solid #dbeafe;
  padding-left: 12px;
}
.div-timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2563eb;
}
.div-timeline-item strong {
  display: block;
  font-size: .82rem;
}
.div-timeline-item span {
  display: block;
  color: #64748b;
  font-size: .73rem;
  margin-top: 2px;
}
.div-manual-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.div-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.div-form-status {
  min-height: 18px;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
}
.div-import-hint {
  color: #64748b;
  font-size: .76rem;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
}
.div-portfolio-toolbar {
  align-items: flex-end;
}
.div-management-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.div-management-grid .invest-panel {
  min-width: 0;
}
.div-management-grid .div-form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.div-holdings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.div-holding-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148,163,184,.18);
}
.div-holding-item:last-child {
  border-bottom: 0;
}
.div-holding-item strong,
.div-holding-item small {
  display: block;
}
.div-holding-item small {
  color: #64748b;
  font-size: .72rem;
  margin-top: 2px;
}
.div-holding-item > div:last-child {
  text-align: right;
  white-space: nowrap;
}
.div-empty-panel {
  color: #64748b;
  font-size: .82rem;
  padding: 10px 0;
}
.div-calendar-panel {
  margin-bottom: 12px;
}
.div-portfolio-calendar {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}
.div-portfolio-calendar .div-month {
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.div-portfolio-calendar .div-month-title {
  padding: 10px 12px;
  background: #f8fafc;
  font-size: .78rem;
  font-weight: 800;
  color: #334155;
}
.div-portfolio-calendar .div-month-body {
  padding: 10px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.div-portfolio-calendar .div-event {
  display: block;
  border: 1px solid rgba(37,99,235,.14);
  border-radius: 10px;
  padding: 8px;
  background: #eff6ff;
  text-decoration: none;
  color: #111827;
}
.div-event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .75rem;
}
.div-event-meta {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: .68rem;
}
.div-empty {
  color: #94a3b8;
  font-size: .72rem;
}

@media (max-width: 1180px) {
  .invest-summary-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .invest-content-grid,
  .div-chart-grid,
  .div-allocation-content,
  .div-main-grid { grid-template-columns: 1fr; }
  .div-management-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .div-management-grid .invest-panel:nth-child(2) {
    grid-column: span 2;
  }
  .invest-news-panel { grid-column: auto; }
}
@media (max-width: 760px) {
  .invest-app {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .invest-sidebar {
    padding: 10px;
    gap: 10px;
  }
  .invest-sidebar-rail {
    width: 72px;
    flex-basis: 72px;
  }
  .invest-sidebar-panel {
    display: none !important;
  }
  .invest-main {
    padding: 20px 14px 34px;
  }
  .invest-header,
  .div-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .invest-header-actions {
    justify-content: flex-start;
  }
  .invest-search-wrap {
    width: 100%;
    order: 3;
  }
  .invest-search-wrap .nav-search-input,
  .invest-search-wrap .nav-search-input:focus {
    width: 100%;
  }
  .invest-search-wrap .nav-search-dropdown {
    width: 100%;
  }
  .invest-tabs {
    overflow-x: auto;
    gap: 18px;
  }
  .invest-summary-grid,
  .div-summary-grid {
    grid-template-columns: 1fr;
  }
  .invest-holding-row {
    grid-template-columns: minmax(130px, 1fr) 64px;
  }
  .invest-holding-row .invest-progress,
  .invest-holding-row .invest-pl {
    grid-column: 2;
  }
  .invest-movers-grid,
  .invest-metric-row,
  .div-form-row,
  .div-management-grid,
  .div-portfolio-calendar {
    grid-template-columns: 1fr;
  }
  .div-management-grid .invest-panel:nth-child(2) {
    grid-column: auto;
  }
  .div-holding-item {
    align-items: flex-start;
  }
  .div-transaction-history-panel .invest-panel-head,
  .div-history-title-wrap,
  .div-history-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .div-history-controls,
  .div-history-tabs {
    width: 100%;
  }
  .div-history-tabs button {
    flex: 1;
  }
  .div-history-search input,
  .div-history-controls select {
    width: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  .investment-shell {
    background: #101418;
  }
  .investment-shell .invest-sidebar,
  .investment-shell .invest-summary-card,
  .investment-shell .invest-panel,
  .investment-shell .invest-filter-btn,
  .investment-shell .invest-user {
    background: rgba(23,28,35,.88);
    border-color: rgba(148,163,184,.18);
    color: #e5e7eb;
  }
  .investment-shell .invest-ai-btn {
    background: #e5e7eb;
    color: #111827;
    border-color: #e5e7eb;
  }
  .investment-shell .invest-search-wrap .nav-search-input {
    background: rgba(23,28,35,.88);
    border-color: rgba(148,163,184,.18);
    color: #f8fafc;
  }
  .investment-shell .invest-search-wrap .nav-search-input:focus,
  .investment-shell .invest-search-wrap .nav-search-dropdown {
    background: #171c23;
    color: #f8fafc;
  }
  .investment-shell .invest-search-wrap .nav-search-item:hover {
    background: rgba(148,163,184,.12);
  }
  .investment-shell .invest-search-wrap .nav-search-nama {
    color: #cbd5e1;
  }
  .investment-shell .invest-tabs a.active,
  .investment-shell .invest-panel-head h2,
  .investment-shell .invest-summary-value {
    color: #f8fafc;
  }
  .investment-shell .invest-tabs,
  .investment-shell .invest-metric,
  .investment-shell .invest-news-item {
    border-color: rgba(148,163,184,.18);
  }
  .investment-shell .invest-metric {
    background: rgba(15,23,42,.75);
  }
  .investment-shell .invest-news-title,
  .investment-shell .invest-asset small,
  .investment-shell .invest-mover-row small,
  .investment-shell .invest-summary-label,
  .investment-shell .invest-summary-change {
    color: #94a3b8;
  }
  .app-sidebar-layout .card,
  .app-sidebar-layout .stat-card,
  .app-sidebar-layout .filter-bar,
  .app-sidebar-layout .table-wrap-outer,
  .app-sidebar-layout .period-tabs,
  .app-sidebar-layout .div-filter-card {
    background: rgba(23,28,35,.88);
    border-color: rgba(148,163,184,.18);
  }
  .app-sidebar-layout .data-table thead th {
    background: rgba(15,23,42,.72);
  }
  .investment-shell .div-history-tabs button.active,
  .investment-shell .div-history-search input,
  .investment-shell .div-history-controls select,
  .investment-shell .div-portfolio-calendar .div-month {
    background: rgba(15,23,42,.78);
    border-color: rgba(148,163,184,.18);
    color: #e5e7eb;
  }
  .investment-shell .div-transaction-month td,
  .investment-shell .div-portfolio-calendar .div-month-title {
    background: rgba(148,163,184,.12);
    color: #cbd5e1 !important;
  }
}

@media (max-width: 1180px) {
  .invest-topbar-inner {
    padding: 10px 16px;
  }
  .invest-topbar .nav-link {
    padding: 9px 11px;
    font-size: .8rem;
  }
  .nav-search-input {
    width: min(260px, 32vw);
  }
  .nav-search-input:focus {
    width: min(320px, 38vw);
  }
}

@media (max-width: 960px) {
  .invest-topbar-inner {
    align-items: center;
  }
  .invest-topbar-menu {
    display: inline-grid;
    order: 2;
  }
  .invest-topbar-links {
    display: none;
    order: 4;
    flex: 0 0 100%;
    width: 100%;
    overflow: visible;
    padding: 8px;
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 18px;
    background: rgba(248,250,252,.96);
    box-shadow: 0 18px 36px rgba(15,23,42,.08);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .invest-topbar-links.open {
    display: flex;
  }
  .invest-topbar .nav-link {
    width: 100%;
    justify-content: flex-start;
    border-radius: 14px;
    padding: 11px 12px;
  }
  .invest-topbar-actions {
    order: 3;
    margin-left: auto;
  }
  .nav-search-wrap {
    width: min(320px, 40vw);
  }
  .invest-header-actions {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .invest-topbar-inner {
    padding: 10px 12px;
  }
  .invest-topbar-brand-text small {
    display: none;
  }
  .invest-topbar-actions {
    flex: 0 0 100%;
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
    flex-wrap: wrap;
  }
  .nav-search-wrap {
    width: 100%;
    margin-left: 0;
    flex: 1 1 100%;
  }
  .nav-search-input,
  .nav-search-input:focus {
    width: 100%;
    height: 38px;
    border-radius: 14px;
  }
  .invest-ai-btn,
  .invest-user {
    min-height: 38px;
  }
  .invest-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
  }
  .invest-header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .invest-topbar-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .invest-topbar-brand-text strong {
    font-size: .96rem;
  }
  .invest-main {
    padding: 14px 10px 28px;
  }
  .invest-header-actions {
    width: 100%;
  }
  .invest-ai-btn,
  .invest-user {
    width: 100%;
    justify-content: center;
  }
  .invest-topbar .nav-link {
    font-size: .82rem;
  }
}

@media (max-width: 1024px) and (prefers-color-scheme: dark) {
  .investment-shell .invest-topbar {
    background: rgba(16,20,24,.96);
    border-bottom-color: rgba(148,163,184,.18);
  }
}
