/* ============================================
   Sheriff — Design System & Components
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-online: #22c55e;
  --color-offline: #94a3b8;

  /* Sidebar */
  --sidebar-bg: #0f172a;
  --sidebar-bg-hover: #1e293b;
  --sidebar-width: 240px;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #f8fafc;

  /* Surfaces */
  --surface-bg: #f8fafc;
  --surface-card: #ffffff;
  --surface-border: #e2e8f0;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--surface-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { color: var(--text-secondary); }

img { max-width: 100%; }

/* --- App Shell --- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.5rem 1.25rem 1.25rem;
  color: var(--sidebar-text-active);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-brand svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.75rem;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-active);
}

.nav-link.active {
  background: var(--color-primary);
  color: #ffffff;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-link.active svg,
.nav-link:hover svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer .nav-link {
  color: var(--text-muted);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  min-height: 100vh;
  max-width: 1200px;
}

/* --- Page Header --- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.page-header h2 {
  margin: 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--surface-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-bg);
  border-color: #cbd5e1;
}

.btn-danger {
  background: var(--surface-card);
  color: var(--color-danger);
  border-color: var(--surface-border);
}

.btn-danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: var(--color-danger);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

.btn[aria-busy="true"] {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn[aria-busy="true"]::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-secondary[aria-busy="true"]::after,
.btn-danger[aria-busy="true"]::after {
  border-color: rgba(0, 0, 0, 0.15);
  border-top-color: var(--text-primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Forms --- */
.form-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  max-width: 420px;
}

.form-card h3 {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  margin-bottom: 1rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-group {
  margin-bottom: 1rem;
}

/* --- Cards --- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* --- Device Grid --- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.device-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-left: 3px solid var(--color-offline);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.device-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.device-card.online {
  border-left-color: var(--color-online);
}

.device-card header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.device-card header strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.device-card .screen-name {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.online {
  background-color: var(--color-online);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-dot.offline {
  background-color: var(--color-offline);
}

/* --- Tables --- */
.data-table-wrapper {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-bg);
  border-bottom: 1px solid var(--surface-border);
}

tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--surface-border);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--color-primary-light);
}

/* --- Modals (using <dialog>) --- */
dialog {
  border: none;
  padding: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  max-height: 90vh;
  overflow: visible;
  background: var(--surface-card);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--surface-bg);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--surface-border);
}

/* Pair modal */
#pair-modal {
  width: 440px;
}

/* Device popup */
#device-popup {
  width: 820px;
}

/* --- Tabs (horizontal pill style) --- */
.popup-tabs {
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--surface-border);
}

.popup-tabs ul {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
  overflow-x: auto;
}

.popup-tabs .tab-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 9999px;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
}

.popup-tabs .tab-link:hover {
  background: var(--surface-bg);
  color: var(--text-primary);
}

.popup-tabs .tab-link.active {
  background: var(--color-primary);
  color: #ffffff;
}

.tab-content {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 220px);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* --- Info sections (device info tabs) --- */
.info-section {
  margin-bottom: 1.5rem;
}

.info-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--surface-border);
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.info-table th {
  text-align: left;
  width: 40%;
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  background: none;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.8125rem;
}

.info-table td {
  padding: 0.4rem 0.75rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.8125rem;
}

.retrieve-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* --- Screenshot --- */
.screenshot-container {
  margin: 1.25rem 0;
}

.screenshot-container h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.screenshot-container img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
}

/* --- Storage Bars (RAM / Disks) --- */
.storage-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.storage-bar {
  height: 8px;
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: 99px;
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.disk-item {
  margin-bottom: 0.75rem;
}

.disk-item:last-child {
  margin-bottom: 0;
}

/* --- Sortable Tables --- */
.sortable-table-wrap {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
}

.sortable-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.sortable-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.sortable-table thead th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-bg);
  border-bottom: 1px solid var(--surface-border);
  user-select: none;
  white-space: nowrap;
}

.sortable-table thead th[data-sort]::after {
  content: '\2195';
  margin-left: 0.35rem;
  opacity: 0.3;
  font-size: 0.65rem;
}

.sortable-table thead th.sort-asc::after {
  content: '\2191';
  opacity: 0.8;
}

