/* CSS Variables - Color Palette */
:root {
    --bg: #0b0d10;
    --bg2: #121418;
    --text: #e8eef2;
    --muted: #9ba4ad;
    --accent: #4ea1ff;
    --accent-2: #20c997;
    --danger: #ff6b6b;
    --border: #222631;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation */
.navbar {
    background: #000;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}

/* Cards */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0e1116;
    color: var(--text);
}

.btn:hover {
    filter: brightness(1.1);
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border-color: transparent;
}

.btn-success {
    background: var(--accent-2);
    color: #000;
    border-color: transparent;
}

.btn-danger {
    background: var(--danger);
    color: #000;
    border-color: transparent;
}

/* Form Elements */
.input,
textarea,
select {
    width: 100%;
    background: #0d1015;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem;
}

label {
    display: block;
    margin: 0.4rem 0 0.2rem;
    color: var(--muted);
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Footer */
footer {
    background: #000;
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Header Components */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.top-links a {
    margin-left: 0.8rem;
}

/* UI Components */
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    background: #0f1318;
    border: 1px solid var(--border);
    color: var(--muted);
}

.hero {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.hero img {
    max-width: 360px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Typography */
.small {
    font-size: 0.9rem;
    color: var(--muted);
}

.tiny-note {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.table th {
    text-align: left;
    color: var(--muted);
}

/* Special Elements */
.notice {
    background: #0b1318;
    border-left: 4px solid var(--accent);
    padding: 0.8rem;
    border-radius: 10px;
}

iframe {
    width: 100%;
    min-height: 100vh;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #101318;
}

/* Prevent any horizontal scroll from rogue elements */
html, body { overflow-x: hidden; }

/* Layout */
.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  @media (min-width: 960px) {
    .news-grid { grid-template-columns: 1fr 1fr; }
  }
  
  /* List */
  .card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
  
  /* Unified vertical card */
  .news-card {
    background: #111;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    overflow: hidden;
  }
  
  /* Image on top; consistent size */
  .news-card .thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;        /* uniform banner height */
    background: #000;
    overflow: hidden;
  }
  .news-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;          /* visually consistent; switch to 'contain' to avoid any cropping */
    display: block;
  }
  
  /* Body */
  .news-card .body { padding: 0.9rem; }
  .news-card .title {
    color: #eee;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.2;
    display: inline-block;
  }
  .news-card .title:hover { text-decoration: underline; }
  .news-card .meta { font-size: 0.86rem; color: #9aa; margin-top: 4px; }
  .news-card .summary { color: #c7c7c7; margin-top: 8px; }
  
  /* Safety: no horizontal scroll */
  html, body { overflow-x: hidden; }
  img { max-width: 100%; height: auto; }
  
  /* Layout */
.dashboard-section { margin-top: 16px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

/* Centered rows (Test Signal & Quick actions) */
.center-row {
  display: flex;
  justify-content: center;
}

/* KPI / action cards */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  padding: 24px;
  min-height: 120px;
  border-radius: 14px;

  text-decoration: none;
  color: inherit;
  cursor: pointer;

  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, opacity .12s ease;
}

.stat-card:hover,
.stat-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0,0,0,.08);
}

.stat-card .kpi {
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
}

.stat-card .label {
  margin-top: 6px;
  opacity: .75;
  font-size: .95rem;
}

/* Dark variant for Test Signal to match/stand out */
.stat-card--dark {
  background: #111;
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
}
.stat-card--dark:hover,
.stat-card--dark:focus-visible {
  background: #0d0d0d;
  box-shadow: 0 6px 22px rgba(0,0,0,.25);
}

/* Quick actions centered */
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.center-actions { justify-content: center; }

/* Accessibility helper */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap; border: 0;
}
