/* Harpy.pro — mid-tone scientific theme
 * Palette is deliberately not-light, not-dark. Cool neutral slate with a deep
 * petrol-blue accent, warm paper for cards, and a subtle ink for type.
 */

:root {
  --bg: #d9dee4;            /* slate paper */
  --bg-sunken: #ced4dc;     /* panel behind cards */
  --surface: #eef1f5;       /* cards */
  --surface-2: #e3e7ed;     /* alt rows */
  --border: #b8bfc8;
  --border-strong: #9aa3af;
  --ink: #1f2a37;           /* primary text */
  --ink-soft: #4b5563;      /* secondary text */
  --ink-faint: #6b7280;     /* tertiary */
  --accent: #0f4c81;        /* petrol blue */
  --accent-2: #1f6aaa;
  --accent-ink: #08365c;
  --accent-surface: #dfe9f3;
  --success: #2f7d55;
  --success-bg: #dff0e5;
  --warn: #a16207;
  --warn-bg: #f2e8cf;
  --danger: #9b2f2f;
  --danger-bg: #f4dcdc;
  --code-bg: #dfe3e9;

  --radius: 8px;
  --radius-sm: 5px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.08);

  --font-sans: "Inter", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace,
    SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 0.5em; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 1em; }

code, pre, .mono { font-family: var(--font-mono); font-size: 12.5px; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow: auto;
}

/* ─── Layout ────────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, #20364e 0%, #182838 100%);
  color: #d9dee4;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar .brand {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 14px;
  color: #fff;
  margin: 4px 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .brand .logo {
  width: 22px; height: 22px;
  background: radial-gradient(circle at 30% 30%, #4f8fc0, #0f4c81 70%);
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px #9bc1e0;
}
.sidebar .brand small { color: #7f96ac; font-weight: 400; letter-spacing: 0.12em; }
.nav-group { margin-top: 12px; }
.nav-group .label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7f96ac;
  padding: 4px 10px;
  margin-top: 6px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  color: #c9d2dc;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
}
.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(79, 143, 192, 0.22); color: #fff; }
.nav a .ico {
  width: 16px; height: 16px; opacity: 0.85; flex: 0 0 auto;
}
.sidebar .bottom { margin-top: auto; padding: 10px; color: #7f96ac; font-size: 12px; }
.sidebar .bottom strong { color: #e6ecf3; display: block; }

main {
  display: flex; flex-direction: column; min-width: 0;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: #dde2e8;
  border-bottom: 1px solid var(--border);
}
.topbar .crumbs { color: var(--ink-soft); font-size: 12.5px; }
.topbar .user {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #4f8fc0, #0f4c81);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
}
.topbar .user a { color: var(--ink-soft); }
.topbar .user form { display: inline; }

.content { padding: 24px; flex: 1 1 auto; overflow: auto; }
.page-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.page-header h1 { margin: 0; }

/* ─── Components ────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card .card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #e7ebf0;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.card .card-header h2, .card .card-header h3 { margin: 0; }
.card .card-body { padding: 18px; }
.card .card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) {
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 64px 1fr; }
  .sidebar .brand small, .sidebar .nav-group .label, .sidebar .bottom { display: none; }
  .nav a span.label { display: none; }
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .label { color: var(--ink-faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-size: 26px; font-weight: 700; color: var(--ink); font-family: var(--font-mono); margin-top: 4px; }
.stat .delta { color: var(--success); font-size: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: #eef1f5;
  color: var(--ink);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { background: #e3e8ee; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(15,23,42,0.06); }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #7a2121; border-color: #7a2121; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.row-actions .btn { margin-left: 6px; }
.inline-form { display: inline; }

/* Forms */
label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 4px; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #f6f7f9;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(31, 106, 170, 0.18);
  background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
