:root {
  --bg: #0a1929;
  --bg-elevated: #102a43;
  --bg-nav: #0e2740;
  --border: #1e3a5f;
  --text: #e3f2fd;
  --text-muted: #90caf9;
  --heading: #bbdefb;
  --accent: #2196f3;
  --accent-hover: #64b5f6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header / nav */
.site-header {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--heading);
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding-block: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.main-nav a:hover {
  color: var(--text);
}

.main-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Main */
main {
  flex: 1;
  padding-top: 4rem;
  padding-bottom: 5rem;
}

.hero {
  margin-bottom: 2.5rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  color: var(--heading);
  font-size: 2.2rem;
  font-weight: 700;
}

.hero-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Empty state */
.empty-state {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 0.75rem;
  color: var(--heading);
  font-size: 1.4rem;
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
}

.empty-state a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.empty-state a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Watch grid (followed watches on home) */
.watch-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.watch-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, transform 0.2s;
}

.watch-card a {
  display: block;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
}

.watch-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.watch-card-brand {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.watch-card-name {
  display: block;
  color: var(--heading);
  font-size: 1.15rem;
  font-weight: 600;
}

/* Model detail page */
.back-link {
  margin-bottom: 1.5rem;
}

.model-detail {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 2.5rem;
  margin-top: 1rem;
}

@media (max-width: 720px) {
  .model-detail {
    grid-template-columns: 1fr;
  }
}

.model-image img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.model-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
}

.placeholder-mark {
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
}

.placeholder-text {
  text-align: center;
  font-size: 0.95rem;
}

.model-brand-label {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.model-name {
  margin: 0 0 1.75rem;
  color: var(--heading);
  font-size: 2.2rem;
}

.model-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem;
  margin: 0 0 1.75rem;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.spec dt {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.25rem;
}

.spec dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

.model-description {
  color: var(--text);
  line-height: 1.65;
  margin: 0 0 1.75rem;
}

.follow-form {
  margin: 0;
}

.btn-following {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-following:hover {
  background: rgba(244, 67, 54, 0.12);
  color: #ff8a80;
  border-color: rgba(244, 67, 54, 0.5);
}

/* User menu (header) */
.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-name {
  color: var(--text);
  font-weight: 600;
}

.logout-form {
  margin: 0;
}

.logout-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font: inherit;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.logout-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* Auth (login) */
.auth-card {
  max-width: 380px;
  margin: 4rem auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
}

.auth-card h1 {
  margin: 0 0 0.5rem;
  color: var(--heading);
  font-size: 1.8rem;
}

.auth-sub {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-form .form-field {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-form label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-form {
  max-width: 480px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"],
.auth-form input[type="url"],
.auth-form textarea,
.auth-form select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  font: inherit;
  width: 100%;
}

.auth-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2390caf9' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

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

.auth-form input[type="number"] {
  -moz-appearance: textfield;
}

.auth-form input[type="number"]::-webkit-inner-spin-button,
.auth-form input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="number"]:focus,
.auth-form input[type="url"]:focus,
.auth-form textarea:focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-field-checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.form-field-checkbox input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.field-help {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-error {
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  background: rgba(244, 67, 54, 0.12);
  color: #ff8a80;
  border: 1px solid rgba(244, 67, 54, 0.4);
  border-radius: 6px;
  font-size: 0.9rem;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #0a1929;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Actions bar */
.actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.actions-bar-split {
  justify-content: stretch;
}

.actions-bar-split > * {
  flex: 1;
  text-align: center;
}

/* Buttons */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
}

.btn-danger {
  background: transparent;
  color: #ff8a80;
  border: 1px solid rgba(244, 67, 54, 0.4);
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-danger:hover {
  background: rgba(244, 67, 54, 0.15);
  color: #ffab91;
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

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

.data-table th {
  background: var(--bg-nav);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

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

.data-table tbody tr:hover {
  background: rgba(33, 150, 243, 0.06);
}

.row-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
  margin: 0;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-active {
  background: rgba(76, 175, 80, 0.15);
  color: #a5d6a7;
  border-color: rgba(76, 175, 80, 0.35);
}

.badge-inactive {
  background: rgba(120, 144, 156, 0.15);
  color: #b0bec5;
  border-color: rgba(120, 144, 156, 0.4);
}

.badge-admin {
  background: rgba(33, 150, 243, 0.15);
  color: var(--accent);
  border-color: rgba(33, 150, 243, 0.4);
}

.badge-user {
  background: rgba(120, 144, 156, 0.15);
  color: #cfd8dc;
  border-color: rgba(120, 144, 156, 0.3);
}

/* Catalog */
.catalog-search {
  margin-bottom: 2rem;
}

.catalog-search input[type="search"] {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.catalog-search input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
}

.catalog-no-results {
  margin-top: 1rem;
  color: var(--text-muted);
}

.catalog-list {
  display: flex;
  flex-direction: column;
}

.brand-block {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.brand-block:first-child {
  padding-top: 0;
}

.brand-block:last-child {
  border-bottom: none;
}

.brand-title {
  margin: 0 0 0.75rem;
  color: var(--heading);
  font-size: 1.35rem;
  font-weight: 700;
}

.model-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 3rem;
}

.model-item {
  margin: 0;
}

.model-item a {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 0.15s;
}

.model-item a:hover {
  color: var(--accent);
}

.model-name-accent {
  color: var(--accent);
}

/* Staff sub-navigation */
.staff-subnav {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.staff-subnav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.staff-subnav a:hover {
  color: var(--text);
}

.staff-subnav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Watches admin list */
.watches-table .watch-thumb-cell {
  width: 60px;
}

.watch-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.watch-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 700;
}

/* Watch image edit form */
.watch-edit-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 720px) {
  .watch-edit-grid {
    grid-template-columns: 1fr;
  }
}

.watch-edit-preview h2 {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.watch-edit-image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.auth-form input[type="file"] {
  display: none;
}

.file-upload-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.file-upload-label:hover {
  border-color: var(--accent);
  color: var(--text);
}

.file-upload-icon {
  font-size: 1.4rem;
}

.file-upload-text {
  font-size: 0.9rem;
}

.file-upload-name {
  color: var(--accent);
  font-weight: 600;
}

.form-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

/* Listings section (model detail) */
.listings-section {
  margin-top: 3rem;
}

.listings-heading {
  margin: 0 0 1.25rem;
  color: var(--heading);
  font-size: 1.5rem;
  font-weight: 700;
}

.listings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.listing-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, transform 0.2s;
}

.favorite-form {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  margin: 0;
  z-index: 2;
}

.favorite-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}

.favorite-btn:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  transform: scale(1.15);
}

.favorite-btn.is-favorited {
  color: #ff6b6b;
}

.listing-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.listing-card a {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  color: inherit;
}

@media (max-width: 600px) {
  .listing-card a {
    grid-template-columns: 48px 1fr;
    gap: 0.75rem;
  }
  .listing-price {
    grid-column: 2;
  }
}

.listing-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg);
}

.listing-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.listing-body {
  min-width: 0;
}

.listing-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.listing-source {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
}

.listing-type {
  font-size: 0.7rem;
}

.listing-title {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-attrs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.listing-attrs span::after {
  content: "·";
  margin-left: 0.5rem;
}

.listing-attrs span:last-child::after {
  content: "";
}

.listing-price {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}

.listings-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.listings-filters select,
.listings-filters input[type="number"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  appearance: none;
  min-width: 0;
}

.listings-filters select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2390caf9' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.listings-filters select:focus,
.listings-filters input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

.price-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 180px;
  min-width: 160px;
}

.price-slider-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.price-slider-label span {
  color: var(--accent);
  font-weight: 600;
}

.price-slider-track {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.price-slider-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  pointer-events: none;
}

.price-slider-track input[type="range"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
}

.price-slider-track input[type="range"]::-webkit-slider-runnable-track {
  height: 0;
  background: transparent;
}

.price-slider-track input[type="range"]::-moz-range-track {
  height: 0;
  background: transparent;
}

.price-slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 0 4px rgba(33, 150, 243, 0.4);
  position: relative;
  z-index: 1;
  margin-top: -7px;
}

.price-slider-track input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 0 4px rgba(33, 150, 243, 0.4);
}

