/**
 * Paikmal Status Module - Enhanced UI/UX Styles
 * Modern, polished design with smooth animations and transitions
 */

/* ===== CSS Custom Properties ===== */
:root {
  --status-primary: #0f766e;
  --status-primary-light: #14b8a6;
  --status-primary-dark: #0d5d56;
  --status-gradient: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  --status-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --status-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --status-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --status-radius: 12px;
  --status-radius-lg: 16px;
  --status-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --status-transition-fast: all 0.15s ease;
}

/* ===== Hero Section ===== */
.status-hero {
  background: var(--status-gradient);
  padding: 70px 0 50px;
  color: #fff;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.status-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.4;
}

.status-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, rgba(0,0,0,0.1), transparent);
  pointer-events: none;
}

.status-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.status-hero .lead {
  font-size: 1.1rem;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

/* ===== Search Box ===== */
.status-search-box {
  background: var(--card-bg, #fff);
  padding: 24px;
  border-radius: var(--status-radius-lg);
  box-shadow: var(--status-shadow-lg);
  max-width: 950px;
  margin: 40px auto 0;
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.1);
}

.status-search-box .form-control,
.status-search-box .form-select {
  border-radius: 10px;
  border: 2px solid var(--card-border, #e2e8f0);
  padding: 12px 16px;
  font-size: 14px;
  transition: var(--status-transition);
}

.status-search-box .form-control:focus,
.status-search-box .form-select:focus {
  border-color: var(--status-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.status-search-box .input-group-text {
  border-radius: 10px 0 0 10px;
  border: 2px solid var(--card-border, #e2e8f0);
  border-right: none;
  background: var(--card-bg, #fff);
}

.status-search-box .form-control {
  border-left: none;
  border-radius: 0 10px 10px 0;
}

/* ===== Summary Dashboard ===== */
.status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.status-summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: var(--status-transition);
  cursor: pointer;
  border: 2px solid transparent;
  backdrop-filter: blur(10px);
}

.status-summary-item:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.status-summary-item.active {
  background: #fff;
  color: var(--status-primary);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.status-summary-count {
  background: rgba(0,0,0,0.2);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.status-summary-item.active .status-summary-count {
  background: var(--status-primary);
  color: #fff;
}

/* ===== Status Cards ===== */
.status-card {
  background: var(--card-bg, #fff);
  border-radius: var(--status-radius);
  overflow: hidden;
  box-shadow: var(--status-shadow-sm);
  transition: var(--status-transition);
  border: 1px solid var(--card-border, #e2e8f0);
  margin-bottom: 16px;
  position: relative;
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--status-primary);
  opacity: 0;
  transition: var(--status-transition);
}

.status-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--status-shadow);
}

.status-card:hover::before {
  opacity: 1;
}

.status-card-header {
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--card-border, #e2e8f0);
  background: linear-gradient(to bottom, var(--card-bg, #fff), rgba(248, 250, 252, 0.5));
}

.status-card-body {
  padding: 22px;
}

.status-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--body-color, #1e293b);
  margin-bottom: 10px;
  line-height: 1.4;
}

.status-card-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--status-transition-fast);
}

.status-card-title a:hover {
  color: var(--status-primary);
}

.status-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted-color, #64748b);
  margin-bottom: 14px;
}

.status-card-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-card-meta-item i {
  font-size: 14px;
  color: var(--status-primary);
}

.status-card-description {
  color: var(--body-color, #475569);
  font-size: 14px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.status-card-footer {
  padding: 14px 22px;
  background: var(--table-stripe-bg, #f8fafc);
  border-top: 1px solid var(--card-border, #e2e8f0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted-color, #94a3b8);
}

/* ===== Status Type Badges ===== */
.status-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid currentColor;
  transition: var(--status-transition);
}

.status-type-badge .bi {
  font-size: 14px;
}

.status-type-badge.operational {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

.status-type-badge.disrupted {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.status-type-badge.under_maintenance {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.status-type-badge.planned_outage {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  border-color: rgba(139, 92, 246, 0.3);
}

.status-type-badge.under_construction {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

.status-type-badge.not_available {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border-color: rgba(107, 114, 128, 0.3);
}

/* Animated status indicator */
.status-type-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* ===== Area Tags ===== */
.area-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.area-tag {
  font-size: 11px;
  padding: 4px 10px;
  background: var(--table-stripe-bg, #f1f5f9);
  border-radius: 12px;
  color: var(--muted-color, #64748b);
  transition: var(--status-transition-fast);
}

.area-tag:hover {
  background: var(--status-primary);
  color: #fff;
}

/* ===== Recently Updated Indicator ===== */
.recently-updated {
  color: #f59e0b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: recentPulse 2s infinite;
}

@keyframes recentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== Search Highlight ===== */
.search-highlight {
  background: linear-gradient(120deg, #fef08a 0%, #fde047 100%);
  padding: 2px 4px;
  border-radius: 3px;
}

/* ===== Filter Dropdowns ===== */
.filter-dropdown {
  position: relative;
}

.filter-dropdown .dropdown-menu {
  z-index: 1050;
  border: none;
  box-shadow: var(--status-shadow-lg);
  border-radius: var(--status-radius);
  padding: 8px;
  min-width: 220px;
  animation: dropdownSlide 0.2s ease;
}

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

.filter-dropdown .dropdown-item {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  transition: var(--status-transition-fast);
}

.filter-dropdown .dropdown-item:hover {
  background: rgba(15, 118, 110, 0.1);
  color: var(--status-primary);
}

.filter-dropdown .dropdown-item.active {
  background: var(--status-primary);
  color: #fff;
}

/* ===== Pagination ===== */
.pagination {
  gap: 6px;
}

.pagination .page-link {
  border: none;
  border-radius: 10px;
  color: var(--body-color, #1e293b);
  font-weight: 600;
  padding: 10px 16px;
  background: var(--card-bg, #fff);
  box-shadow: var(--status-shadow-sm);
  transition: var(--status-transition);
}

.pagination .page-link:hover {
  background: rgba(15, 118, 110, 0.1);
  color: var(--status-primary);
  transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
  background: var(--status-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.pagination .page-item.disabled .page-link {
  background: var(--table-stripe-bg, #f8fafc);
  color: var(--muted-color, #94a3b8);
  box-shadow: none;
}

/* ===== Buttons ===== */
.btn-primary {
  background: var(--status-gradient);
  border: none;
  padding: 10px 20px;
  font-weight: 600;
  border-radius: 10px;
  transition: var(--status-transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
  background: linear-gradient(135deg, #0d5d56 0%, #0f766e 100%);
}

.btn-outline-primary {
  border: 2px solid var(--status-primary);
  color: var(--status-primary);
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 18px;
  transition: var(--status-transition);
}

.btn-outline-primary:hover {
  background: var(--status-primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ===== Loading States ===== */
.skeleton-loader {
  background: linear-gradient(90deg, var(--table-stripe-bg, #f1f5f9) 25%, var(--card-bg, #fff) 50%, var(--table-stripe-bg, #f1f5f9) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 200px;
  margin-bottom: 16px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 60%;
}

/* ===== Toast Notifications ===== */
.toast-container {
  z-index: 10000 !important;
}

.toast {
  border-radius: 12px;
  box-shadow: var(--status-shadow-lg);
  animation: toastSlide 0.3s ease;
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-body {
  font-weight: 500;
}

/* ===== Modal Enhancements ===== */
.modal-content {
  border: none;
  border-radius: var(--status-radius-lg);
  box-shadow: var(--status-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--card-border, #e2e8f0);
  padding: 20px 24px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--card-border, #e2e8f0);
  padding: 16px 24px;
}

/* ===== Detail Page Styles ===== */
.status-detail-hero {
  background: var(--status-gradient);
  padding: 60px 0;
  color: #fff;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.status-detail-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

.status-type-badge-lg {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
}

.status-type-badge-lg .bi {
  font-size: 20px;
}

/* ===== Countdown Timer ===== */
.countdown-container {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--status-radius-lg);
  padding: 24px 32px;
  margin-top: 24px;
  border: 1px solid rgba(255,255,255,0.2);
}

.countdown-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.9;
  margin-bottom: 12px;
}

.countdown-timer {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.countdown-unit {
  text-align: center;
  min-width: 70px;
}

.countdown-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px;
  display: block;
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.countdown-unit-label {
  font-size: 11px;
  text-transform: uppercase;
  margin-top: 8px;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

/* ===== Detail Cards ===== */
.detail-card {
  background: var(--card-bg, #fff);
  border-radius: var(--status-radius-lg);
  box-shadow: var(--status-shadow);
  border: 1px solid var(--card-border, #e2e8f0);
  margin-bottom: 24px;
  overflow: hidden;
  transition: var(--status-transition);
}

.detail-card:hover {
  box-shadow: var(--status-shadow-lg);
}

.detail-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(to bottom, var(--card-bg, #fff), rgba(248, 250, 252, 0.5));
}

.detail-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--body-color, #1e293b);
}

.detail-card-header h3 i {
  color: var(--status-primary);
}

.detail-card-body {
  padding: 24px;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--status-primary), var(--card-border, #e2e8f0));
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
  transition: var(--status-transition);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:hover {
  transform: translateX(4px);
}

.timeline-marker {
  position: absolute;
  left: -28px;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--status-primary);
  border: 3px solid var(--card-bg, #fff);
  box-shadow: 0 0 0 3px var(--status-primary);
  transition: var(--status-transition);
}

.timeline-marker.created {
  background: #22c55e;
  box-shadow: 0 0 0 3px #22c55e;
}

.timeline-marker.updated {
  background: #3b82f6;
  box-shadow: 0 0 0 3px #3b82f6;
}

.timeline-marker.resolved {
  background: #10b981;
  box-shadow: 0 0 0 3px #10b981;
}

.timeline-content {
  background: var(--table-stripe-bg, #f8fafc);
  border-radius: var(--status-radius);
  padding: 18px;
  border: 1px solid var(--card-border, #e2e8f0);
  transition: var(--status-transition);
}

.timeline-item:hover .timeline-content {
  box-shadow: var(--status-shadow-sm);
}

.timeline-action {
  font-weight: 600;
  color: var(--body-color, #1e293b);
  margin-bottom: 6px;
}

.timeline-meta {
  font-size: 12px;
  color: var(--muted-color, #64748b);
  margin-bottom: 10px;
}

.timeline-changes {
  font-size: 13px;
  color: var(--body-color, #475569);
  background: var(--card-bg, #fff);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border, #e2e8f0);
}

/* ===== Attachments ===== */
.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.attachment-item {
  background: var(--table-stripe-bg, #f8fafc);
  border-radius: var(--status-radius);
  overflow: hidden;
  border: 1px solid var(--card-border, #e2e8f0);
  transition: var(--status-transition);
}

.attachment-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--status-shadow);
}

.attachment-preview {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-border, #e2e8f0);
  overflow: hidden;
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--status-transition);
}

.attachment-item:hover .attachment-preview img {
  transform: scale(1.05);
}

.attachment-preview i {
  font-size: 48px;
  color: var(--muted-color, #94a3b8);
}

.attachment-info {
  padding: 14px;
}

.attachment-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--body-color, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.attachment-download {
  font-size: 12px;
  color: var(--status-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--status-transition-fast);
}

.attachment-download:hover {
  color: var(--status-primary-dark);
  text-decoration: underline;
}

/* ===== Related Cards ===== */
.related-card {
  background: var(--card-bg, #fff);
  border-radius: var(--status-radius);
  padding: 18px;
  box-shadow: var(--status-shadow-sm);
  border: 1px solid var(--card-border, #e2e8f0);
  transition: var(--status-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--status-shadow);
  border-color: var(--status-primary);
}

.related-card-link {
  text-decoration: none;
  color: inherit;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.related-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  width: fit-content;
}

.related-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--body-color, #1e293b);
  margin-bottom: 10px;
  line-height: 1.4;
  transition: var(--status-transition-fast);
}

.related-card:hover .related-card-title {
  color: var(--status-primary);
}

.related-card-meta {
  font-size: 12px;
  color: var(--muted-color, #64748b);
  margin-top: auto;
}

/* ===== Admin Dashboard ===== */
.dashboard-stat-card {
  border-radius: var(--status-radius);
  padding: 22px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #e2e8f0);
  transition: var(--status-transition);
  position: relative;
  overflow: hidden;
}

.dashboard-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--status-gradient);
  opacity: 0;
  transition: var(--status-transition);
}

.dashboard-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--status-shadow);
}

.dashboard-stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--status-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  transition: var(--status-transition);
}

.stat-value.updated {
  animation: statPulse 0.5s ease;
}

@keyframes statPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); color: var(--status-primary); }
  100% { transform: scale(1); }
}

.stat-label {
  font-size: 13px;
  color: var(--muted-color, #64748b);
  margin-top: 6px;
}

/* ===== Quick Action Buttons ===== */
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: var(--status-radius);
  background: var(--card-bg, #fff);
  border: 2px solid var(--card-border, #e2e8f0);
  text-decoration: none;
  color: var(--body-color, #1e293b);
  transition: var(--status-transition);
}

.quick-action-btn:hover {
  background: var(--status-primary);
  color: #fff;
  border-color: var(--status-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.3);
}

.quick-action-btn i {
  font-size: 32px;
  margin-bottom: 10px;
}

.quick-action-btn span {
  font-size: 14px;
  font-weight: 600;
}

/* ===== Activity Feed ===== */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-border, #f1f5f9);
  transition: var(--status-transition);
}

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

.activity-item:hover {
  background: var(--table-stripe-bg, #f8fafc);
  margin: 0 -16px;
  padding: 14px 16px;
  border-radius: 8px;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

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

.activity-title {
  font-size: 14px;
  color: var(--body-color, #1e293b);
  margin-bottom: 4px;
}

.activity-title a {
  color: var(--body-color, #1e293b);
  text-decoration: none;
  transition: var(--status-transition-fast);
}

.activity-title a:hover {
  color: var(--status-primary);
}

.activity-meta {
  font-size: 12px;
  color: var(--muted-color, #64748b);
}

/* ===== Live Indicator ===== */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-color, #64748b);
}

.live-indicator .live-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ===== Entry Row (Admin) ===== */
.entry-row {
  display: flex;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--card-border, #f1f5f9);
  gap: 18px;
  transition: var(--status-transition);
}

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

.entry-row:hover {
  background: var(--table-stripe-bg, #f8fafc);
}

.entry-row.deleting {
  opacity: 0.5;
  pointer-events: none;
}

.entry-row.resolved {
  background: rgba(34, 197, 94, 0.05);
}

.entry-info { flex: 1; min-width: 0; }

.entry-title {
  font-weight: 600;
  color: var(--body-color, #1e293b);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.entry-meta {
  font-size: 12px;
  color: var(--muted-color, #64748b);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.entry-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.entry-meta-item i { color: var(--status-primary); }

.entry-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.entry-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn-action {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: var(--status-transition);
}

.btn-action:hover {
  transform: scale(1.1);
}

.btn-action.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-action.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .status-search-box {
  background: #1e293b;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .status-search-box input,
[data-theme="dark"] .status-search-box select,
[data-theme="dark"] .status-search-box .form-select {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}

[data-theme="dark"] .status-search-box input::placeholder,
[data-theme="dark"] .status-search-box select option {
  color: #94a3b8;
}

[data-theme="dark"] .status-search-box .input-group-text {
  background: #334155;
  border-color: #475569;
}

[data-theme="dark"] .status-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .status-card:hover {
 {}
  border-color: var(--status-primary-light, #14b8a6);
}

[data-theme="dark"] .status-card-header {
  border-bottom-color: #334155;
  background: linear-gradient(to bottom, #1e293b, #0f172a);
}

[data-theme="dark"] .status-card-title {
  color: #f1f5f9;
}

[data-theme="dark"] .status-card-title a {
  color: #f1f5f9;
}

[data-theme="dark"] .status-card-meta {
  color: #94a3b8;
}

[data-theme="dark"] .status-card-description {
  color: #cbd5e1;
}

[data-theme="dark"] .status-card-footer {
  background: #0f172a;
  border-top-color: #334155;
  color: #64748b;
}

[data-theme="dark"] .area-tag {
  background: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .area-tag:hover {
  background: var(--status-primary);
  color: #fff;
}

[data-theme="dark"] .pagination .page-link {
  background: #1e293b;
  color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

[data-theme="dark"] .pagination .page-link:hover {
  background: #334155;
  color: #2dd4bf;
}

[data-theme="dark"] .pagination .page-item.disabled .page-link {
  background: #0f172a;
  color: #475569;
}

[data-theme="dark"] .filter-dropdown .dropdown-menu {
  background: #1e293b;
  border: 1px solid #334155;
}

[data-theme="dark"] .filter-dropdown .dropdown-item {
  color: #e2e8f0;
}

[data-theme="dark"] .filter-dropdown .dropdown-item:hover {
  background: #334155;
  color: #2dd4bf;
}

[data-theme="dark"] .detail-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .detail-card-header {
  border-bottom-color: #334155;
  background: linear-gradient(to bottom, #1e293b, #0f172a);
}

[data-theme="dark"] .detail-card-header h3 {
  color: #f1f5f9;
}

[data-theme="dark"] .timeline::before {
  background: linear-gradient(to bottom, var(--status-primary), #334155);
}

[data-theme="dark"] .timeline-marker {
  border-color: #1e293b;
}

[data-theme="dark"] .timeline-content {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .timeline-action {
  color: #f1f5f9;
}

[data-theme="dark"] .timeline-changes {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .area-item {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .attachment-item {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .attachment-preview {
  background: #334155;
}

[data-theme="dark"] .attachment-info {
  background: #1e293b;
}

[data-theme="dark"] .attachment-name {
  color: #f1f5f9;
}

[data-theme="dark"] .related-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .related-card-title {
  color: #f1f5f9;
}

[data-theme="dark"] .related-card-meta {
  color: #94a3b8;
}

[data-theme="dark"] .dashboard-stat-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .quick-action-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .quick-action-btn:hover {
  background: var(--status-primary);
  border-color: var(--status-primary);
}

[data-theme="dark"] .activity-item:hover {
  background: #334155;
}

[data-theme="dark"] .entry-row:hover {
  background: #334155;
}

[data-theme="dark"] .entry-row.resolved {
  background: rgba(34, 197, 94, 0.1);
}

[data-theme="dark"] .card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .text-muted {
  color: #94a3b8 !important;
}

[data-theme="dark"] .skeleton-loader {
  background: linear-gradient(90deg, #334155 25%, #1e293b 50%, #334155 75%);
  background-size: 200% 100%;
}

/* ===== Accessibility - Focus Indicators ===== */
a:focus,
button:focus,
input:focus,
select:focus,
.form-control:focus,
.form-select:focus,
.page-link:focus,
.btn:focus {
  outline: 3px solid var(--status-primary);
  outline-offset: 2px;
}

.status-card:focus-within {
  outline: 3px solid var(--status-primary);
  outline-offset: 2px;
}

.detail-card:focus-within {
  outline: 3px solid var(--status-primary);
  outline-offset: 2px;
}

/* ===== Visually Hidden (Screen Reader Only) ===== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {
  .status-type-badge,
  .status-summary-item,
  .status-card,
  .detail-card,
  .related-card {
    border: 2px solid currentColor;
  }
  
  .status-card-title a,
  .related-card-title {
    text-decoration: underline;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .status-card,
  .status-summary-item,
  .attachment-item,
  .related-card,
  .detail-card,
  .timeline-item,
  .dashboard-stat-card,
  .quick-action-btn,
  .activity-item,
  .entry-row,
  .btn,
  .page-link {
    transition: none;
  }
  
  .status-type-badge::before,
  .recently-updated,
  .live-indicator .live-dot,
  .countdown-value {
    animation: none;
  }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
  .status-hero {
    padding: 50px 0 40px;
    margin-bottom: 20px;
  }
  
  .status-hero h1 {
    font-size: 1.75rem;
  }
  
  .status-hero .lead {
    font-size: 1rem;
  }
  
  .status-search-box {
    padding: 18px;
    margin-top: 30px;
  }
  
  .status-search-box .row {
    gap: 10px !important;
  }
  
  .status-search-box .col-md-3,
  .status-search-box .col-md-2 {
    flex: 0 0 48%;
    max-width: 48%;
  }
  
  .status-search-box .col-md-4:first-child {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .status-summary {
    gap: 8px;
  }
  
  .status-summary-item {
    padding: 10px 14px;
    font-size: 12px;
  }
  
  .status-summary-count {
    font-size: 11px;
    padding: 2px 8px;
  }
  
  .status-card {
    margin-bottom: 12px;
  }
  
  .status-card-header {
    padding: 14px 16px;
    gap: 10px;
  }
  
  .status-card-body {
    padding: 16px;
  }
  
  .status-card-title {
    font-size: 15px;
  }
  
  .status-card-meta {
    gap: 10px;
    font-size: 12px;
  }
  
  .status-card-description {
    font-size: 13px;
  }
  
  .status-card-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .status-detail-hero {
    padding: 40px 0;
    margin-bottom: 20px;
  }
  
  .status-detail-hero h1 {
    font-size: 1.5rem;
  }
  
  .countdown-timer {
    gap: 10px;
  }
  
  .countdown-value {
    font-size: 26px;
    padding: 10px;
  }
  
  .countdown-unit {
    min-width: 55px;
  }
  
  .detail-card-header {
    padding: 16px 20px;
  }
  
  .detail-card-body {
    padding: 20px;
  }
  
  .attachment-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .dashboard-stat-card {
    padding: 18px;
  }
  
  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
  
  .stat-value {
    font-size: 26px;
  }
  
  .quick-action-btn {
    padding: 18px;
  }
  
  .quick-action-btn i {
    font-size: 28px;
  }
  
  .entry-row {
    flex-wrap: wrap;
    padding: 14px;
    gap: 12px;
  }
  
  .entry-info {
    flex: 1 1 calc(100% - 44px);
  }
  
  .entry-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .status-summary-item {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
  
  .attachment-grid {
    grid-template-columns: 1fr;
  }
  
  .countdown-timer {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .countdown-unit {
    min-width: 60px;
  }
}

/* ===== Print Styles ===== */
@media print {
  .status-hero,
  .status-search-box,
  .status-summary,
  .pagination,
  .btn,
  .entry-actions,
  .activity-item button {
    display: none !important;
  }
  
  .status-card,
  .detail-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .status-card-title a,
  .related-card-title {
    color: #000 !important;
  }
  
  .status-heatmap-card {
    display: none !important;
  }
}

/* ===== Public status page: activity heatmap (GitHub-style grid) ===== */
.status-heatmap-card {
  background: var(--card-bg, #fff);
  border-radius: var(--status-radius);
  overflow: visible;
}

.status-heatmap-card .card-body {
  overflow: visible;
}

/* Heatmap fills card width: each week column is flex:1, cells share column width */
#statusPageHeatmapTabContent,
#statusPageHeatmapTabContent .tab-pane,
.activity-heatmap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.activity-heatmap {
  min-height: 0;
  overflow: visible;
}

.heatmap-body {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: flex-start;
  align-content: flex-start;
  gap: 0.4rem;
  min-width: 0;
  box-sizing: border-box;
}

.status-heatmap-card .heatmap-scroller {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px;
  max-height: none;
}

.heatmap-container {
  display: flex;
  width: 100%;
  min-width: 100%;
  min-height: 4.5rem;
  flex: 1 1 0;
  align-items: stretch;
  align-content: stretch;
  justify-content: flex-start;
  gap: 2px;
  padding: 0;
  box-sizing: border-box;
}

.heatmap-week {
  flex: 1 1 0;
  min-width: 0.25rem;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 2px;
  min-height: 4.25rem;
  height: 4.5rem;
}

.heatmap-day {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  max-width: 100%;
  min-width: 0;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: default;
  position: relative;
  box-sizing: border-box;
}

.heatmap-day.is-interactive:hover {
  transform: scale(1.15);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.heatmap-day.heat-future,
.heatmap-day.heat-pad {
  background: #eef2f6;
  border-color: #e2e8f0;
  opacity: 0.85;
}

.heatmap-day.heat-future {
  opacity: 0.45;
}

.heatmap-month-labels {
  display: flex;
  width: 100%;
  min-width: 100%;
  margin-bottom: 2px;
  font-size: 9px;
  color: var(--muted-color, #64748b);
  gap: 1px;
}

.heatmap-month-label {
  min-width: 0;
  flex: 0 0 auto;
  line-height: 1.2;
  padding: 0 1px;
}

.heatmap-dow-col {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 1.6rem;
  min-height: 0;
  align-self: stretch;
  margin-right: 2px;
}

.heatmap-dow-col-inner {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-height: 0;
  justify-content: space-between;
  height: 4.5rem;
  gap: 2px;
}

.heatmap-day-labels {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 2px;
  width: 28px;
  margin-right: 4px;
  font-size: 10px;
  color: var(--muted-color, #64748b);
}

.heatmap-day-label,
.heatmap-dow-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 0;
  flex: 1 1 0;
  line-height: 1;
  font-size: 9px;
  color: var(--muted-color, #64748b);
}

.heatmap-month-pad {
  flex: 0 0 auto;
  min-height: 0.5rem;
  line-height: 1;
}

.heatmap-wrapper {
  display: flex;
  width: 100%;
  max-width: 100%;
  align-items: flex-start;
}

.heatmap-legend .legend-item,
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px 12px;
  flex-wrap: wrap;
}

.status-heat-legend {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
  flex-shrink: 0;
  vertical-align: -0.1em;
  margin-right: 0.25rem;
}

#statusPageHeatmapTabs .nav-link {
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: var(--body-color, #64748b);
}

#statusPageHeatmapTabs .nav-link.active {
  background: var(--status-primary, #0f766e) !important;
  color: #fff !important;
}

.heatmap-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1080;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.heatmap-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}
