/* =========================================================
 * Special Discount Notification System — Styles
 * ========================================================= */

/* ---- Page Card ---- */
.sd-card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

/* ---- Page Header ---- */
.sd-page-header {
  margin-bottom: 18px;
}

.sd-page-title {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

/* ---- Controls Row ---- */
.sd-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.sd-controls-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sd-controls-right {
  display: flex;
  align-items: center;
}

/* ---- Filter Select ---- */
.sd-filter-select {
  height: 38px;
  padding: 4px 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #ffffff;
  color: #24292f;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  min-width: 180px;
  appearance: auto;
}

.sd-filter-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ---- Refresh Button ---- */
.sd-refresh-btn {
  height: 38px;
  padding: 0 16px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  color: #24292f;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.sd-refresh-btn:hover {
  background: #f6f8fa;
  border-color: #b0b8c4;
}

.sd-refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- Search ---- */
.sd-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.sd-search-icon {
  position: absolute;
  left: 10px;
  color: #8c959f;
  font-size: 13px;
  pointer-events: none;
}

.sd-search-input {
  height: 38px;
  padding: 4px 12px 4px 32px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #ffffff;
  color: #24292f;
  font-size: 13px;
  width: 240px;
  outline: none;
  transition: border-color 0.15s;
}

.sd-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ---- Table Meta Info ---- */
.sd-table-meta {
  font-size: 12px;
  color: #6e7781;
  margin-bottom: 8px;
}

/* ---- Notification Table ---- */
.sd-notification-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e8ecf0;
  border-radius: 6px;
  overflow: hidden;
  font-size: 13px;
}

.sd-notification-table thead tr {
  background-color: #5485b9;
}

.sd-notification-table thead th {
  color: #ffffff !important;
  font-weight: 600;
  padding: 11px 14px;
  border-bottom: none;
  white-space: nowrap;
}

.sd-notification-table tbody tr {
  border-bottom: 1px solid #e8ecf0;
  cursor: pointer;
  transition: background 0.12s;
}

.sd-notification-table tbody tr:last-child {
  border-bottom: none;
}

.sd-notification-table tbody tr:hover {
  background-color: #f0f5fb;
}

.sd-notification-table td {
  padding: 11px 14px;
  vertical-align: middle;
  border-right: 1px solid #e8ecf0;
  color: #24292f;
}

.sd-notification-table td:last-child {
  border-right: none;
}

/* ---- Unread / Read row styles ---- */
.sd-row-unread td {
  font-weight: 600;
  color: #1a1a2e;
}

.sd-row-read td {
  font-weight: 400;
  color: #6e7781;
}

/* ---- Column specifics ---- */
.sd-col-message-no {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sd-mail-icon {
  width: 18px;
  height: auto;
  flex-shrink: 0;
}

.sd-col-subject {
  max-width: 380px;
}

.sd-subject-link {
  color: #1a6bb5;
  text-decoration: none;
  cursor: pointer;
}

.sd-subject-link:hover {
  text-decoration: underline;
}

.sd-row-read .sd-subject-link {
  color: #5a6472;
}

/* ---- Status Badges ---- */
.sd-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.sd-status-approved {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.sd-status-rejected {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.sd-status-pending {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* ---- Loading Skeleton ---- */
.sd-loading-state {
  padding: 12px 0;
}

.sd-skeleton-row {
  height: 42px;
  background: linear-gradient(90deg, #f0f2f5 25%, #e4e8ed 50%, #f0f2f5 75%);
  background-size: 400% 100%;
  animation: sdSkeletonShimmer 1.4s ease infinite;
  border-radius: 6px;
  margin-bottom: 10px;
}

@keyframes sdSkeletonShimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- Empty State ---- */
.sd-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #8c959f;
}

.sd-empty-icon {
  font-size: 40px;
  margin-bottom: 14px;
  opacity: 0.4;
  display: block;
}

.sd-empty-text {
  font-size: 14px;
  margin: 0;
}

/* ---- Error State ---- */
.sd-error-state {
  text-align: center;
  padding: 50px 20px;
  color: #b91c1c;
}

.sd-error-icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
}

/* ---- DataTable overrides ---- */
.sd-dt-top {
  margin-bottom: 10px;
}

.sd-dt-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.dataTables_length select {
  height: 32px;
  padding: 2px 8px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 12px;
  margin: 0 4px;
}

.dataTables_paginate {
  display: flex;
  gap: 4px;
}

.dataTables_paginate .paginate_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  background: #ffffff;
  color: #24292f !important;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.dataTables_paginate .paginate_button:hover {
  background: #f6f8fa;
}

.dataTables_paginate .paginate_button.current {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #3b82f6;
}

.dataTables_paginate .paginate_button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dataTables_info {
  font-size: 12px;
  color: #6e7781;
  display: flex;
  align-items: center;
}

/* ---- Modal ---- */
.sd-modal-content {
  border: none;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* ---- Detail View ---- */
.sd-detail-wrapper {
  padding: 24px;
  position: relative;
}

.sd-detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #1a69b0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: background 0.15s, color 0.15s;
}

.sd-detail-close:hover {
  background: #f0f4ff;
  color: #154f8a;
}

.sd-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: #1a69b0;
  color: #ffffff;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  gap: 12px;
}

.sd-detail-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sd-detail-mail-icon {
  width: 28px;
  height: auto;
  flex-shrink: 0;
}

.sd-detail-dept {
  font-size: 15px;
  font-weight: 700;
}

.sd-detail-message-no {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}

.sd-detail-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.sd-detail-date {
  font-size: 12px;
  opacity: 0.85;
}

/* ---- Detail Fields ---- */
.sd-detail-fields {
  margin-bottom: 20px;
}

.sd-detail-field-row {
  margin-bottom: 14px;
}

.sd-detail-field-row-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sd-detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sd-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8c959f;
  margin: 0;
}

