/* ── NORA — Admin Panel ────────────────────────────── */

/* ── Admin Panel ─────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: rgba(30, 30, 60, 0.55);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 3px;
}
.admin-tab {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--hint);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.admin-tab.active {
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.admin-panel { min-height: 60px; }

/* ── Cards ── */
.adm-card {
  background: rgba(30, 30, 60, 0.55);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.adm-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.adm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.adm-row:last-child { border-bottom: none; }
.adm-row > span:first-child { color: var(--hint); }
.adm-mono { font-family: monospace; font-size: 0.85rem; }

/* ── Battery ── */
.adm-battery { margin-bottom: 12px; }
.adm-battery-header { font-size: 1rem; margin-bottom: 6px; }
.adm-battery-bar {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.adm-battery-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.adm-battery-fill.green { background: var(--accent-green); }
.adm-battery-fill.orange { background: var(--accent-orange); }
.adm-battery-fill.red { background: var(--accent-red); }
.adm-battery-details {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--hint);
}

/* ── Status Grid ── */
.adm-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.adm-stat {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.adm-stat-value { font-size: 0.95rem; font-weight: 700; }
.adm-stat-label { font-size: 0.72rem; color: var(--hint); margin-top: 2px; }

/* ── Action Grids ── */
.adm-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.adm-action-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.adm-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.adm-action-btn:active { background: rgba(255,255,255,0.08); }
.adm-action-btn span { font-size: 1.2rem; }
.adm-action-btn.danger {
  border-color: rgba(255,80,80,0.25);
  color: var(--accent-red);
}
.adm-action-btn.danger:active { background: rgba(255,80,80,0.1); }

/* ── Danger Card ── */
.adm-danger-card { border: 1px solid rgba(255,80,80,0.2); }

/* ── User List ── */
.admin-user-list { display: flex; flex-direction: column; gap: 2px; }
.admin-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-user-row:last-child { border-bottom: none; }
.admin-user-row.clickable { cursor: pointer; border-radius: var(--radius); padding: 10px 8px; transition: background 0.15s; }
.admin-user-row.clickable:hover, .admin-user-row.clickable:active { background: rgba(255,255,255,0.06); }
.admin-user-name { font-weight: 600; font-size: 0.9rem; }
.admin-user-meta { font-size: 0.8rem; color: var(--hint); }
.admin-detail .critical-badge, .admin-user-row .critical-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,80,80,0.15);
  color: var(--accent-red);
  vertical-align: middle;
}

/* ── User Detail ── */
.admin-detail { display: flex; flex-direction: column; gap: 2px; }
.admin-detail-header { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.admin-history { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }

/* ── Items ── */
.adm-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.adm-item-row:last-child { border-bottom: none; }
.adm-item-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.adm-item-name { font-size: 0.88rem; }
.adm-item-name.paused { opacity: 0.5; text-decoration: line-through; }
.adm-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.adm-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.adm-icon-btn.active { border-color: var(--accent-orange); background: rgba(255,165,0,0.1); }
.adm-icon-btn:active { background: rgba(255,255,255,0.08); }

/* ── Slot rows ── */
.adm-slot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.85rem;
}
.adm-slot-controls { display: flex; align-items: center; gap: 6px; }

/* ── Settings rows ── */
.adm-settings-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 8px;
}
.adm-settings-row label { flex: 1; min-width: 100px; font-size: 0.78rem; color: var(--hint); }
.adm-select {
  display: block;
  width: 100%;
  padding: 6px 8px;
  margin-top: 2px;
  border: 1px solid var(--hint);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 0.85rem;
}
.adm-input {
  display: block;
  width: 100%;
  padding: 6px 8px;
  margin-top: 2px;
  border: 1px solid var(--hint);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 0.85rem;
}

/* ── Textarea / Editor ── */
.admin-textarea {
  width: 100%;
  min-height: 200px;
  padding: 10px 12px;
  border: 1px solid var(--hint);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font-family: monospace;
  font-size: 0.8rem;
  resize: vertical;
  margin-top: 8px;
}

