/* ══════════════════════════════════════════════
   HR Dashboard — Notifications & Channels Page
   ══════════════════════════════════════════════ */

/* ── Page Header ── */
.ntf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.ntf-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

/* ── Tab Navigation ── */
.ntf-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.ntf-tab {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ntf-tab:hover {
  color: #1e293b;
  background: rgba(255,255,255,0.5);
}

.ntf-tab--active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ntf-tab__icon {
  font-size: 1.05rem;
}

/* ── Tab Panels ── */
.ntf-panel {
  display: none;
}

.ntf-panel--active {
  display: block;
}

/* ── Section Cards ── */
.ntf-section {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 2px 12px rgba(0,0,0,0.03);
  margin-bottom: 20px;
  overflow: hidden;
}

.ntf-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9;
}

.ntf-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ntf-section__title-icon {
  font-size: 1.2rem;
}

.ntf-section__body {
  padding: 20px 22px;
}

/* ── Channel Cards ── */
.ntf-channels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.ntf-channel {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  position: relative;
}

.ntf-channel:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ntf-channel--connected {
  border-color: #22c55e;
  background: #f0fdf4;
}

.ntf-channel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ntf-channel__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.ntf-channel__icon--email { background: #ede9fe; }
.ntf-channel__icon--telegram { background: #dbeafe; }
.ntf-channel__icon--whatsapp { background: #dcfce7; }
.ntf-channel__icon--calendar { background: #fef3c7; }
.ntf-channel__icon--slack { background: #fce7f3; }
.ntf-channel__icon--webhook { background: #f1f5f9; }

.ntf-channel__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ntf-channel__status--active {
  background: #dcfce7;
  color: #16a34a;
}

.ntf-channel__status--inactive {
  background: #f1f5f9;
  color: #94a3b8;
}

.ntf-channel__name {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.ntf-channel__desc {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 14px;
}

.ntf-channel__actions {
  display: flex;
  gap: 8px;
}

/* ── Buttons ── */
.ntf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ntf-btn--primary {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 1px 3px rgba(59,130,246,0.3);
}

.ntf-btn--primary:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59,130,246,0.35);
}

.ntf-btn--success {
  background: #22c55e;
  color: #fff;
}

.ntf-btn--success:hover {
  background: #16a34a;
}

.ntf-btn--outline {
  background: #fff;
  color: #475569;
  border: 2px solid #e2e8f0;
}

.ntf-btn--outline:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.ntf-btn--danger {
  background: #fef2f2;
  color: #dc2626;
  border: 2px solid #fecaca;
}

.ntf-btn--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.ntf-btn--sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.ntf-btn--block {
  width: 100%;
  justify-content: center;
}

.ntf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Forms ── */
.ntf-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ntf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ntf-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ntf-field input,
.ntf-field select,
.ntf-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.ntf-field input:focus,
.ntf-field select:focus,
.ntf-field textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.ntf-field textarea {
  resize: vertical;
  min-height: 100px;
}

.ntf-field__hint {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.3;
}

.ntf-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Compose Section ── */
.ntf-compose {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ntf-compose__channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ntf-compose__channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ntf-compose__channel-chip:hover {
  border-color: #94a3b8;
}

.ntf-compose__channel-chip--selected {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}

.ntf-compose__channel-chip--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ntf-compose__recipients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ntf-recipient-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #475569;
  font-weight: 500;
}

/* ── Notification Log ── */
.ntf-log {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ntf-log-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}

.ntf-log-item:last-child {
  border-bottom: none;
}

.ntf-log-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ntf-log-item__icon--email { background: #ede9fe; }
.ntf-log-item__icon--telegram { background: #dbeafe; }
.ntf-log-item__icon--whatsapp { background: #dcfce7; }

.ntf-log-item__body {
  flex: 1;
  min-width: 0;
}

.ntf-log-item__subject {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}

.ntf-log-item__meta {
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ntf-log-item__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ntf-log-item__status--sent {
  background: #dcfce7;
  color: #16a34a;
}

.ntf-log-item__status--failed {
  background: #fee2e2;
  color: #dc2626;
}

.ntf-log-item__status--pending {
  background: #fef3c7;
  color: #d97706;
}

/* ── Calendar Section ── */
.ntf-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.ntf-cal-event {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.15s ease;
}

.ntf-cal-event:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ntf-cal-event__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.ntf-cal-event__time {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 4px;
}

.ntf-cal-event__type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ntf-cal-event__type--meeting { background: #dbeafe; color: #1d4ed8; }
.ntf-cal-event__type--reminder { background: #fef3c7; color: #d97706; }
.ntf-cal-event__type--holiday { background: #dcfce7; color: #16a34a; }
.ntf-cal-event__type--deadline { background: #fee2e2; color: #dc2626; }

/* ── Status Indicator ── */
.ntf-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.ntf-status-dot--green { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.2); }
.ntf-status-dot--red { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.2); }
.ntf-status-dot--yellow { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,0.2); }

/* ── Empty State ── */
.ntf-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 0.9rem;
}

.ntf-empty__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ── Toast / Feedback ── */
.ntf-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 22px;
  border-radius: 10px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.ntf-toast--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ntf-toast--success { background: #16a34a; }
.ntf-toast--error { background: #dc2626; }
.ntf-toast--info { background: #3b82f6; }

/* ── API Key Display ── */
.ntf-api-key {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: #475569;
}

.ntf-api-key__value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Info Box ── */
.ntf-info {
  padding: 14px 18px;
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  border-radius: 0 8px 8px 0;
  font-size: 0.84rem;
  color: #166534;
  line-height: 1.5;
  margin-top: 12px;
}

.ntf-info--blue {
  background: #eff6ff;
  border-left-color: #3b82f6;
  color: #1e40af;
}

.ntf-info--amber {
  background: #fffbeb;
  border-left-color: #f59e0b;
  color: #92400e;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .ntf-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ntf-tabs {
    width: 100%;
  }

  .ntf-channels {
    grid-template-columns: 1fr;
  }

  .ntf-field-row {
    grid-template-columns: 1fr;
  }

  .ntf-calendar-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .ntf-tab {
    padding: 8px 14px;
    font-size: 0.78rem;
  }

  .ntf-section__body {
    padding: 14px 16px;
  }

  .ntf-channel {
    padding: 14px;
  }
}
