/* Base UI styling for the CasperVend admin (Dutch UI).
 *
 * Single stylesheet for the whole app, linked from base.html. The design tokens
 * and base element styles here were previously inline in base.html; they now
 * live in one place so every page (login, dashboard, later product pages) shares
 * them. Keep this small and readable — it is the foundation later phases extend.
 */

:root {
  --fg: #1c2430;
  --muted: #5b6878;
  --accent: #2d6cdf;
  --bg: #f4f6fa;
  --card: #fff;
  --border: #dde3ec;
  /* Red palette for unconfigured products / errors. */
  --red: #9b1c1c;
  --red-bg: #fdecec;
  --red-border: #f5c2c2;
  /* Green palette for success notices (e.g. bot connection test). */
  --green: #166534;
  --green-bg: #e9f7ef;
  --green-border: #b7e0c6;
}

* { box-sizing: border-box; }

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

header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header .brand { font-weight: 600; }

main { max-width: 860px; margin: 2rem auto; padding: 0 1.25rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

h1 { font-size: 1.3rem; margin: 0 0 1rem; }

label {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  margin: .75rem 0 .25rem;
}

input[type=text], input[type=password] {
  width: 100%;
  padding: .6rem .7rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 7px;
}

button {
  margin-top: 1.1rem;
  padding: .55rem 1.1rem;
  font-size: .95rem;
  cursor: pointer;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
}
button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  margin: 0;
  padding: .4rem .9rem;
}

.error {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
  padding: .6rem .75rem;
  border-radius: 7px;
  font-size: .9rem;
}

.success {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
  padding: .6rem .75rem;
  border-radius: 7px;
  font-size: .9rem;
}

.muted { color: var(--muted); }

/* --- Type filter ---------------------------------------------------------- */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 1rem 0; }
.filter-label { font-size: .85rem; color: var(--muted); margin-right: .25rem; }
.chip {
  display: inline-block;
  padding: .25rem .7rem;
  font-size: .85rem;
  text-decoration: none;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Product table -------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.products { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.products th, table.products td {
  text-align: left;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.products th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }

.tag {
  display: inline-block;
  padding: .1rem .5rem;
  margin: 0 .15rem .15rem 0;
  font-size: .78rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.badge { display: inline-block; padding: .15rem .55rem; font-size: .78rem; border-radius: 5px; }
.badge.ok { background: #e8f3ec; color: #1d6b3a; border: 1px solid #bfe0cb; }
.badge.red { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

/* Unconfigured products are visibly RED: red left border + subtle red wash. */
.product-row.unconfigured td { background: var(--red-bg); }
.product-row.unconfigured td:first-child { box-shadow: inset 4px 0 0 0 var(--red); }

/* --- Product configuration form ------------------------------------------ */
.back-link { color: var(--accent); text-decoration: none; font-size: .9rem; }

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem 1rem 1rem;
  margin: 1.25rem 0 0;
}
legend {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  padding: 0 .35rem;
}

select, textarea {
  width: 100%;
  padding: .55rem .7rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
}
textarea { resize: vertical; }

label.checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  color: var(--fg);
  margin: .5rem 0 0;
}
label.checkbox input { width: auto; margin: 0; }

.checkbox-list { display: flex; flex-direction: column; gap: .15rem; }

.hint { font-size: .82rem; color: var(--muted); margin: .35rem 0 0; }

.error-list { margin: 0; padding-left: 1.1rem; }

/* --- Bot management ------------------------------------------------------- */
.header-actions { display: flex; align-items: center; gap: 1rem; }

/* An inline delete form sits next to the "Bewerken" link in a table cell; its
 * submit button is styled as a red text link rather than a filled button. */
.inline-form { display: inline; margin: 0 0 0 .6rem; }
.link-danger {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--red);
  border: 0;
  font-size: .9rem;
  cursor: pointer;
}
