:root {
  --primary: #0066cc;
  --primary-dark: #004d99;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --gray: #6c757d;
  --light: #f8f9fa;
  --dark: #343a40;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--light);
  color: var(--dark);
  line-height: 1.5;
}

/* Header */
.header {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.header .user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.header .user-name {
  opacity: 0.9;
}

.btn-logout {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.3);
}

/* Main Container */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

/* Login Page */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-box {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 360px;
}

.login-box h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  text-align: center;
  color: var(--primary);
}

.login-box .subtitle {
  text-align: center;
  color: var(--gray);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0,102,204,0.2);
}

.form-group input:disabled {
  background: #eee;
  cursor: not-allowed;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #218838;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c82333;
}

.btn-secondary {
  background: var(--gray);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
}

.btn-block {
  display: block;
  width: 100%;
}

/* Sections */
.section {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.section h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section h2 .step-number {
  background: var(--primary);
  color: white;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.section.completed h2 .step-number {
  background: var(--success);
}

.section.completed {
  opacity: 0.8;
}

/* Input Row */
.input-row {
  display: flex;
  gap: 0.5rem;
}

.input-row input {
  flex: 1;
}

.input-row .btn {
  flex-shrink: 0;
}

/* Status Messages */
.status {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 4px;
}

.status.success {
  background: #d4edda;
  color: #155724;
}

.status.error {
  background: #f8d7da;
  color: #721c24;
}

.status.info {
  background: #cce5ff;
  color: #004085;
}

/* Current Info Bar */
.current-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem;
  background: #e9ecef;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.current-info .info-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.current-info .info-label {
  color: var(--gray);
}

.current-info .info-value {
  font-weight: 600;
}

/* Pill */
.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 999px;
  background: white;
  font-size: 0.85rem;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

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

th {
  background: #e9ecef;
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: #f8f9fa;
}

/* Scanner */
.scanner-container {
  position: relative;
  margin: 1rem 0;
}

.scanner-video {
  width: 100%;
  max-width: 100%;
  border-radius: 4px;
  background: #000;
}

.scanner-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--success);
  width: 80%;
  height: 40%;
  border-radius: 8px;
  pointer-events: none;
}

.scanner-status {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.9rem;
  color: var(--gray);
}

/* Summary */
.summary {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.summary p {
  margin: 0.25rem 0;
}

.summary ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

/* Checkbox Toggle */
.checkbox-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.checkbox-toggle input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }

  .section {
    padding: 0.75rem;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row .btn {
    width: 100%;
  }

  .current-info {
    flex-direction: column;
    gap: 0.25rem;
  }
}
