/* ============================================================
   APOMETRE BLOC P48 — Premium Dark-Mode Design System
   Clasele sunt aliniate cu index.php
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Design Tokens ── */
:root {
  --bg:           #0a0e17;
  --surface:      rgba(17, 24, 39, 0.65);
  --surface-solid: #111827;
  --border:       rgba(255, 255, 255, 0.07);
  --border-glow:  rgba(59, 130, 246, 0.15);
  --text:         #f1f5f9;
  --muted:        #64748b;
  --secondary:    #94a3b8;
  --accent:       #3b82f6;
  --green:        #10b981;
  --yellow:       #f59e0b;
  --red:          #ef4444;
  --mono:         'JetBrains Mono', monospace;
  --sans:         'Inter', -apple-system, sans-serif;
  --glass-blur:   16px;
  --radius:       12px;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Gradiente ambientale subtile */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(59,130,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 80%, rgba(16,185,129,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.15); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.3); }

/* ── Animații ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.2); }
}

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

.animate-in {
  animation: fadeInUp 0.6s var(--ease) both;
}

.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.2s; }
.animate-in:nth-child(4) { animation-delay: 0.3s; }
.animate-in:nth-child(5) { animation-delay: 0.4s; }

/* ═══════════════════════════════════════════════════════════════ */
/* HEADER                                                         */
/* ═══════════════════════════════════════════════════════════════ */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  margin-bottom: 24px;
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: var(--radius);
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(59,130,246,0.25);
}

.logo-text h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-text p {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--mono);
}

.header-meta {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--secondary);
}

.header-meta span {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════ */
/* STATS BAR                                                      */
/* ═══════════════════════════════════════════════════════════════ */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-chip {
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s var(--ease);
}

.stat-chip:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 20px rgba(59,130,246,0.06);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-content strong {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}

.stat-content span {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════ */
/* MAIN GRID (2 METER CARDS)                                      */
/* ═══════════════════════════════════════════════════════════════ */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.meter-card {
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}

.meter-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 30px rgba(59,130,246,0.08), 0 8px 30px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}

.meter-card.offline {
  opacity: 0.55;
}

.meter-card.offline:hover {
  opacity: 0.75;
}

/* Card Header */
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title h2 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Status Dot */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--green);
  opacity: 0.3;
  animation: pulse 2s infinite 0.5s;
}

.status-dot.offline {
  background: var(--muted);
  animation: none;
}

.status-dot.offline::after {
  display: none;
}

/* Battery Badge */
.battery-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.2);
}

.battery-bar {
  width: 24px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.battery-bar::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 5px;
  background: currentColor;
  border-radius: 0 1px 1px 0;
}

.battery-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.5s;
}

/* Meter Image */
.meter-image-wrap {
  position: relative;
  background: #000;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.meter-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
  cursor: pointer;
}

.meter-image-wrap:hover img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-family: var(--mono);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.7);
  display: flex;
  justify-content: space-between;
}

.no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--muted);
  gap: 10px;
  font-size: 0.85rem;
}

.no-image svg {
  opacity: 0.25;
}

/* OCR Section */
.ocr-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.ocr-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.ocr-value {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
  text-shadow: 0 0 30px rgba(59,130,246,0.2);
}

.ocr-value.pending {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
  text-shadow: none;
}

.ocr-unit {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-left: 4px;
  font-weight: 400;
}

.ocr-debug {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--mono);
  padding: 6px 10px;
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ocr-debug-label {
  color: var(--secondary);
  margin-right: 6px;
}

/* Sparkline Section */
.sparkline-section {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.sparkline-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.sparkline-section canvas {
  width: 100% !important;
  height: 40px !important;
}

/* Meta Grid */
.meta-grid {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.meta-item label {
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 3px;
}

.meta-item span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════ */
/* CHART SECTION                                                   */
/* ═══════════════════════════════════════════════════════════════ */

.chart-section {
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
}

.chart-container {
  position: relative;
  height: 320px;
  margin-top: 16px;
}

.chart-container canvas {
  max-height: 320px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* SECTION TITLE                                                   */
/* ═══════════════════════════════════════════════════════════════ */

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══════════════════════════════════════════════════════════════ */
/* HISTORY TABLE                                                   */
/* ═══════════════════════════════════════════════════════════════ */

.history-section {
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.filter-buttons {
  display: flex;
  gap: 6px;
}

.filter-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.filter-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: var(--border-glow);
}

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.history-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  white-space: nowrap;
}

.history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-family: var(--mono);
  font-size: 0.75rem;
  vertical-align: middle;
}

.history-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.ocr-raw-cell {
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
}

/* Thumbnails */
.thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: 1px solid var(--border);
}

.thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  border-color: var(--accent);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-family: var(--mono);
  font-weight: 600;
}

.badge-scara1 {
  background: rgba(59,130,246,0.15);
  color: var(--accent);
}

.badge-scara2 {
  background: rgba(16,185,129,0.15);
  color: var(--green);
}

/* Battery colors */
.batt-good { color: var(--green); }
.batt-mid  { color: var(--yellow); }
.batt-low  { color: var(--red); }

/* Retry button */
.btn-retry {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--secondary);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s var(--ease);
}

.btn-retry:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.1);
}

