:root {
  --primary: #dc3545;
  --primary-dark: #b71c1c;
  --primary-light: #ffebee;
  --accent: #1a73e8;
  --accent-dark: #1557b0;
  --success: #0f9d58;
  --warning: #f9ab00;
  --danger: #dc3545;
  --dark: #1f2937;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #6b7280;
  --gray-500: #9ca3af;
  --gray-400: #d1d5db;
  --gray-300: #e5e7eb;
  --gray-200: #f3f4f6;
  --gray-100: #f9fafb;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-dark); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; width: 100%; }

.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand:hover { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-links a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}
.nav-links .nav-admin {
  color: var(--primary);
  font-weight: 600;
}
.nav-links .nav-admin:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.main-content { flex: 1; padding: 32px 0; }

.footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-500);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: var(--font);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c82333; color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #0b8043; color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}
.card-header h3 { font-size: 1rem; font-weight: 600; color: var(--gray-700); }

.form-container {
  max-width: 480px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.form-container-wide { max-width: 640px; }
.form-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--gray-900);
}
.form-container p.subtitle {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
  color: var(--gray-900);
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.form-input::placeholder { color: var(--gray-400); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-footer { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--gray-500); }
.form-footer a { font-weight: 600; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.stat-card.stat-primary .stat-value { color: var(--primary); }
.stat-card.stat-success .stat-value { color: var(--success); }
.stat-card.stat-accent .stat-value { color: var(--accent); }
.stat-card.stat-warning .stat-value { color: var(--warning); }

.dashboard-header {
  margin-bottom: 24px;
}
.dashboard-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}
.dashboard-header p {
  color: var(--gray-500);
  font-size: 0.95rem;
}

.tab-nav {
  display: flex;
  gap: 2px;
  margin-bottom: 24px;
  background: var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 3px;
  overflow-x: auto;
}
.tab-nav button {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
  color: var(--gray-600);
  white-space: nowrap;
  font-family: var(--font);
}
.tab-nav button.active {
  background: var(--white);
  color: var(--gray-900);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.tab-nav button:hover:not(.active) { color: var(--gray-900); }
.tab { display: none; }
.tab.active { display: block; }

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.85rem;
}
.table th {
  background: var(--gray-100);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
}
.table tr:hover td { background: var(--gray-50); }
.table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }
.badge-info { background: #d1ecf1; color: #0c5460; }

.text-muted { color: var(--gray-500); font-size: 0.85rem; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.1rem; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; }

.qr-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.qr-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s;
}
.qr-card:hover { box-shadow: var(--shadow-md); }
.qr-card .qr-code { font-family: monospace; font-size: 1.1rem; font-weight: 700; color: var(--gray-900); letter-spacing: 1px; }
.qr-card .qr-meta { font-size: 0.8rem; color: var(--gray-500); margin: 8px 0; }
.qr-card .qr-actions { display: flex; gap: 8px; margin-top: 12px; }

.hero {
  text-align: center;
  padding: 60px 20px;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
  margin-bottom: 12px;
}
.hero .hero-subtitle {
  font-size: 1.05rem;
  color: var(--gray-500);
  max-width: 520px;
  margin: 0 auto 40px;
}
.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 40px;
}
.hero-cards .card {
  text-align: center;
  padding: 28px 20px;
}
.hero-cards .card .card-icon { font-size: 2rem; margin-bottom: 12px; }
.hero-cards .card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.hero-cards .card p { font-size: 0.85rem; color: var(--gray-500); line-height: 1.5; }
.cta-section { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.info-section {
  padding: 40px 20px;
  max-width: 800px;
  margin: 0 auto;
}
.info-section h2 {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--gray-900);
}
.steps { display: grid; gap: 16px; }
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--white);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.step p { font-size: 0.9rem; color: var(--gray-600); padding-top: 6px; }

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .hero { padding: 40px 16px; }
  .hero h1 { font-size: 1.8rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .navbar .container { height: auto; min-height: 56px; }
  .nav-links a { padding: 6px 10px; font-size: 0.8rem; }
  .qr-list { grid-template-columns: 1fr; }
  .hero-cards { grid-template-columns: 1fr; }
  .main-content { padding: 20px 0; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 1.5rem; }
}
