/* Shared styles for all page templates.
   Pages override CSS variables and add page-specific rules
   in an extra_styles block after this stylesheet is loaded. */

:root {
  --card-width: 760px;

  /* Page background gradient */
  --bg-start: #fdf8ef;       /* light gradient stop; also used for input/surface backgrounds */
  --bg-end: #efe7d4;         /* dark gradient stop */
  --surface-hover: #fbf7ef;  /* subtle hover tint for table rows */

  /* Surfaces */
  --panel: #ffffff;
  --border: #e3dccb;

  /* Text */
  --ink: #1f1f1f;
  --ink-muted: #5b5243;      /* secondary text: subtitles, status messages, table headers */

  /* Accent */
  --accent: #c2542f;
  --accent-dark: #a14424;

  /* Status */
  --status-success: #1f5f3b;
  --status-error: #9a2b2b;

  /* Site header (dark) */
  --header-bg: #111111;
  --header-bg-hover: #2a2a2a;   /* nav link hover background; also secondary button */
  --header-text: #f0ebe0;       /* title and nav hover text */
  --header-text-muted: #c9c2b4; /* nav link default text */
}

body {
  margin: 0;
  font-family: "IBM Plex Mono", "Fira Code", "Courier New", monospace;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: var(--header-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--header-text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-title:hover { color: var(--accent); }

.site-nav a {
  color: var(--header-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover { background: var(--header-bg-hover); color: var(--header-text); }

/* Wraps each page's block body; centers content vertically and horizontally */
.page-content {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.card {
  width: min(var(--card-width), 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

header {
  padding: 2rem 2.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cardbody { padding: 1rem; }

h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0;
  color: var(--ink-muted);
}

.button {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--panel);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}

.button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.button.secondary {
  background: var(--header-bg-hover);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

input {
  /* width: 100%; */
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-start);
  box-sizing: border-box;
}

input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-color: var(--accent);
}

.status {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
  padding: 0.25rem;
}

.status.success {
  color: var(--status-success);
}

.status.error {
  color: var(--status-error);
}

form { padding: 0.5rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

th, td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--border); }
th { font-weight: 700; color: var(--ink-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: var(--surface-hover); }
