/* Graphova — minimal, clean UI */

:root {
  --bg: #fafaf8;
  --surface: #fff;
  --border: #e8e4df;
  --text: #1a1a18;
  --text-dim: #6b6b66;
  --accent: #1a1a18;
  --accent-light: #f0ede8;
  --green: #2d6a4f;
  --red: #c0392b;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  text-decoration: none;
}

.logo span { color: var(--text-dim); font-weight: 400; }

nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
nav a:hover, nav a.active { color: var(--text); background: var(--accent-light); }

main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card h2 .badge {
  background: var(--accent-light);
  color: var(--text-dim);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 500;
}

/* ── Forms ── */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,26,24,.08);
}

textarea { resize: vertical; min-height: 80px; font-family: inherit; }

.form-row { margin-bottom: 1rem; }
.form-row:last-child { margin-bottom: 0; }

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

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

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--accent-light); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #fde8e8; color: var(--red); border: 1px solid #f5c0c0; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }

.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

/* ── Upload drop zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  color: var(--text-dim);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--text);
}
.drop-zone .icon { font-size: 2rem; margin-bottom: .5rem; }
.drop-zone p { font-size: 0.875rem; }
.drop-zone strong { color: var(--text); }

.file-list { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.file-chip {
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.file-chip button { background: none; border: none; cursor: pointer; color: var(--text-dim); font-size: 0.9rem; line-height: 1; padding: 0 2px; }

/* ── Profile list ── */
.profile-list { display: flex; flex-direction: column; gap: .75rem; }

.profile-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: border-color .15s;
}
.profile-item:hover { border-color: var(--accent); }
.profile-item.selected { border-color: var(--accent); background: var(--accent-light); }

.profile-info h3 { font-size: 0.95rem; font-weight: 600; }
.profile-meta { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }

.profile-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* ── Fingerprint card ── */
.fingerprint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.fp-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .75rem 1rem;
}
.fp-stat .label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.fp-stat .value { font-size: 1.2rem; font-weight: 600; }
.fp-stat .sub { font-size: 0.78rem; color: var(--text-dim); margin-top: 1px; }

/* ── Generated content ── */
.content-output {
  background: #fefefe;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
}

/* ── Scores ── */
.score-bar-wrap { margin-top: .5rem; }
.score-row { display: flex; align-items: center; gap .75rem; margin-bottom: .3rem; }
.score-label { font-size: 0.82rem; color: var(--text-dim); width: 140px; flex-shrink: 0; }
.score-bar-bg { flex: 1; background: var(--bg); border-radius: 4px; height: 8px; overflow: hidden; border: 1px solid var(--border); }
.score-bar { height: 100%; border-radius: 4px; transition: width .5s ease; }
.score-val { font-size: 0.82rem; font-weight: 600; width: 36px; text-align: right; flex-shrink: 0; }

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  margin-right: 1rem;
}
.grade-A { background: #d4edda; color: #155724; }
.grade-B { background: #d1ecf1; color: #0c5460; }
.grade-C { background: #fff3cd; color: #856404; }
.grade-D { background: #ffe5d0; color: #b45309; }
.grade-F { background: #fde8e8; color: var(--red); }

/* ── Alerts / toasts ── */
.alert {
  padding: .75rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert-error { background: #fde8e8; color: var(--red); border: 1px solid #f5c0c0; }
.alert-success { background: #d4edda; color: var(--green); border: 1px solid #b2dfdb; }
.alert-info { background: #e8f4fd; color: #0c5460; border: 1px solid #bee5eb; }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading overlay ── */
.loading {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-dim);
  font-size: 0.875rem;
  padding: 1rem 0;
}
.loading .spinner { border-color: var(--text-dim); border-top-color: transparent; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: .5rem; }
.empty-state p { font-size: 0.9rem; }

/* ── Tabs ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  padding: .6rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-dim);
  transition: color .15s;
}
.tab.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }
.tab:hover { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.page-info { font-size: .875rem; color: var(--text-dim); }

/* small status chips (register / refined / structured) */
.chip {
  display: inline-block;
  padding: .15rem .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-dim);
}
