/* Admin panel. Shares the palette in styles.css; only the layout is new.
   The visual language is deliberately flatter and more clerical than the file
   browser — this is a console, not a place to enjoy spending time. */

.gate { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.gate-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  max-width: 460px;
  text-align: center;
}
.gate-card h1 { margin: 0 0 10px; font-size: 22px; }
.gate-card p { margin: 0 0 18px; }

.button-like {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
}
.button-like:hover { background: var(--bg-hover); color: var(--text); }
.primary.button-like { background: var(--accent); color: #fff; border-color: transparent; }

.panel { min-height: 100vh; display: flex; flex-direction: column; }
.panel .topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--bg-raised);
}
.panel .brand { font-weight: 600; }
.panel .elevation { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.panel .account { display: flex; align-items: center; gap: 10px; color: var(--muted); }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--line); color: var(--muted);
}
.pill.good   { color: var(--good);   border-color: var(--good); }
.pill.warn   { color: var(--warn);   border-color: var(--warn); }
.pill.danger { color: var(--danger); border-color: var(--danger); }
.pill.accent { color: var(--accent); border-color: var(--accent); }

.tabs { display: flex; gap: 4px; padding: 8px 18px 0; border-bottom: 1px solid var(--line); }
.tab { color: var(--muted); border-radius: 8px 8px 0 0; border-bottom: 2px solid transparent; }
.tab:hover { background: var(--bg-hover); color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab[data-tab="danger"] { color: var(--danger); }

.content { padding: 20px; flex: 1; overflow: auto; }
.tab-body { max-width: 1180px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.card {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; display: grid; gap: 3px;
}
.card-label { color: var(--muted); font-size: 12px; text-transform: uppercase;
              letter-spacing: .05em; }
.card-value { font-size: 25px; font-weight: 600; }
.card-sub { color: var(--muted); font-size: 12px; }

.warnings {
  margin: 16px 0; padding: 12px 16px; border-radius: 10px;
  background: #e8a33d18; border: 1px solid var(--warn);
}
.warnings p { margin: 4px 0; }

.note { margin-top: 18px; max-width: 76ch; font-size: 13px; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type="search"] { max-width: 320px; }
.toolbar select { max-width: 220px; }

.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg);
}
.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tr:hover td { background: var(--bg-hover); }
.grid .right { text-align: right; }
/* Timestamps and short identifiers should not wrap into a column of four
   lines just because the table is wide elsewhere. */
.grid td.when, .grid th.when { white-space: nowrap; width: 1%; }
.grid td.addr { white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid td.detail { max-width: 46ch; overflow-wrap: anywhere; }
.small { font-size: 12px; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
button.small { padding: 3px 8px; font-size: 12px; }
.danger-text { color: var(--danger); }
.danger-text:hover { background: #e5484d1a; }

.inline-form { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-form input { max-width: 240px; }

.danger-box {
  border: 1px solid var(--danger); border-radius: 12px; padding: 20px;
  background: #e5484d0f; max-width: 720px;
}
.danger-box h2 { margin: 0 0 10px; color: var(--danger); font-size: 18px; }
.danger-box p { max-width: 70ch; }
.danger-button {
  background: var(--danger); color: #fff; border-color: transparent; margin-top: 6px;
}
.danger-button:hover { filter: brightness(1.1); }

/* -- Modal (shared with the security dialog on the main page) ------------ */
.modal {
  position: fixed; inset: 0; background: #0009; display: grid; place-items: center;
  padding: 20px; z-index: 50;
}
.modal-card {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; width: min(460px, 100%); display: grid; gap: 12px;
}
.modal-card header { display: flex; align-items: center; justify-content: space-between; }
.modal-card h2 { margin: 0; font-size: 17px; }
.modal-card label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

.sec-form { display: grid; gap: 10px; max-width: 380px; margin: 10px 0; }
.sec-form label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.sec-form button { justify-self: start; }
/* The confirmation label reads as one sentence; without this the inline
   <code> forces a break and it renders as three stacked fragments. */
.danger-box .sec-form label { display: block; margin-bottom: 8px; }
.danger-box .sec-form label code {
  background: var(--bg); padding: 1px 6px; border-radius: 5px; margin: 0 2px;
}
.danger-box .sec-form input { margin-top: 8px; max-width: 380px; }
