/* ============================================================
   UZHAVA - App Stylesheet
   Tailwind handles most styles; this covers custom overrides
   ============================================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Page transitions ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.25s ease both; }

@keyframes slideIn {
  from { transform: translateX(-10px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
.animate-slide-in { animation: slideIn 0.2s ease both; }

/* ── Card ── */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  padding: 1.25rem;
}
.card-header {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #f3f4f6;
}

/* ── Stat card ── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: #111827; line-height: 1; }
.stat-card .stat-label { font-size: 0.78rem; color: #6b7280; margin-top: 2px; }
.stat-card .stat-change { font-size: 0.75rem; margin-top: 4px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary   { background: #16a34a; color: #fff; }
.btn-primary:hover   { background: #15803d; }

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

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

.btn-outline   { background: transparent; color: #16a34a; border: 1.5px solid #16a34a; }
.btn-outline:hover   { background: #f0fdf4; }

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ── Form Controls ── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.3rem;
}
.form-label .required { color: #dc2626; margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  color: #111827;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-control:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.form-control::placeholder { color: #9ca3af; }
.form-control.error { border-color: #dc2626; }
.form-error { font-size: 0.78rem; color: #dc2626; margin-top: 0.25rem; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: 10px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.data-table thead th {
  background: #f9fafb;
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e7eb;
}
.data-table tbody tr { border-bottom: 1px solid #f3f4f6; transition: background 0.1s; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table tbody td { padding: 0.7rem 1rem; color: #374151; vertical-align: middle; }
.data-table tbody tr:last-child { border-bottom: none; }

/* ── Badge / Status ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Progress Bar ── */
.progress-bar-wrap { background: #e5e7eb; border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: #16a34a; transition: width 0.4s ease; }

/* ── Task Item ── */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.task-item:hover { border-color: #bbf7d0; box-shadow: 0 2px 8px rgba(22,163,74,.08); }
.task-item.done { background: #f0fdf4; border-color: #bbf7d0; }
.task-item.done .task-title { text-decoration: line-through; color: #9ca3af; }
.task-checkbox {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  flex-shrink: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.15s;
}
.task-checkbox:checked {
  background: #16a34a;
  border-color: #16a34a;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
}

/* ── Alert ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ── Timeline ── */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0; bottom: 0;
  width: 2px;
  background: #e5e7eb;
}
.timeline-item { display: flex; gap: 1rem; margin-bottom: 1rem; position: relative; }
.timeline-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e5e7eb;
  z-index: 1;
  background: #fff;
}
.timeline-content { flex: 1; padding-top: 4px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: fadeIn 0.2s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}
.modal-body    { padding: 1.25rem; }
.modal-footer  { padding: 1rem 1.25rem; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}
.empty-state .empty-icon  { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state .empty-title { font-size: 1rem; font-weight: 600; color: #6b7280; margin-bottom: 0.25rem; }
.empty-state .empty-desc  { font-size: 0.875rem; }

/* ── Print ── */
@media print {
  aside, header, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #e5e7eb; }
}
