:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #17202a;
  --muted: #667085;
  --line: #dbe1e8;
  --line-soft: #edf1f5;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --brand-soft: #dff5f1;
  --blue-soft: #e8f2ff;
  --red: #b42318;
  --red-soft: #fee4e2;
  --amber: #92400e;
  --amber-soft: #fef3c7;
  --green: #166534;
  --green-soft: #dcfce7;
  --shadow: 0 10px 28px rgba(16, 24, 40, .08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 128px;
  max-width: 34vw;
  height: auto;
}

.brand-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-title h1 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 7px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
}

.header-link:hover {
  background: var(--brand-soft);
  text-decoration: none;
}

.page {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.breadcrumb-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 12px 24px;
  list-style: none;
}

.breadcrumb a,
.breadcrumb span {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.breadcrumb a {
  color: var(--brand-strong);
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb li + li::before {
  content: ">";
  color: #98a2b3;
  font-weight: 800;
}

.stack {
  display: grid;
  gap: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 18px;
  align-items: start;
}

.panel {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-body {
  padding: 18px;
}

h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

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

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.metric {
  min-height: 78px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .16);
  outline: none;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--brand-strong);
  text-decoration: none;
}

button.secondary {
  background: #475467;
}

button.secondary:hover {
  background: #344054;
}

button.danger {
  background: var(--red);
}

button.danger:hover {
  background: #912018;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfcfd;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.ok {
  background: var(--green-soft);
  color: var(--green);
}

.status.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.status.err {
  background: var(--red-soft);
  color: var(--red);
}

.row-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.form-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

form.inline {
  display: inline-flex;
}

.embedded-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.banner {
  padding: 13px 16px;
  border: 1px solid #b8d9ff;
  border-radius: 8px;
  background: var(--blue-soft);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(400px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card img {
  width: 150px;
  height: auto;
  margin-bottom: 18px;
}

.login-card h1 {
  margin: 0 0 18px;
  font-size: 22px;
}

.login-card label {
  margin-bottom: 14px;
}

.login-card button {
  width: 100%;
}

.error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 14px;
}

.qr {
  width: min(260px, 100%);
  height: auto;
  image-rendering: crisp-edges;
}

.message-body {
  max-width: 420px;
  line-height: 1.45;
}

.password-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  min-width: 280px;
}

.quota-form {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 10px;
  align-items: end;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.mini-metric {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
}

.mini-metric:hover {
  border-color: var(--brand);
  text-decoration: none;
}

.mini-metric span,
.mini-metric small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-metric strong {
  font-size: 24px;
  line-height: 1;
}

.mini-metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-header {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .header-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
  }

  .brand-title h1 {
    white-space: normal;
  }

  .page {
    padding: 16px;
  }

  .breadcrumb {
    padding: 12px 16px;
  }

  .panel-header {
    flex-direction: column;
  }

  th,
  td {
    padding: 10px;
  }

  .password-form {
    grid-template-columns: 1fr;
    min-width: 220px;
  }

  .quota-form {
    grid-template-columns: 1fr;
  }
}
