/* Offbeat — main stylesheet */

:root,
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #1c1c20;
  --bg-deep: #141416;
  --bg-mid: #222228;
  --surface: #2a2a30;
  --surface-mid: #323238;
  --surface-2: #3c3c44;
  --surface-highlight: #4a4a54;
  --border: #52525c;
  --border-light: #6b6b78;
  --text: #f2f2f4;
  --text-strong: #ffffff;
  --label-text: #ececf0;
  --field-text: #ffffff;
  --field-bg: #1a1a20;
  --field-gradient-top: #26262e;
  --option-bg: #141418;
  --option-text: #ffffff;
  --muted: #b8b8c4;
  --accent: #b4bcc8;
  --accent-dim: #8a929e;
  --accent-shine: #d8dde4;
  --accent-active-end: #5c626c;
  --accent-active-end-alt: #5a606a;
  --onbeat: #22c55e;
  --offbeat: #ef4444;
  --warn: #f59e0b;
  --stat-alert: #f97316;
  --link: #7ec4ff;
  --link-hover: #b8dcff;
  --btn-primary-text: #1a1a1e;
  --overlay-hover: rgba(255, 255, 255, 0.06);
  --overlay-subtle: rgba(255, 255, 255, 0.04);
  --overlay-strong: rgba(255, 255, 255, 0.08);
  --panel-inset: rgba(0, 0, 0, 0.12);
  --panel-inset-soft: rgba(0, 0, 0, 0.18);
  --shadow-elevated: rgba(0, 0, 0, 0.35);
  --shadow-dropdown: rgba(0, 0, 0, 0.45);
  --shadow-deep: rgba(0, 0, 0, 0.6);
  --inset-line: rgba(255, 255, 255, 0.06);
  --inset-line-strong: rgba(255, 255, 255, 0.15);
  --inset-field: rgba(0, 0, 0, 0.2);
  --glow-top: rgba(180, 188, 200, 0.12);
  --header-bg-end: #242428;
  --modal-backdrop: rgba(8, 8, 12, 0.72);
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
  --metal-gradient: linear-gradient(
    145deg,
    var(--surface-mid) 0%,
    var(--surface) 45%,
    var(--bg-deep) 100%
  );
  --metal-gradient-subtle: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(0, 0, 0, 0.12) 100%
  );
  --metal-sheen: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 40%,
    rgba(0, 0, 0, 0.08) 100%
  );
  --body-bg:
    radial-gradient(ellipse 120% 80% at 50% -20%, var(--glow-top), transparent 55%),
    linear-gradient(165deg, var(--bg-deep) 0%, var(--bg) 35%, var(--bg-mid) 70%, var(--bg-deep) 100%);
  --header-bg:
    var(--metal-gradient-subtle),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 55%, var(--header-bg-end) 100%);
  --footer-bg:
    var(--metal-gradient-subtle),
    linear-gradient(0deg, var(--bg-deep) 0%, var(--surface) 100%);
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f3f3f6;
  --bg-deep: #e6e6ec;
  --bg-mid: #fafafc;
  --surface: #ffffff;
  --surface-mid: #f8f8fb;
  --surface-2: #f0f0f5;
  --surface-highlight: #e4e4eb;
  --border: #d2d2dc;
  --border-light: #bcbcc8;
  --text: #1a1a22;
  --text-strong: #0f0f14;
  --label-text: #2a2a34;
  --field-text: #1a1a22;
  --field-bg: #ffffff;
  --field-gradient-top: #ffffff;
  --option-bg: #ffffff;
  --option-text: #1a1a22;
  --muted: #5c5c6a;
  --accent: #6b7280;
  --accent-dim: #9ca3af;
  --accent-shine: #ffffff;
  --accent-active-end: #d1d5db;
  --accent-active-end-alt: #cbd5e1;
  --onbeat: #16a34a;
  --offbeat: #dc2626;
  --warn: #d97706;
  --stat-alert: #f97316;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --btn-primary-text: #ffffff;
  --overlay-hover: rgba(0, 0, 0, 0.05);
  --overlay-subtle: rgba(0, 0, 0, 0.03);
  --overlay-strong: rgba(255, 255, 255, 0.65);
  --panel-inset: rgba(0, 0, 0, 0.04);
  --panel-inset-soft: rgba(0, 0, 0, 0.06);
  --shadow-elevated: rgba(0, 0, 0, 0.08);
  --shadow-dropdown: rgba(0, 0, 0, 0.12);
  --shadow-deep: rgba(0, 0, 0, 0.16);
  --inset-line: rgba(255, 255, 255, 0.75);
  --inset-line-strong: rgba(255, 255, 255, 0.9);
  --inset-field: rgba(0, 0, 0, 0.06);
  --glow-top: rgba(255, 255, 255, 0.95);
  --header-bg-end: #ececf2;
  --modal-backdrop: rgba(15, 15, 20, 0.35);
  --metal-gradient: linear-gradient(
    145deg,
    #ffffff 0%,
    var(--surface-mid) 45%,
    var(--bg-deep) 100%
  );
  --metal-gradient-subtle: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0) 42%,
    rgba(0, 0, 0, 0.04) 100%
  );
  --metal-sheen: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.55) 40%,
    rgba(0, 0, 0, 0.03) 100%
  );
  --body-bg:
    radial-gradient(ellipse 120% 80% at 50% -20%, var(--glow-top), transparent 55%),
    linear-gradient(165deg, var(--bg-deep) 0%, var(--bg) 35%, var(--bg-mid) 70%, #ffffff 100%);
  --header-bg:
    var(--metal-gradient-subtle),
    linear-gradient(180deg, #ffffff 0%, var(--surface) 55%, var(--header-bg-end) 100%);
  --footer-bg:
    var(--metal-gradient-subtle),
    linear-gradient(0deg, var(--bg-deep) 0%, var(--surface) 100%);
}

[data-theme="gold"] {
  color-scheme: light;

  --bg: #faf6ee;
  --bg-deep: #f3ead8;
  --bg-mid: #fffdf8;
  --surface: #fffdf8;
  --surface-mid: #faf3e4;
  --surface-2: #f5e9d0;
  --surface-highlight: #edd9b8;
  --border: #dcc9a3;
  --border-light: #c9b48a;
  --text: #3d2e1a;
  --text-strong: #2a1f12;
  --label-text: #4a3820;
  --field-text: #3d2e1a;
  --field-bg: #fffdf8;
  --field-gradient-top: #fffef9;
  --option-bg: #fffdf8;
  --option-text: #3d2e1a;
  --muted: #7a6a52;
  --accent: #c9a227;
  --accent-dim: #b8860b;
  --accent-shine: #e8c547;
  --accent-active-end: #d4b84a;
  --accent-active-end-alt: #c9a227;
  --onbeat: #15803d;
  --offbeat: #b91c1c;
  --warn: #b45309;
  --stat-alert: #f97316;
  --link: #9a7209;
  --link-hover: #7a5a07;
  --btn-primary-text: #2a1f12;
  --overlay-hover: rgba(42, 31, 18, 0.06);
  --overlay-subtle: rgba(42, 31, 18, 0.04);
  --overlay-strong: rgba(255, 253, 248, 0.75);
  --panel-inset: rgba(42, 31, 18, 0.05);
  --panel-inset-soft: rgba(42, 31, 18, 0.07);
  --shadow-elevated: rgba(42, 31, 18, 0.1);
  --shadow-dropdown: rgba(42, 31, 18, 0.14);
  --shadow-deep: rgba(42, 31, 18, 0.2);
  --inset-line: rgba(255, 255, 255, 0.65);
  --inset-line-strong: rgba(255, 255, 255, 0.85);
  --inset-field: rgba(42, 31, 18, 0.06);
  --glow-top: rgba(232, 197, 71, 0.35);
  --header-bg-end: #f0e4cc;
  --modal-backdrop: rgba(42, 31, 18, 0.4);
  --metal-gradient: linear-gradient(
    145deg,
    #fffdf8 0%,
    var(--surface-mid) 45%,
    var(--bg-deep) 100%
  );
  --metal-gradient-subtle: linear-gradient(
    180deg,
    rgba(255, 253, 248, 0.95) 0%,
    rgba(255, 253, 248, 0) 42%,
    rgba(42, 31, 18, 0.04) 100%
  );
  --metal-sheen: linear-gradient(
    135deg,
    rgba(255, 253, 248, 0.95) 0%,
    rgba(232, 197, 71, 0.15) 40%,
    rgba(42, 31, 18, 0.04) 100%
  );
  --body-bg:
    radial-gradient(ellipse 120% 80% at 50% -20%, var(--glow-top), transparent 55%),
    linear-gradient(165deg, var(--bg-deep) 0%, var(--bg) 35%, var(--bg-mid) 70%, #fffdf8 100%);
  --header-bg:
    var(--metal-gradient-subtle),
    linear-gradient(180deg, #fffdf8 0%, var(--surface) 55%, var(--header-bg-end) 100%);
  --footer-bg:
    var(--metal-gradient-subtle),
    linear-gradient(0deg, var(--bg-deep) 0%, var(--surface) 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  background: var(--body-bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
}

.container {
  width: min(1200px, 100% - 2rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  box-shadow:
    0 1px 0 var(--inset-line),
    0 4px 20px var(--shadow-elevated);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
  position: relative;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    var(--metal-gradient-subtle),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--accent-dim);
  outline: none;
  box-shadow: 0 0 0 2px var(--overlay-strong);
}

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 1.15rem;
  height: 1rem;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: min(220px, 45vw);
  object-fit: contain;
  transition: opacity 0.15s ease;
}

.brand:hover .brand-logo,
.brand:focus-visible .brand-logo {
  opacity: 0.8;
}

.brand-mark {
  color: var(--onbeat);
  font-size: 1.25rem;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-dropdown-trigger::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.nav-dropdown.is-open .nav-dropdown-trigger::after {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 10.5rem;
  margin: 0;
  padding: 0.45rem 0.35rem 0.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--shadow-dropdown);
  z-index: 120;
}

.nav-dropdown.is-open .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: calc(var(--radius) - 2px);
  white-space: nowrap;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible,
.nav-dropdown-menu a.active {
  background: var(--overlay-hover);
  color: var(--text-strong);
}

.nav-dropdown-menu-locations {
  min-width: 11.5rem;
}

.nav-dropdown-submenu {
  position: relative;
}

.nav-dropdown-submenu-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.925rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.nav-dropdown-submenu-trigger::after {
  content: '';
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.nav-dropdown-submenu.is-open > .nav-dropdown-submenu-trigger,
.nav-dropdown-submenu-trigger:hover,
.nav-dropdown-submenu-trigger:focus-visible {
  background: var(--overlay-hover);
  color: var(--text-strong);
}

.nav-dropdown-submenu-menu {
  display: none;
  min-width: 14rem;
  max-width: 18rem;
  max-height: min(70vh, 28rem);
  margin: 0;
  padding: 0.35rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--shadow-dropdown);
}

.nav-dropdown-submenu-menu a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  text-decoration: none;
  white-space: normal;
  line-height: 1.35;
}

.nav-dropdown-submenu-menu a:hover,
.nav-dropdown-submenu-menu a:focus-visible,
.nav-dropdown-submenu-menu a.active {
  background: var(--overlay-hover);
  color: var(--text-strong);
}

@media (min-width: 768px) {
  .main-nav,
  .nav-dropdown-locations,
  .nav-dropdown-locations .nav-dropdown-menu,
  .nav-dropdown-locations .nav-dropdown-menu-locations,
  .nav-dropdown-locations .nav-dropdown-submenu {
    overflow: visible;
  }

  .nav-dropdown-menu-locations {
    max-height: min(70vh, 32rem);
    overflow-y: auto;
  }

  .nav-dropdown-submenu-trigger::after {
    border-left: none;
    border-right: 5px solid currentColor;
  }

  .nav-dropdown-submenu.is-open > .nav-dropdown-submenu-menu.is-flyout {
    display: block;
  }

  .nav-dropdown-submenu-menu.is-flyout {
    position: fixed;
    z-index: 10001;
    display: block;
    box-shadow: 0 14px 36px var(--shadow-deep);
  }

  .nav-dropdown-submenu.is-open > .nav-dropdown-submenu-trigger::after,
  .nav-dropdown-submenu:hover > .nav-dropdown-submenu-trigger::after,
  .nav-dropdown-submenu:focus-within > .nav-dropdown-submenu-trigger::after {
    transform: none;
  }
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.925rem;
  transition: background 0.15s, color 0.15s;
}

.main-nav a:hover {
  color: var(--text);
  background: linear-gradient(180deg, var(--surface-highlight) 0%, var(--surface-2) 100%);
}

.main-nav a.active {
  color: var(--text);
  background: linear-gradient(180deg, var(--accent-dim) 0%, var(--accent-active-end) 100%);
  box-shadow: inset 0 1px 0 var(--inset-line-strong);
}

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin: 0;
    padding: 0.65rem;
    background:
      var(--metal-gradient-subtle),
      linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 28px var(--shadow-dropdown);
  }

  .site-header.is-nav-open .main-nav {
    display: flex;
  }

  .nav-dropdown {
    width: 100%;
  }

  .main-nav > a {
    display: block;
    width: 100%;
  }

  .nav-dropdown-trigger {
    display: flex;
    width: 100%;
  }

  .nav-dropdown-trigger::after {
    margin-left: auto;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    margin: 0.15rem 0 0;
    padding: 0.15rem 0 0.15rem 0.75rem;
    background: transparent;
    border: none;
    border-left: 2px solid var(--border);
    border-radius: 0;
    box-shadow: none;
  }

  .nav-dropdown:not(.is-open) .nav-dropdown-menu {
    display: none;
  }

  .nav-dropdown.is-open .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-submenu-trigger {
    width: 100%;
  }

  .nav-dropdown-submenu-trigger::after {
    margin-left: auto;
    transform: rotate(0deg);
  }

  .nav-dropdown-submenu.is-open > .nav-dropdown-submenu-trigger::after {
    transform: rotate(90deg);
  }

  .nav-dropdown-submenu-menu {
    position: static;
    left: auto;
    right: auto;
    min-width: 0;
    max-width: none;
    max-height: none;
    margin: 0.15rem 0 0.15rem 0.75rem;
    padding: 0.15rem 0 0.15rem 0.75rem;
    overflow: visible;
    background: transparent;
    border: none;
    border-left: 2px solid var(--border);
    border-radius: 0;
    box-shadow: none;
  }

  .nav-dropdown-menu-locations {
    max-height: min(70vh, 32rem);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .nav-dropdown-submenu:not(.is-open) .nav-dropdown-submenu-menu {
    display: none;
  }

  .nav-dropdown-submenu.is-open > .nav-dropdown-submenu-menu {
    display: block;
  }

  body.is-nav-open {
    overflow: hidden;
  }
}

/* Main */
.site-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.hero {
  margin-bottom: 2rem;
}

.hero-compact {
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 65ch;
  font-size: 1.05rem;
}

.lead strong {
  color: var(--text);
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background:
    var(--metal-gradient-subtle),
    var(--metal-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow:
    inset 0 1px 0 var(--inset-line),
    0 2px 8px var(--shadow-elevated);
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-onbeat .stat-value { color: var(--onbeat); }
.stat-offbeat .stat-value { color: var(--offbeat); }

.stat-alert .stat-value { color: var(--stat-alert); }

.stat-card-link {
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.stat-card-link:hover,
.stat-card-link:focus-visible {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 var(--inset-line),
    0 4px 12px var(--shadow-elevated);
}

.location-detail-link {
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.location-detail-link:hover,
.location-detail-link:focus-visible {
  color: var(--link-hover);
  text-decoration: underline;
}

.location-dashboard-nav {
  margin-bottom: 0.75rem;
}

.location-dashboard-nav a {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
}

.location-dashboard-nav a:hover,
.location-dashboard-nav a:focus-visible {
  color: var(--link-hover);
  text-decoration: underline;
}

.location-dashboard-hero .muted {
  margin-top: 0.35rem;
}

.location-trends-panel {
  margin-bottom: 1.5rem;
}

.location-trends-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.location-trends-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.location-trends-control input[type="checkbox"] {
  margin: 0;
}

.location-trends-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.location-trends-swatch-onbeat {
  background: var(--onbeat);
}

.location-trends-swatch-offbeat {
  background: var(--offbeat);
}

.location-trends-swatch-warning {
  background: var(--warn);
}

.location-trends-swatch-alert {
  background: var(--stat-alert);
}

.location-trends-chart-wrap {
  width: 100%;
  height: 320px;
  position: relative;
}

.location-trends-hint {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.stat-warning .stat-value { color: var(--warn); }

/* Panels */
.panel {
  background:
    var(--metal-gradient-subtle),
    var(--metal-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow:
    inset 0 1px 0 var(--inset-line),
    0 2px 10px var(--shadow-elevated);
}

.panel-flush {
  padding: 0;
  overflow: hidden;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.field-list {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 2rem;
}

@media (max-width: 600px) {
  .field-list { columns: 1; }
}

/* Badges & alerts */
.badge {
  display: inline-block;
  padding: 0.35rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--onbeat);
}

.badge-muted {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  color: var(--muted);
}

.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--offbeat);
}

.badge-warn {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.badge-warn-inline,
.badge-error-inline {
  font-size: 0.85em;
  padding: 0.15em 0.5em;
  border-radius: 999px;
}

.badge-warn-inline {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.badge-error-inline {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.alert-warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.alert-ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert code,
.panel code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.muted {
  color: var(--muted);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  position: sticky;
  top: 0;
}

.data-table tbody tr:hover {
  background: var(--overlay-subtle);
}

.data-table tbody tr.row-alert-warning {
  background: rgba(245, 158, 11, 0.08);
}

.data-table tbody tr.row-alert-critical {
  background: rgba(239, 68, 68, 0.1);
}

.data-table tbody tr.row-hidden-csv-drift {
  background: rgba(139, 92, 246, 0.1);
}

.data-table tbody tr.row-alert-critical:hover,
.data-table tbody tr.row-alert-warning:hover,
.data-table tbody tr.row-hidden-csv-drift:hover {
  background: var(--overlay-hover);
}

.data-table code {
  font-family: var(--mono);
  font-size: 0.85em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  background: var(--footer-bg);
  box-shadow: inset 0 1px 0 var(--overlay-subtle);
}

.site-footer-inner {
  display: block;
}

.site-footer-menu {
  margin-bottom: 1rem;
}

.site-footer-menu-list {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.site-footer-menu-list li {
  display: inline-flex;
  align-items: center;
}

.site-footer-menu-list li + li::before {
  content: '|';
  margin: 0 0.65rem;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}

.site-footer-menu a {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer-menu a:hover,
.site-footer-menu a.active {
  color: var(--text);
}

.site-footer-copy p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.profile-hero {
  position: relative;
  padding-right: 15rem;
}

.profile-theme-picker {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  margin: 0;
  padding: 0.85rem 1rem;
  width: 13.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    var(--metal-gradient-subtle),
    var(--metal-gradient);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
  .profile-hero {
    padding-right: 0;
  }

  .profile-theme-picker {
    position: static;
    width: auto;
    max-width: 16rem;
    margin: 0 0 1rem;
  }
}

.profile-theme-picker legend {
  padding: 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--label-text);
}

.profile-theme-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.profile-theme-option input {
  margin: 0;
  accent-color: var(--accent);
}

.profile-theme-hint {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.site-footer p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Forms */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 520px;
}

.upload-form-daily {
  max-width: 920px;
}

.upload-slots {
  display: grid;
  gap: 1rem;
}

.upload-slots-single {
  grid-template-columns: 1fr;
}

.withdraw-upload-split {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.withdraw-upload-pane {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-inset);
  min-width: 0;
}

.withdraw-upload-pane > h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.withdraw-upload-pane > .muted {
  margin-top: 0;
}

.withdraw-upload-pane .upload-form {
  max-width: none;
}

.withdraw-upload-pane .upload-slot {
  background: var(--panel);
}

.withdraw-single-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.withdraw-single-form input[type="text"] {
  background-color: var(--field-bg);
  background-image: linear-gradient(180deg, var(--field-gradient-top) 0%, var(--field-bg) 100%);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--field-text);
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

.withdraw-single-form input[type="text"]:focus {
  outline: 2px solid var(--accent-shine);
  outline-offset: 2px;
  border-color: var(--accent-shine);
}

@media (min-width: 900px) {
  .withdraw-upload-split {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (min-width: 760px) {
  .upload-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .upload-slots-single {
    grid-template-columns: 1fr;
  }
}

.upload-slot {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-inset);
}

.upload-slot-required {
  border-color: var(--accent-dim);
}

.upload-slot-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.upload-slot-heading h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-strong);
}

.upload-slot-help {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.upload-slot .form-row {
  margin: 0;
}

.upload-dropzone {
  display: block;
  position: relative;
  margin: 0;
  cursor: pointer;
}

.upload-dropzone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-dropzone-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 11rem;
  padding: 1.25rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background:
    var(--metal-sheen),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.08) 100%);
  text-align: center;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.upload-dropzone:hover .upload-dropzone-body,
.upload-dropzone:focus-within .upload-dropzone-body {
  border-color: var(--accent-dim);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.upload-dropzone.is-dragover .upload-dropzone-body {
  border-color: var(--link);
  background-color: rgba(126, 196, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(126, 196, 255, 0.2);
}

.upload-dropzone.has-file .upload-dropzone-body {
  border-style: solid;
  border-color: var(--onbeat);
  background-color: rgba(34, 197, 94, 0.08);
}

.upload-dropzone-icon {
  display: flex;
  color: var(--accent-dim);
  transition: color 0.15s ease, transform 0.15s ease;
}

.upload-dropzone.is-dragover .upload-dropzone-icon {
  color: var(--link);
  transform: translateY(-2px);
}

.upload-dropzone.has-file .upload-dropzone-icon {
  color: var(--onbeat);
}

.upload-dropzone-prompt {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}

.upload-dropzone-or {
  font-size: 0.82rem;
  color: var(--muted);
}

.upload-dropzone-filename {
  display: none;
  max-width: 100%;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--onbeat);
  word-break: break-word;
}

.upload-dropzone.has-file .upload-dropzone-prompt {
  display: none;
}

.upload-dropzone.has-file .upload-dropzone-filename {
  display: block;
}

.upload-slot-required .upload-dropzone-body {
  border-color: rgba(138, 146, 158, 0.55);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--label-text);
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="date"],
.form-row input[type="url"],
.form-row input[type="file"],
.form-row select,
.auth-form .form-field input[type="text"],
.auth-form .form-field input[type="email"],
.auth-form .form-field input[type="password"] {
  background-color: var(--field-bg);
  background-image: linear-gradient(180deg, var(--field-gradient-top) 0%, var(--field-bg) 100%);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--field-text);
  padding: 0.55rem 0.75rem;
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.form-row select {
  color-scheme: dark;
  cursor: pointer;
}

.form-row select option,
.form-row select optgroup {
  background-color: var(--option-bg);
  color: var(--option-text);
}

.form-row input:focus,
.form-row select:focus,
.auth-form .form-field input:focus {
  outline: 2px solid var(--accent-shine);
  outline-offset: 2px;
  border-color: var(--accent-shine);
}

.form-divider {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.form-actions {
  padding-top: 0.25rem;
}

.btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
}

.btn.is-processing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: wait;
  opacity: 0.85;
  pointer-events: none;
}

.btn-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: var(--btn-primary-text);
  box-shadow:
    inset 0 1px 0 var(--inset-line-strong),
    0 1px 3px var(--shadow-elevated);
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--accent-shine) 0%, var(--accent) 100%);
}

.csv-help {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-grid-compact {
  margin-bottom: 1.5rem;
}

.panel-heading-padded {
  padding: 1.25rem 1.5rem 0;
  margin: 0;
}

.admin-toolbar {
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.admin-form-panel {
  margin-bottom: 1.5rem;
}

.admin-form-panel h2 {
  margin-top: 0;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 640px;
}

.user-add-modal .asset-modal-dialog {
  width: min(640px, 100%);
}

.user-bulk-modal .asset-modal-dialog {
  width: min(640px, 100%);
}

.user-bulk-modal .admin-form {
  max-width: none;
}

.user-bulk-help {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.user-bulk-template-link {
  margin: 0 0 1rem;
}

.user-bulk-results {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.user-bulk-summary {
  margin: 0 0 0.5rem;
}

.user-bulk-error-list {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  color: var(--muted);
  max-height: 12rem;
  overflow: auto;
}

.user-bulk-error-list li {
  margin-bottom: 0.25rem;
}

.admin-modal .asset-modal-dialog {
  width: min(640px, 100%);
}

.admin-modal .asset-modal-body {
  padding: 1rem 1.25rem 1.25rem;
}

.user-add-modal .admin-form,
.admin-modal .admin-form,
.admin-modal-form {
  max-width: none;
  gap: 0.65rem;
}

.admin-modal .admin-form-actions {
  margin-top: 0.25rem;
}

.user-add-modal .form-row-inline .form-row,
.admin-modal .form-row-inline .form-row {
  flex: 1 1 70px;
}

.admin-modal .form-row-inline {
  gap: 0.75rem;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.form-row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-row-inline .form-row {
  flex: 1 1 140px;
}

.admin-actions-cell {
  white-space: nowrap;
}

.admin-actions-cell .link-button + .link-button {
  margin-left: 0.65rem;
}

.data-table tbody tr.row-archived {
  opacity: 0.72;
}

.btn-muted {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
}

.btn-muted:hover {
  color: var(--text);
  background: var(--overlay-subtle);
}

/* Filter tabs */
.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.filter-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  background:
    var(--metal-gradient-subtle),
    linear-gradient(180deg, var(--surface-mid) 0%, var(--surface) 100%);
}

.filter-nav a:hover {
  color: var(--text);
  border-color: var(--border-light);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}

.filter-nav a.active {
  color: var(--text);
  background: linear-gradient(180deg, var(--accent-dim) 0%, var(--accent-active-end-alt) 100%);
  border-color: var(--accent-dim);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.filter-nav-count {
  margin-left: auto;
  align-self: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.35rem 0.25rem;
}

/* Assets / locations filter bar */
.assets-list-filters {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.assets-search-form {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.assets-search-form .form-row--search {
  width: min(100%, 26rem);
  margin: 0;
}

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

.assets-search-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.assets-search-controls input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  background-color: var(--field-bg);
  background-image: linear-gradient(180deg, var(--field-gradient-top) 0%, var(--field-bg) 100%);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--field-text);
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

.assets-search-controls input[type="search"]:focus {
  outline: 2px solid var(--accent-shine);
  outline-offset: 2px;
  border-color: var(--accent-shine);
}

.assets-search-controls .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.assets-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 0;
  padding: 0.85rem 1rem;
  background:
    var(--metal-gradient-subtle),
    var(--metal-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.assets-filter-form .form-row {
  min-width: 160px;
  flex: 1 1 160px;
}

.assets-filter-form .form-row label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--label-text);
}

.assets-filter-form select {
  background-color: var(--field-bg);
  background-image: linear-gradient(180deg, var(--field-gradient-top) 0%, var(--field-bg) 100%);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--field-text);
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  max-width: 360px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
  color-scheme: dark;
  cursor: pointer;
}

.assets-filter-form select option,
.assets-filter-form select optgroup {
  background-color: var(--option-bg);
  color: var(--option-text);
  font-weight: 500;
}

.assets-filter-form select:focus {
  outline: 2px solid var(--accent-shine);
  outline-offset: 2px;
  border-color: var(--accent-shine);
}

.assets-filter-form select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (min-width: 992px) {
  .assets-filter-form {
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
  }

  .assets-filter-form .form-row {
    min-width: 0;
    flex: 1 1 0;
  }

  .assets-filter-form .form-row--location {
    flex: 1.4 1 0;
  }

  .assets-filter-form select {
    max-width: none;
    padding: 0.45rem 0.55rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--field-text);
  }

  .assets-filter-form .form-row label {
    font-size: 0.8125rem;
    color: var(--label-text);
  }
}

.assets-toolbar {
  margin-bottom: 1rem;
  min-height: 2.5rem;
}

.assets-select-all-banner,
.assets-select-all-active {
  margin: 0.75rem 0 0;
}

.link-button {
  appearance: none;
  background: none;
  border: 0;
  color: var(--link);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.link-button:hover {
  color: var(--link-hover);
}

.sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sort-link:hover {
  color: var(--accent-shine);
}

.sort-ind {
  font-size: 0.75rem;
  color: var(--accent);
}

.sort-ind-muted {
  color: var(--muted);
  opacity: 0.5;
}

.col-check {
  width: 2.5rem;
  text-align: center;
}

.col-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--accent-dim);
}

.data-table tbody tr.row-type-header td {
  background:
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.85rem;
}

.data-table tbody tr.row-type-header:hover {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.9rem 1.25rem 1.15rem;
  border-top: 1px solid var(--border);
}

.pagination-summary {
  margin: 0;
  font-size: 0.875rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pagination a,
.pagination-current,
.pagination-disabled,
.pagination-ellipsis {
  min-width: 2.25rem;
  text-align: center;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.pagination a {
  color: var(--field-text);
  border: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--field-gradient-top) 0%, var(--field-bg) 100%);
}

.pagination a:hover {
  border-color: var(--accent-shine);
  color: var(--text-strong);
}

.pagination-current {
  color: var(--text-strong);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: var(--btn-primary-text);
  border: 1px solid var(--accent);
}

.pagination-disabled {
  color: var(--muted);
  border: 1px solid var(--border);
  opacity: 0.55;
}

.pagination-ellipsis {
  color: var(--muted);
  min-width: auto;
  padding-inline: 0.35rem;
}

/* Asset detail links & modal */
.asset-detail-link {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(126, 196, 255, 0.45);
  text-underline-offset: 2px;
  font-weight: 500;
}

.asset-detail-link:hover,
.asset-detail-link:focus-visible {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

.asset-detail-link code {
  color: inherit;
  background: transparent;
  padding: 0;
}

body.asset-modal-open {
  overflow: hidden;
}

.asset-modal {
  display: none;
}

.asset-modal[hidden] {
  display: none !important;
}

.asset-modal.is-open {
  display: flex !important;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10000;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.asset-modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(4px);
}

.asset-modal-dialog {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: min(920px, 100%);
  max-height: calc(100vh - 3rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--metal-gradient);
  box-shadow: 0 24px 64px var(--shadow-dropdown);
}

.asset-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--metal-sheen);
}

.asset-modal-heading h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-strong);
}

.asset-modal-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.asset-modal-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text-strong);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.asset-modal-close:hover {
  border-color: var(--accent-shine);
}

.asset-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.asset-detail-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-inset-soft);
}

