/* Shared admin dashboard styling. Design tokens come from the shared theme
   file (light default, [data-theme="dark"] override) -- see
   public/shared/theme.css and splat-tour-viewer-authoring-DECISION-RECORD-v2.md §8. */
@import url('/shared/theme.css');
@import url('/shared/header.css');

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 24px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 20px; }
.page-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }

/* Cards & panels */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.section-title {
  margin: 0 0 14px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted-strong);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--radius);
  background: var(--surface-soft); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.btn-primary {
  color: var(--on-accent); border-color: transparent;
  background: var(--accent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, black); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 700; color: var(--text-muted-strong); text-transform: uppercase; letter-spacing: 0.03em; }
.field .help { font-size: 12px; color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; margin-top: -2px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius);
  background: var(--surface-soft); border: 1px solid var(--border); outline: none;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
/* Browsers render a <select>'s open dropdown list using native/OS styling by
   default, ignoring the element's own background -- option background-color
   and color are the two properties that actually get respected there. */
.select option { background-color: var(--surface); color: var(--text); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-softer); }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--border);
}
.badge-ready { color: var(--status-ok); border-color: color-mix(in srgb, var(--status-ok) 50%, var(--border)); }
.badge-processing { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.badge-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.badge-link { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 50%, var(--border)); }
.badge-private { color: var(--text-muted-strong); }
.badge-revoked { color: var(--danger); }
.badge-expired { color: var(--text-muted); }
.badge-active { color: var(--status-ok); }

/* Stat tiles (analytics summary) */
.stat-grid { display: grid; gap: 10px; }
.stat { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-softer); }
.stat-label { display: block; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.stat-value { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 15px; color: var(--text); }

/* Utilities */
.muted { color: var(--text-muted); }
.stack { display: grid; gap: 14px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.grow { flex: 1; }
.empty { padding: 32px; text-align: center; color: var(--text-muted); }
.hidden { display: none !important; }

/* Progress bar */
.progress { height: 8px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 120ms ease; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(10px);
  padding: 13px 20px 13px 16px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--border-strong); border-left: 4px solid var(--status-ok);
  box-shadow: var(--shadow); font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease; z-index: 100; max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-left-color: var(--danger); color: var(--danger); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(360px, 100%); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 20px;
  background: var(--scrim); backdrop-filter: blur(6px);
}
.modal-backdrop.show { display: grid; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 17px; }
