/* =====================================================
   NOTIFICATIONS DIALOG — BIZMETRY DESIGN SYSTEM
   Aligned with clients-tab.css design tokens & patterns
   Popup detail styles → NotificationDetailDialog.css
   ===================================================== */

/* ── Design Tokens ─────────────────────────────────── */
:root {
  --notif-gradient:  linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --notif-color:     #667eea;
  --notif-shadow-sm: 0 2px 6px rgba(102, 126, 234, 0.2);
  --notif-shadow-md: 0 3px 12px rgba(102, 126, 234, 0.4);
  --notif-border:    2px solid #e0e0e0;
  --notif-h-ctrl:    40px;
  --notif-ease:      all 0.2s ease;
  --notif-radius:    8px;
}

/* =====================================================
   DIALOG SHELL
   ===================================================== */

.notifications-dialog {
  width: 98%;
  max-width: 1800px;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =====================================================
   TOOLBAR
   ===================================================== */

.notifications-toolbar {
  background: var(--notif-gradient) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  min-height: 72px !important;
  flex-shrink: 0 !important;
}

.notifications-dialog .notifications-toolbar .md-toolbar-tools {
  padding: 0 16px 0 8px !important;
  min-height: 72px;
  display: flex !important;
  align-items: center !important;
  gap: 16px;
}

.notifications-toolbar .md-toolbar-tools > span[flex] {
  flex: 1 !important;
  min-width: 20px;
}

.notifications-toolbar .md-icon-button {
  margin-left: 16px !important;
  margin-right: 0 !important;
  flex-shrink: 0;
}

.notifications-toolbar .md-icon-button md-icon {
  color: white !important;
}

.notifications-icon {
  color: white !important;
  font-size: 32px !important;
  width: 32px !important;
  height: 32px !important;
  flex-shrink: 0;
}

.notifications-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
}

.notifications-header-info h2 {
  font-size: 20px;
  font-weight: 600;
  color: white;
  margin: 0;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

/* =====================================================
   DIALOG CONTENT
   ===================================================== */

.notifications-dialog-content {
  flex: 1;
  overflow: hidden;
  padding: 0 !important;
  background: #fafafa;
  display: flex;
  flex-direction: column;
}

/* =====================================================
   STICKY CONTROLS
   ===================================================== */

.notifications-controls-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: #fafafa;
  flex-shrink: 0;
}

/* =====================================================
   ACTIONS BAR
   ===================================================== */