.asset-detail-hero-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.asset-detail-section {
  margin-bottom: 1.5rem;
}

.asset-detail-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text-strong);
}

.asset-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem 1rem;
  margin: 0;
}

.asset-detail-grid div {
  margin: 0;
}

.asset-detail-grid dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.asset-detail-grid dd {
  margin: 0.15rem 0 0;
  color: var(--text-strong);
  word-break: break-word;
}

.asset-detail-status-row {
  margin: 0;
}

.asset-detail-status-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.asset-status-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--accent-shine);
  cursor: pointer;
}

.asset-status-edit-btn:hover,
.asset-status-edit-btn:focus-visible {
  background: var(--overlay-strong);
  color: var(--text-strong);
}

.asset-status-edit-icon {
  display: block;
}

.asset-status-locked {
  font-size: 0.72rem;
}

.asset-update-fields {
  display: grid;
  gap: 0.55rem;
}

.asset-update-fields label {
  font-size: 0.8rem;
  color: var(--muted);
}

.asset-update-actions,
.asset-ticket-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.asset-status-editor {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.55rem;
}

.asset-status-editor label {
  font-size: 0.8rem;
  color: var(--muted);
}

.asset-status-required {
  color: var(--offbeat);
}

.asset-status-note-wrap {
  display: grid;
  gap: 0.55rem;
}

