/* Dashboard CSS architecture — deliberately a smaller, standalone token set than the main app's
   public/styles.css (this ships to shared hosting, not bundled with the Node app), but follows
   the same shape: --space-*/--color-*/--radius-* custom properties, BEM-ish component classes,
   and a prefers-color-scheme dark variant. Add new component styles as classes here rather than
   inline style="" attributes in the PHP templates, same convention as the main app. */

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;

  --radius-sm: 6px;
  --radius-md: 8px;

  --color-bg: #f7f7f8;
  --color-surface: #ffffff;
  --color-border: #e0e0e5;
  --color-text: #1f2430;
  --color-muted: #6b7280;

  --color-primary: #2f6fed;
  --color-primary-bg: #eef1fb;

  --color-error: #c0392b;
  --color-error-bg: #fbe7e4;

  --color-success: #1c8a4a;
  --color-success-bg: #e3f6ea;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #14161a;
    --color-surface: #1b1e24;
    --color-border: #2c313a;
    --color-text: #e7e9ee;
    --color-muted: #9aa1ac;

    --color-primary: #5b8def;
    --color-primary-bg: #21252c;

    --color-error: #f87171;
    --color-error-bg: #3a1414;

    --color-success: #4ade80;
    --color-success-bg: #14311f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-4);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.page-header__title { margin: 0; font-size: 1.4rem; }

.nav {
  display: flex;
  gap: var(--space-3);
}

.nav a { color: var(--color-muted); text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--color-primary); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.card > h2:first-child { margin-top: 0; }

.form-field { margin-bottom: var(--space-3); }
.form-field label { display: block; margin-bottom: var(--space-1); font-weight: 600; font-size: 0.9rem; }

.form-control {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.95rem;
}

.button {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.9rem;
}

.button--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
th { color: var(--color-muted); font-weight: 600; }

.badge { padding: 2px var(--space-2); border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge--done { background: var(--color-success-bg); color: var(--color-success); }
.badge--failed { background: var(--color-error-bg); color: var(--color-error); }
.badge--pending, .badge--running { background: var(--color-primary-bg); color: var(--color-primary); }

.message { margin-top: var(--space-3); font-size: 0.9rem; }
.message--error { color: var(--color-error); }
.message--ok { color: var(--color-success); }

.hint { color: var(--color-muted); font-size: 0.85rem; }

[hidden] { display: none !important; }