.sd-field-value {
  font-size: 14px;
  color: #24292f;
  font-weight: 500;
}

.sd-field-subject {
  font-size: 15px;
  font-weight: 600;
  color: #1a6bb5;
}

/* ---- Detail Message Body ---- */
.sd-detail-message-body {
  background: #f6f8fa;
  border: 1px solid #e8ecf0;
  border-radius: 8px;
  padding: 16px;
}

.sd-message-text {
  font-size: 13px;
  color: #24292f;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 8px;
}

/* ---- Detail Actions ---- */
.sd-detail-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

/* ---- Detail Error / Loading ---- */
.sd-detail-error {
  padding: 40px;
  text-align: center;
  color: #b91c1c;
  position: relative;
}

.sd-detail-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #e8ecf0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: sdSpin 0.8s linear infinite;
}

@keyframes sdSpin {
  to { transform: rotate(360deg); }
}

/* =============================================
 * Header Notification Bell — Special Discount
 * ============================================= */
.sd-notif-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.sd-notif-bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #5a6472;
  transition: background 0.15s, color 0.15s;
}

.sd-notif-bell-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #24292f;
}

.sd-notif-bell-btn svg {
  display: block;
}

.sd-notif-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #e53e3e;
  color: #ffffff;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 1px solid #ffffff;
}

/* ---- Notification Dropdown ---- */
.sd-notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  overflow: hidden;
}

.sd-notif-dropdown-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid #e8ecf0;
  font-size: 14px;
  font-weight: 700;
  color: #24292f;
}

.sd-notif-dropdown-body {
  max-height: 340px;
  overflow-y: auto;
}

.sd-notif-dropdown-loading {
  padding: 20px 16px;
  font-size: 13px;
  color: #8c959f;
  text-align: center;
}

.sd-notif-dropdown-empty {
  padding: 32px 16px;
  font-size: 13px;
  color: #8c959f;
  text-align: center;
}

/* ---- Dropdown Items ---- */
.sd-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}

.sd-notif-item:last-child {
  border-bottom: none;
}

.sd-notif-item:hover {
  background: #f6f8fa;
}

.sd-notif-item-icon {
  flex-shrink: 0;
  width: 20px;
  margin-top: 2px;
}

.sd-notif-item-body {
  flex: 1;
  min-width: 0;
}

.sd-notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #24292f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sd-notif-item.sd-notif-read .sd-notif-item-title {
  font-weight: 400;
  color: #6e7781;
}

.sd-notif-item-rezno {
  font-size: 12px;
  color: #3b82f6;
  font-weight: 500;
  margin-top: 2px;
}

.sd-notif-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.sd-notif-item-date {
  font-size: 11px;
  color: #8c959f;
}

.sd-notif-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
  margin-top: 5px;
}

.sd-notif-item.sd-notif-read .sd-notif-item-dot {
  display: none;
}

/* ---- Dropdown Footer ---- */
.sd-notif-dropdown-footer {
  padding: 10px 16px;
  border-top: 1px solid #e8ecf0;
  text-align: center;
}

.sd-notif-dropdown-footer a {
  font-size: 13px;
  color: #1a6bb5;
  font-weight: 600;
  text-decoration: none;
}

.sd-notif-dropdown-footer a:hover {
  text-decoration: underline;
}