.asset-status-select,
.asset-status-note {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--text-strong);
  font: inherit;
}

.asset-status-note {
  resize: vertical;
  min-height: 4.5rem;
}

.asset-status-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.asset-status-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.asset-status-note {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-inset);
}

.asset-status-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.asset-status-note-meta time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.asset-status-note-arrow {
  color: var(--muted);
}

.asset-status-note-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.asset-note-add {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.55rem;
}

.asset-note-add label {
  font-size: 0.8rem;
  color: var(--muted);
}

.asset-general-note {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--text-strong);
  font: inherit;
  resize: vertical;
  min-height: 4.5rem;
}

.asset-note-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.asset-ticket-link-add {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.55rem;
}

.asset-ticket-link-add label {
  font-size: 0.8rem;
  color: var(--muted);
}

.asset-ticket-link-input {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--text-strong);
  font: inherit;
}

.asset-ticket-link-body a {
  color: var(--link);
  word-break: break-all;
}

.asset-notes-empty {
  margin: 0 0 0.5rem;
}

.asset-status-save-notice {
  margin-bottom: 1rem;
}

.asset-withdrawn-records-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.asset-withdrawn-record {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-inset);
}

.asset-withdrawn-record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.asset-withdrawn-record-meta time {
  font-size: 0.82rem;
  color: var(--muted);
}

