:root {
  --navy: #0F172A;
  --navy-2: #1E293B;
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --accent: #38BDF8;
  --success: #10B981;
  --danger: #EF4444;
  --warn: #F59E0B;
  --bg: #F8FAFC;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #64748B;
}

* { box-sizing: border-box; }

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar .brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3px;
}
.topbar .brand span { color: var(--accent); }

.topbar nav a {
  color: #CBD5E1;
  margin-left: 16px;
  font-size: 14px;
  font-weight: 600;
}
.topbar nav a:hover { color: #fff; }

.topbar .who {
  font-size: 13px;
  color: var(--accent);
  margin-left: 16px;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-center img {
  height: 32px;
  max-width: 140px;
  object-fit: contain;
}
.topbar-center-text {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 2px;
  color: #fff;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.card h2, .card h3 { margin-top: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
.stat-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.stat-box .num { font-size: 28px; font-weight: 800; color: var(--blue); }
.stat-box .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
th { background: #EEF2F7; color: var(--navy-2); font-size: 12.5px; text-transform: uppercase; }
tr:hover td { background: #F8FAFC; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); text-decoration: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; text-decoration: none; }
.btn-secondary { background: #E2E8F0; color: #334155; }
.btn-secondary:hover { background: #CBD5E1; text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

input[type=text], input[type=password], input[type=date], select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
}

.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12.5px; font-weight: 700; color: var(--navy-2); margin-bottom: 4px; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form .form-row { margin-bottom: 0; min-width: 140px; flex: 1; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge-online { background: #DCFCE7; color: #15803D; }
.badge-offline { background: #F1F5F9; color: #64748B; }
.badge-active { background: #DBEAFE; color: #1D4ED8; }
.badge-inactive { background: #FEE2E2; color: #B91C1C; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot-on { background: #22C55E; }
.dot-off { background: #94A3B8; }

.flash { padding: 11px 16px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.flash-success { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.flash-error { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }
.flash-info { background: #DBEAFE; color: #1D4ED8; border: 1px solid #93C5FD; }

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0F172A, #1E3A8A);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  width: 360px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.login-card h1 { font-size: 19px; text-align: center; color: var(--navy); margin-bottom: 4px; }
.login-card p.sub { text-align: center; color: var(--muted); font-size: 13px; margin-top: 0; margin-bottom: 20px; }

.panel-scan-input {
  font-size: 20px;
  padding: 14px;
  border: 2px solid var(--blue);
  border-radius: 10px;
  width: 100%;
}

.scan-total {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
}

.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12.5px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }

.pdf-list-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.pdf-list-item .top-row { display: flex; justify-content: space-between; align-items: center; }
.version-chip { font-size: 11px; background: #EEF2F7; padding: 2px 7px; border-radius: 6px; margin-left: 6px; color: var(--muted); }

.empty-state { text-align: center; padding: 30px; color: var(--muted); }
