/* dashboard/dashboard.css — shared styles loaded after theme.css on every page. */

/* Freshness badge — used next to live tables on every polling page. */
.freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--card-border);
  vertical-align: middle;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex: 0 0 8px;
}
.freshness-badge[data-state="ok"] .freshness-dot {
  background: var(--green);
  box-shadow: 0 0 6px var(--green-dim);
  animation: freshness-pulse 2s ease-in-out infinite;
}
.freshness-badge[data-state="warn"] {
  color: var(--yellow);
  border-color: rgba(250,204,21,0.35);
}
.freshness-badge[data-state="warn"] .freshness-dot {
  background: var(--yellow);
  box-shadow: 0 0 6px rgba(250,204,21,0.5);
}
.freshness-badge[data-state="err"] {
  color: var(--red);
  border-color: rgba(248,113,113,0.4);
}
.freshness-badge[data-state="err"] .freshness-dot {
  background: var(--red);
  box-shadow: 0 0 6px var(--red-dim);
  animation: freshness-pulse 1s ease-in-out infinite;
}
@keyframes freshness-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.freshness-mount {
  display: inline-flex;
  margin: 0 0 12px 0;
}

/* Skeleton loading rows — shimmer effect using theme tokens. */
.skeleton {
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--card-border) 0%,
    var(--card-hover) 50%,
    var(--card-border) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton-row td {
  padding: 12px 8px !important;
}
.skeleton-block {
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    var(--card-border) 0%,
    var(--card-hover) 50%,
    var(--card-border) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Today-so-far widget on home.html. */
.today-widget {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 20px;
}
.today-widget .tile {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px 20px;
  text-align: left;
  position: relative;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, transform 0.2s;
}
.today-widget .tile:hover {
  border-color: var(--card-hover);
  transform: translateY(-2px);
}
.today-widget .tile-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px 0;
  font-weight: 600;
}
.today-widget .tile-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.today-widget .tile-value.pos { color: var(--green); }
.today-widget .tile-value.neg { color: var(--red); }
.today-widget .tile-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin: 6px 0 0 0;
}
.today-widget .tile-sub.warn {
  color: var(--yellow);
}
@media (max-width: 720px) {
  .today-widget {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .today-widget .tile-value { font-size: 26px; }
}

/* Recent-settled VIP ribbon on alerts.html. */
.settled-ribbon {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 8px 16px 16px;
}
.settled-ribbon[data-tone="pos"] { border-left: 3px solid var(--green); }
.settled-ribbon[data-tone="neg"] { border-left: 3px solid var(--red); }
.settled-ribbon-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 10px;
}
.settled-ribbon-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.settled-ribbon-scroll::-webkit-scrollbar { height: 4px; }
.settled-ribbon-scroll::-webkit-scrollbar-thumb { background: var(--card-hover); border-radius: 2px; }
.settled-card {
  flex: 0 0 170px;
  background: var(--card-solid);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  scroll-snap-align: start;
  transition: border-color 0.2s, transform 0.2s;
}
.settled-card.pos { border-left: 3px solid var(--green); }
.settled-card.neg { border-left: 3px solid var(--red); opacity: 0.75; }
.settled-card.neutral { border-left: 3px solid var(--yellow); }
.settled-card-result {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.settled-card.pos .settled-card-result { color: var(--green); }
.settled-card.neg .settled-card-result { color: var(--red); }
.settled-card.neutral .settled-card-result { color: var(--yellow); }
.settled-card-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settled-card-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settled-card.flash { animation: settled-flash 1.5s ease-out 1; }
@keyframes settled-flash {
  0% { box-shadow: 0 0 0 2px var(--orange); transform: scale(1.03); }
  100% { box-shadow: none; transform: scale(1); }
}
@media (max-width: 600px) {
  .settled-ribbon { margin: 8px 10px 12px; padding: 10px 12px; }
  .settled-card { flex-basis: 150px; }
}

/* Skip-to-content link — invisible until focused via Tab. */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--orange);
  color: #0a0a14;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  z-index: 9999;
  transition: top 0.15s;
}
.skip-link:focus { top: 8px; outline: 2px solid var(--text); }

/* Share-view button on filter toolbars. */
.share-btn {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  transition: border-color .15s, color .15s, background .15s;
}
.share-btn:hover { border-color: var(--orange); color: var(--orange); }
.share-btn:active { transform: translateY(1px); }

/* Contextual empty-state inside live tables. */
.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}
.empty-state strong {
  color: var(--text);
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}
.empty-state a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
}
.empty-state a:hover { text-decoration: underline; }
