/*
  DiveOne Web Cabinet (instrument baseline)

  Goals:
  - Light, calm, "instrument panel" feel (match main site)
  - Minimal ornamentation; panels feel like "instrument clusters"
  - Status colors are indicators, not decoration

  Explicit bans (enforced by review discipline):
  - No UI libraries with their own themes
  - No "material" styles
  - No bright gradients / neon accents
*/

:root {
  color-scheme: light;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --border: #e5e7eb; /* gray-200 */

  --ink: #111827; /* gray-900 */
  --muted: #6b7280; /* gray-500 */
  --muted-2: #9ca3af; /* gray-400 */

  --accent: #0284c7; /* brand-600 */
  --accent-strong: #0369a1; /* brand-700 */

  --ok: #16a34a;
  --warn: #b45309;
  --danger: #b91c1c;

  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --mono: var(--font);
  --font: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px circle at 12% 0%, rgba(2, 132, 199, 0.10), transparent 55%),
    radial-gradient(800px circle at 92% 12%, rgba(2, 132, 199, 0.06), transparent 52%),
    var(--bg);
}

a {
  color: var(--accent-strong);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 10px;
}

.nav a:hover {
  color: var(--ink);
  border-color: rgba(17, 24, 39, 0.14);
}

.nav a.active {
  color: var(--accent-strong);
  border-color: rgba(2, 132, 199, 0.35);
  background: rgba(2, 132, 199, 0.08);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.pill {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  cursor: pointer;
}

.pill.active {
  background: rgba(2, 132, 199, 0.12);
  color: var(--ink);
}

.pill:hover {
  background: rgba(17, 24, 39, 0.04);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(2, 132, 199, 0.18);
  background: rgba(2, 132, 199, 0.08);
  color: var(--accent-strong);
}

.app {
  max-width: 1100px;
  margin: 22px auto 64px;
  padding: 0 18px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stack {
  display: grid;
  gap: 14px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.field {
  display: grid;
  gap: 6px;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  min-width: 220px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

textarea {
  min-height: 120px;
}

button {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

button.secondary {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--border);
}

button.secondary:hover {
  background: rgba(2, 132, 199, 0.06);
  border-color: rgba(2, 132, 199, 0.22);
}

button.danger {
  border-color: rgba(185, 28, 28, 0.4);
  background: rgba(185, 28, 28, 0.08);
  color: #7f1d1d;
}

button.danger:hover {
  border-color: rgba(185, 28, 28, 0.55);
  background: rgba(185, 28, 28, 0.12);
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.notice {
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  background: rgba(2, 132, 199, 0.06);
  border-radius: 10px;
}

.notice.warn {
  border-left-color: var(--warn);
}

.notice.error {
  border-left-color: var(--danger);
}

.notice-details summary {
  cursor: pointer;
  color: var(--muted);
}

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 50;
  width: min(420px, calc(100vw - 36px));
}

.toast {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.toast-title {
  font-weight: 600;
  margin-right: 18px;
}

.toast-message {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.toast-close {
  position: absolute;
  right: 8px;
  top: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 6px;
  line-height: 1;
  font-size: 18px;
  border-radius: 10px;
}

.toast-close:hover {
  border-color: rgba(2, 132, 199, 0.22);
  color: var(--accent-strong);
}

.skeleton {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.85);
  overflow: hidden;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  margin: 10px 0;
  background: linear-gradient(
    90deg,
    rgba(17, 24, 39, 0.10),
    rgba(17, 24, 39, 0.04),
    rgba(17, 24, 39, 0.10)
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.skeleton-line:first-child {
  width: 70%;
}

.skeleton-line:nth-child(2) {
  width: 94%;
}

.skeleton-line:nth-child(3) {
  width: 86%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.footer {
  border-top: 1px solid var(--border);
  padding: 14px 18px;
  color: var(--muted-2);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  input,
  textarea,
  select {
    min-width: 0;
    width: 100%;
  }
}
