:root {
  --ceps-green: #207164;
  --ceps-navy: #0c2443;
  --ceps-red: #b02441;
  --ceps-grey: #6b6b69;
  --ceps-grey-2: #a3a3a1;
  --ceps-grey-3: #d4d4d2;
  --ceps-green-tint: #c4ded9;
  --ceps-rule: #e3e3e1;
  --ink: #1a1a1a;
  --paper: #ffffff;
  --field: #ffffff;
  --field-ro: #f6f6f4;
  --wash: #f1f1ef;
  --heading: #0c2443;
  --bar: #0c2443;
  --link: #207164;
  --hover: #185a50;
  --font: Carlito, Calibri, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ceps-green: #2a7d6f;
  --ceps-red: #e0607a;
  --ceps-grey: #a8a8a4;
  --ceps-grey-2: #5d6063;
  --ceps-grey-3: #3a3d40;
  --ceps-green-tint: #8fd3c4;
  --ceps-rule: #2c2f32;
  --ink: #e9e9e6;
  --paper: #131517;
  --field: #1b1e21;
  --field-ro: #22262a;
  --wash: #1b1e21;
  --heading: #9fb6db;
  --bar: #0e1a2b;
  --link: #6cc2b0;
  --hover: #33917f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.4;
}

.bar {
  background: var(--bar);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bar a, .bar button.link { color: #fff; }

.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { display: block; width: 33px; height: 36px; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-app { font-size: 21px; font-weight: 400; letter-spacing: 0; }
.brand-version { margin-top: 1px; font-size: 11px; font-weight: 400; letter-spacing: 0; line-height: 1.1; opacity: .7; }

.narrow {
  max-width: 420px;
  margin: 64px auto;
  padding: 0 20px;
}

.wide {
  max-width: 1040px;
  margin: 36px auto;
  padding: 0 24px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 6px;
}

h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--heading);
  margin: 36px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ceps-green);
}

p.lead { color: var(--ceps-grey); margin: 0 0 24px; }

label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ceps-grey);
  margin: 16px 0 6px;
}

input[type=email], input[type=password], input[type=text], select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--ceps-grey-3);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
}

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

input[readonly] { background: var(--field-ro); color: var(--ceps-grey); }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 0;
}

.primary {
  margin-top: 22px;
  width: 100%;
  padding: 11px 16px;
  background: var(--ceps-green);
  color: #fff;
  border: 0;
  font-weight: 700;
}

.primary:hover { background: var(--hover); }
.primary:disabled { background: var(--ceps-grey-2); cursor: default; }

.small {
  padding: 5px 10px;
  border: 1px solid var(--ceps-grey-3);
  background: var(--field);
  color: var(--ink);
  font-size: 14px;
}

.small:hover { border-color: var(--ceps-green); color: var(--link); }
.small.danger:hover { border-color: var(--ceps-red); color: var(--ceps-red); }

button.link {
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  font-size: 15px;
}

.msg { min-height: 22px; margin-top: 14px; font-size: 15px; }
.msg.error { color: var(--ceps-red); }
.msg.ok { color: var(--link); }

.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > div { flex: 1 1 260px; }
.inline-form label { margin-top: 0; }
.inline-form .primary { width: auto; margin-top: 0; }

.linkbox {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--wash);
  border-left: 3px solid var(--ceps-green);
  word-break: break-all;
  font-size: 14px;
}

.linkbox .row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }

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

th {
  text-align: left;
  font-weight: 700;
  color: var(--ceps-grey);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ceps-grey-3);
  padding: 8px 10px;
}

td {
  border-bottom: 1px solid var(--ceps-rule);
  padding: 9px 10px;
  vertical-align: middle;
}

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.meter {
  display: inline-block;
  width: 70px;
  height: 6px;
  background: var(--ceps-rule);
  vertical-align: middle;
  margin-left: 8px;
}

.meter i { display: block; height: 100%; background: var(--ceps-green); }
.meter.full i { background: var(--ceps-red); }

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid var(--ceps-grey-3);
  color: var(--ceps-grey);
  margin-left: 6px;
}

.tag.off { color: var(--ceps-red); border-color: var(--ceps-red); }
.tag.admin { color: var(--link); border-color: var(--link); }

.muted { color: var(--ceps-grey); }
.note { color: var(--ceps-grey); font-size: 14px; margin-top: 10px; }

main a { color: var(--link); }

select.tier { width: auto; min-width: 118px; padding: 5px 8px; font-size: 14px; }
select.tier:disabled { opacity: .7; cursor: not-allowed; }
