/* ==========================================================================
   System Notifications & Alert Logs Screen
   SGB Agro Industries - Enterprise Design System
   ========================================================================== */

/* Header Bell Flyout Dropdown */
.header-notify-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.notifications-flyout {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1050;
  overflow: hidden;
  animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notifications-flyout-header {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  background: #fafaf9;
}

.flyout-unread-pill {
  font-size: 0.65rem;
  font-weight: 800;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
}

.flyout-close-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.flyout-close-btn:hover {
  color: #0f172a;
}

.notifications-flyout-body {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.4rem 0;
}

.flyout-notif-item {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f8fafc;
  display: flex;
  gap: 0.65rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.flyout-notif-item:hover {
  background: #f8fafc;
}

.flyout-notif-item.unread {
  background: #f0fdf4;
}

.flyout-notif-item.unread:hover {
  background: #ecfdf5;
}

.flyout-notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.flyout-notif-icon.shortage {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.flyout-notif-icon.damage {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.flyout-notif-icon.extra {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.flyout-notif-icon.info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.flyout-notif-content {
  flex: 1;
  min-width: 0;
}

.flyout-notif-title {
  font-size: 0.775rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.15rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flyout-notif-msg {
  font-size: 0.7rem;
  color: #64748b;
  margin: 0 0 0.25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.flyout-notif-time {
  font-size: 0.625rem;
  color: #94a3b8;
  font-weight: 600;
}

.notifications-flyout-footer {
  padding: 0.65rem 1rem;
  background: #fafaf9;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Notifications Center Full Page View (#view-notifications)
   -------------------------------------------------------------------------- */
.notifications-container {
  padding: 1rem 1.25rem 3rem 1.25rem;
}

.notif-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.notif-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.notif-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.notif-toolbar-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.notif-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 280px;
  flex-wrap: wrap;
}

.notif-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 270px;
}

.notif-search-wrap svg {
  position: absolute;
  left: 10px;
  color: #94a3b8;
  pointer-events: none;
}

.notif-search-wrap input {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem 0 2.2rem;
  font-size: 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: all 0.15s ease;
}

.notif-search-wrap input:focus {
  border-color: #059669;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.notif-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
}

.notif-filter-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.notif-filter-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.notif-filter-pill.active {
  background: #065f46 !important;
  color: #ffffff !important;
  border-color: #065f46 !important;
  box-shadow: 0 1px 3px rgba(6, 95, 70, 0.3);
}

.notif-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Notifications Interactive Data Table
   -------------------------------------------------------------------------- */
.notif-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.notif-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.notif-table th {
  background: #fafaf9;
  padding: 0.85rem 1rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.04em;
  border-bottom: 1.5px solid #e2e8f0;
}

.notif-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.notif-table tr:hover {
  background: #fafaf9;
}

.notif-table tr.unread-row {
  background: #f0fdf4;
}

.notif-table tr.unread-row:hover {
  background: #ecfdf5;
}

.notif-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.675rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.notif-type-pill.shortage {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.notif-type-pill.damage {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.notif-type-pill.extra {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.notif-type-pill.low_stock {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.notif-type-pill.info {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.notif-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.notif-status-dot.unread {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
  animation: pulseUnread 1.8s infinite;
}

.notif-status-dot.read {
  background: #10b981;
}

@keyframes pulseUnread {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}
