:root {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #20242d;
  --border: #2a2f3a;
  --text: #e7eaf0;
  --muted: #8a93a4;
  --accent: #1264a3;       /* Anima blue */
  --accent-fg: #fff;
  --danger: #d64545;
  --ok: #2f9e6e;
  --radius: 8px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.container.narrow {
  max-width: 480px;
  text-align: center;
  padding-top: 5rem;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
}

.site-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.1rem; margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.logo { font-size: 3rem; margin-bottom: 0.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Page header with back link + action */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.back-link {
  font-size: 0.9rem;
  color: var(--muted);
}

.back-link:hover { color: var(--text); }

/* User info in header */
.user {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Buttons */
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  border: 0;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.button:hover { opacity: 0.9; text-decoration: none; }

.button.slack {
  background: #4a154b;
  font-size: 1rem;
  padding: 0.65rem 1.5rem;
}

.link {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

.link:hover { color: var(--text); }

.inline { display: inline; }

/* Flash messages */
.flash {
  background: color-mix(in srgb, var(--ok) 15%, transparent);
  border: 1px solid var(--ok);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.flash.error {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  border-color: var(--danger);
}

/* Reports list table */
.reports-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.reports-table th {
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.reports-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.reports-table tr:last-child td { border-bottom: 0; }

.reports-table tr:hover td { background: var(--surface-2); }

.reports-table td.date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  width: 120px;
}

.reports-table td:not(.date) a {
  display: block;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  hyphens: auto;
}

/* Report view */
.report-card { padding: 2rem; }

.report-meta {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.report-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.25rem;
}

.report-title {
  font-size: 1.4rem;
  margin: 0;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
}

/* Prose markdown output */
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose h2 { font-size: 1.15rem; }
.prose h3 { font-size: 1rem; color: var(--muted); }

.prose p { margin: 0.75rem 0; }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.prose pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 1rem 0;
}

.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.prose li { margin: 0.25rem 0; }

.prose a { color: var(--accent); }

.prose blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

/* New report form */
label {
  display: block;
  margin-bottom: 1rem;
}

label > span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

input[type="text"],
input:not([type]),
input[type="date"],
input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.date-input { max-width: 200px; }

.report-textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 400px;
}

.report-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
