/* Custom styling for Baby Care Stock Inventory - Original Warm Teal Theme */

:root {
  --primary-teal: #0d9488;
  --primary-teal-dark: #0f766e;
}

body {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: #f8fafc;
}

/* Hide scrollbar for clean horizontal scrolls */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Tab active state */
.tab-btn.active {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 600;
}

/* Modal Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Monthly Matrix 31-Day Table Styling */
#monthly-matrix-table {
  border-collapse: separate;
  border-spacing: 0;
}

#monthly-matrix-table th, 
#monthly-matrix-table td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 6px 8px;
  white-space: nowrap;
}

/* Sticky first and second columns for seamless 31-day horizontal scroll */
#monthly-matrix-table .col-sticky-1 {
  position: sticky;
  left: 0;
  z-index: 20;
  background-color: #f8fafc;
  min-width: 170px;
  max-width: 220px;
  text-align: left;
  border-right: 2px solid #cbd5e1;
}

#monthly-matrix-table .col-sticky-2 {
  position: sticky;
  left: 170px;
  z-index: 19;
  background-color: #f8fafc;
  min-width: 140px;
  text-align: left;
  border-right: 2px solid #cbd5e1;
}

#monthly-matrix-table thead .col-sticky-1,
#monthly-matrix-table thead .col-sticky-2 {
  z-index: 25;
  background-color: #f1f5f9;
}

#monthly-matrix-table th {
  background-color: #f1f5f9;
  font-weight: 600;
  color: #334155;
  position: sticky;
  top: 0;
  z-index: 10;
}

#monthly-matrix-table td.day-cell {
  min-width: 38px;
  max-width: 45px;
  font-family: 'Sarabun', monospace, sans-serif;
  font-size: 11px;
}

/* Row types for the 4 metrics */
.matrix-row-bf {
  background-color: #ffffff;
  color: #475569;
}

.matrix-row-in {
  background-color: #f0fdf4;
  color: #15803d;
  font-weight: 500;
}

.matrix-row-out {
  background-color: #fffbeb;
  color: #b45309;
  font-weight: 500;
}

/* Original Warm Teal highlight for 4. Balance */
.matrix-row-bal {
  background-color: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
}

/* Highlight today's column */
.today-col-header {
  background-color: #fef08a !important;
  color: #854d0e !important;
  border-left: 2px solid #eab308 !important;
  border-right: 2px solid #eab308 !important;
}

.today-col-cell {
  background-color: #fef9c3 !important;
  border-left: 2px solid #eab308 !important;
  border-right: 2px solid #eab308 !important;
}

/* Toast styling */
.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  animation: slideIn 0.25s ease-out forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Print view optimization */
@media print {
  header, nav, #low-stock-alert-banner, button, .no-print {
    display: none !important;
  }
  body {
    background: white !important;
    padding: 0 !important;
  }
  #tab-monthly {
    display: block !important;
  }
  .tab-content:not(#tab-monthly) {
    display: none !important;
  }
  #monthly-matrix-table {
    font-size: 8pt !important;
  }
  #monthly-matrix-table td, #monthly-matrix-table th {
    padding: 2px 4px !important;
  }
}

/* Role Visibility Control */
body.role-user .admin-only {
  display: none !important;
}

body.role-admin .user-only {
  display: none !important;
}
