:root {
  --bg: #eef3f7;
  --text: #12222d;
  --muted: #4c606c;
  --line: #cad7df;
  --panel: #ffffff;
  --brand: #0f7f8f;
  --brand-2: #0a6371;
  --ok: #1e7c2f;
  --warn: #a56a18;
  --err: #a22f2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(165deg, #f7fafc 0%, var(--bg) 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-pill,
.user-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--muted);
  background: #fff;
}

.app-shell {
  width: min(1240px, 96vw);
  margin: 14px auto 24px;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 14px;
}

.sidebar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 14px;
  height: fit-content;
  position: sticky;
  top: 72px;
}

.sidebar h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.side-nav a:hover {
  border-color: var(--line);
  background: #f7fbfd;
}

.side-nav a.on {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.page {
  min-width: 0;
}

.page-head {
  margin-bottom: 10px;
}

.page-head h1 {
  margin: 0;
  font-size: 1.6rem;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.card h2,
.card h3 {
  margin-top: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.btn.ghost {
  color: var(--text);
  border-color: var(--line);
  background: #fff;
}

.btn.warn {
  color: #fff;
  background: #a56a18;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.kpi strong {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 3px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 9px 8px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge.info {
  background: #e9f6fb;
  color: #1a6f8b;
}

.badge.ok {
  background: #e9f8ec;
  color: var(--ok);
}

.badge.warn {
  background: #fff5e8;
  color: var(--warn);
}

.badge.err {
  background: #ffeaea;
  color: var(--err);
}

.form-row {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

input,
select,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 11px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f1c24;
  color: #d9eef9;
  border-radius: 12px;
  padding: 12px;
  max-height: 420px;
  overflow: auto;
}

.alert,
.ok,
.warn-box {
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}

.alert {
  border: 1px solid #f2c4c4;
  background: #fff3f3;
  color: #8f2d2d;
}

.ok {
  border: 1px solid #c7e7cb;
  background: #effcf1;
  color: #2c6f35;
}

.warn-box {
  border: 1px solid #efd5ad;
  background: #fff8ec;
  color: #8f5e14;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 0 12px 20px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

.modal-open {
  overflow: hidden;
}

.disclaimer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 18, 26, 0.68);
  backdrop-filter: blur(4px);
}

.disclaimer-overlay.is-hidden {
  display: none;
}

.disclaimer-modal {
  width: min(640px, 96vw);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(12, 25, 37, 0.24);
}

.disclaimer-kicker {
  margin: 0 0 8px;
  color: var(--brand-2);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.disclaimer-modal h2 {
  margin: 0 0 8px;
}

.disclaimer-modal p {
  margin: 0 0 10px;
  line-height: 1.6;
}