.form-row { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.helptext { color: var(--ink-faint); font-size: 12px; margin-top: 4px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #e5e9ee; color: var(--ink-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover { background: #e9edf2; }
td .mono { color: var(--ink-soft); }

/* Badges / pills */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent-surface);
  color: var(--accent-ink);
  border: 1px solid #c9d9e7;
}
.badge-success { background: var(--success-bg); color: var(--success); border-color: #b8dcc6; }
.badge-warn    { background: var(--warn-bg);    color: var(--warn);    border-color: #d8c78a; }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: #d8acac; }
.badge-neutral { background: #d8dde4; color: var(--ink-soft); border-color: var(--border-strong); }

/* Alerts */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border: 1px solid;
}
.alert-info    { background: var(--accent-surface); border-color: #c9d9e7; color: var(--accent-ink); }
.alert-success { background: var(--success-bg); border-color: #b8dcc6; color: var(--success); }
.alert-warn    { background: var(--warn-bg);    border-color: #d8c78a; color: var(--warn); }
.alert-danger  { background: var(--danger-bg);  border-color: #d8acac; color: var(--danger); }

/* ─── Auth pages ───────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: linear-gradient(135deg, #1a2a3d 0%, #263a55 70%, #0f4c81 100%);
}
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } }
.auth-art {
  position: relative;
  color: #e6ecf3;
  padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.auth-art::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(800px circle at 20% 30%, rgba(79, 143, 192, 0.28), transparent 60%),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.04) 0 1px,
      transparent 1px 28px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.04) 0 1px,
      transparent 1px 28px
    );
  pointer-events: none;
}
.auth-art .head, .auth-art .foot { position: relative; z-index: 1; }
.auth-art .brand-xl {
  font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 14px;
}
.auth-art .brand-xl .logo {
  width: 30px; height: 30px; border-radius: 6px;
  background: radial-gradient(circle at 30% 30%, #86b8dd, #0f4c81 70%);
  box-shadow: inset 0 0 0 1px #9bc1e0;
}
.auth-art .tag { max-width: 520px; margin-top: 40vh; font-size: 22px; line-height: 1.35; color: #e6ecf3; }
.auth-art .tag small { color: #9bb3cb; display: block; font-size: 13px; margin-top: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.auth-art .foot { font-size: 12px; color: #9bb3cb; }

.auth-panel {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { margin-top: 0; }
.auth-card .sub { color: var(--ink-soft); margin-top: -4px; margin-bottom: 18px; }
.auth-card .actions { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.auth-card .actions .btn { min-width: 120px; justify-content: center; }
.auth-card .links { margin-top: 14px; font-size: 12.5px; color: var(--ink-faint); display: flex; justify-content: space-between; }

/* ─── Module cards ────────────────────────────────────────────────────── */
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.module-card:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.module-card .icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent-surface);
  color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #c9d9e7;
  font-family: var(--font-mono);
}
.module-card .title { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.module-card .desc  { color: var(--ink-soft); font-size: 12.5px; min-height: 2em; }
.module-card .meta  { display: flex; justify-content: space-between; color: var(--ink-faint); font-size: 11.5px; }

/* Category headings on dashboard */
.cat-heading {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 11.5px; margin: 22px 0 10px;
}
.cat-heading::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ─── Report builder ──────────────────────────────────────────────────── */
.report-builder { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }
@media (max-width: 1000px) { .report-builder { grid-template-columns: 1fr; } }
.block-palette .palette-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 8px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
}
.block-palette .palette-btn:hover { background: var(--surface-2); }
.report-canvas { min-height: 480px; }
.block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 14px 14px 14px;
  margin-bottom: 12px;
}
.block .block-controls {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 4px;
}
.block .block-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.empty-canvas {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--ink-faint);
  background: var(--surface-2);
}

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; color: var(--ink); }

.muted { color: var(--ink-faint); }
.hidden { display: none !important; }
.right { text-align: right; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gap-2 { gap: 8px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* Public report view */
.public-shell { background: var(--bg); min-height: 100vh; }
.public-wrap { max-width: 840px; margin: 0 auto; padding: 32px 20px 60px; }
.public-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.public-header .brand { font-family: var(--font-mono); letter-spacing: 0.08em; font-weight: 600; color: var(--accent-ink); }
.public-header .stamp { color: var(--ink-faint); font-size: 12px; }
.public-report .block { background: var(--surface); }

/* Copy-to-clipboard input row */
.copy-row { display: flex; gap: 6px; }
.copy-row input { font-family: var(--font-mono); }