.notif-fixed-actions {
  background: white;
  padding: 12px 20px;
  border-bottom: var(--notif-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  flex-wrap: wrap;
}

.notif-fixed-left,
.notif-fixed-middle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-fixed-right {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}

.notif-inline-pagination {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.notif-separator {
  width: 1px;
  height: 40px;
  background-color: #e0e0e0;
  align-self: flex-end;
  margin-bottom: 2px;
  flex-shrink: 0;
}

/* ─── Input containers ──────────────────────────────── */

.notif-ctrl-container {
  margin: 0 !important;
  padding: 0 !important;
  min-width: 130px;
}

.notif-ctrl-wide     { min-width: 160px; }
.notif-ctrl-pagesize { min-width: 80px; max-width: 80px; }

.notif-ctrl-container > label {
  position: static !important;
  font-size: 12px !important;
  color: #666 !important;
  font-weight: 500 !important;
  margin-bottom: 4px !important;
  transform: none !important;
  display: block !important;
  pointer-events: none;
}

.notif-ctrl-disabled > label    { color: #bdbdbd !important; }
.notif-ctrl-disabled .notif-select { opacity: 0.5; }

.notif-ctrl-container .md-errors-spacer {
  display: none !important;
  min-height: 0 !important;
}

/* ─── Select control ────────────────────────────────── */

.notif-select {
  height: var(--notif-h-ctrl) !important;
  min-height: var(--notif-h-ctrl) !important;
  line-height: var(--notif-h-ctrl) !important;
  padding: 0 12px !important;
  font-size: 14px !important;
  border: var(--notif-border) !important;
  border-radius: var(--notif-radius) !important;
  background: white !important;
  transition: var(--notif-ease) !important;
  margin: 0 !important;
}

.notif-select:focus {
  outline: none !important;
  border-color: var(--notif-color) !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.notif-select .md-select-value {
  height: var(--notif-h-ctrl) !important;
  min-height: var(--notif-h-ctrl) !important;
  line-height: var(--notif-h-ctrl) !important;
  padding: 0 !important;
  font-size: 14px !important;
  border: none !important;
  color: #424242 !important;
}

.notif-select .md-select-value span,
.notif-select .md-select-value .md-text       { color: #424242 !important; opacity: 1 !important; }
.notif-select .md-select-value .md-select-placeholder { color: #9e9e9e !important; }
.notif-select .md-select-icon                  { color: #757575 !important; }
.notif-select[disabled] .md-select-value       { color: #bdbdbd !important; }

.notif-ctrl-pagesize .notif-select .md-select-value {
  padding-right: 20px !important;
}

/* ─── Action buttons ────────────────────────────────── */

.notif-btn-apply,
.notif-btn-clear {
  height: var(--notif-h-ctrl) !important;
  min-height: var(--notif-h-ctrl) !important;
  border-radius: 20px !important;
  padding: 0 18px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  transition: var(--notif-ease) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.notif-btn-apply md-icon,
.notif-btn-clear md-icon {
  font-size: 18px !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  color: inherit !important;
}

.notif-btn-apply {
  background: var(--notif-gradient) !important;
  color: white !important;
  box-shadow: var(--notif-shadow-sm) !important;
}

.notif-btn-apply:not([disabled]):hover {
  box-shadow: var(--notif-shadow-md) !important;
  transform: translateY(-1px) !important;
}

.notif-btn-clear {
  background: #ff9800 !important;
  color: white !important;
  box-shadow: 0 2px 6px rgba(255, 152, 0, 0.25) !important;
}

.notif-btn-clear:not([disabled]):hover {
  box-shadow: 0 4px 14px rgba(255, 152, 0, 0.4) !important;
  transform: translateY(-1px) !important;
}

.notif-btn-apply[disabled],
.notif-btn-clear[disabled] {
  opacity: 0.45 !important;
  background: #e0e0e0 !important;
  color: #9e9e9e !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: not-allowed !important;
}

/* =====================================================
   SUMMARY ROW
   ===================================================== */

.notif-summary-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  background: white;
  border-bottom: var(--notif-border);
  min-height: 48px;
}

.notif-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.notif-summary-badge md-icon {
  font-size: 14px !important;
  width: 14px !important;
  height: 14px !important;
  color: inherit !important;
}

.notif-summary-primary { background-color: #e3f2fd; color: #1565c0; }
.notif-summary-queued  { background-color: #fff3e0; color: #e65100; }
.notif-summary-sent    { background-color: #e8f5e9; color: #2e7d32; }
.notif-summary-failed  { background-color: #ffebee; color: #c62828; }

/* Active object filter chip */
.notif-chip-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.notif-chip-label {
  font-size: 11px;
  color: #9e9e9e;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.notif-object-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #5e35b1;
  transition: var(--notif-ease);
}

.notif-object-filter-chip md-icon {
  font-size: 14px !important;
  width: 14px !important;
  height: 14px !important;
  color: #764ba2 !important;
  flex-shrink: 0;
}

.notif-object-filter-chip > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.notif-chip-clear-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  padding: 0 !important;
  margin: 0 0 0 2px !important;
  border-radius: 50% !important;
  background: rgba(118, 75, 162, 0.15) !important;
  flex-shrink: 0;
}

.notif-chip-clear-btn md-icon {
  font-size: 13px !important;
  width: 13px !important;
  height: 13px !important;
  color: #764ba2 !important;
}

.notif-chip-clear-btn:hover {
  background: rgba(118, 75, 162, 0.28) !important;
}

/* =====================================================
   SCROLLABLE CONTENT
   ===================================================== */

.notifications-scrollable-content {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 20px 20px 48px;
}

.notifications-scrollable-content::-webkit-scrollbar       { width: 8px; }
.notifications-scrollable-content::-webkit-scrollbar-track { background: #f5f5f5; border-radius: 4px; }
.notifications-scrollable-content::-webkit-scrollbar-thumb { background: #bdbdbd; border-radius: 4px; }
.notifications-scrollable-content::-webkit-scrollbar-thumb:hover { background: #9e9e9e; }

/* =====================================================
   STATE WRAPPERS (loading / empty)
   ===================================================== */

.notif-state-wrapper {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.notif-empty-card {
  background: #fafbfc;
  border: 2px dashed #cfcfcf;
  border-radius: 14px;
  padding: 48px 36px;
  max-width: 520px;
  text-align: center;
  transition: var(--notif-ease);
}

.notif-empty-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.notif-empty-icon-wrap {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-radius: 50%;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  animation: pulse-icon 2s ease-in-out infinite;
}

.notif-empty-icon-wrap md-icon {
  font-size: 52px !important;
  width: 52px !important;
  height: 52px !important;
  color: #1976d2 !important;
}

.notif-empty-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin: 0 0 14px;
}

.notif-empty-text {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

/* =====================================================
   TABLE
   ===================================================== */

.notif-table-wrapper {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.notif-table-scroll {
  overflow-y: auto;
  overflow-x: auto;
  max-height: calc(85vh - 310px);
}

.notif-table-scroll::-webkit-scrollbar        { width: 6px; height: 6px; }
.notif-table-scroll::-webkit-scrollbar-track  { background: #f5f5f5; border-radius: 3px; }
.notif-table-scroll::-webkit-scrollbar-thumb  { background: #bdbdbd; border-radius: 3px; }
.notif-table-scroll::-webkit-scrollbar-thumb:hover { background: #9e9e9e; }

.notifications-table {
  width: 100%;
  min-width: 1300px;
  border-collapse: collapse;
  font-size: 14px;
}

.notifications-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.notifications-table th {
  padding: 0 16px;
  height: 40px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--notif-color);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
  border-bottom: 2px solid #e8ecff;
  white-space: nowrap;
}

.notifications-table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
}

.notification-row {
  cursor: pointer;
  background: white;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.notification-row:hover {
  background: #fafbff !important;
  box-shadow: inset 0 0 0 1px #e4e8ff;
}

.notification-row:last-child td {
  border-bottom: none;
}

/* Table cell helpers */
.notif-id-badge {
  background: rgba(102, 126, 234, 0.1);
  color: var(--notif-color);
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.notifications-dialog .notifications-table td .notif-user-cell {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px;
  min-width: 0;
  height: 100%;
}

.notifications-dialog .notifications-table td .notif-user-cell md-icon {
  font-size: 16px !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  line-height: 16px !important;
  color: #bdbdbd !important;
  flex: 0 0 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: middle !important;
  overflow: hidden !important;
}

.notifications-dialog .notifications-table td .notif-user-cell span {
  font-size: 13px;
  color: #424242;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
  line-height: 16px;
  vertical-align: middle;
  display: block;
}

.notif-ts {
  font-size: 12px;
  font-family: 'Monaco', 'Courier New', monospace;
  color: #757575;
  white-space: nowrap;
}

.notif-obj-name {
  font-size: 13px;
  color: #616161;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  max-width: 150px;
}

.notif-subject-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-subject-cell > span {
  font-size: 13px;
  color: #424242;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
}

.notif-subject-cell > md-icon {
  font-size: 16px !important;
  color: #bdbdbd !important;
  flex-shrink: 0;
  margin-left: auto;
}

/* =====================================================
   PAGINATION
   ===================================================== */

.notif-pagination-btn {
  width: var(--notif-h-ctrl) !important;
  height: var(--notif-h-ctrl) !important;
  min-width: var(--notif-h-ctrl) !important;
  min-height: var(--notif-h-ctrl) !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: var(--notif-radius) !important;
  border: var(--notif-border) !important;
  background: white !important;
  transition: var(--notif-ease) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.notif-pagination-btn:not([disabled]) {
  background: var(--notif-gradient) !important;
  border-color: transparent !important;
  box-shadow: var(--notif-shadow-sm) !important;
}

.notif-pagination-btn:not([disabled]):hover {
  box-shadow: var(--notif-shadow-md) !important;
  transform: translateY(-1px) scale(1.05);
}

.notif-pagination-btn[disabled] {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  background: #f5f5f5 !important;
}

.notif-pagination-btn md-icon {
  font-size: 24px !important;
  width: 24px !important;
  height: 24px !important;
  line-height: 24px !important;
  margin: 0 !important;
}

.notif-pagination-btn:not([disabled]) md-icon { color: white !important; }
.notif-pagination-btn[disabled] md-icon        { color: #bdbdbd !important; }

.notif-pagination-badge {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  background: #f8f9fa;
  border: var(--notif-border);
  border-radius: var(--notif-radius);
  height: var(--notif-h-ctrl);
  min-width: 130px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes pulse-icon {
  0%, 100% { transform: scale(1);    opacity: 0.8; }
  50%       { transform: scale(1.05); opacity: 1;   }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1400px) {
  .notifications-dialog {
    width: 98vw;
    max-width: 98vw;
  }
}

@media (max-width: 768px) {
  .notifications-dialog {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
  }

  .notif-fixed-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .notif-fixed-left,
  .notif-fixed-middle,
  .notif-fixed-right {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .notif-separator { display: none; }

  .notifications-table th,
  .notifications-table td {
    padding: 10px 12px;
    font-size: 12px;
  }
}