.listings-filter-count {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-left: auto;
}

.listings-empty {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
}

/* Model name row with stats button */
.model-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.model-name-row .model-name {
  margin: 0;
}

.btn-stats {
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.55rem 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.btn-stats:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
}

/* Stats filter */
.stats-filter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stats-filter-label {
  font-weight: 500;
}

.stats-source-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.source-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s;
  font-size: 0.85rem;
  color: var(--text);
}

.source-check:hover {
  border-color: var(--accent);
}

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

.stats-filter select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2390caf9' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  cursor: pointer;
}

.stats-filter select:focus {
  outline: none;
  border-color: var(--accent);
}

/* KPIs grid */
.kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 600px) {
  .kpis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.kpi-value {
  display: block;
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.kpi-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Chart */
.chart-container {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.chart-container h3 {
  margin: 0 0 1rem;
  color: var(--heading);
  font-size: 1rem;
}

/* Alerts */
.alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.alert-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.alert-card-inactive {
  opacity: 0.6;
}

.alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.alert-title {
  margin: 0;
  color: var(--heading);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.alert-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.alert-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.alert-meta a {
  color: var(--accent);
  text-decoration: none;
}

.alert-meta a:hover {
  text-decoration: underline;
}

.alert-meta-label {
  color: var(--text-muted);
  margin-right: 0.3rem;
}

.alert-criteria {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.alert-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.alert-chip strong {
  color: var(--text);
  font-weight: 600;
}

.alert-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 560px) {
  .alert-form .form-row {
    grid-template-columns: 1fr;
  }
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.checkbox-group label {
  color: var(--text);
  font-weight: normal;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  accent-color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-block: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}
