/* assets/css/rfid.css – RFID Tracking page styles */

/* ── Live bar ─────────────────────────────────────── */
.live-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg, #1e2a3a);
  border: 1px solid var(--border, #2e3d50);
  border-radius: 8px;
  padding: 10px 18px;
  margin: 16px 24px;
  font-size: 0.9rem;
  color: var(--text-muted, #8899aa);
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,.25);
  flex-shrink: 0;
  transition: background 0.3s;
}
.live-dot.blink {
  animation: dotPulse 0.6s ease 3;
}
@keyframes dotPulse {
  0%,100% { background:#4ade80; box-shadow:0 0 0 3px rgba(74,222,128,.25); }
  50%      { background:#22c55e; box-shadow:0 0 0 6px rgba(74,222,128,.45); }
}

.live-tag {
  margin-left: auto;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--accent, #3b82f6);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ── Stats grid ───────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  padding: 0 24px 16px;
}

.stat-card {
  background: var(--card-bg, #1e2a3a);
  border: 1px solid var(--border, #2e3d50);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.green  { border-left: 3px solid #4ade80; }
.stat-card.orange { border-left: 3px solid #fb923c; }
.stat-card.blue   { border-left: 3px solid #60a5fa; }

.stat-icon { font-size: 1.6rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted, #8899aa); margin-top: 2px; }

/* ── Two-col layout ───────────────────────────────── */
.rfid-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  padding: 0 24px 24px;
}

.card {
  background: var(--card-bg, #1e2a3a);
  border: 1px solid var(--border, #2e3d50);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card.wide { min-width: 0; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #2e3d50);
  flex-shrink: 0;
}
.card-header h2 { font-size: 0.95rem; font-weight: 600; margin: 0; }

.search-box {
  background: var(--bg, #141e2b);
  border: 1px solid var(--border, #2e3d50);
  border-radius: 6px;
  padding: 6px 12px;
  color: inherit;
  font-size: 0.82rem;
  width: 200px;
  outline: none;
  transition: border-color 0.2s;
}
.search-box:focus { border-color: var(--accent, #3b82f6); }

/* ── Asset table ──────────────────────────────────── */
.table-wrap { overflow-x: auto; overflow-y: auto; max-height: 420px; }
.rfid-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.rfid-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #8899aa);
  position: sticky;
  top: 0;
  background: var(--card-bg, #1e2a3a);
  z-index: 1;
}
.rfid-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border, #2e3d50);
  vertical-align: middle;
}
.rfid-table tr { transition: background 0.3s; }
.rfid-table tbody tr:hover { background: rgba(255,255,255,.04); }
.rfid-table tr.row-highlight { background: rgba(59,130,246,.12) !important; }

code { font-family: monospace; font-size: 0.82rem; color: var(--accent, #60a5fa); }

/* Status badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-active      { background: rgba(74,222,128,.15);  color: #4ade80; }
.badge-checked_out { background: rgba(251,146,60,.15);  color: #fb923c; }
.badge-lost        { background: rgba(239,68,68,.15);   color: #ef4444; }
.badge-maintenance { background: rgba(250,204,21,.15);  color: #facc15; }

/* ── Scan log ─────────────────────────────────────── */
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); }
  50%      { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
}

.scan-log {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 440px;
  flex: 1;
}

.log-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, #2e3d50);
  font-size: 0.82rem;
  position: relative;
  transition: background 0.2s;
}
.log-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.log-check_in::before  { background: #4ade80; }
.log-check_out::before { background: #fb923c; }
.log-scan::before      { background: #60a5fa; }

.log-item.new-scan { animation: slideIn 0.35s ease-out; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.log-tag { font-family: monospace; font-weight: 700; color: var(--accent, #60a5fa); font-size: 0.88rem; }
.log-meta { display: flex; justify-content: space-between; color: var(--text-muted, #8899aa); }
.log-loc  { font-size: 0.78rem; }
.log-time { font-size: 0.75rem; color: var(--text-muted, #8899aa); margin-top: 2px; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .rfid-grid { grid-template-columns: 1fr; }
}
