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

:root {
  --bg: #1a1a2e;
  --surface: #252542;
  --primary: #4a90d9;
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --text: #e0e0e0;
  --text-muted: #888;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0;
}

header {
  background: var(--surface);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.2rem;
  font-weight: 600;
}

.status-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}

.online-status {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.status-dot.online {
  background: var(--success);
}

.pending-badge {
  background: var(--warning);
  color: #000;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.75rem;
}

.pending-badge.empty {
  background: var(--text-muted);
}

main {
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.form-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.form-btn {
  background: var(--surface);
  border: 2px solid transparent;
  color: var(--text);
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.form-btn:hover, .form-btn.active {
  border-color: var(--primary);
  background: rgba(74, 144, 217, 0.1);
}

.form-btn .icon {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

.form-container {
  background: var(--surface);
  border-radius: 8px;
  padding: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid #444;
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 6px;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary);
  transform: scale(1.2);
}

.checkbox-item label {
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

.submit-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

.submit-btn:hover:not(:disabled) {
  background: #3a7bc8;
}

.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: 1px solid #444;
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--danger);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.queue-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #333;
}

.queue-section h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.queue-item {
  background: var(--surface);
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.queue-item .type {
  font-weight: 600;
}

.queue-item .time {
  color: var(--text-muted);
}

.sync-btn {
  background: var(--success);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 0.5rem;
}

.sync-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

.hidden {
  display: none;
}
