:root {
  color-scheme: light;
  font-family: "Inter", system-ui, sans-serif;
  background: #f5f6fb;
  color: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #f5f6fb;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-panel,
.table-section,
.card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
}

.auth-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

h2 {
  margin-bottom: 6px;
}

.subhead {
  margin: 0;
  color: #4b5563;
  max-width: 720px;
}

.small {
  font-size: 12px;
}

.muted {
  color: #6b7280;
  margin: 0;
}

.auth-actions,
.header-actions,
.section-actions,
.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border-radius: 999px;
  border: none;
  padding: 11px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

button.primary {
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.2);
}

button.primary.alt {
  background: #0f172a;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
}

button.ghost {
  background: #fff;
  color: #1d4ed8;
  border: 1px solid #dbe4ff;
}

button.danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

button.small {
  padding: 7px 12px;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.status {
  padding: 12px 16px;
  border-radius: 12px;
  background: #eef2ff;
  color: #1e3a8a;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.status.error,
.import-status.error,
.bond-status.error {
  background: #fee2e2;
  color: #991b1b;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.card,
.table-section {
  padding: 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.highlight-section {
  border: 1px solid #dbe4ff;
}

.insight-card,
.history-item {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(238,242,255,0.65), rgba(255,255,255,1));
}

.insight-topline,
.history-head,
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.insight-date {
  color: #6b7280;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #e5e7eb;
  color: #111827;
}

.pill.high {
  background: #dcfce7;
  color: #166534;
}

.pill.medium {
  background: #dbeafe;
  color: #1d4ed8;
}

.pill.low {
  background: #fee2e2;
  color: #991b1b;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.section-spacer {
  height: 24px;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 16px;
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.compact-table table {
  min-width: 420px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  vertical-align: middle;
}

th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: #6b7280;
}

tr:last-child td {
  border-bottom: none;
}

.form-grid,
.import-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
  align-items: end;
}

.import-text-controls {
  align-items: start;
}

.import-actions {
  margin-top: 16px;
}

.import-status,
.bond-status {
  margin: 12px 0 0;
  min-height: 18px;
  padding: 8px 10px;
  border-radius: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.empty-state {
  color: #6b7280;
  background: #f8fafc;
  border-radius: 14px;
  padding: 16px;
}

.insight-history {
  display: grid;
  gap: 14px;
}

.history-metrics {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #4b5563;
  font-weight: 600;
}

@media (max-width: 920px) {
  .grid-two {
    grid-template-columns: 1fr;
  }

  .header-actions {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 20px 14px 48px;
  }

  .auth-panel,
  .table-section,
  .card {
    padding: 16px;
  }

  h1 {
    font-size: 28px;
  }
}


.settings-card {
  border: 1px solid #e5e7eb;
}

.settings-grid {
  align-items: center;
}

.toggle-label {
  align-self: center;
  justify-content: center;
  min-height: 72px;
}

.toggle-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.settings-note {
  margin-top: 12px;
  min-height: 18px;
}
