/* ==========================================================================
   CECONiQ Management Dashboard — styled to match ops.ceconiq.com
   Flat dark surfaces, CECON orange accent, DM Sans / DM Mono / Outfit.
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   1. Theme tokens
   -------------------------------------------------------------------------- */
:root,
:root[data-theme='dark'] {
  --bg: #0f1117;
  --bg-soft: #161b27;
  --bg-input: #0b0e15;
  --border: #2d3748;
  --border-soft: #1f2533;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #d85a30;
  --accent-hover: #e66d46;
  --accent-soft: rgba(216, 90, 48, 0.12);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --radius: 6px;
  --radius-lg: 8px;
}

:root[data-theme='light'] {
  --bg: #f8fafc;
  --bg-soft: #ffffff;
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --accent: #d85a30;
  --accent-hover: #b94a26;
  --accent-soft: rgba(216, 90, 48, 0.08);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.1);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* --------------------------------------------------------------------------
   2. Globals
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  font-family:
    'DM Sans',
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: 'Outfit', 'DM Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

code,
.mono,
.metric-value,
.modal-subtitle,
.badge-loc {
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

.hidden {
  display: none !important;
}
.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}
.relative {
  position: relative;
}
.scroll-y {
  overflow-y: auto;
  max-height: 480px;
}

/* --------------------------------------------------------------------------
   3. Loader
   -------------------------------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, 0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.premium-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spinner-spin 0.9s linear infinite;
}

.premium-spinner::before {
  content: none;
}

@keyframes spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   4. Auth / sign-in
   -------------------------------------------------------------------------- */
.auth-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow);
}

.auth-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.auth-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-brand p {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

.input-wrapper input,
input[type='text'],
input[type='email'],
input[type='password'] {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.input-wrapper input:focus,
input:focus {
  border-color: var(--accent);
}

.error-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--danger);
  font-size: 0.8rem;
  background: var(--danger-soft);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--danger);
}

