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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

.navbar {
  background: #1a1a2e;
  color: white;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-decoration: none;
  margin-right: 32px;
}

.navbar-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.navbar-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.navbar-links a:hover,
.navbar-links a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.navbar-user span {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.navbar-user a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 13px;
}

.navbar-user a:hover {
  color: white;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 20px;
  max-width: 100%;
  box-sizing: border-box;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .label {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .value {
  font-size: 32px;
  font-weight: 700;
}

.stat-card .value.green { color: #22c55e; }
.stat-card .value.red { color: #ef4444; }
.stat-card .value.blue { color: #3b82f6; }
.stat-card .value.orange { color: #f97316; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f9fafb;
}

tr:hover {
  background: #f9fafb;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-success {
  background: #22c55e;
  color: white;
}

.btn-success:hover {
  background: #16a34a;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-group label.inline-label,
.form-group label:has(input[type="checkbox"]) {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-weight: 400;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 0;
  cursor: pointer;
  text-align: left;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-inline {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-inline .form-group {
  margin-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-row.four {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-ok { background: #dcfce7; color: #166534; }
.badge-late { background: #fef9c3; color: #854d0e; }
.badge-critical { background: #fef2f2; color: #dc2626; }
.badge-never { background: #f3f4f6; color: #6b7280; }
.badge-unassigned { background: #fef9c3; color: #854d0e; }
.badge-admin { background: #dbeafe; color: #1e40af; }
.badge-controller { background: #e0e7ff; color: #3730a3; }
.badge-cleaner { background: #dcfce7; color: #166534; }

.alerts-list {
  max-height: 300px;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

.alert-item.critical {
  background: #fef2f2;
  color: #dc2626;
}

.alert-item.late {
  background: #fffbeb;
  color: #b45309;
}

.alert-item.never {
  background: #f9fafb;
  color: #6b7280;
}

.alert-item .time {
  font-size: 12px;
  opacity: 0.7;
  margin-left: auto;
}

.qr-container {
  text-align: center;
  padding: 32px;
}

.qr-container img {
  max-width: 400px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: white;
}

.qr-url {
  margin-top: 16px;
  font-size: 12px;
  color: #6b7280;
  word-break: break-all;
}

.scan-result {
  text-align: center;
  padding: 48px 24px;
}

.scan-result .icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.scan-result h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.scan-result .detail {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #1a1a2e;
}

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 32px;
  font-size: 24px;
  color: #1a1a2e;
}

.auth-card .btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

.auth-card .footer {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #6b7280;
}

.auth-card .footer a {
  color: #3b82f6;
  text-decoration: none;
}

.analytics-table th {
  position: sticky;
  top: 0;
  background: #f9fafb;
  z-index: 1;
}

.tab-buttons {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 10px;
  display: inline-flex;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
}

.tab-btn.active {
  background: white;
  color: #1a1a2e;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