.btn-retry:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════════════════════════════════════════════════════════ */
/* LIGHTBOX                                                        */
/* ═══════════════════════════════════════════════════════════════ */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* ═══════════════════════════════════════════════════════════════ */
/* FOOTER                                                          */
/* ═══════════════════════════════════════════════════════════════ */

.refresh-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-family: var(--mono);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.refresh-hint strong {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════ */
/* RESPONSIVE                                                      */
/* ═══════════════════════════════════════════════════════════════ */

/* ── Controale & Vizualizări Istoric ── */
.history-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.view-toggle {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px;
  display: inline-flex;
}

.view-toggle .toggle-btn {
  background: transparent;
  border: none;
  color: var(--secondary);
  padding: 6px 14px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: var(--sans);
}

.view-toggle .toggle-btn:hover {
  color: var(--text);
}

.view-toggle .toggle-btn.active {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px 6px 36px;
  color: var(--text);
  font-size: 0.78rem;
  font-family: var(--sans);
  outline: none;
  transition: all 0.2s ease;
  width: 200px;
}

.search-box input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  width: 240px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  pointer-events: none;
}

.history-view-container {
  display: none;
  animation: fadeIn 0.3s ease;
}

.history-view-container.active {
  display: block;
}

.history-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  gap: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.1);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Sortare Tabel ── */
th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  position: relative;
}

th.sortable:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text);
}

th.sortable .sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  color: var(--muted);
  width: 10px;
}

th.sortable.active {
  color: var(--accent);
}

th.sortable.active .sort-icon {
  color: var(--accent);
}

/* ── Acordion Istoric Grupat ── */
.grouped-history-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion-month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s var(--ease);
}

.accordion-month:hover {
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  background: rgba(255,255,255,0.005);
  transition: background-color 0.15s ease;
}

.month-header:hover {
  background: rgba(255, 255, 255, 0.015);
}

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

.month-title-wrap h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.month-badge {
  font-size: 0.72rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.month-arrow-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.month-meta-info {
  font-size: 0.78rem;
  color: var(--muted);
}

.month-meta-info strong {
  color: var(--secondary);
}

.month-arrow {
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.accordion-month.expanded {
  border-color: rgba(59, 130, 246, 0.25);
}

.accordion-month.expanded .month-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}

.accordion-month.expanded .month-arrow {
  transform: rotate(90deg);
  color: var(--text);
}

.month-content {
  display: none;
  padding: 4px 16px 16px 16px;
  background: rgba(0, 0, 0, 0.12);
}

.accordion-month.expanded .month-content {
  display: block;
}

/* Săptămâni */
.accordion-week {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.accordion-week:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.week-header:hover {
  background: rgba(255, 255, 255, 0.015);
}

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

.week-title-wrap h4 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--secondary);
}

.week-date-range {
  font-size: 0.72rem;
  color: var(--muted);
}

.week-arrow-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.week-meta-info {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}

.week-arrow {
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.accordion-week.expanded .week-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.005);
}

.accordion-week.expanded .week-arrow {
  transform: rotate(90deg);
  color: var(--text);
}

.week-content {
  display: none;
  padding: 14px;
}

.accordion-week.expanded .week-content {
  display: block;
}

.week-cameras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.camera-section {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.camera-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  padding-bottom: 6px;
}

.camera-title-bar h5 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.camera-title-bar h5::before {
  content: '●';
  font-size: 0.6rem;
}
.camera-section.scara1 h5::before { color: var(--accent); }
.camera-section.scara2 h5::before { color: var(--green); }

.camera-consum-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  font-family: var(--mono);
}

.camera-consum-badge.positive {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--green);
}

.camera-consum-badge.zero {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--muted);
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.005);
  border: 1px solid rgba(255, 255, 255, 0.01);
  border-radius: 6px;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.day-row:hover {
  background: rgba(255, 255, 255, 0.015);
  border-color: rgba(255, 255, 255, 0.04);
}

.day-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.day-name {
  font-weight: 500;
  color: var(--secondary);
  min-width: 50px;
}

.day-thumb {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.15s ease;
}

.day-thumb:hover {
  transform: scale(1.1);
}

.day-ocr-value {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

.day-ocr-value.empty {
  color: var(--muted);
  font-weight: normal;
}

.day-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-battery {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
}

.day-time {
  color: var(--muted);
  font-size: 0.68rem;
  font-family: var(--mono);
}

.day-badge-type {
  font-size: 0.62rem;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.day-retry-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 2px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  line-height: 1;
}

.day-retry-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.day-success-check {
  color: var(--green);
  font-size: 0.72rem;
}

/* Mesaj Căutare Fără Rezultate */
.history-no-results {
  text-align: center;
  padding: 48px;
  color: var(--muted);
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.05);
}

@media (max-width: 1024px) {
  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  body { padding: 16px; }

  header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .header-meta { text-align: center; }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .history-table {
    font-size: 0.7rem;
  }

  .history-table th,
  .history-table td {
    padding: 8px 6px;
  }
}

@media (max-width: 480px) {
  .stats-bar {
    grid-template-columns: 1fr;
  }

  .ocr-value {
    font-size: 1.5rem;
  }

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

/* ── Animations keyframes used by JS ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
