:root { --pico-font-size: 15px; }

header {
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

header h1 { margin: 0; }

/* Card table */
.card-table { width: 100%; }

.card-table td, .card-table th { white-space: nowrap; }

/* Log table */
.log-table { width: 100%; font-size: 0.875rem; }

.log-table td, .log-table th { white-space: nowrap; }

.muted { color: var(--pico-muted-color); font-size: 0.875rem; }

tr.locked-row td { color: var(--pico-muted-color); }

tr.group-header td {
  background: var(--pico-table-border-color, #e0e0e0);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  color: var(--pico-muted-color);
}

.status-ok     { color: var(--pico-color-green-550, #2d9a4e); font-weight: 600; }
.status-locked { color: var(--pico-color-red-550, #c0392b);   font-weight: 600; }

/* Alias cell */
.alias-cell { white-space: nowrap; }

.alias-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.2rem;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.4;
  display: inline;
}

.alias-edit-btn:hover { opacity: 1; }

/* Lock button — icon only, no chrome */
.lock-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  font-size: 1.1rem;
  line-height: 1;
  display: inline;
}

.lock-btn:hover { opacity: 0.7; }

/* Confirmation dialog */
dialog article { max-width: 420px; }

.warning-text {
  color: var(--pico-color-orange-500, #e67e22);
  font-weight: 600;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* Error / info messages */
.error-msg { color: var(--pico-color-red-550, #c0392b); margin-top: 0.5rem; }

/* PIN safety banners */
.pin-warning {
  background: #fef3c7;
  border-left: 4px solid #e67e22;
  color: #92400e;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

.pin-critical {
  background: #fee2e2;
  border-left: 4px solid #c0392b;
  color: #7f1d1d;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

[aria-busy="true"] { text-align: center; padding: 2rem; }

/* History button — icon-only link, same style as alias-edit-btn */
.history-btn {
  font-size: 0.85rem;
  opacity: 0.4;
  text-decoration: none;
  padding: 0 0.1rem;
}
.history-btn:hover { opacity: 1; }

/* Card history page */
.history-summary {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.history-consumed  { color: var(--pico-color-red-550,   #c0392b); }
.history-recharged { color: var(--pico-color-green-550, #2d9a4e); }

tr.recharge-row td { background: #f0fdf4; }

.history-consumed-cell  { color: var(--pico-color-red-550,   #c0392b); font-weight: 600; }
.history-recharged-cell { color: var(--pico-color-green-550, #2d9a4e); font-weight: 600; }
