:root {
  --elo-primary: #10104F;
  --elo-action: #006FFF;
  --elo-success: #00E4A5;
  --elo-bg: #F5F7FA;
  --elo-text: #1F2937;
  --elo-border: #E5E7EB;
  --elo-danger: #DC3545;
  --elo-warning: #F59E0B;
}

body {
  background: var(--elo-bg);
  color: var(--elo-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.portal-shell { display: flex; min-height: 100vh; }
.portal-sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: var(--elo-primary);
  color: #fff;
  padding: 24px 16px;
}
.portal-brand { font-size: 20px; font-weight: 700; margin-bottom: 28px; }
.portal-nav { display: grid; gap: 4px; }
.portal-nav a {
  color: #fff;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  opacity: .9;
}
.portal-nav a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.portal-nav .portal-subnav {
  font-size: 13px;
  padding: 7px 12px 7px 28px;
  opacity: .78;
}
.portal-main { flex: 1; min-width: 0; }
.portal-topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--elo-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}
.portal-content { padding: 24px; }
.page-title { font-size: 26px; font-weight: 700; margin: 0; }
.panel {
  background: #fff;
  border: 1px solid var(--elo-border);
  border-radius: 8px;
  padding: 20px;
}
.panel h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.narrow { max-width: 720px; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.metric {
  background: #fff;
  border: 1px solid var(--elo-border);
  border-radius: 8px;
  padding: 18px;
}
.metric span { color: #6B7280; display: block; font-size: 13px; }
.metric strong { display: block; font-size: 22px; margin-top: 8px; }
.btn-primary { background: var(--elo-action); border-color: var(--elo-action); }
.btn-outline-primary { color: var(--elo-action); border-color: var(--elo-action); }
.btn-outline-primary:hover { background: var(--elo-action); border-color: var(--elo-action); }
.form-control, .form-select {
  background: #FFFDF8;
  border-color: var(--elo-border);
  border-radius: 8px;
  min-height: 42px;
}
.form-control:focus, .form-select:focus {
  border-color: #8FE8D0;
  box-shadow: 0 0 0 .2rem rgba(0, 228, 165, .16);
  background: #fff;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.span-2 { grid-column: span 2; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.searchbar { display: flex; gap: 10px; }
.status-pill {
  display: inline-block;
  border: 1px solid var(--elo-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: #fff;
}
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--elo-border);
  padding: 10px 0;
}
.list-row:last-child { border-bottom: 0; }
.form-error { color: var(--elo-danger); font-size: 13px; margin-top: 4px; }
.field-feedback { color: var(--elo-danger); font-size: 13px; margin-top: 4px; }
.copy-box {
  white-space: pre-wrap;
  border: 1px solid var(--elo-border);
  background: #F8FAFC;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
}
.login-wrap {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}
.login-panel {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--elo-border);
  border-radius: 8px;
  padding: 28px;
}
.login-panel h1 { font-size: 28px; color: var(--elo-primary); }
.logo-preview {
  display: none;
  max-width: 160px;
  max-height: 80px;
  margin-top: 10px;
  border: 1px solid var(--elo-border);
  border-radius: 8px;
}
.logo-preview-static {
  max-width: 180px;
  max-height: 90px;
  border: 1px solid var(--elo-border);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}
.color-pair { display: grid; grid-template-columns: 1fr 48px; gap: 8px; }
.color-pair input[type="color"] {
  width: 48px;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--elo-border);
  border-radius: 8px;
  background: #fff;
}
.session-alert {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(9, 9, 15, .36);
  z-index: 2000;
}
.session-alert[hidden] { display: none; }
.session-alert-panel {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--elo-border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(9, 9, 15, .2);
}
.session-alert-panel p { margin: 8px 0 16px; color: #6B7280; }

@media (max-width: 860px) {
  .portal-shell { display: block; }
  .portal-sidebar { width: 100%; flex-basis: auto; }
  .portal-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-topbar { height: auto; gap: 12px; align-items: flex-start; flex-direction: column; padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .searchbar { flex-direction: column; }
}
