/* ═══════════════════════════════════════════════════
   components.css  —  All reusable UI components.
   Buttons, cards, forms, tables, badges, avatars,
   progress bars, modal, loading states, AI bubbles.
════════════════════════════════════════════════════ */

/* ── Buttons ──────────────────────────────────── */
.btn {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}
.btn[disabled]       { opacity: 0.7; cursor: not-allowed; }
.btn:hover          { background: var(--bg3); }
.btn-primary        { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover  { filter: brightness(0.9); }
.btn-sm             { padding: 5px 11px; font-size: 12px; }
.btn-danger         { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn-inline         { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-icon {
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text2);
  display: flex; align-items: center;
}
.notif-btn { position: relative; }
.topbar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Cards ────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card-title {
  font-size: 13px; font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

/* Metric summary cards */
.metric-card {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.metric-label {
  font-size: 11px; color: var(--text3);
  margin-bottom: 4px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
}
.metric-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.metric-sub   { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ── Forms ────────────────────────────────────── */
.form-group    { margin-bottom: 14px; }
.form-label    { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
.form-input,
.form-select,
.form-textarea {
  width: 100%; padding: 9px 12px;
  font-size: 13px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { outline: none; border-color: var(--accent); }
.form-textarea  { resize: vertical; min-height: 80px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* ── Tables ───────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 8px 12px;
  font-size: 11px; font-weight: 600; color: var(--text3);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td         { border-bottom: none; }
tbody tr:hover td        { background: var(--bg3); }
.details-row td          { padding: 0 12px 12px; background: transparent !important; }
.details-row:hover td    { background: transparent !important; }
.details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  text-decoration: none;
}
.details-toggle:hover { color: var(--text2); }
.details-panel {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 14px;
}
.details-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 3px;
}
.details-value { font-size: 12px; color: var(--text2); line-height: 1.5; }
.details-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.details-link:hover { text-decoration: underline; }
.record-row { cursor: pointer; }
.record-row .btn,
.record-row .btn-sm,
.record-row .details-toggle { position: relative; z-index: 1; }

/* ── Badges ───────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; padding: 2px 9px;
  border-radius: 99px; font-weight: 600;
  white-space: nowrap;
}
.b-blue   { background: var(--accent-bg);   color: var(--accent);  }
.b-green  { background: var(--success-bg);  color: var(--success); }
.b-amber  { background: var(--warning-bg);  color: var(--warning); }
.b-red    { background: var(--danger-bg);   color: var(--danger);  }
.b-gray   { background: var(--bg3);         color: var(--text2);   }
.b-purple { background: #EEEDFE;            color: #534AB7;        }

/* ── Avatars ──────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.av-sm { width: 28px; height: 28px; font-size: 11px; }
.av-md { width: 36px; height: 36px; font-size: 13px; }

.av-blue   { background: #B5D4F4; color: #0C447C; }
.av-green  { background: #C0DD97; color: #27500A; }
.av-amber  { background: #FAC775; color: #633806; }
.av-purple { background: #CECBF6; color: #3C3489; }
.av-coral  { background: #F5C4B3; color: #712B13; }
.av-teal   { background: #9FE1CB; color: #085041; }

/* ── Progress bar ─────────────────────────────── */
.progress {
  height: 6px;
  background: var(--border2);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}

/* ── Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.95);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.modal-title  { font-size: 15px; font-weight: 700; }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── AI advisor bubbles ───────────────────────── */
.ai-card { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.ai-blue   { background: linear-gradient(135deg, var(--accent-bg), #f0ebff); border: 1px solid #B5D4F4; }
.ai-amber  { background: linear-gradient(135deg, var(--warning-bg), #fff3e0);  border: 1px solid #FAC775; }
.ai-green  { background: linear-gradient(135deg, var(--success-bg), #e8f5e9);  border: 1px solid #C0DD97; }
.ai-red    { background: linear-gradient(135deg, var(--danger-bg),  #ffeaea);  border: 1px solid #F7C1C1; }

[data-theme="dark"] .ai-blue  { background: rgba(55,138,221,0.10); border-color: rgba(55,138,221,0.30); }
[data-theme="dark"] .ai-amber { background: rgba(186,117,23,0.10); border-color: rgba(186,117,23,0.30); }
[data-theme="dark"] .ai-green { background: rgba(99,153,34,0.10);  border-color: rgba(99,153,34,0.30);  }
[data-theme="dark"] .ai-red   { background: rgba(226,75,74,0.10);  border-color: rgba(226,75,74,0.30);  }

.ai-tag { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.ai-msg { font-size: 13px; line-height: 1.55; }

/* ── Loading / empty states ───────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; flex-direction: column; gap: 12px;
  color: var(--text2); font-size: 13px;
}

.empty-state { text-align: center; padding: 40px 20px; color: var(--text3); }
.empty-state svg { margin: 0 auto 12px; display: block; opacity: .4; }

/* ── Announcement menus ───────────────────────── */
.ann-meta       { font-size: 11px; color: var(--text3); }
.ann-flags      { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-menu       { position: relative; flex-shrink: 0; }
.ann-menu-toggle { color: var(--text3); }
.ann-menu-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
  padding: 6px;
  z-index: 40;
}
.ann-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.ann-menu-item:hover        { background: var(--bg3); }
.ann-menu-item-danger       { color: var(--danger); }
.ann-menu-item svg          { flex-shrink: 0; }

/* ── Profile center ──────────────────────────── */
.profile-center { display: flex; flex-direction: column; gap: 14px; }
.profile-center-subtitle {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}
.profile-center-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-center-nav-btn {
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.profile-center-nav-btn.active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: #B5D4F4;
}
.profile-center-section { display: flex; flex-direction: column; gap: 12px; }
.profile-center-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-bg), var(--bg3));
  border: 1px solid var(--border);
}
.profile-center-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.profile-center-copy {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
}
.profile-center-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.profile-center-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}
.profile-center-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.profile-center-meta {
  font-size: 11px;
  color: var(--text3);
}
@media (max-width: 640px) {
  .profile-center-stack { grid-template-columns: 1fr; }
  .profile-center-hero { align-items: flex-start; }
}

/* ── Account center ──────────────────────────── */
.account-center {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}
.account-center-sidebar {
  border-right: 1px solid var(--border);
  padding-right: 12px;
}
.account-center-group + .account-center-group { margin-top: 16px; }
.account-center-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text3);
  margin-bottom: 8px;
}
.account-center-nav-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 6px;
}
.account-center-nav-btn:hover { background: var(--bg3); }
.account-center-nav-btn.active {
  background: linear-gradient(135deg, var(--accent-bg), var(--bg3));
  color: var(--accent);
  border-color: #B5D4F4;
  font-weight: 600;
}
.account-center-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.account-center-subtitle {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}
.account-center-content { display: flex; flex-direction: column; gap: 12px; }
.account-center-hero {
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.account-center-hero-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.account-center-hero-copy {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
  margin-top: 4px;
}
.account-center-panel,
.account-center-doc {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.account-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.account-center-copy {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.75;
}
.account-center-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
}
.account-center-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.theme-switch {
  position: relative;
  width: 168px;
  height: 36px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: var(--bg3);
  color: var(--text2);
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}
.theme-switch-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .18s ease;
}
.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(0,0,0,0.10);
  transition: transform .18s ease;
}
.theme-switch.is-dark .theme-switch-thumb {
  transform: translateX(100%);
}
.theme-switch.is-light .theme-switch-label-light,
.theme-switch.is-dark .theme-switch-label-dark {
  color: var(--text);
}
.theme-switch.is-light .theme-switch-label-dark,
.theme-switch.is-dark .theme-switch-label-light {
  color: var(--text3);
}
.theme-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.account-center-meta {
  font-size: 11px;
  color: var(--text3);
}
.account-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.account-accordion-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.account-accordion-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 700;
}
.account-accordion-item summary::-webkit-details-marker { display: none; }
.account-accordion-body {
  padding: 0 16px 16px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
}
.account-accordion-blue {
  background: linear-gradient(135deg, var(--accent-bg), #f0ebff);
  border: 1px solid #B5D4F4;
}
.account-accordion-amber {
  background: linear-gradient(135deg, var(--warning-bg), #fff3e0);
  border: 1px solid #FAC775;
}
@media (max-width: 800px) {
  .account-center {
    grid-template-columns: 1fr;
  }
  .account-center-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 10px;
  }
  .theme-switch {
    width: 100%;
    max-width: 220px;
  }
}

/* ── Admin workspace ───────────────────────────── */
.admin-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-hero-card {
  padding: 0;
  overflow: hidden;
}
.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.admin-sections {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.admin-list-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.admin-section-sub {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
  margin-top: -6px;
}
.admin-row-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.admin-row-meta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
}
.admin-row-copy {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.55;
  margin-top: 6px;
}
.admin-actions-cell {
  text-align: right;
  white-space: nowrap;
}
.admin-empty {
  font-size: 12px;
  color: var(--text3);
  padding: 10px 0 2px;
}
.admin-menu {
  position: relative;
  display: inline-block;
}
.admin-menu[open] .admin-menu-toggle {
  background: var(--bg3);
  color: var(--accent);
}
.admin-menu-toggle {
  list-style: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.admin-menu-toggle::-webkit-details-marker { display: none; }
.admin-menu-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
  padding: 6px;
  z-index: 40;
}
.admin-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.admin-menu-item:hover { background: var(--bg3); }
.admin-menu-item-danger { color: var(--danger); }
.admin-modal-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-desktop-table {
  display: block;
}
.admin-mobile-list {
  display: none;
}
.admin-mobile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-mobile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.admin-mobile-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-mobile-meta-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.admin-mobile-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text3);
  white-space: nowrap;
}
.admin-mobile-meta-value {
  font-size: 12px;
  color: var(--text);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}
.admin-mobile-meta-sub {
  font-size: 11px;
  color: var(--text3);
}
.admin-mobile-actions {
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 960px) {
  .admin-sections {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .admin-desktop-table {
    display: none;
  }
  .admin-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .admin-actions-cell {
    text-align: left;
  }
  .admin-menu-pop {
    right: 0;
    left: auto;
    min-width: min(220px, calc(100vw - 48px));
  }
}
@media (max-width: 480px) {
  .admin-mobile-head,
  .admin-mobile-meta-line {
    flex-direction: column;
  }
  .admin-mobile-meta-value {
    align-items: flex-start;
    text-align: left;
  }
  .admin-mobile-actions {
    justify-content: flex-start;
  }
  .admin-menu-pop {
    min-width: min(220px, calc(100vw - 32px));
  }
}

/* ── Notifications / task comments ───────────── */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  text-align: left;
  padding: 12px 14px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
}
.notif-item:hover { background: var(--bg3); }
.notif-item-unread { border-color: var(--border2); background: var(--bg3); }
.notif-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.notif-title-row { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-time { font-size: 11px; color: var(--text3); white-space: nowrap; }
.notif-message { font-size: 12px; color: var(--text2); line-height: 1.5; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
}
.notif-dot-warning { background: var(--warning); }
.notif-dot-alert { background: var(--danger); }
.notif-dot-success { background: var(--success); }

.task-comment {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--bg3);
  margin-bottom: 8px;
}
.task-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.task-comment-head span:last-child {
  font-weight: 400;
  color: var(--text3);
  font-size: 11px;
}
.task-comment-body {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.55;
  white-space: pre-wrap;
}

/* ── Finance helpers ─────────────────────────── */
.finance-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.finance-info {
  position: relative;
  flex-shrink: 0;
}
.finance-info-toggle {
  list-style: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.finance-info-toggle::-webkit-details-marker { display: none; }
.finance-info[open] .finance-info-toggle {
  color: var(--accent);
  border-color: #B5D4F4;
  background: var(--accent-bg);
}
.finance-info-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(280px, calc(100vw - 48px));
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
  color: var(--text2);
  font-size: 12px;
  line-height: 1.55;
  z-index: 30;
}
@media (max-width: 480px) {
  .finance-card-head {
    align-items: flex-start;
  }
  .finance-info-pop {
    width: min(260px, calc(100vw - 32px));
  }
}

/* ── Misc helpers ─────────────────────────────── */
.divider   { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.tag-row   { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
code       { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: monospace; color: var(--accent); }