.error-message svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.btn:hover {
  border-color: var(--text-dim);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.glow-button {
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   6. Dashboard shell + header
   -------------------------------------------------------------------------- */
.dashboard-container {
  min-height: 100vh;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1800px;
  margin: 0 auto;
}

.glass-header {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-logo {
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius);
  font-weight: 700;
}

.app-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.selector-container {
  position: relative;
  display: flex;
  align-items: center;
}

.selector-icon {
  position: absolute;
  left: 0.625rem;
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

select {
  padding: 0.45rem 1.75rem 0.45rem 1.875rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
select:focus {
  border-color: var(--accent);
}

.selector-container::after {
  content: '▾';
  font-size: 0.7rem;
  color: var(--text-dim);
  position: absolute;
  right: 0.625rem;
  pointer-events: none;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 0;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.btn-icon:hover {
  border-color: var(--text-dim);
  color: var(--text);
}
.btn-icon svg {
  width: 16px;
  height: 16px;
}

.divider {
  width: 1px;
  height: 22px;
  background: var(--border);
}

.profile-badge {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: transparent;
  padding: 0.25rem 0.625rem 0.25rem 0.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.profile-avatar {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--accent);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: #fff;
}

.profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.profile-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.profile-role {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-logout {
  color: var(--text-muted);
}
.btn-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* --------------------------------------------------------------------------
   7. Metric cards
   -------------------------------------------------------------------------- */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.metric-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: none;
}

.card-glow-indigo,
.card-glow-violet,
.card-glow-blue,
.card-glow-emerald {
  /* color modifiers retained on element; no border accent now */
}

.metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-icon-bg {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.metric-icon-bg svg {
  width: 15px;
  height: 15px;
}

.bg-indigo,
.bg-violet,
.bg-blue,
.bg-emerald {
  background: var(--accent-soft);
}

.text-indigo,
.text-violet,
.text-blue,
.text-emerald {
  color: var(--accent);
}

.metric-value-container {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}

.metric-value {
  font-family: 'DM Mono', monospace;
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.metric-trend.success {
  background: var(--success-soft);
  color: var(--success);
}
.metric-trend.warning {
  background: var(--danger-soft);
  color: var(--danger);
}
.metric-trend.neutral {
  background: var(--border-soft);
  color: var(--text-muted);
}
.metric-trend svg {
  width: 11px;
  height: 11px;
}

.metric-comparison {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.animate-spin-hover:hover,
.animate-bounce-hover:hover {
  animation: none;
}

/* --------------------------------------------------------------------------
   8. Charts
   -------------------------------------------------------------------------- */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

.glass-panel {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chart-card {
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.chart-legend {
  display: flex;
  gap: 0.75rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-color {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}
.bg-indigo-solid {
  background: var(--accent);
}
.bg-muted-solid {
  background: var(--border);
}
.bg-glowing-blue {
  background: var(--accent);
}

.chart-wrapper {
  height: 280px;
  width: 100%;
  position: relative;
}

/* --------------------------------------------------------------------------
   9. Tables
   -------------------------------------------------------------------------- */
.details-row {
  display: flex;
  gap: 1.25rem;
}

@media (max-width: 1100px) {
  .details-row {
    flex-direction: column;
  }
}

.flex-2 {
  flex: 2;
}
.flex-3 {
  flex: 3;
}

.table-card {
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 420px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.625rem;
  width: 14px;
  height: 14px;
  color: var(--text-dim);
}

.search-box input {
  padding: 0.45rem 0.75rem 0.45rem 1.875rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  width: 200px;
  transition:
    border-color 0.15s ease,
    width 0.2s ease;
}
.search-box input:focus {
  border-color: var(--accent);
  width: 240px;
}

.selector-container.compact select {
  padding: 0.45rem 1.5rem 0.45rem 0.625rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
}
.selector-container.compact::after {
  right: 0.5rem;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.premium-table th {
  padding: 0.625rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
}

.premium-table td {
  padding: 0.625rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
}

.premium-table tbody tr {
  transition: background-color 0.1s ease;
}

.premium-table tbody tr:hover {
  background: var(--bg);
}

.premium-table.interactive tbody tr {
  cursor: pointer;
}
.premium-table.interactive tbody tr:hover {
  background: var(--accent-soft);
}

.badge-loc {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.72rem;
  background: var(--border-soft);
  color: var(--text);
  font-family: 'DM Mono', monospace;
}

.delta-badge {
  font-weight: 600;
  font-size: 0.8rem;
  font-family: 'DM Mono', monospace;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.delta-badge.up {
  color: var(--success);
}
.delta-badge.down {
  color: var(--danger);
}
.delta-badge.neutral {
  color: var(--text-muted);
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}
.trend-badge.positive {
  background: var(--success-soft);
  color: var(--success);
}
.trend-badge.negative {
  background: var(--danger-soft);
  color: var(--danger);
}
.trend-badge.equal {
  background: var(--border-soft);
  color: var(--text-muted);
}
.trend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.trend-badge.positive .trend-dot {
  background: var(--success);
}
.trend-badge.negative .trend-dot {
  background: var(--danger);
}
.trend-badge.equal .trend-dot {
  background: var(--text-muted);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  gap: 0.75rem;
  font-size: 0.85rem;
}
.empty-icon {
  width: 36px;
  height: 36px;
  stroke-width: 1.5;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   10. Modal
   -------------------------------------------------------------------------- */
.modal-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: modal-enter 0.15s ease;
}

@keyframes modal-enter {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.info-label svg {
  width: 13px;
  height: 13px;
}

.info-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.notes-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
  min-height: 56px;
}

.info-block-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  gap: 1rem;
}

.info-sub-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* --------------------------------------------------------------------------
   11. Error banners
   -------------------------------------------------------------------------- */
.error-banner {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 0.25rem;
}
.error-banner-icon {
  width: 24px;
  height: 24px;
  color: var(--danger);
  flex-shrink: 0;
}
.error-banner-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.error-banner-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   12. Microsoft sign-in button + divider + link notice
   -------------------------------------------------------------------------- */
.ms-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: #1f1f1f;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 14px;
  transition: border-color 0.15s ease;
}
.ms-btn:hover {
  border-color: var(--text-dim);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.link-notice {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.78rem;
  line-height: 1.4;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   13. Ask card (top of dashboard)
   -------------------------------------------------------------------------- */
.ask-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ask-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ask-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}
.ask-input {
  flex: 1;
  height: 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.ask-input:focus {
  border-color: var(--accent);
}
.ask-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  height: 36px;
  padding: 0 16px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.ask-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}
.ask-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ask-answer {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}
.ask-answer-text {
  white-space: pre-wrap;
}
.ask-queries {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.ask-queries summary {
  cursor: pointer;
  user-select: none;
  outline: none;
}
.ask-queries summary:hover {
  color: var(--text);
}
.ask-queries ul {
  margin: 6px 0 0 16px;
  padding: 0;
  list-style: disc;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   14. Recent Swaps by Location (grid of per-site tiles)
   -------------------------------------------------------------------------- */
.recent-by-loc-card {
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.recent-by-loc-hd .panel-subtitle {
  margin-top: 0.15rem;
}
.recent-by-loc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.recent-by-loc-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.recent-by-loc-tile-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.recent-by-loc-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.recent-by-loc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.recent-by-loc-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text);
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.recent-by-loc-list li:last-child {
  border-bottom: none;
}
.recent-by-loc-time {
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
}
.recent-by-loc-ref {
  font-family: 'DM Mono', monospace;
  font-weight: 600;
  color: var(--accent);
}
.recent-by-loc-trailer {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text);
}
.recent-by-loc-stream {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: lowercase;
  grid-column: 1 / -1;
  border-top: 1px dashed var(--border-soft);
  padding-top: 0.2rem;
  margin-top: 0.1rem;
}
.recent-by-loc-stream:empty {
  display: none;
}
