/* RNVLive QR Scanner - Clean Mobile & Desktop Pro Stylesheet */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --dark: #0f172a;
  --slate: #334155;
  --muted: #64748b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --header-h: 66px;
  --sidebar-w: 275px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--dark);
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  padding: 16px;
}
.admin-auth {
  background: linear-gradient(135deg, #090d16 0%, #1e293b 100%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 30px 26px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.45);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-icon {
  background: #0f172a;
  font-weight: 800;
  font-size: 16px;
}
.auth-logo h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}
.auth-logo h1 span { color: var(--primary); }
.auth-logo p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.auth-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.form-group { margin-bottom: 15px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 6px;
}
.form-group input, .select-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  background: #fff;
}
.select-input { width: auto; padding: 8px 12px; font-size: 13.5px; }
.form-group input:focus { border-color: var(--primary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: 0.15s ease;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { padding: 13px 20px; font-size: 15.5px; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-outline {
  background: #fff;
  color: var(--dark);
  border: 1.5px solid #cbd5e1;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(15,23,42,0.04);
}
.admin-header {
  background: #0f172a;
  color: #fff;
  border-bottom-color: #1e293b;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: inherit;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
}
.brand-wrap { display: flex; align-items: center; gap: 11px; }
.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.admin-badge { background: #3b82f6; }
.brand-title { font-size: 18px; font-weight: 800; line-height: 1.15; }
.brand-title span { color: var(--primary); }
.admin-header .brand-title span { color: #60a5fa; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.admin-header .brand-sub { color: #94a3b8; }
.user-pill {
  background: #eff6ff;
  color: var(--primary-dark);
  padding: 7px 13px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  padding-top: var(--header-h);
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 16px 14px;
  overflow-y: auto;
  z-index: 950;
  transition: transform 0.25s ease;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.sidebar-user strong { display: block; font-size: 14px; }
.sidebar-user small { color: var(--muted); font-size: 12px; }
.sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
}

.side-nav { display: flex; flex-direction: column; gap: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--dark);
  border: 1.5px solid transparent;
  transition: 0.15s;
}
.nav-item:hover { background: #f8fafc; }
.nav-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary-dark);
}
.nav-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.nav-item.active .nav-icon {
  background: var(--primary);
  color: #fff;
}
.nav-text strong { display: block; font-size: 14.5px; }
.nav-text small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
}
.nav-logout { margin-top: 14px; color: var(--red); }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 20px;
  max-width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
}
.stat-indigo { border-left-color: #4f46e5; }
.stat-green { border-left-color: var(--green); }
.stat-amber { border-left-color: var(--amber); }
.stat-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.stat-val { font-size: 28px; font-weight: 800; margin: 4px 0 2px; }
.stat-sub { font-size: 12px; color: var(--muted); }

.panel-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.03);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.mode-switch {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}
.mode-btn {
  border: none;
  background: transparent;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate);
  cursor: pointer;
}
.mode-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.scanner-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: start;
}
#qr-reader {
  width: 100%;
  min-height: 250px;
  background: #0f172a;
  border-radius: 14px;
  overflow: hidden;
}
.camera-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.manual-box {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.manual-box input {
  flex: 1;
  padding: 11px 13px;
  border: 1.5px solid #cbd5e1;
  border-radius: 11px;
  font-size: 14px;
}

.preview-box {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  padding: 16px;
}
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 14px;
}
.dim-tag {
  background: #dbeafe;
  color: var(--primary-dark);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
}
.label-stage {
  display: flex;
  justify-content: center;
  padding: 16px 8px;
  background: #e2e8f0;
  border-radius: 12px;
}
.label-6x3 {
  width: 300px;
  height: 150px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 14px;
}
.label-qr-slot {
  width: 108px;
  height: 108px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.label-qr-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.label-text-slot {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #0f172a;
  word-break: break-all;
  letter-spacing: 0.3px;
}
.scan-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13.5px;
  text-align: center;
}
.preview-actions {
  margin-top: 12px;
  display: flex;
}
.preview-actions .btn { width: 100%; }

.day-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.day-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 13px 15px;
  transition: 0.15s;
}
.day-card:hover, .day-card.active {
  border-color: var(--primary);
  background: #eff6ff;
}
.day-title { font-weight: 800; font-size: 13.5px; margin-bottom: 8px; }
.day-metrics { display: flex; justify-content: space-between; font-size: 12.5px; }
.txt-green { color: var(--green); }
.txt-amber { color: var(--amber); }

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  text-align: left;
  padding: 11px 12px;
  background: #f8fafc;
  color: var(--slate);
  font-weight: 700;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.empty-cell {
  text-align: center;
  padding: 26px !important;
  color: var(--muted);
}
.code-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  background: #f1f5f9;
  padding: 3px 7px;
  border-radius: 6px;
}
.pass-pill {
  font-family: ui-monospace, monospace;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
}
.badge-mode {
  background: #e0e7ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
}
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pill-green { background: #dcfce7; color: #166534; }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-red { background: #fee2e2; color: #991b1b; }

.alert {
  padding: 12px 15px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1200;
}
.modal-box {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  padding: 24px;
}
.modal-box h3 { margin: 0 0 16px; }

@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.2); }
  .sidebar-close { display: block; }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.45);
    z-index: 900;
  }
  .sidebar-backdrop.show { display: block; }
  .main-content { margin-left: 0; padding: 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .scanner-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .label-6x3 { width: 260px; height: 130px; padding: 10px 12px; gap: 10px; }
  .label-qr-slot { width: 92px; height: 92px; }
  .label-text-slot { font-size: 13px; }
  .brand-sub, .user-pill { display: none; }
}
