/* MOMENT COFFEE — small custom polish on top of Tailwind */

html, body { -webkit-tap-highlight-color: transparent; }

/* Nice scrollbar for tables on desktop */
.scroll-x { overflow-x: auto; }
.scroll-x::-webkit-scrollbar { height: 8px; }
.scroll-x::-webkit-scrollbar-thumb { background: #ddd4c7; border-radius: 8px; }

/* Table base */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl thead th {
  text-align: left;
  font-weight: 600;
  color: #5e4f3a;
  background: #f8f6f3;
  padding: 10px 12px;
  border-bottom: 1px solid #efebe5;
  position: sticky;
  top: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.tbl tbody td {
  padding: 12px;
  border-bottom: 1px solid #efebe5;
  vertical-align: middle;
}
.tbl tbody tr:hover { background: #fffaf2; }
.tbl tbody tr.is-low { background: #fef2f2; }
.tbl tbody tr.is-low:hover { background: #fee2e2; }

/* Pill / badge */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: #efebe5; color: #43382a;
}
.pill.pill-low { background: #fee2e2; color: #991b1b; }
.pill.pill-warn { background: #fef3c7; color: #92400e; }
.pill.pill-ok { background: #dcfce7; color: #166534; }
.pill.pill-info { background: #dbeafe; color: #1e40af; }

/* Card */
.card { background: #fff; border-radius: 16px; box-shadow: 0 1px 2px rgba(28,20,13,.04), 0 4px 14px rgba(28,20,13,.06); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: all .15s ease; }
.btn-primary { background: #1c140d; color: #f8b75b; }
.btn-primary:hover { background: #2a2218; }
.btn-secondary { background: #efebe5; color: #1c140d; }
.btn-secondary:hover { background: #ddd4c7; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: #43382a; }
.btn-ghost:hover { background: #efebe5; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Form controls */
.input, .select, .textarea {
  width: 100%; border: 1px solid #ddd4c7; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; background: #fff; outline: none;
  transition: border .15s, box-shadow .15s;
}
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: #f29e36; box-shadow: 0 0 0 3px #feeacb; }
.label { font-size: 12px; font-weight: 600; color: #43382a; display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }
.hint { font-size: 11px; color: #7d6a4f; margin-top: 4px; }

/* Nav items */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; color: #43382a; font-weight: 500;
}
.nav-item:hover { background: #f8f6f3; }
.nav-item.active { background: #1c140d; color: #f8b75b; }
.nav-item .ic { width: 18px; height: 18px; flex-shrink: 0; }

/* Bottom tabs */
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 7px 4px; color: #7d6a4f;
}
.tab.active { color: #b06515; }
.tab svg { width: 22px; height: 22px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(28,20,13,.5); z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; } }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(28,20,13,.25);
  animation: modalIn .18s ease-out;
}
@keyframes modalIn { from { transform: translateY(20px); opacity: 0 } to { transform: none; opacity: 1 } }

/* Toast */
.toast {
  background: #1c140d; color: #fff; padding: 10px 14px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
  animation: toastIn .18s ease-out;
}
.toast.toast-ok { background: #0f9d58; }
.toast.toast-err { background: #dc2626; }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0 } to { transform: none; opacity: 1 } }

/* Empty state */
.empty {
  padding: 40px 16px; text-align: center; color: #7d6a4f;
}

/* Print: clean reports */
@media print {
  header, aside, #bottom-tabs, #modal-host, #toast-host, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ddd4c7; }
}