.sortable-table thead th.sort-desc::after {
  content: '\2193';
  opacity: 0.8;
}

.sortable-table tbody td {
  padding: 0.4rem 0.75rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.8125rem;
}

.sortable-table tbody tr:hover {
  background: var(--color-primary-light);
}

.sortable-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Task Tree (Scheduled Tasks) --- */
.task-tree {
  font-size: 0.8125rem;
}

.task-folder {
  margin-bottom: 2px;
}

.task-folder summary {
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem;
}

.task-folder .folder-icon {
  margin-right: 0.25rem;
}

.task-folder-content {
  padding-left: 1.25rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border-bottom: 1px solid var(--surface-border);
}

.task-item:last-child {
  border-bottom: none;
}

.task-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.task-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.task-status.status-ready {
  color: var(--color-success);
  background: #f0fdf4;
}

.task-status.status-running {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.task-status.status-disabled {
  color: var(--text-muted);
  background: var(--surface-bg);
}

.task-next {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 100px;
  text-align: right;
}

/* --- Windows Updates --- */
.updates-list {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  max-height: 280px;
  overflow-y: auto;
}

.update-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.8125rem;
}

.update-item:last-child {
  border-bottom: none;
}

.update-id {
  font-weight: 600;
  color: var(--color-primary);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.75rem;
  white-space: nowrap;
}

.update-desc {
  flex: 1;
  color: var(--text-secondary);
}

.update-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Monitor Cards --- */
.monitor-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.monitor-card.active {
  border-left: 3px solid var(--color-success);
}

.monitor-card.inactive {
  border-left: 3px solid var(--color-offline);
  opacity: 0.75;
}

.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.monitor-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.monitor-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.monitor-status-dot.online {
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.monitor-status-dot.offline {
  background: var(--color-offline);
}

.monitor-specs {
  margin-bottom: 0.75rem;
}

.monitor-resolutions summary {
  font-size: 0.8125rem;
}

.resolution-list {
  padding: 0.5rem 0;
}

.resolution-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.75rem;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.8125rem;
}

.resolution-row:last-child {
  border-bottom: none;
}

.res-dim {
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8125rem;
}

.res-rates {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 9999px;
  background: var(--surface-bg);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
}

.badge-success {
  color: var(--color-success);
  background: #f0fdf4;
  border-color: rgba(34, 197, 94, 0.2);
}

.badge-muted {
  color: var(--text-muted);
  background: var(--surface-bg);
}

/* --- Utility classes --- */
.text-muted {
  color: var(--text-muted);
}

.text-mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.75rem;
}

.text-truncate {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Screen Controls --- */
.screen-controls {
  margin-top: 1.25rem;
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
}

.screen-controls h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.screen-methods {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.screen-method {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.screen-method-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 48px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.screen-method-actions {
  display: flex;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.screen-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--surface-card);
  color: var(--text-secondary);
}

.screen-btn + .screen-btn {
  border-left: 1px solid var(--surface-border);
}

.screen-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.screen-btn:hover svg {
  opacity: 1;
}

.screen-btn-off:hover {
  background: #fef2f2;
  color: var(--color-danger);
}

.screen-btn-on:hover {
  background: #f0fdf4;
  color: var(--color-success);
}

.screen-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.screen-btn[aria-busy="true"] {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.screen-btn[aria-busy="true"] svg {
  visibility: hidden;
}

.screen-btn[aria-busy="true"]::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Login Page (standalone) --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.login-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.login-brand svg {
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
}

.login-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.login-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-card label {
  margin-bottom: 0.35rem;
}

.login-card .btn {
  margin-top: 0.5rem;
}

/* --- Error --- */
.error {
  color: var(--color-danger);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

/* --- Details/Summary --- */
details {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

details summary {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--surface-bg);
}

details summary:hover {
  color: var(--text-primary);
}

details[open] summary {
  border-bottom: 1px solid var(--surface-border);
}

/* --- Server URL display (admin) --- */
.server-url-display {
  margin-bottom: 1.25rem;
}

.url-value {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  word-break: break-all;
}

/* --- Utility --- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

[aria-busy="true"] {
  position: relative;
}

p[aria-busy="true"]::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--surface-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}
