/* Feedback Admin — styles */

:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --border: #e4e4e0;
  --text: #1a1a1a;
  --text-2: #666660;
  --text-3: #999990;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 12px;
  --font: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111112;
    --surface: #1c1c1e;
    --border: #2e2e30;
    --text: #f0f0f0;
    --text-2: #a0a0a0;
    --text-3: #707070;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============ Login ============ */

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
  text-align: center;
}

.login-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-mark svg { width: 24px; height: 24px; }

.login-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.login-sub {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 4px;
  margin-bottom: 24px;
}

.login-form { text-align: left; }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-2);
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: inherit;
  background: var(--bg);
  transition: border-color .12s ease-out, box-shadow .12s ease-out;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.login-error {
  font-size: 13px;
  color: var(--red);
  margin-bottom: 12px;
}

.btn-primary {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .12s ease-out, transform .12s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover { opacity: .9; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .55; cursor: default; transform: none; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-3);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-ghost {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.btn-ghost:hover { background: var(--bg); }
.btn-ghost:active { transform: scale(.98); }

.magic-sent {
  font-size: 13px;
  color: var(--green);
  margin-top: 12px;
}

/* ============ Dashboard ============ */

.dash-view { min-height: 100vh; }

.dash-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.dash-brand svg { width: 20px; height: 20px; color: var(--accent); }

.dash-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: inherit;
  background: var(--surface);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s ease-out, color .12s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon:active { transform: scale(.93); }
.btn-icon svg { width: 16px; height: 16px; }

.dash-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px 0;
}

.stat {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.stat strong { color: var(--text); font-weight: 700; }

.dash-list {
  padding: 16px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 860px;
}

.loading,
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 14px;
}

/* Feedback card */

.fb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s ease-out;
}

.fb-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.05); }

.fb-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.fb-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.fb-badge-dispatchsaf { background: #fef3c7; color: #92400e; }
.fb-badge-thelist     { background: #dbeafe; color: #1e40af; }
.fb-badge-moneytracker { background: #dcfce7; color: #166534; }
.fb-badge-eqmarkets   { background: #fae8ff; color: #86198f; }
.fb-badge-oracular     { background: #ffedd5; color: #9a3412; }
.fb-badge-default      { background: #f0f0f0; color: #555; }

@media (prefers-color-scheme: dark) {
  .fb-badge-dispatchsaf { background: #422006; color: #fcd34d; }
  .fb-badge-thelist     { background: #172554; color: #93c5fd; }
  .fb-badge-moneytracker { background: #052e16; color: #86efac; }
  .fb-badge-eqmarkets   { background: #4a044e; color: #f0abfc; }
  .fb-badge-oracular     { background: #431407; color: #fdba74; }
  .fb-badge-default      { background: #2e2e30; color: #a0a0a0; }
}

.fb-preview {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.fb-date {
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
  font-family: var(--mono);
}

.fb-chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-3);
  transition: transform .2s ease-out;
}

.fb-card.open .fb-chevron { transform: rotate(180deg); }

.fb-card-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.fb-card.open .fb-card-body { display: block; }

.fb-message {
  font-size: 14px;
  line-height: 1.6;
  padding: 14px 0 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.fb-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--mono);
}

.fb-meta a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.fb-meta a:hover { text-decoration: underline; }

.fb-meta-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.fb-meta-label {
  color: var(--text-3);
  flex-shrink: 0;
  min-width: 72px;
}

@media (max-width: 600px) {
  .dash-header { padding: 12px 16px; }
  .dash-list { padding: 12px 16px 40px; }
  .dash-stats { padding: 12px 16px 0; }
  .fb-preview { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