.asset-detail-grid-compact {
  gap: 0.35rem 1rem;
}

.asset-geo-place {
  font-size: 1.05rem;
  color: var(--text-strong);
  margin: 0.5rem 0 0.75rem;
}

.asset-geo-map {
  margin-top: 0.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--field-bg);
}

.asset-geo-map iframe {
  display: block;
  width: 100%;
  height: 280px;
  border: 0;
}

.asset-geo-credit {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}

.asset-history-wrap {
  max-height: 280px;
  overflow: auto;
}

.data-table-compact th,
.data-table-compact td {
  padding: 0.45rem 0.55rem;
  font-size: 0.875rem;
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
}

.auth-page-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: 100vh;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.auth-brand {
  display: block;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-brand-logo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: min(280px, 100%);
  height: auto;
  width: auto;
  transition: opacity 0.15s ease;
}

.auth-brand:hover .auth-brand-logo,
.auth-brand:focus-visible .auth-brand-logo {
  opacity: 0.8;
}

.auth-card-title {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-form .form-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--label-text);
}

.auth-form .form-field input[type="email"],
.auth-form .form-field input[type="password"],
.auth-form .form-field input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.auth-step-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.auth-password-hint {
  margin: -0.5rem 0 0.75rem;
  font-size: 0.8rem;
}