/* ── System Output ── */
.admin-sys-output { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.admin-log-pre {
  font-size: 0.7rem;
  line-height: 1.3;
  white-space: pre-wrap;
  word-break: break-all;
  background: rgba(0,0,0,0.2);
  padding: 8px;
  border-radius: var(--radius);
  max-height: 280px;
  overflow-y: auto;
}

/* ── Access ── */
.adm-access-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.adm-access-row:last-child { border-bottom: none; }
.adm-access-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Feedback ── */
.adm-feedback-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.adm-feedback-row:last-child { border-bottom: none; }
.adm-feedback-text { font-size: 0.85rem; margin-top: 2px; opacity: 0.9; }

/* ── Badge ── */
.adm-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--accent-orange);
  color: var(--bg);
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Sheet Wizard ──────────────────────────────────────── */
.sheet-info { margin-bottom: 8px; }
.sheet-status { font-weight: 600; margin-bottom: 6px; }
.sheet-status.connected { color: var(--accent-green); }
.sheet-status.disconnected { color: var(--hint); margin-bottom: 12px; }
.sheet-detail { font-size: 0.85rem; color: var(--hint); margin-bottom: 4px; }
.sheet-detail a { color: var(--link); text-decoration: none; }
.sheet-form { display: flex; flex-direction: column; gap: 8px; }
.sheet-form .modal-input { width: 100%; box-sizing: border-box; }
.adm-skip-reasons { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--secondary-bg); }

/* ── Wizard Page ──────────────────────────────────────── */
.wiz-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wiz-back { background: none; border: none; color: var(--link); font-size: 1rem; padding: 4px 0; cursor: pointer; }
.wiz-title { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--fg); }

.wiz-connection-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 8px 12px; background: var(--secondary-bg); border-radius: var(--radius); }
.wiz-sheet-link { color: var(--link); text-decoration: none; font-size: 0.85rem; }

.wiz-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--secondary-bg); }
.wiz-section h4 { margin: 0 0 8px; font-size: 0.95rem; font-weight: 600; }

.wiz-step { background: var(--secondary-bg); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.wiz-step.compact { padding: 10px 12px; }
.wiz-step-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-fg); font-size: 0.75rem; font-weight: 700; margin-bottom: 6px; }
.wiz-step-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
.wiz-step-body { display: flex; flex-direction: column; gap: 8px; }

.wiz-field { border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 8px; margin-bottom: 4px; }
.wiz-field:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.wiz-field-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wiz-field-header label { font-size: 0.85rem; color: var(--fg); font-weight: 500; }
.wiz-field-hint { font-size: 0.75rem; color: var(--hint); margin-top: 2px; }
.wiz-input { background: var(--bg); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 6px 10px; color: var(--fg); font-size: 0.85rem; width: 80px; text-align: center; }
.wiz-input[type="text"] { width: 140px; text-align: left; }

.wiz-col-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.wiz-field-inline { display: flex; flex-direction: column; gap: 3px; }
.wiz-field-inline label { font-size: 0.78rem; color: var(--hint); }
.wiz-field-inline .wiz-input { width: 100%; box-sizing: border-box; }

/* Row preview */
.wiz-preview { margin-top: 4px; min-height: 20px; transition: opacity 0.2s; }
.wiz-preview.loading { opacity: 0.5; }
.wiz-preview.ok { opacity: 1; }
.wiz-preview.error .wiz-preview-empty,
.wiz-preview.error .wiz-preview-err { color: var(--accent-red); font-size: 0.78rem; }
.wiz-cells { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0; -webkit-overflow-scrolling: touch; }
.wiz-cell { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 0.75rem; white-space: nowrap; background: var(--bg); border: 1px solid rgba(255,255,255,0.08); }
.wiz-cell.text { color: var(--fg); }
.wiz-cell.bool { color: var(--accent-green); font-weight: 600; }
.wiz-cell.empty { color: var(--hint); opacity: 0.5; }
