/* ==========================================
   NOTIFICATIONS — Tabs, Cards, Breakdowns
   ========================================== */

/* Tab bar */
.notif-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}
.notif-tabs::-webkit-scrollbar { display: none; }

.notif-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #aaa;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-align: center;
  position: relative;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.notif-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
}
.notif-tab.active {
  background: rgba(255, 120, 150, 0.15);
  border-color: rgba(255, 120, 150, 0.4);
  color: #fff;
}

/* Badge on tab */
.notif-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 2px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
  box-sizing: border-box;
}

/* Panels */
.notif-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  min-height: 120px;
}
.notif-panel.active {
  display: flex;
}

.notif-loading {
  text-align: center;
  color: #777;
  padding: 30px 0;
  font-size: 14px;
}

.notif-empty {
  text-align: center;
  color: #666;
  padding: 30px 0;
  font-size: 14px;
}

/* ==========================================
   Notification Cards
   ========================================== */
.notif-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: background 0.15s;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}
.notif-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Severity borders */
.notif-card--critical {
  border-left: 3px solid #e74c3c;
}
.notif-card--warning {
  border-left: 3px solid #f39c12;
}
.notif-card--success {
  border-left: 3px solid #2ecc71;
}
.notif-card--info {
  border-left: 3px solid #3498db;
}

.notif-card-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  line-height: 1;
  margin-top: 2px;
}

.notif-card-body {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.notif-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #f0e8ec;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-card-desc {
  font-size: 12px;
  color: #999;
  line-height: 1.4;
}

.notif-card-time {
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==========================================
   Progress Bar
   ========================================== */
.notif-progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.notif-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.notif-progress-fill--low { background: #e74c3c; }
.notif-progress-fill--mid { background: #f39c12; }
.notif-progress-fill--high { background: #2ecc71; }

.notif-progress-text {
  font-size: 11px;
  color: #888;
  margin-top: 3px;
}

/* ==========================================
   Report Group
   ========================================== */
.notif-group {
  margin-bottom: 6px;
}
.notif-group-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 120, 150, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 2px;
}
.notif-group-title .sop-arrow {
  transition: transform 0.2s;
}
.notif-group-title.collapsed .sop-arrow {
  transform: rotate(-90deg);
}
.sop-group-content.hidden {
  display: none;
}

/* ==========================================
   Breakdowns
   ========================================== */
.breakdown-add-btn {
  width: 100%;
  padding: 12px;
  border: 1px dashed rgba(255, 120, 150, 0.35);
  border-radius: 12px;
  background: rgba(255, 120, 150, 0.06);
  color: rgba(255, 120, 150, 0.8);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}
.breakdown-add-btn:hover {
  background: rgba(255, 120, 150, 0.12);
  border-color: rgba(255, 120, 150, 0.5);
}

.breakdown-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.breakdown-card.resolved {
  opacity: 0.5;
}

.breakdown-photo {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.breakdown-body {
  flex: 1;
  min-width: 0;
}

.breakdown-desc {
  font-size: 13px;
  color: #eee;
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: break-word;
}

.breakdown-meta {
  font-size: 11px;
  color: #777;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.breakdown-resolve-btn {
  padding: 4px 12px;
  border: 1px solid rgba(46, 204, 113, 0.4);
  border-radius: 8px;
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s;
}
.breakdown-resolve-btn:hover {
  background: rgba(46, 204, 113, 0.2);
}

.breakdown-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
.breakdown-status--open {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}
.breakdown-status--resolved {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

/* ==========================================
   Breakdown Form (Modal inline)
   ========================================== */
.breakdown-form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.breakdown-form.show {
  display: flex;
}

.breakdown-form-title {
  font-size: 14px;
  font-weight: 700;
  color: #f0e8ec;
  margin-bottom: 2px;
}

.breakdown-form label {
  font-size: 12px;
  color: #aaa;
  font-weight: 600;
}

.breakdown-form textarea {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #f0e8ec;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.breakdown-form textarea::placeholder {
  color: #666;
}

.breakdown-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #f0e8ec;
  font-size: 13px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.breakdown-photo-upload {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breakdown-photo-upload-btn {
  padding: 8px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #bbb;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.breakdown-photo-upload-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.breakdown-photo-preview {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  display: none;
}
.breakdown-photo-preview.has-photo {
  display: block;
}

.breakdown-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.breakdown-submit-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 120, 150, 0.3);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.breakdown-submit-btn:hover {
  background: rgba(255, 120, 150, 0.45);
}
.breakdown-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.breakdown-cancel-btn {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: transparent;
  color: #aaa;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.breakdown-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ==========================================
   Photo fullscreen preview
   ========================================== */
.breakdown-photo-zoom {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.breakdown-photo-zoom img {
  max-width: 92%;
  max-height: 92%;
  border-radius: 8px;
  object-fit: contain;
}

/* ==========================================
   Schedule / Photo status list
   ========================================== */
.notif-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}
.notif-status-row + .notif-status-row {
  margin-top: 4px;
}

.notif-status-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.notif-status-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-status-value {
  font-size: 12px;
  font-weight: 600;
  color: #999;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Summary counters at top */
.notif-summary {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.notif-summary-item {
  flex: 1;
  min-width: 80px;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}
.notif-summary-number {
  font-size: 22px;
  font-weight: 700;
  color: #f0e8ec;
  line-height: 1;
}
.notif-summary-label {
  font-size: 11px;
  color: #777;
  margin-top: 4px;
}

/* ==========================================
   Chat Messages
   ========================================== */
.chat-section {
  margin-bottom: 14px;
}

.chat-section-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 120, 150, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 2px;
}

.chat-msg {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: background 0.15s;
  position: relative;
}
.chat-msg:hover {
  background: rgba(255, 255, 255, 0.07);
}
.chat-msg--pinned {
  border-left: 3px solid rgba(255, 180, 50, 0.6);
  background: rgba(255, 180, 50, 0.04);
}
.chat-msg--pinned:hover {
  background: rgba(255, 180, 50, 0.08);
}

.chat-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.chat-msg-author {
  font-size: 13px;
  font-weight: 700;
  color: #e0d6da;
}

.chat-msg-time {
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
}

.chat-msg-text {
  font-size: 13px;
  color: #ccc;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg-source {
  font-size: 11px;
  color: #777;
  margin-top: 4px;
  font-style: italic;
}

.chat-msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  justify-content: flex-end;
}

.chat-pin-btn,
.chat-delete-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.chat-pin-btn:hover {
  background: rgba(255, 180, 50, 0.15);
  border-color: rgba(255, 180, 50, 0.3);
}
.chat-delete-btn:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.3);
}
