.page-admin {
  overflow: auto;
  min-height: 100%;
}
.page-admin .app {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
}
.page-admin .board {
  min-height: calc(100vh - 52px);
  min-height: calc(100dvh - 52px);
}
.page-admin .top-actions .icon-btn {
  width: auto;
  min-width: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}
.nav-chat {
  text-decoration: none;
  background: #fff8ee;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(200, 150, 80, 0.12);
}

.login-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 16px 40px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--chat);
  border-radius: 22px;
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(90, 60, 30, 0.08);
}
.login-card h2 {
  margin: 8px 0 4px;
  font-family: var(--display);
  font-size: 26px;
}
.login-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.login-card .privacy { text-align: left; margin: 0 0 16px; }
.login-card .field { text-align: left; }
.login-card .field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
.login-go {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  border: 0;
}
.err { color: #c45b4a; font-size: 13px; min-height: 1.2em; margin: 10px 0 0; }

.admin {
  display: grid;
  gap: 16px;
  padding: 0 16px 28px;
}
.block-title {
  margin: 4px 2px 0;
  font-size: 14px;
  color: var(--muted);
}
.web-limit-card { background: var(--chat); }
.web-limit-card .privacy { margin: 0 14px 12px; }
.web-limit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  padding: 0 14px 12px;
}
.web-limit-row > div { flex: 1 1 180px; }
.web-limit-input {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.web-limit-input input {
  width: 120px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}
.web-limit-card .meta { padding: 0 14px 12px; }
.kpis, .keys {
  display: grid;
  gap: 12px;
}
.kpis { grid-template-columns: repeat(4, 1fr); }
.keys { grid-template-columns: repeat(5, 1fr); }
.card, .kpi, .key-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.table-card { background: var(--chat); }
.kpi .n {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  word-break: break-all;
}
.kpi .l { color: var(--muted); font-size: 12px; margin-top: 4px; }
.key-card h4 { margin: 0 0 4px; font-size: 15px; }
.meta { font-size: 12px; color: var(--muted); line-height: 1.5; }
.bar {
  height: 10px;
  background: #efe4d2;
  border-radius: 99px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7ec87a, #f5d56a, #f4a04c);
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge.ok { background: #e7f6e4; color: #2f7a32; }
.badge.cool { background: #fff1d4; color: #b36a1c; }
.badge.bad { background: #ffe4e0; color: #b33; }

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 4px 12px;
  align-items: center;
}
.toolbar input, .toolbar select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  min-height: 40px;
}
.toolbar input { flex: 1 1 180px; }
.pager { justify-content: center; padding-top: 12px; padding-bottom: 4px; }
.table-scroll { overflow: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }
tr:hover td { background: #fff1d4; cursor: pointer; }
.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-admin .modal {
  position: fixed;
  inset: 0;
  background: rgba(50, 34, 16, 0.32);
  display: none;
  place-items: center;
  padding: 16px;
  z-index: 20;
}
.page-admin .modal.show { display: grid; }
.page-admin .sheet {
  width: min(920px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #fffaf0;
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.page-admin .sheet h3 { font-family: var(--display); margin: 0 0 10px; }
.page-admin .sheet h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.page-admin pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .kpis, .keys { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .page-admin .app { padding: 0; }
  .page-admin .board { border-radius: 0; min-height: 100dvh; }
  .page-admin .deco { display: none; }
  .kpis, .keys { grid-template-columns: 1fr; }
  .admin { padding: 0 10px 24px; }
  .login-wrap { padding: 12px 12px 28px; }
  table, thead, tbody, th, td, tr { display: block; }
  table { min-width: 0; }
  thead { display: none; }
  tbody tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  tbody tr:hover td { background: transparent; }
  td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border: 0;
    padding: 6px 0;
    max-width: none;
    white-space: normal;
  }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    flex: 0 0 64px;
    font-weight: 700;
  }
  .clip {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
  }
  .page-admin .sheet { max-height: 90dvh; padding: 16px; }
}
