:root {
  --bg: #081624;
  --bg-alt: #0d2235;
  --panel: rgba(10, 32, 49, 0.94);
  --panel-soft: rgba(15, 41, 62, 0.72);
  --stroke: rgba(138, 183, 214, 0.12);
  --text: #eaf4fb;
  --muted: #94aec2;
  --accent: #4dd0c8;
  --accent-2: #ff8f5c;
  --accent-3: #72c4ff;
  --accent-4: #a98fff;
  --accent-5: #7de47c;
  --danger: #ff7c8d;
  --danger-deep: #3b131d;
  --success-deep: #0b3429;
  --warning: #ffd17d;
  --shadow: 0 28px 70px rgba(3, 11, 19, 0.45);
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(77, 208, 200, 0.12), transparent 20%),
    radial-gradient(circle at left 20%, rgba(114, 196, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #07111c, #0a1828 52%, #0b1a2b);
  color: var(--text);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.auth-panel {
  display: grid;
  gap: 1rem;
  width: min(430px, 100%);
  padding: 1.35rem;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(11, 33, 50, 0.98), rgba(9, 25, 41, 0.96)),
    linear-gradient(140deg, rgba(255, 255, 255, 0.04), transparent 34%);
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin: 0;
  font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
  font-size: 1.55rem;
}

.auth-panel__logo {
  display: block;
  width: 100%;
  max-width: 250px;
  height: auto;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 0.65rem 0.75rem;
}

.auth-field {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-field input {
  width: 100%;
  border: 1px solid rgba(114, 196, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(7, 22, 36, 0.86);
  color: var(--text);
  font: inherit;
  padding: 0.9rem 1rem;
}

.auth-field input:focus {
  outline: 2px solid rgba(77, 208, 200, 0.42);
  outline-offset: 2px;
}

.auth-submit {
  width: 100%;
  border: 1px solid rgba(77, 208, 200, 0.45);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(77, 208, 200, 0.92), rgba(114, 196, 255, 0.76)),
    var(--accent);
  color: #06131f;
  cursor: pointer;
  font: 700 0.98rem/1 "Bahnschrift", "Trebuchet MS", sans-serif;
  padding: 0.92rem 1rem;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.auth-secondary {
  width: 100%;
  border: 1px solid rgba(114, 196, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(15, 42, 64, 0.72);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 0.8rem 1rem;
}

.auth-hint {
  margin: -0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-message {
  min-height: 1.4rem;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-methods {
  display: grid;
  gap: 0.65rem;
}

.auth-method {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  border: 1px solid rgba(114, 196, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(15, 42, 64, 0.72);
  color: var(--text);
  cursor: pointer;
  padding: 0.85rem 1rem;
  text-align: left;
}

.auth-method:hover,
.auth-method:focus-visible {
  border-color: rgba(77, 208, 200, 0.52);
  outline: none;
}

.auth-method span {
  font-weight: 700;
}

.auth-method small {
  color: var(--muted);
}

.shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 1.5rem;
  background:
    linear-gradient(180deg, rgba(10, 31, 47, 0.98), rgba(7, 21, 34, 0.98)),
    linear-gradient(140deg, rgba(255, 255, 255, 0.03), transparent 28%);
  border-right: 1px solid var(--stroke);
}

.brand {
  display: grid;
  gap: 0.85rem;
  padding: 0.5rem 0;
}

.brand__logo {
  display: block;
  width: 100%;
  max-width: 245px;
  height: auto;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
}

.brand__eyebrow,
.eyebrow {
  margin: 0 0 0.3rem;
  color: #7abbd9;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}

.brand h1,
.topbar h2,
.panel h3,
.hero-card h3 {
  margin: 0;
  font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
  font-weight: 700;
}

.brand h1 {
  font-size: 1.1rem;
}

.import-card,
.ghost-button,
.portfolio-chip,
.dropzone {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.import-card,
.ghost-button,
.portfolio-chip {
  width: 100%;
  border: 1px solid rgba(114, 196, 255, 0.15);
  background: rgba(15, 42, 64, 0.78);
  color: var(--text);
  border-radius: var(--radius-sm);
}

.import-card,
.ghost-button {
  cursor: pointer;
}

.import-card {
  padding: 1rem 1.1rem;
  text-align: left;
}

.import-card__label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.import-card__hint,
.subcopy,
.sidebar__note,
.panel__caption,
.metric-card__meta {
  color: var(--muted);
}

.sidebar__section {
  display: grid;
  gap: 0.85rem;
}

.sidebar__heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.portfolio-list {
  display: grid;
  gap: 0.65rem;
}

.portfolio-chip {
  padding: 0.9rem 1rem;
  text-align: left;
  cursor: pointer;
}

.portfolio-chip:hover,
.ghost-button:hover,
.import-card:hover,
.dropzone:hover,
.portfolio-chip.is-active {
  transform: translateY(-1px);
  border-color: rgba(114, 196, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.portfolio-chip.is-active {
  background:
    linear-gradient(135deg, rgba(77, 208, 200, 0.16), rgba(114, 196, 255, 0.12)),
    rgba(16, 48, 72, 0.92);
}

.portfolio-chip__name {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.portfolio-chip__meta {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.ghost-button {
  padding: 0.88rem 1rem;
  font: inherit;
}

.sidebar__section--utility {
  margin-top: auto;
}

.sidebar__note {
  margin: 0;
  line-height: 1.6;
  font-size: 0.85rem;
}

.main {
  padding: 1.6rem;
}

.topbar,
.hero-card,
.overview-grid,
.dashboard-grid,
.site-disclaimer {
  max-width: 1440px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.35rem;
}

.topbar > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.topbar h2 {
  font-size: clamp(1.85rem, 2vw, 2.55rem);
  margin-bottom: 0.45rem;
}

.subcopy {
  max-width: 62ch;
  margin: 0;
  line-height: 1.6;
}

.subcopy--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.15rem;
  max-width: none;
}

.subcopy__item {
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}

.session-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.42rem;
  border: 1px solid rgba(114, 196, 255, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(15, 42, 64, 0.72);
}

.session-pill span {
  max-width: 180px;
  color: var(--muted);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-pill .ghost-button {
  width: auto;
  padding: 0.62rem 0.75rem;
}

.settings-button {
  display: grid;
  place-items: center;
  min-height: 48px;
  width: 48px;
  border: 1px solid rgba(114, 196, 255, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(15, 42, 64, 0.72);
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.settings-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-button:hover {
  transform: translateY(-1px);
  border-color: rgba(114, 196, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.settings-button:focus-visible,
.settings-modal__close:focus-visible,
.theme-option:focus-visible {
  outline: 2px solid rgba(77, 208, 200, 0.52);
  outline-offset: 2px;
}

.topbar__actions .ghost-button {
  width: auto;
  white-space: nowrap;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 380px);
  gap: 1.2rem;
  margin-top: 1rem;
  padding: 1.45rem;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(12, 34, 52, 0.95), rgba(10, 26, 42, 0.92)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 35%);
  box-shadow: var(--shadow);
}

.hero-card__copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 0.45rem;
  padding: 1.5rem;
  border: 1px dashed rgba(125, 228, 124, 0.32);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at top, rgba(125, 228, 124, 0.12), transparent 42%),
    rgba(9, 32, 49, 0.9);
  cursor: pointer;
  text-align: center;
}

.dropzone.is-dragging {
  border-color: rgba(77, 208, 200, 0.7);
  background:
    radial-gradient(circle at top, rgba(77, 208, 200, 0.18), transparent 42%),
    rgba(12, 37, 57, 0.94);
}

.dropzone__title {
  font: 700 1.08rem/1.2 "Bahnschrift", "Trebuchet MS", sans-serif;
}

.dropzone__hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(320px, 2.15fr) repeat(4, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.metric-card,
.panel {
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background:
    linear-gradient(180deg, rgba(11, 33, 50, 0.96), rgba(9, 25, 41, 0.94));
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 1.1rem 1.2rem;
  min-width: 0;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 0.15rem;
  container-type: inline-size;
}

.metric-card__label {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.metric-card__value {
  margin: 0;
  max-width: 100%;
  color: #ffffff;
  font: 700 clamp(0.96rem, 14cqw, 1.68rem)/1.05 "Bahnschrift", "Trebuchet MS", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.metric-card__meta {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.metric-card--nav {
  min-height: 190px;
  padding: 1.35rem 1.45rem;
  background:
    linear-gradient(135deg, rgba(28, 83, 107, 0.86), rgba(8, 42, 54, 0.96)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 36%);
  border-color: rgba(114, 196, 255, 0.32);
}

.metric-card--nav .metric-card__label {
  color: #bfeaff;
}

.metric-card--nav .metric-card__value {
  font-size: 2.65rem;
  line-height: 1;
}

@container (max-width: 180px) {
  .metric-card__label {
    font-size: 0.76rem;
    letter-spacing: 0.06em;
  }

  .metric-card__value {
    font-size: 1.22rem;
  }
}

@container (max-width: 155px) {
  .metric-card__label {
    font-size: 0.7rem;
  }

  .metric-card__value {
    font-size: 1.04rem;
  }
}

@container (max-width: 125px) {
  .metric-card__label {
    font-size: 0.64rem;
  }

  .metric-card__value {
    font-size: 0.9rem;
  }
}

@container (max-width: 360px) {
  .metric-card--nav .metric-card__value {
    font-size: 2.15rem;
  }
}

@container (max-width: 300px) {
  .metric-card--nav .metric-card__value {
    font-size: 1.8rem;
  }
}

.metric-card--buying-power {
  background:
    linear-gradient(135deg, rgba(15, 93, 67, 0.9), rgba(8, 49, 40, 0.94)),
    var(--success-deep);
  border-color: rgba(125, 228, 124, 0.42);
}

.metric-card--buying-power .metric-card__label,
.metric-card--buying-power .metric-card__meta {
  color: #baf4c2;
}

.metric-card--margin-call,
.performance-pill--margin-call {
  background:
    linear-gradient(135deg, rgba(115, 29, 42, 0.88), rgba(52, 18, 29, 0.94)),
    var(--danger-deep);
  border-color: rgba(255, 124, 141, 0.45);
}

.metric-card--margin-call .metric-card__label,
.metric-card--margin-call .metric-card__meta,
.performance-pill--margin-call span {
  color: #ffc6cf;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 0.8fr;
  gap: 1rem;
  margin-top: 1rem;
}

.panel {
  padding: 1.2rem;
}

.panel--wide {
  grid-column: 1 / -1;
}

.panel--allocation {
  grid-column: span 2;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.panel__caption {
  margin: 0;
  max-width: 28ch;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: right;
}

.phone-verification {
  display: grid;
  gap: 1rem;
}

.phone-verification h3 {
  margin: 0;
  font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
}

.phone-verification__controls,
.pv-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.phone-verification__controls .control-field {
  min-width: 0;
}

.phone-verification__controls .small-button {
  width: auto;
  white-space: nowrap;
}

.phone-verification .auth-message {
  min-height: 1.2em;
  margin: 0;
}

body.settings-open {
  overflow: hidden;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.settings-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(0, 15, 35, 0.72);
  backdrop-filter: blur(8px);
  cursor: default;
}

.settings-modal__panel {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 2.5rem));
  overflow-y: auto;
  padding: 1.35rem;
  border: 1px solid rgba(138, 183, 214, 0.2);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(12, 35, 53, 0.99), rgba(8, 25, 41, 0.99)),
    var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.settings-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.settings-modal__header h2 {
  margin: 0.2rem 0 0;
  font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
  font-size: 1.7rem;
}

.settings-modal__close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(114, 196, 255, 0.17);
  border-radius: 50%;
  background: rgba(7, 22, 36, 0.75);
  color: var(--text);
  cursor: pointer;
  font: 300 1.55rem/1 "Aptos", "Segoe UI", sans-serif;
}

.settings-modal__body {
  display: grid;
  gap: 1rem;
}

.settings-section {
  padding: 1rem;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: rgba(10, 32, 49, 0.76);
}

.settings-section h3 {
  margin: 0;
  font-family: "Bahnschrift", "Trebuchet MS", sans-serif;
}

.settings-section > div > p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid rgba(114, 196, 255, 0.17);
  border-radius: var(--radius-sm);
  background: rgba(7, 22, 36, 0.72);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.theme-option:hover {
  border-color: rgba(114, 196, 255, 0.38);
}

.theme-option.is-selected {
  border-color: rgba(77, 208, 200, 0.72);
  background: rgba(77, 208, 200, 0.12);
  box-shadow: inset 0 0 0 1px rgba(77, 208, 200, 0.16);
}

.theme-option__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(114, 196, 255, 0.12);
  color: var(--accent-3);
  font-size: 1.2rem;
}

.theme-option strong,
.theme-option small {
  display: block;
}

.theme-option small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.pv-upload {
  grid-template-columns: minmax(280px, 1fr) auto;
}

.import-result {
  overflow: auto;
  max-height: 260px;
  margin: 0.9rem 0 0;
  padding: 0.85rem;
  border: 1px solid rgba(114, 196, 255, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(7, 22, 36, 0.74);
  color: var(--text);
  font: 0.82rem/1.45 Consolas, "Cascadia Mono", monospace;
  white-space: pre-wrap;
}

.holdings-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(auto-fit, minmax(132px, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin: 0 0 0.8rem;
  padding: 0.8rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.control-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-field--search {
  grid-column: span 2;
}

.control-field input,
.control-field select,
.small-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(114, 196, 255, 0.17);
  border-radius: var(--radius-sm);
  background: rgba(7, 22, 36, 0.8);
  color: var(--text);
  font: 0.9rem/1.2 "Aptos", "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.control-field input,
.control-field select {
  padding: 0.65rem 0.72rem;
}

.control-field input::placeholder {
  color: rgba(148, 174, 194, 0.75);
}

.control-field input:focus,
.control-field select:focus,
.small-button:focus-visible,
.table-sort:focus-visible {
  outline: 2px solid rgba(77, 208, 200, 0.42);
  outline-offset: 2px;
}

.control-field input:disabled,
.control-field select:disabled,
.small-button:disabled,
.table-sort:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.control-field--button {
  min-width: 92px;
}

.small-button {
  cursor: pointer;
  padding: 0.65rem 0.72rem;
  font-weight: 700;
}

.small-button--muted {
  color: var(--muted);
}

.holdings-summary {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.allocation {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.allocation__chart {
  display: grid;
  place-items: center;
}

.donut {
  position: relative;
  width: min(260px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) 0 20%,
    var(--accent-2) 20% 40%,
    var(--accent-3) 40% 60%,
    var(--accent-4) 60% 80%,
    var(--accent-5) 80% 100%
  );
  display: grid;
  place-items: center;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 56%),
    rgba(8, 26, 40, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.donut__inner {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0 1rem;
}

.donut__label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.donut__inner strong {
  font: 700 clamp(1.2rem, 1.9vw, 1.6rem)/1.1 "Bahnschrift", "Trebuchet MS", sans-serif;
}

.allocation__legend {
  display: grid;
  gap: 0.8rem;
}

.legend-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(14, 40, 60, 0.72);
  min-width: 0;
}

.legend-item__swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.legend-item__name {
  font-weight: 600;
}

.legend-item__value {
  text-align: right;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
}

.panel--positions table {
  min-width: 1120px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.78rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.92rem;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  padding: 0;
  text-align: left;
  text-transform: inherit;
}

.table-sort.is-active {
  color: var(--text);
}

.table-sort__indicator {
  min-width: 2.4em;
  color: var(--accent);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.table-placeholder {
  color: var(--muted);
  text-align: center;
  padding: 1.15rem 0.75rem;
}

.holding-name {
  display: grid;
  gap: 0.18rem;
}

.holding-name strong {
  font-weight: 600;
}

.holding-name span {
  color: var(--muted);
  font-size: 0.82rem;
}

.table-group-row td {
  padding: 0.72rem 0.65rem;
  background:
    linear-gradient(90deg, rgba(77, 208, 200, 0.13), rgba(114, 196, 255, 0.06)),
    rgba(11, 35, 53, 0.96);
  border-bottom-color: rgba(77, 208, 200, 0.18);
}

.table-group-row:hover {
  background: transparent;
}

.table-group-row__content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.table-group-row__content strong {
  color: var(--text);
  font: 700 0.94rem/1.2 "Bahnschrift", "Trebuchet MS", sans-serif;
}

.quantity-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.side-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.2rem 0.42rem;
  border-radius: var(--radius-sm);
  background: rgba(125, 228, 124, 0.12);
  color: #baf4c2;
  font-size: 0.72rem;
  font-weight: 700;
}

.side-tag--short {
  background: rgba(255, 124, 141, 0.13);
  color: #ffc6cf;
}

.stacked-bars {
  display: grid;
  gap: 0.95rem;
}

.bar-row {
  display: grid;
  gap: 0.45rem;
}

.bar-row__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.bar-row__track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar-row__fill {
  height: 100%;
  border-radius: inherit;
}

.performance {
  display: grid;
  gap: 1rem;
}

.performance__summary,
.winner-grid {
  display: grid;
  gap: 0.8rem;
}

.performance__summary {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.performance-pill,
.mini-card {
  min-width: 0;
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: rgba(14, 40, 60, 0.72);
}

.performance-pill span,
.mini-card p {
  display: block;
  color: var(--muted);
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
}

.performance-pill strong,
.mini-card strong {
  display: block;
  max-width: 100%;
  font: 700 clamp(1rem, 1.25vw, 1.18rem)/1.15 "Bahnschrift", "Trebuchet MS", sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.performance-pill.performance-pill--margin-call {
  border: 1px solid rgba(255, 124, 141, 0.45);
  background:
    linear-gradient(135deg, rgba(115, 29, 42, 0.88), rgba(52, 18, 29, 0.94)),
    var(--danger-deep);
}

.performance-pill.performance-pill--margin-call span {
  color: #ffc6cf;
}

.performance-pill--positive strong,
.mini-card span.is-positive {
  color: var(--accent);
}

.mini-card span,
.negative {
  color: var(--danger);
}

.mini-card--warning {
  background: linear-gradient(135deg, rgba(255, 124, 141, 0.14), rgba(255, 124, 141, 0.04));
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0;
}

.detail-list div {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(14, 40, 60, 0.72);
  min-width: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.detail-list dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.58rem;
  border-radius: var(--radius-sm);
  background: rgba(114, 196, 255, 0.12);
  color: #b9dff9;
  font-size: 0.78rem;
  line-height: 1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
}

.positive {
  color: var(--accent);
}

.negative {
  color: var(--danger);
}

.warning {
  color: var(--warning);
}

.site-disclaimer {
  margin-top: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(255, 209, 125, 0.22);
  border-radius: var(--radius-md);
  background: rgba(14, 40, 60, 0.58);
  color: #bfd1df;
  font-size: 0.92rem;
  line-height: 1.55;
}

html[data-theme="light"] {
  --bg: #d8e3eb;
  --bg-alt: #cbd9e4;
  --panel: #ffffff;
  --panel-soft: #e8f0f6;
  --stroke: #9fb2c1;
  --text: #061421;
  --muted: #344d63;
  --accent: #006f68;
  --accent-2: #a74620;
  --accent-3: #155f94;
  --accent-4: #5845a5;
  --accent-5: #186a3b;
  --danger: #98172f;
  --danger-deep: #ffdbe4;
  --success-deep: #cdeedc;
  --warning: #6c4706;
  --shadow: 0 18px 36px rgba(15, 37, 55, 0.22), 0 2px 6px rgba(15, 37, 55, 0.1);
}

html[data-theme="light"] body {
  background:
    linear-gradient(180deg, #eef4f8 0%, #d9e4ec 46%, #cbd9e4 100%);
  color: var(--text);
}

html[data-theme="light"] .auth-panel,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .site-disclaimer {
  background:
    linear-gradient(180deg, #ffffff, #f4f8fb),
    var(--panel);
  border-color: #9fb2c1;
  box-shadow: var(--shadow);
}

html[data-theme="light"] .metric-card,
html[data-theme="light"] .panel {
  border-top: 4px solid #275f83;
}

html[data-theme="light"] .panel--allocation {
  border-top-color: #006f68;
}

html[data-theme="light"] .panel--holdings {
  border-top-color: #155f94;
}

html[data-theme="light"] .panel--exposure {
  border-top-color: #186a3b;
}

html[data-theme="light"] .panel--performance {
  border-top-color: #5845a5;
}

html[data-theme="light"] .panel--cash {
  border-top-color: #a74620;
}

html[data-theme="light"] .panel--positions {
  border-top-color: #275f83;
}

html[data-theme="light"] .panel--document {
  border-top-color: #6c4706;
}

html[data-theme="light"] .sidebar {
  background:
    linear-gradient(180deg, #ffffff, #e5eef5),
    linear-gradient(140deg, rgba(0, 111, 104, 0.18), transparent 34%);
  border-right-color: #9fb2c1;
  box-shadow: 14px 0 36px rgba(15, 37, 55, 0.14);
}

html[data-theme="light"] .brand__logo,
html[data-theme="light"] .auth-panel__logo {
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 37, 55, 0.16);
}

html[data-theme="light"] .brand__eyebrow,
html[data-theme="light"] .eyebrow {
  color: #286f90;
}

html[data-theme="light"] .auth-field input {
  border-color: #9fb2c1;
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] .auth-field input:focus {
  outline-color: rgba(19, 138, 132, 0.34);
}

html[data-theme="light"] .auth-submit {
  border-color: rgba(0, 127, 120, 0.38);
  background: linear-gradient(135deg, #008e86, #216fa8);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(0, 127, 120, 0.24);
}

html[data-theme="light"] .auth-secondary {
  border-color: #9fb2c1;
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] .import-card,
html[data-theme="light"] .ghost-button,
html[data-theme="light"] .portfolio-chip,
html[data-theme="light"] .session-pill,
html[data-theme="light"] .settings-button {
  border-color: #9fb2c1;
  background: linear-gradient(180deg, #ffffff, #edf4f8);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(15, 37, 55, 0.11);
}

html[data-theme="light"] .portfolio-chip:hover,
html[data-theme="light"] .ghost-button:hover,
html[data-theme="light"] .import-card:hover,
html[data-theme="light"] .dropzone:hover,
html[data-theme="light"] .settings-button:hover,
html[data-theme="light"] .portfolio-chip.is-active {
  border-color: #006f68;
  box-shadow: 0 14px 28px rgba(15, 37, 55, 0.18);
}

html[data-theme="light"] .portfolio-chip.is-active {
  background:
    linear-gradient(135deg, rgba(0, 111, 104, 0.18), rgba(21, 95, 148, 0.16)),
    rgba(255, 255, 255, 0.94);
  box-shadow: inset 4px 0 0 #006f68, 0 14px 28px rgba(15, 37, 55, 0.16);
}

html[data-theme="light"] .settings-modal__panel {
  border-color: #9fb2c0;
  background: rgba(248, 252, 255, 0.98);
  color: #061421;
  box-shadow: 0 28px 90px rgba(15, 37, 55, 0.34);
}

html[data-theme="light"] .settings-modal__close,
html[data-theme="light"] .theme-option {
  border-color: #9fb2c0;
  background: #f6fbfe;
  color: #102033;
}

html[data-theme="light"] .settings-section {
  border-color: #9fb2c0;
  background: #ffffff;
}

html[data-theme="light"] .theme-option.is-selected {
  border-color: #006f68;
  background: rgba(0, 111, 104, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 111, 104, 0.14);
}

html[data-theme="light"] .theme-option__icon {
  background: rgba(21, 95, 148, 0.12);
  color: #155f94;
}

html[data-theme="light"] .dropzone {
  border-color: rgba(31, 122, 71, 0.34);
  background:
    linear-gradient(180deg, #e4f6eb, #ffffff);
}

html[data-theme="light"] .dropzone.is-dragging {
  border-color: rgba(0, 127, 120, 0.62);
  background:
    linear-gradient(180deg, #d4f2ef, #ffffff);
}

html[data-theme="light"] .metric-card__value {
  color: #102033;
}

html[data-theme="light"] .metric-card--nav {
  background:
    linear-gradient(135deg, #b7e3df 0%, #ffffff 62%),
    #ffffff;
  border-color: #268c84;
  border-top-color: #006f68;
  box-shadow: 0 22px 44px rgba(0, 111, 104, 0.21);
}

html[data-theme="light"] .metric-card--nav .metric-card__label {
  color: #006e85;
}

html[data-theme="light"] .metric-card--buying-power {
  background:
    linear-gradient(135deg, #c7ebd6 0%, #ffffff 64%),
    var(--success-deep);
  border-color: #5aa577;
  border-top-color: #186a3b;
}

html[data-theme="light"] .metric-card--buying-power .metric-card__label,
html[data-theme="light"] .metric-card--buying-power .metric-card__meta {
  color: #226c43;
}

html[data-theme="light"] .metric-card--margin-call,
html[data-theme="light"] .performance-pill--margin-call,
html[data-theme="light"] .performance-pill.performance-pill--margin-call {
  background:
    linear-gradient(135deg, #ffd1dc 0%, #ffffff 64%),
    var(--danger-deep);
  border-color: #c45f72;
  border-top-color: #98172f;
}

html[data-theme="light"] .metric-card--margin-call .metric-card__label,
html[data-theme="light"] .metric-card--margin-call .metric-card__meta,
html[data-theme="light"] .performance-pill--margin-call span,
html[data-theme="light"] .performance-pill.performance-pill--margin-call span {
  color: #961b33;
}

html[data-theme="light"] .donut::after {
  background:
    linear-gradient(180deg, #ffffff, #edf4f8);
  border-color: rgba(35, 64, 88, 0.14);
}

html[data-theme="light"] .legend-item,
html[data-theme="light"] .performance-pill,
html[data-theme="light"] .mini-card,
html[data-theme="light"] .detail-list div {
  background: linear-gradient(180deg, #ffffff, #eaf2f7);
  border: 1px solid #aebfcb;
  box-shadow: 0 8px 18px rgba(15, 37, 55, 0.08);
}

html[data-theme="light"] th,
html[data-theme="light"] td {
  border-bottom-color: #b7c5d0;
}

html[data-theme="light"] th {
  color: #29465c;
}

html[data-theme="light"] tbody tr:hover {
  background: rgba(0, 127, 120, 0.07);
}

html[data-theme="light"] .bar-row__track {
  background: #cfdce6;
  box-shadow: inset 0 0 0 1px rgba(35, 64, 88, 0.1);
}

html[data-theme="light"] .mini-card--warning {
  background: linear-gradient(135deg, #ffd9e2, #ffffff);
  border-color: #c45f72;
}

html[data-theme="light"] .tag {
  background: rgba(29, 111, 167, 0.14);
  color: #1b5d89;
}

html[data-theme="light"] .positive,
html[data-theme="light"] .performance-pill--positive strong,
html[data-theme="light"] .mini-card span.is-positive {
  color: #0f8176;
}

html[data-theme="light"] .negative,
html[data-theme="light"] .mini-card span {
  color: var(--danger);
}

html[data-theme="light"] .site-disclaimer {
  color: #384e60;
  border-color: #c7a45f;
  border-top: 4px solid #9b6a12;
  background:
    linear-gradient(180deg, #ffefbf, #ffffff),
    #ffffff;
}

html[data-theme="light"] .overview-grid .metric-card {
  border: 1px solid rgba(6, 20, 33, 0.18);
  border-top: 1px solid rgba(6, 20, 33, 0.18);
  box-shadow:
    0 18px 34px rgba(15, 37, 55, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

html[data-theme="light"] .overview-grid .metric-card--nav {
  background: #006f68;
  border-color: #005a55;
  box-shadow:
    0 22px 40px rgba(0, 111, 104, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

html[data-theme="light"] .overview-grid .metric-card--buying-power {
  background: #186a3b;
  border-color: #11502b;
}

html[data-theme="light"] .overview-grid .metric-card--margin-call {
  background: #98172f;
  border-color: #761024;
}

html[data-theme="light"] .overview-grid .metric-card:nth-child(4) {
  background: #155f94;
  border-color: #104b76;
}

html[data-theme="light"] .overview-grid .metric-card:nth-child(5) {
  background: #a74620;
  border-color: #813516;
}

html[data-theme="light"] .overview-grid .metric-card .metric-card__label,
html[data-theme="light"] .overview-grid .metric-card .metric-card__meta,
html[data-theme="light"] .overview-grid .metric-card--nav .metric-card__label,
html[data-theme="light"] .overview-grid .metric-card--buying-power .metric-card__label,
html[data-theme="light"] .overview-grid .metric-card--buying-power .metric-card__meta,
html[data-theme="light"] .overview-grid .metric-card--margin-call .metric-card__label,
html[data-theme="light"] .overview-grid .metric-card--margin-call .metric-card__meta {
  color: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .overview-grid .metric-card .metric-card__value {
  color: #ffffff;
}

html[data-theme="light"] .panel {
  background: #ffffff;
  border-color: #8298a8;
  border-top-width: 8px;
  box-shadow: 0 18px 34px rgba(15, 37, 55, 0.18);
}

html[data-theme="light"] .panel__header {
  border-bottom: 1px solid #b5c4cf;
  padding-bottom: 0.85rem;
}

html[data-theme="light"] .holdings-toolbar {
  border-top-color: #b5c4cf;
  border-bottom-color: #b5c4cf;
}

html[data-theme="light"] .control-field input,
html[data-theme="light"] .control-field select,
html[data-theme="light"] .small-button {
  background: #f6fbfe;
  border-color: #9fb2c0;
  color: #102033;
}

html[data-theme="light"] .control-field input::placeholder {
  color: #6b7f8e;
}

html[data-theme="light"] .table-sort.is-active {
  color: #061421;
}

html[data-theme="light"] .table-sort__indicator {
  color: #006f68;
}

html[data-theme="light"] .table-group-row td {
  background:
    linear-gradient(90deg, rgba(0, 111, 104, 0.13), rgba(21, 95, 148, 0.07)),
    #eef6f8;
  border-bottom-color: #8fbfbd;
}

html[data-theme="light"] .side-tag {
  background: rgba(24, 106, 59, 0.13);
  color: #186a3b;
}

html[data-theme="light"] .side-tag--short {
  background: rgba(152, 23, 47, 0.12);
  color: #98172f;
}

html[data-theme="light"] .panel h3 {
  color: #061421;
}

html[data-theme="light"] .legend-item,
html[data-theme="light"] .performance-pill,
html[data-theme="light"] .mini-card,
html[data-theme="light"] .detail-list div {
  background: #ffffff;
  border-color: #8fa4b3;
}

html[data-theme="light"] .performance-pill.performance-pill--positive {
  background: #006f68;
  border-color: #005a55;
  color: #ffffff;
}

html[data-theme="light"] .performance-pill.performance-pill--margin-call {
  background: #98172f;
  border-color: #761024;
  color: #ffffff;
}

html[data-theme="light"] .performance-pill.performance-pill--positive span,
html[data-theme="light"] .performance-pill.performance-pill--margin-call span {
  color: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .performance-pill.performance-pill--positive strong,
html[data-theme="light"] .performance-pill.performance-pill--margin-call strong {
  color: #ffffff;
}

html[data-theme="light"] .table-wrap {
  border: 1px solid #aebfcb;
  border-radius: var(--radius-sm);
}

html[data-theme="light"] th {
  background: #dce7ef;
}

@media (max-width: 1200px) {
  .overview-grid {
    grid-template-columns: minmax(225px, 2fr) repeat(4, minmax(105px, 1fr));
    gap: 0.85rem;
  }

  .metric-card--nav {
    grid-column: auto;
  }

  .metric-card {
    padding: 1rem 0.9rem;
  }

  .metric-card--nav {
    padding: 1.15rem 1.1rem;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel--allocation,
  .panel--wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .main {
    order: 1;
  }

  .sidebar {
    order: 2;
    align-self: start;
    gap: 1rem;
    border-right: none;
    border-top: 1px solid var(--stroke);
    border-bottom: none;
  }

  .brand {
    grid-template-columns: minmax(190px, 245px) minmax(0, 1fr);
    align-items: center;
  }

  .sidebar__section--utility {
    margin-top: 0;
  }

  .sidebar .empty-state {
    min-height: 72px;
    padding: 0.75rem 0;
  }

  .hero-card,
  .allocation,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar__actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .holdings-toolbar {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .phone-verification,
  .phone-verification__controls,
  .pv-upload {
    grid-template-columns: 1fr;
  }

  .phone-verification__controls .small-button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card--nav {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .main,
  .sidebar {
    padding: 1rem;
  }

  .overview-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .panel,
  .hero-card {
    padding: 1rem;
  }

  .holdings-toolbar {
    grid-template-columns: 1fr;
  }

  .phone-verification {
    padding: 1rem;
  }

  .settings-modal {
    align-items: end;
    padding: 0.75rem;
  }

  .settings-modal__panel {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    padding: 1rem;
  }

  .theme-options {
    grid-template-columns: 1fr;
  }

  .control-field--search {
    grid-column: 1 / -1;
  }

  .metric-card--nav .metric-card__value {
    font-size: 2.1rem;
  }
}





.admin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.admin-action-btn {
  border: 1px solid rgba(0, 26, 85, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: #001A55;
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}

.admin-action-btn:hover {
  background: rgba(0, 26, 85, 0.08);
}

.admin-action-btn--primary {
  background: rgba(0, 103, 95, 0.12);
  border-color: rgba(0, 103, 95, 0.25);
  color: #00675f;
}

.admin-action-btn--danger {
  background: rgba(160, 18, 55, 0.1);
  border-color: rgba(160, 18, 55, 0.25);
  color: #a01237;
}

.admin-action-btn--enable {
  background: rgba(20, 110, 55, 0.1);
  border-color: rgba(20, 110, 55, 0.25);
  color: #146e37;
}

.admin-users-scroll {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: auto;
}

.admin-users-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 15, 35, 0.65);
  backdrop-filter: blur(8px);
}

.admin-modal__panel {
  position: relative;
  width: min(520px, 100%);
  border-radius: 24px;
  padding: 24px;
  background: rgba(248, 252, 255, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  color: #001A55;
}

[data-theme="dark"] .admin-modal__panel {
  background: rgba(12, 28, 44, 0.98);
  color: #f6fbff;
}

.admin-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-modal__header h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.admin-modal__close {
  border: 0;
  background: rgba(0, 26, 85, 0.08);
  color: inherit;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.admin-modal__body {
  display: grid;
  gap: 16px;
}

.admin-modal__text {
  margin: 0;
  opacity: 0.82;
}

.admin-modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.generated-password-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(0, 26, 85, 0.08);
  border: 1px solid rgba(0, 26, 85, 0.12);
}

.generated-password-box code {
  flex: 1;
  font-size: 15px;
  font-weight: 800;
  word-break: break-all;
}
.admin-table-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}

[data-theme="dark"] .admin-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f6fbff;
}

[data-theme="dark"] .admin-action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(77, 208, 200, 0.35);
}

[data-theme="dark"] .admin-action-btn--primary {
  background: rgba(77, 208, 200, 0.14);
  border-color: rgba(77, 208, 200, 0.35);
  color: #7ff7ee;
}

[data-theme="dark"] .admin-action-btn--primary:hover {
  background: rgba(77, 208, 200, 0.22);
}

[data-theme="dark"] .admin-action-btn--danger {
  background: rgba(255, 95, 125, 0.12);
  border-color: rgba(255, 95, 125, 0.35);
  color: #ff9bad;
}

[data-theme="dark"] .admin-action-btn--danger:hover {
  background: rgba(255, 95, 125, 0.2);
}

[data-theme="dark"] .admin-action-btn--enable {
  background: rgba(125, 228, 124, 0.12);
  border-color: rgba(125, 228, 124, 0.35);
  color: #9dff9c;
}

[data-theme="dark"] .admin-action-btn--enable:hover {
  background: rgba(125, 228, 124, 0.2);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-badge--active {
  background: rgba(20, 110, 55, 0.12);
  border: 1px solid rgba(20, 110, 55, 0.25);
  color: #146e37;
}

.status-badge--disabled {
  background: rgba(160, 18, 55, 0.1);
  border: 1px solid rgba(160, 18, 55, 0.25);
  color: #a01237;
}

[data-theme="dark"] .status-badge--active {
  background: rgba(125, 228, 124, 0.12);
  border-color: rgba(125, 228, 124, 0.35);
  color: #9dff9c;
}

[data-theme="dark"] .status-badge--disabled {
  background: rgba(255, 95, 125, 0.12);
  border-color: rgba(255, 95, 125, 0.35);
  color: #ff9bad;
}

.dt-container {
  color: inherit;
}

.dt-container .dt-search,
.dt-container .dt-length {
  margin: 12px 0;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(0, 26, 85, 0.16);
  background: rgba(255, 255, 255, 0.85);
  color: #001A55;
  padding: 0 12px;
  outline: none;
}

.dt-container .dt-search input {
  min-width: 260px;
}

.dt-container .dt-paging button {
  border-radius: 10px !important;
  border: 1px solid rgba(0, 26, 85, 0.14) !important;
  background: rgba(255, 255, 255, 0.8) !important;
  color: #001A55 !important;
  margin: 0 3px;
}

.dt-container .dt-paging button.current {
  background: rgba(77, 208, 200, 0.18) !important;
  color: #00675f !important;
}

[data-theme="dark"] .dt-container .dt-search input,
[data-theme="dark"] .dt-container .dt-length select {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f6fbff;
}

[data-theme="dark"] .dt-container .dt-search input::placeholder {
  color: rgba(246, 251, 255, 0.55);
}

[data-theme="dark"] .dt-container .dt-length select option {
  background: #10283d;
  color: #f6fbff;
}

[data-theme="dark"] .dt-container .dt-paging button {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f6fbff !important;
}

/* Light mode DataTables spacing fix */
html:not([data-theme="dark"]) .dt-container {
  padding: 16px;
}

html:not([data-theme="dark"]) .dt-container .dt-layout-row:first-child {
  padding: 14px 0 18px;
}

html:not([data-theme="dark"]) .dt-container .dt-search {
  margin-right: 0;
}

html:not([data-theme="dark"]) .dt-container .dt-length {
  margin-left: 0;
}

.sidebar__section:has(#adminUserList) {
  flex: 0 0 360px;
  min-height: 0;
  overflow: hidden;
}

#adminUserList {
  height: 300px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}
