@font-face {
  font-family: "ProximaSoft";
  src: url("./assets/fonts/proximasoft/ProximaSoft-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ProximaSoft";
  src: url("./assets/fonts/proximasoft/ProximaSoft-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --ink: #202524;
  --muted: #66706d;
  --line: #d5ddda;
  --accent: #9b332c;
  --accent-strong: #7f241f;
  --ok: #25724f;
  --warn: #a56714;
  --bad: #a22e2e;
  --focus: #1b6f8f;
  --shadow: 0 16px 40px rgba(20, 34, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: "ProximaSoft", Arial, sans-serif;
  line-height: 1.45;
}

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

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  min-height: 36px;
  max-width: 100%;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.danger {
  border-color: #d59a9a;
  color: var(--bad);
}

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

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

.login-panel h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.login-panel p {
  margin: 0 0 20px;
  color: var(--muted);
}

.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #23302d;
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-head {
  display: block;
}

.brand {
  display: grid;
  gap: 2px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.brand strong {
  font-size: 20px;
}

.brand span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

.menu-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
}

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

.nav button {
  text-align: left;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.session {
  margin-top: auto;
  display: grid;
  justify-items: start;
  gap: 8px;
}

.session small {
  color: rgba(255, 255, 255, 0.62);
  overflow-wrap: anywhere;
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.section {
  margin-bottom: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid > button {
  justify-self: start;
}

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

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 28px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
button:focus {
  outline: 2px solid rgba(27, 111, 143, 0.28);
  outline-offset: 1px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  background: var(--surface-2);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

.linkish {
  border: 0;
  padding: 0;
  min-height: 0;
  width: auto;
  color: var(--accent);
  background: transparent;
  text-align: left;
  border-radius: 0;
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.status.ok {
  background: #dff0e6;
  color: var(--ok);
}

.status.warn {
  background: #f4e7d1;
  color: var(--warn);
}

.status.bad {
  background: #f1dada;
  color: var(--bad);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.card h3 {
  margin: 0;
  font-size: 18px;
}

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

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

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

.detail {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.detail strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.notice {
  border: 1px solid #e0c37e;
  background: #fff7df;
  color: #5e4714;
  border-radius: 8px;
  padding: 12px;
}

.error {
  border: 1px solid #e0a0a0;
  background: #fff0f0;
  color: var(--bad);
  border-radius: 8px;
  padding: 12px;
}

.success {
  border: 1px solid #9fd3b6;
  background: #effaf3;
  color: var(--ok);
  border-radius: 8px;
  padding: 12px;
}

.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}

.scan-box {
  max-width: 620px;
}

.scan-input {
  font-size: 28px;
  min-height: 64px !important;
  font-weight: 600;
}

.output-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
  align-items: end;
}

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

.public-panel {
  width: min(680px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px 14px;
    gap: 0;
  }

  .sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .brand {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    flex: 0 0 auto;
  }

  .menu-panel {
    display: none;
    padding-top: 12px;
  }

  .sidebar.open .menu-panel {
    display: grid;
    gap: 12px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav button {
    width: fit-content;
  }

  .session {
    margin-top: 0;
  }

  .split,
  .grid.cols-2,
  .grid.cols-3,
  .details {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .main {
    padding: 14px;
  }

  .topbar {
    display: grid;
  }

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

  .toolbar {
    display: grid;
  }
}
