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

:root {
  --bg: #fafafa;
  --card: #fff;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --muted: #888;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --pending-bg: #fef3c7;
  --printed-bg: #f0fdf4;
}

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

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.badge--online {
  background: #dcfce7;
  color: #166534;
}

.badge--offline {
  background: #fee2e2;
  color: #991b1b;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

textarea:focus {
  border-color: var(--accent);
}

.char-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

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

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

.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  width: auto;
}

.job-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}

.job-card--pending {
  border-left: 3px solid #f59e0b;
}

.job-card--printed {
  border-left: 3px solid var(--success);
  opacity: 0.6;
}

.job-card__text {
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
}

.job-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.job-card__status {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.job-card__status--pending {
  color: #d97706;
}

.job-card__status--printed {
  color: var(--success);
}

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 24px 0 12px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  z-index: 1000;
  animation: toast-in 0.3s ease;
}

.toast--success {
  background: var(--success);
}

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

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 360px;
}

.modal h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.modal input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
  outline: none;
}

.modal input:focus {
  border-color: var(--accent);
}

.settings {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 24px;
}

.settings h3 {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.settings label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.settings input[type="text"] {
  width: 180px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle.active {
  background: var(--success);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle.active::after {
  transform: translateX(20px);
}
