.panel {
  max-width: 440px; margin: 24px auto 96px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px; box-shadow: 0 12px 40px -16px rgba(0,0,0,.14);
}
.panel h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.02em; }
.panel .muted { color: var(--muted); margin: 0 0 22px; font-size: 15.5px; }
.panel.wide { max-width: 640px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 22px; }
.tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; font: inherit; font-size: 15px;
  color: var(--muted); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
input[type="text"], input[type="email"], input[type="number"], textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--wax); outline-offset: 1px; border-color: transparent; }
textarea { display: block; min-height: 190px; line-height: 1.55; resize: vertical; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%; border: 0; cursor: pointer;
  background: var(--wax); color: var(--wax-ink); font: inherit; font-weight: 650; padding: 12px 18px; border-radius: 11px;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.inline { width: auto; }
.notice { border-radius: 11px; padding: 12px 14px; font-size: 15px; margin-bottom: 18px; }
.notice.ok { background: var(--wax-soft); color: var(--ink); }
.notice.err { background: #fde8e6; color: #8c1d14; }
[hidden] { display: none !important; }

.rows { display: grid; gap: 0; margin: 0 0 24px; }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row dt { color: var(--muted); font-size: 14.5px; }
.row dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; text-align: right; }
.copy { display: flex; gap: 8px; align-items: center; margin: 6px 0 24px; }
.copy code { flex: 1; padding: 11px 13px; border: 1px dashed var(--wax); border-radius: 10px; background: var(--wax-soft); overflow-wrap: anywhere; font-size: 15px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; }
.badge.on { background: #e3f4e8; color: #1d6b37; }
.badge.off { background: var(--wax-soft); color: var(--wax); }
.actions { display: grid; gap: 10px; }

.panel-title { font-size: 20px; margin: 0 0 14px; letter-spacing: -.01em; }
.panel-sub { font-size: 15px; margin: 28px 0 8px; color: var(--muted); font-weight: 600; }
.small { font-size: 13.5px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.meter-head strong { font-size: 22px; letter-spacing: -.02em; }
.meter-head span { color: var(--muted); font-size: 14.5px; }
.meter { height: 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: #2f8f57; border-radius: 999px; transition: width .4s ease; }
.meter.warn span { background: var(--wax); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 10px; }
.stats > div, .kpi { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--muted); }
.stat { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
table.hist { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.hist th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.hist td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); }
.hist th:not(:first-child), .hist td:not(:first-child) { text-align: right; }

.admin { padding-bottom: 96px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.admin-table { min-width: 860px; }
.admin-table th, .admin-table td { text-align: left !important; white-space: nowrap; }

.code-row { display: flex; justify-content: center; gap: 8px; margin: 8px 0 18px; }
.code-box {
  width: 48px; height: 58px; text-align: center; font: 700 26px ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--ink);
}
.code-box:focus { outline: 2px solid var(--wax); outline-offset: 1px; border-color: transparent; }
@media (max-width: 400px) { .code-row { gap: 5px; } .code-box { width: 40px; height: 52px; font-size: 22px; } }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; }
.link { background: none; border: 0; padding: 4px; font: inherit; font-size: 14.5px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }
