
/* ===== Sidebar chat panel ===== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 1040;
}
.sidebar-overlay.active { display: block; }

.sidebar-panel {
  position: fixed; top: 0; right: -420px; bottom: 0;
  width: 400px;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,.12);
  z-index: 1050;
  display: flex; flex-direction: column;
  transition: right .25s ease;
}
.sidebar-panel.open { right: 0; }

.sidebar-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}
.sidebar-title { font-weight: 600; font-size: .95rem; }

.sidebar-messages {
  flex: 1; overflow-y: auto;
  padding: .75rem 1rem;
  display: flex; flex-direction: column; gap: .5rem;
}

.sidebar-msg {
  max-width: 88%;
  padding: .5rem .75rem;
  border-radius: 12px;
  font-size: .875rem;
  line-height: 1.45;
  word-break: break-word;
}
.sidebar-msg-user {
  align-self: flex-end;
  background: #0d6efd; color: #fff;
  border-bottom-right-radius: 3px;
}
.sidebar-msg-assistant {
  align-self: flex-start;
  background: #f0f2f5; color: #212529;
  border-bottom-left-radius: 3px;
}

/* Typing indicator — three bouncing dots */
.sidebar-typing {
  align-self: flex-start;
  background: #f0f2f5;
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  padding: .5rem .85rem;
  display: flex;
  gap: 4px;
  align-items: center;
}
.sidebar-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #adb5bd;
  animation: typing-bounce .9s infinite ease-in-out;
}
.sidebar-typing span:nth-child(2) { animation-delay: .15s; }
.sidebar-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}

.sidebar-input-area {
  padding: .75rem 1rem;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
}

/* Floating toggle button */
.sidebar-toggle-btn {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #0d6efd; color: #fff;
  border: none;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(13,110,253,.4);
  z-index: 1039;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.sidebar-toggle-btn:hover { background: #0b5ed7; }

@media (max-width: 576px) {
  .sidebar-panel { width: 100%; right: -100%; }
}

/* ===== Collapsible card headers ===== */
.collapse-icon { transition: transform .2s ease; }
[aria-expanded="true"] .collapse-icon { transform: rotate(180deg); }

/* ===== Global ===== */
body { background: #f8f9fa; }
.navbar-brand { font-weight: 700; letter-spacing: -0.5px; }
.nav-link.active { font-weight: 600; }
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-radius: 10px; }
.card-header { background: #fff; border-bottom: 1px solid #f0f0f0; font-weight: 600; border-radius: 10px 10px 0 0 !important; }
.negative { color: #dc3545; font-weight: 600; }
.milestone-row td:first-child { font-weight: 600; }
.milestone-badge { font-size: 0.68em; white-space: nowrap; }
.section-title { font-size: 1rem; font-weight: 600; color: #495057; margin-bottom: .5rem; }
.form-label { font-size: .85rem; color: #495057; }
input.form-control { font-size: .9rem; }

/* ===== Stat cards ===== */
.stat-card { text-align: center; padding: 1.25rem; }
.stat-card .value { font-size: 1.1rem; font-weight: 700; color: #0d6efd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card .label { font-size: 0.8rem; color: #6c757d; text-transform: uppercase; letter-spacing: .05em; }

/* ===== Retirement page ===== */
.accounts-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
#projectionChart { height: 360px !important; }
.table-sm td, .table-sm th { font-size: .8rem; }

/* ===== Money page drag-and-drop overlay ===== */
#dropOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 110, 253, 0.15);
  border: 3px dashed #0d6efd;
  z-index: 9999;
  pointer-events: none;
}
#dropOverlay.active { display: flex; align-items: center; justify-content: center; }
#dropMessage { text-align: center; color: #0d6efd; font-size: 1.2rem; font-weight: 600; }

/* ===== Sortable table ===== */
th.sortable { cursor: pointer; white-space: nowrap; user-select: none; }
th.sortable:hover { background: #e9ecef; }
.sort-icon { font-size: .7rem; margin-left: 2px; }
.sort-active { color: #0d6efd; }
.sort-inactive { color: #adb5bd; }
.owner-group-header td {
  background: #e9ecef;
  border-top: 3px solid #adb5bd;
  border-bottom: 1px solid #adb5bd;
  padding-top: .4rem !important;
  padding-bottom: .4rem !important;
  letter-spacing: .06em;
  font-size: .75rem !important;
  color: #495057 !important;
}

/* ===== Explorer page ===== */
.fla-explorer { height: calc(100vh - 140px); }

/* ===== Tax page ===== */
.tax-summary-card {
  position: sticky;
  top: 1rem;
}
.tax-section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6c757d;
  margin-bottom: .25rem;
}

.border-dashed { border-style: dashed !important; }
