:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #0070c0;
  --accent-soft: #1d4ed8;
  --etco-red: #e30613;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --brand-panel: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 2rem;
}

header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.app-header {
  margin-bottom: 1rem;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  background: #fff;
  color: #111827;
  border-radius: 18px;
  padding: 0.85rem 1rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.brand-logo {
  display: block;
  width: min(260px, 82vw);
  height: auto;
  object-fit: contain;
}

.brand-logo--login {
  width: min(240px, 76vw);
}

.brand-copy {
  text-align: center;
}

.brand-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.brand-sub {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.build-line {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.login-card {
  padding-top: 1.1rem;
}

.login-card h2 {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 1.1rem;
}

.login-brand {
  text-align: center;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}

.login-logo-wrap {
  display: inline-block;
  background: #fff;
  border-radius: 14px;
  padding: 0.5rem 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.site-label {
  margin: 0.85rem 0 0;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.site-label strong {
  color: #93c5fd;
  font-weight: 700;
}

.site-inline {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.welcome-card p:first-child {
  margin: 0;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.pin-input {
  width: 100%;
  font-size: 1.75rem;
  letter-spacing: 0.5rem;
  text-align: center;
  padding: 0.85rem;
  border: 2px solid #334155;
  border-radius: 12px;
  background: #0b1220;
  color: var(--text);
}

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.75rem;
}

.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: #334155; color: white; }
.btn-danger { background: var(--err); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hidden { display: none !important; }

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

label.btn {
  display: block;
  width: 100%;
  text-align: center;
  cursor: pointer;
}

.status {
  text-align: center;
  padding: 0.75rem;
  border-radius: 10px;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.status.ok { background: rgba(34,197,94,.15); color: #86efac; }
.status.err { background: rgba(239,68,68,.15); color: #fca5a5; }

#reader {
  width: 100%;
  min-height: 280px;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 0.5rem;
  background: #0b1220;
}

.scan-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.scan-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #334155;
  font-size: 0.9rem;
}

.scan-list li:last-child { border-bottom: 0; }

.install-hint {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.scan-hint {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.today-head h3 {
  margin: 0;
}

.btn-small {
  width: auto;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  margin-top: 0;
}

.admin-grid {
  display: grid;
  gap: 0.75rem;
}

input[type="text"], input[type="password"], input[type="date"] {
  width: 100%;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1220;
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #334155;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.qr-card {
  background: white;
  color: #111;
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
}

.qr-card img { width: 140px; height: 140px; }

@media print {
  body { background: white; color: black; }
  .no-print { display: none !important; }
  .qr-card { break-inside: avoid; border: 1px solid #ccc; }
}
