/* ===================================================================
   EasyJobCard — custom CSS (supplements Tailwind CDN)
   =================================================================== */

/* ── Base resets ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Form helpers (used throughout templates) ─────────────────────── */
.form-label {
  display: block;
  font-size: 0.875rem;  /* text-sm */
  font-weight: 500;
  color: #374151;       /* gray-700 */
  margin-bottom: 0.25rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #111827;
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.form-input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }

.form-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #ef4444; /* red-500 */
}

/* ── Button helpers ────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: #2563EB;
  color: #ffffff;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.btn-primary:hover { background-color: #1d4ed8; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: #ffffff;
  color: #374151;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover { background-color: #f9fafb; border-color: #9ca3af; }

/* ── Sidebar nav links ─────────────────────────────────────────────── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #d1d5db; /* gray-300 */
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  background-color: #374151; /* gray-700 */
  color: #ffffff;
}

.sidebar-link.active {
  background-color: #2563EB;
  color: #ffffff;
}

/* ── Status badges ─────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-transform: uppercase;
}

.status-created {
  background-color: #f3f4f6;
  color: #4b5563;
}

.status-awaiting_signature {
  background-color: #fef3c7;
  color: #92400e;
}

.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

/* ── Flash messages ────────────────────────────────────────────────── */
.flash-success  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-warning  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.flash-info     { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.flash-error    { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Signature pad canvas ──────────────────────────────────────────── */
.signature-pad-container {
  position: relative;
  background: #fafafa;
}

.signature-pad-container canvas {
  display: block;
  cursor: crosshair;
  touch-action: none;
}

/* ── Photo upload drag-and-drop area ────────────────────────────────── */
.photo-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
}

.photo-drop-zone.drag-over,
.photo-drop-zone:hover {
  border-color: #2563EB;
  background-color: #eff6ff;
}

/* ── Photo items ────────────────────────────────────────────────────── */
.photo-item {
  position: relative;
  display: inline-block;
}

/* ── Print styles ───────────────────────────────────────────────────── */
@media print {
  aside, header, footer, nav, .btn-primary, .btn-secondary,
  button, form[method="POST"], #sidebar, #sidebar-overlay {
    display: none !important;
  }

  body { background: #fff; font-size: 12pt; }
  main { padding: 0 !important; }
  .shadow-sm, .shadow-xl { box-shadow: none !important; }
  .border { border-color: #ccc !important; }
}
