/* ebill admin panel — external stylesheet.
 *
 * An external file, and that is a security control rather than a tidiness choice:
 * the CSP is `style-src 'self'` with no 'unsafe-inline', so an inline `<style>`
 * block or a `style="..."` attribute would be REFUSED by the browser. Styling
 * therefore lives here or nowhere. The same applies to app.js — `script-src
 * 'self'`, no inline handlers, no `onclick`.
 */

:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #262b36;
  --text: #e6e8ec;
  --muted: #9aa3b2;
  --accent: #5aa9ff;
  --err: #ff8a8a;
  --ok: #7ddba1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

code, .ua {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* ---- header ---- */

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

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

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* ---- cards ---- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.card.narrow { max-width: 420px; margin: 48px auto; }

h1 { font-size: 20px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 12px; }

.count {
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

.note {
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 12px;
  margin: 12px 0 0;
}

/* ---- forms ---- */

label {
  display: block;
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 8px 10px;
  background: #0c0e13;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

button {
  margin-top: 14px;
  padding: 8px 14px;
  background: var(--accent);
  color: #06121f;
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }

button.linkish {
  background: none;
  color: var(--accent);
  font-weight: 400;
  margin: 0;
  padding: 0;
  text-decoration: underline;
}

/* A form with nothing but a button in it must not introduce a block-level box
 * inside the flex header. */
form.inline { display: inline; margin: 0; }
form.inline button { margin: 0; }
form.spaced { display: block; margin-top: 14px; }

.err {
  color: var(--err);
  background: rgba(255, 138, 138, 0.08);
  border: 1px solid rgba(255, 138, 138, 0.3);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 12px 0 0;
}

.ok {
  color: var(--ok);
  border: 1px solid rgba(125, 219, 161, 0.3);
  background: rgba(125, 219, 161, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 12px 0 0;
}

/* ---- tables ---- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { color: var(--muted); font-weight: 500; white-space: nowrap; }

tr.current td { background: rgba(90, 169, 255, 0.06); }

.ua {
  max-width: 260px;
  overflow-wrap: anywhere;
}

/* Numeric columns must not jitter as digits change, so the cells that hold
 * money and times are monospaced and right-aligned in the later slices. */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