.auth-form-footer {
  margin-top: 1rem;
  font-size: 0.875rem;
  text-align: center;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.password-field-wrap {
  position: relative;
}

.password-field-wrap .password-field-input {
  padding-right: 2.75rem;
}

/* Hide browser built-in password reveal (Edge/IE) — conflicts with our eyeball toggle */
.password-field-input::-ms-reveal,
.password-field-input::-ms-clear {
  display: none;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  bottom: 0.55rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover,
.password-toggle:focus {
  color: var(--text);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.password-toggle-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.password-toggle-icon-hide {
  display: none;
}

.password-toggle.is-password-visible .password-toggle-icon-show {
  display: none;
}

.password-toggle.is-password-visible .password-toggle-icon-hide {
  display: block;
}

.nav-logout {
  margin-left: 0.5rem;
  font-size: 0.9rem;
}

.nav-dropdown-divider {
  margin: 0.35rem 0;
  border-top: 1px solid var(--border);
}

.nav-dropdown-menu .nav-logout-link {
  color: var(--muted);
}

.profile-panel {
  max-width: 640px;
}

.profile-password-form {
  max-width: 420px;
}

.profile-details {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.profile-detail-row {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) 1fr;
  gap: 0.35rem 1rem;
}

.profile-detail-row dd {
  margin: 0;
}

.profile-detail-label {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

.profile-location-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.location-checklist-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0;
}

.location-checklist-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.location-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.35rem 1rem;
  max-height: 280px;
  overflow: auto;
}

.location-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.asset-detail-print-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.asset-print-root {
  display: none;
}

@media print {
  @page {
    margin: 0.6in;
  }

  body.is-printing-asset-detail {
    background: #fff !important;
    color: #111 !important;
  }

  body.is-printing-asset-detail > *:not(#asset-print-root) {
    display: none !important;
  }

  body.is-printing-asset-detail #asset-print-root {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
  }

  body.is-printing-asset-detail .asset-print-header {
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ccc;
  }

  body.is-printing-asset-detail .asset-print-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    color: #111 !important;
  }

  body.is-printing-asset-detail .asset-print-subtitle {
    margin: 0;
    color: #333 !important;
    font-size: 0.95rem;
  }

  body.is-printing-asset-detail .asset-print-section {
    margin: 0 0 1rem;
  }

  body.is-printing-asset-detail .asset-print-section h2 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: #111 !important;
  }

  body.is-printing-asset-detail .asset-print-section h3 {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.95rem;
    color: #111 !important;
  }

  body.is-printing-asset-detail .asset-print-section p {
    margin: 0 0 0.5rem;
    color: #111 !important;
  }

  body.is-printing-asset-detail .asset-print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: #111 !important;
  }

  body.is-printing-asset-detail .asset-print-table th,
  body.is-printing-asset-detail .asset-print-table td {
    border: 1px solid #ccc;
    padding: 0.28rem 0.4rem;
    vertical-align: top;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    color: #111 !important;
    background: #fff !important;
  }

  body.is-printing-asset-detail .asset-print-table th[scope="row"] {
    width: 32%;
    font-weight: 600;
    background: #f5f5f5 !important;
  }

  body.is-printing-asset-detail .asset-print-table thead th {
    background: #eee !important;
    font-weight: 600;
  }

  body.is-printing-asset-detail a {
    color: #111 !important;
    text-decoration: none !important;
  }
}

