/**
 * policy.css - Policy Management Styles
 * @version 1.0.0
 * @date 2025-12-01
 */

/* ==================== POLICY HUB CONTAINER ==================== */

.policy-hub-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ==================== HEADER ==================== */

.policy-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.header-left h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.header-left h1 i {
  width: 32px;
  height: 32px;
  color: #667eea;
}

.subtitle {
  color: #6b7280;
  font-size: 1rem;
  margin: 0;
}

.header-right {
  display: flex;
  gap: 1rem;
}

/* ==================== KPI GRID ==================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.kpi-card-clickable {
  cursor: pointer;
  border: 2px solid transparent;
}

.kpi-card-clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
  border-color: #667eea;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.kpi-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon i {
  width: 28px;
  height: 28px;
  color: white;
}

.kpi-content {
  flex: 1;
}

.kpi-content h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.kpi-content p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 0.5rem 0;
  font-weight: 500;
}

.kpi-detail {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ==================== QUICK ACTIONS ==================== */

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.quick-action-card {
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.quick-action-card i {
  width: 40px;
  height: 40px;
  color: #667eea;
  margin-bottom: 1rem;
}

.quick-action-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.quick-action-card p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

/* ==================== CHARTS ==================== */

.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.chart-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.chart-card canvas {
  height: 250px !important;
}

/* ==================== RECENT ACTIVITY ==================== */

.recent-activity-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.recent-activity-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: #f9fafb;
  transition: background 0.2s;
}

.activity-item:hover {
  background: #f3f4f6;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon i {
  width: 20px;
  height: 20px;
  color: white;
}

.activity-content {
  flex: 1;
}

.activity-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  margin: 0;
}

.activity-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #9ca3af;
}

.activity-time i {
  width: 14px;
  height: 14px;
}

.activity-actions {
  display: flex;
  align-items: center;
}

/* ==================== EMPTY STATE ==================== */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state i {
  width: 64px;
  height: 64px;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-state p {
  color: #6b7280;
  font-size: 1rem;
  margin: 0 0 1.5rem 0;
}

/* ==================== ERROR MESSAGE ==================== */

.error-message {
  text-align: center;
  padding: 3rem 2rem;
}

.error-message i {
  width: 64px;
  height: 64px;
  color: #ef4444;
  margin-bottom: 1rem;
}

.error-message h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.error-message p {
  color: #6b7280;
  margin: 0 0 1.5rem 0;
}

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

@media (max-width: 768px) {
  .policy-hub-container {
    padding: 1rem;
  }

  .policy-hub-header {
    flex-direction: column;
    gap: 1rem;
  }

  .header-left h1 {
    font-size: 1.5rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .charts-section {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ==================== POLICY LIBRARY ==================== */

.policy-library-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.library-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.library-header .header-left h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.library-header .header-left h1 i {
  width: 32px;
  height: 32px;
  color: #667eea;
}

.library-header .header-right {
  display: flex;
  gap: 1rem;
}

/* ==================== LIBRARY CONTROLS ==================== */

.library-controls {
  margin-bottom: 2rem;
}

.search-box {
  position: relative;
  margin-bottom: 1rem;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9ca3af;
}

.search-box input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: #667eea;
}

.filter-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.625rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
}

/* ==================== POLICY GRID ==================== */

.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

/* ==================== POLICY CARDS ==================== */

.policy-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  border: 2px solid transparent;
}

.policy-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.policy-card-header {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
}

.policy-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.policy-icon i {
  width: 24px;
  height: 24px;
  color: white;
}

.policy-title-section {
  flex: 1;
}

.policy-title-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.policy-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.policy-card-body {
  padding: 0 1.5rem 1rem 1.5rem;
  flex: 1;
}

.policy-summary {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.policy-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.meta-item i {
  width: 14px;
  height: 14px;
}

.policy-card-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid #f3f4f6;
}

.policy-card-footer button {
  flex: 1;
}

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

@media (max-width: 768px) {
  .policy-library-container {
    padding: 1rem;
  }

  .library-header {
    flex-direction: column;
    gap: 1rem;
  }

  .policy-grid {
    grid-template-columns: 1fr;
  }

  .filter-controls {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }
}


/* ==================== POLICY EDITOR ==================== */

.policy-editor-container {
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.editor-header .header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.editor-header .header-left h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.editor-header .header-right {
  display: flex;
  gap: 1rem;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
}

.editor-main {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.policy-title-input {
  width: 100%;
  border: none;
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
  padding: 0;
}

.policy-title-input:focus {
  outline: none;
}

.policy-title-input::placeholder {
  color: #d1d5db;
}

.policy-summary-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  font-family: inherit;
  resize: vertical;
}

.policy-summary-input:focus {
  outline: none;
  border-color: #667eea;
}

#policy-content-editor {
  min-height: 500px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

/* Quill Editor Overrides */
.ql-toolbar.ql-snow {
  border: 1px solid #e5e7eb;
  border-radius: 8px 8px 0 0;
  background: #f9fafb;
}

.ql-container.ql-snow {
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 8px;
  font-size: 1rem;
  line-height: 1.7;
}

.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.sidebar-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem 0;
}

.form-select,
.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: #667eea;
}

.sidebar-section small {
  color: #9ca3af;
  font-size: 0.75rem;
}

/* ==================== POLICY VIEW ==================== */

.policy-view-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.policy-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.policy-view-content {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
}

.policy-view-main {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.policy-header-section {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #f3f4f6;
  margin-bottom: 2rem;
}

.policy-icon-large {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.policy-icon-large i {
  width: 40px;
  height: 40px;
  color: white;
}

.policy-header-section h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.policy-badges-large {
  display: flex;
  gap: 0.75rem;
}

.policy-content-section {
  font-size: 1rem;
  line-height: 1.7;
  color: #374151;
}

.policy-body {
  max-width: 800px;
}

.policy-body h1,
.policy-body h2,
.policy-body h3 {
  font-weight: 600;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.policy-body h1 {
  font-size: 1.75rem;
}

.policy-body h2 {
  font-size: 1.5rem;
}

.policy-body h3 {
  font-size: 1.25rem;
}

.policy-body p {
  margin-bottom: 1rem;
}

.policy-body ul,
.policy-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.policy-body li {
  margin-bottom: 0.5rem;
}

.policy-body blockquote {
  border-left: 4px solid #667eea;
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: #6b7280;
  font-style: italic;
}

.policy-view-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.policy-view-sidebar .sidebar-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.policy-view-sidebar .sidebar-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem 0;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
}

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

.info-label {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.875rem;
}

.info-item span:last-child {
  color: #1f2937;
  font-size: 0.875rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: #ede9fe;
  color: #7c3aed;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

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

@media (max-width: 1024px) {
  .editor-layout,
  .policy-view-content {
    grid-template-columns: 1fr;
  }

  .editor-sidebar,
  .policy-view-sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .policy-editor-container,
  .policy-view-container {
    padding: 1rem;
  }

  .editor-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .editor-header .header-right {
    width: 100%;
  }

  .editor-header .header-right button {
    flex: 1;
  }

  .policy-title-input {
    font-size: 1.5rem;
  }

  .policy-header-section {
    flex-direction: column;
  }

  .policy-icon-large {
    width: 60px;
    height: 60px;
  }

  .policy-icon-large i {
    width: 30px;
    height: 30px;
  }

  .policy-header-section h1 {
    font-size: 1.5rem;
  }
}


/* Owner Details Display */
.owner-details {
  background: #f9fafb;
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
}

.owner-info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: #374151;
}

.owner-info-item:not(:last-child) {
  border-bottom: 1px solid #e5e7eb;
}

.owner-info-item strong {
  color: #6b7280;
  font-weight: 600;
}


/* Owner Search Container */
.owner-search-container {
  position: relative;
}

.owner-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 2px solid #667eea;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 0.25rem;
  display: none;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s;
}

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

.search-result-item:hover {
  background: #f9fafb;
}

.search-result-item.no-results {
  cursor: default;
  color: #9ca3af;
  text-align: center;
}

.search-result-item.no-results:hover {
  background: white;
}

.search-result-name {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.search-result-details {
  font-size: 0.75rem;
  color: #6b7280;
}


/* ==========================================
   ATTESTATION VIEWS
   ========================================== */

.attestation-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.attestation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.attestation-header .header-left {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.attestation-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.attestation-header .text-gray {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

/* Stats Cards */
.attestation-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-pending .stat-icon {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
}

.stat-overdue .stat-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.stat-completed .stat-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.stat-total .stat-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

/* Tabs */
.attestation-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #667eea;
  background: #f9fafb;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.tab-btn svg {
  width: 16px;
  height: 16px;
}

/* Filters */
.attestation-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.attestation-filters .search-box {
  flex: 1;
}

.filter-select {
  min-width: 180px;
  padding: 0.625rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Attestation List */
.attestation-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Attestation Card */
.attestation-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.2s;
}

.attestation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #667eea;
}

.attestation-card.overdue {
  border-left: 4px solid #ef4444;
}

.attestation-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  flex-shrink: 0;
}

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

.attestation-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.attestation-policy-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.attestation-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.attestation-card-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.attestation-card-meta .meta-item svg {
  width: 14px;
  height: 14px;
}

/* Urgency Indicators */
.urgency-normal {
  color: #6b7280;
}

.urgency-warning {
  color: #f59e0b;
  font-weight: 600;
}

.urgency-critical {
  color: #ef4444;
  font-weight: 600;
}

.urgency-overdue {
  color: #dc2626;
  font-weight: 700;
}

.attestation-card-actions {
  display: flex;
  gap: 0.75rem;
}

.attestation-card-actions button {
  white-space: nowrap;
}

/* Badge Variants */
.badge-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Empty State for Attestations */
.attestation-list .empty-state {
  padding: 4rem 2rem;
  text-align: center;
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.attestation-list .empty-state .empty-state-icon {
  color: #9ca3af;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .attestation-container {
    padding: 1rem;
  }

  .attestation-header {
    flex-direction: column;
    gap: 1rem;
  }

  .attestation-header .header-left {
    width: 100%;
  }

  .attestation-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .attestation-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    flex-shrink: 0;
  }

  .attestation-filters {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }

  .attestation-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .attestation-card-actions {
    width: 100%;
  }

  .attestation-card-actions button {
    flex: 1;
  }
}


/* ==========================================
   ATTESTATION MODAL
   ========================================== */

.attestation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.attestation-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.attestation-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.attestation-modal-header {
  padding: 2rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.attestation-modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.attestation-modal-header .text-gray {
  margin: 0;
}

.attestation-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.attestation-modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Sections */
.attestation-policy-section,
.attestation-quiz-section,
.attestation-signature-section,
.attestation-details-section,
.attestation-signature-view {
  margin-bottom: 2.5rem;
}

.attestation-policy-section h3,
.attestation-quiz-section h3,
.attestation-signature-section h3,
.attestation-details-section h3,
.attestation-signature-view h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.attestation-policy-section h3 svg,
.attestation-quiz-section h3 svg,
.attestation-signature-section h3 svg {
  width: 20px;
  height: 20px;
  color: #667eea;
}

.section-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

/* Policy Content Display */
.policy-content-display {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

.policy-content-display h1,
.policy-content-display h2,
.policy-content-display h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.policy-content-display h1:first-child,
.policy-content-display h2:first-child,
.policy-content-display h3:first-child {
  margin-top: 0;
}

.policy-content-display ul,
.policy-content-display ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* Quiz Questions */
.quiz-questions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.quiz-question {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
}

.question-text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.radio-label:hover {
  background: white;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.radio-label span {
  font-size: 0.875rem;
  color: #374151;
}

.quiz-passing-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #1e40af;
}

.quiz-passing-note svg {
  width: 16px;
  height: 16px;
}

/* Signature Pad */
.signature-pad-container {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
}

.signature-canvas {
  width: 100%;
  height: 200px;
  border: 1px dashed #d1d5db;
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
  background: white;
}

.signature-pad-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.signature-instructions {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Acknowledgment */
.attestation-acknowledgment {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 1.25rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.125rem;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label span {
  font-size: 0.9375rem;
  color: #92400e;
  font-weight: 500;
  line-height: 1.5;
}

/* Success Overlay */
.attestation-success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.attestation-success-card {
  background: white;
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: successSlideIn 0.5s ease;
}

@keyframes successSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 40px;
}

.attestation-success-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.75rem 0;
}

.attestation-success-card p {
  font-size: 0.9375rem;
  color: #6b7280;
  margin: 0 0 2rem 0;
}

/* Attestation View (Read-only) */
.attestation-details-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-item label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-item value {
  font-size: 0.9375rem;
  color: #1f2937;
  font-weight: 500;
}

.signature-display {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.signature-display img {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  border: 1px dashed #d1d5db;
  border-radius: 4px;
}

.attestation-policy-collapsed {
  margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .attestation-modal {
    padding: 0;
  }

  .attestation-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .attestation-modal-header,
  .attestation-modal-body,
  .attestation-modal-footer {
    padding: 1.5rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .attestation-modal-footer {
    flex-direction: column-reverse;
  }

  .attestation-modal-footer button {
    width: 100%;
  }
}

/* ==========================================
   CAMPAIGN MANAGEMENT
   ========================================== */

.campaigns-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.campaigns-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.campaigns-header .header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.campaign-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.campaign-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e5e7eb;
}

.campaign-tabs .tab-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.campaign-tabs .tab-btn:hover {
  color: #8b5cf6;
}

.campaign-tabs .tab-btn.active {
  color: #8b5cf6;
  border-bottom-color: #8b5cf6;
}

.campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.campaign-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.campaign-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.campaign-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.campaign-card-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.campaign-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.campaign-card-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.meta-item i {
  width: 16px;
  height: 16px;
}

.campaign-card-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
}

/* ==========================================
   CAMPAIGN WIZARD
   ========================================== */

.wizard-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.wizard-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.wizard-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: wizardSlideIn 0.3s ease-out;
}

@keyframes wizardSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.wizard-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.wizard-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  background: #f3f4f6;
  color: #9ca3af;
  transition: all 0.3s;
}

.wizard-step.active .step-number {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  transform: scale(1.1);
}

.wizard-step.completed .step-number {
  background: #10b981;
  color: white;
}

.step-label {
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
}

.wizard-step.active .step-label {
  color: #8b5cf6;
  font-weight: 600;
}

.step-line {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  margin: 0 1rem;
}

.wizard-step.completed + .step-line {
  background: #10b981;
}

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.wizard-step-content {
  max-width: 600px;
  margin: 0 auto;
}

.wizard-step-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.step-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 2rem 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.filter-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.filter-select:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
}

.policy-selection-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.policy-selection-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.policy-selection-item:hover {
  background: white;
  border-color: #8b5cf6;
}

.policy-selection-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.policy-selection-content {
  flex: 1;
}

.policy-selection-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.policy-selection-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.75rem;
  color: #6b7280;
}

.selection-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #1e40af;
}

.selection-summary i {
  width: 20px;
  height: 20px;
}

.reminder-config {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
}

.review-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.review-section:last-child {
  border-bottom: none;
}

.review-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.review-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.review-item label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-item value {
  font-size: 0.875rem;
  color: #1f2937;
}

.review-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.review-list li {
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.review-list li:last-child {
  border-bottom: none;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid #e5e7eb;
}

/* ==========================================
   CAMPAIGN ANALYTICS
   ========================================== */

.analytics-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.analytics-header .header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

.analytics-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.analytics-stat-card .stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analytics-stat-card .stat-icon.stat-total {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.analytics-stat-card .stat-icon.stat-completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.analytics-stat-card .stat-icon.stat-pending {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.analytics-stat-card .stat-icon.stat-overdue {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.analytics-stat-card .stat-icon i {
  width: 28px;
  height: 28px;
  color: white;
}

.analytics-stat-card .stat-content {
  flex: 1;
}

.analytics-stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.analytics-stat-card .stat-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.stat-progress {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: #10b981;
}

.analytics-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-chart-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
}

.analytics-chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1.5rem 0;
}

.analytics-table-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.table-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.analytics-table-container {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.analytics-table thead {
  background: #f9fafb;
}

.analytics-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e5e7eb;
}

.analytics-table td {
  padding: 1rem;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.analytics-table tbody tr:hover {
  background: #f9fafb;
}

.user-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-cell strong {
  color: #1f2937;
}

.user-email {
  font-size: 0.75rem;
  color: #9ca3af;
}

.empty-cell {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}

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

@media (max-width: 768px) {
  .campaigns-header,
  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .campaigns-header .header-left,
  .analytics-header .header-left {
    width: 100%;
  }

  .campaign-stats-grid,
  .analytics-stats-grid {
    grid-template-columns: 1fr;
  }

  .campaign-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }

  .campaign-card-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .campaign-card-actions {
    flex-wrap: wrap;
  }

  .wizard-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .wizard-steps {
    overflow-x: auto;
  }

  .wizard-step {
    min-width: 80px;
  }

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

  .analytics-charts-row {
    grid-template-columns: 1fr;
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-actions {
    width: 100%;
    flex-direction: column;
  }

  .analytics-table {
    font-size: 0.75rem;
  }

  .analytics-table th,
  .analytics-table td {
    padding: 0.5rem;
  }
}

/* ==========================================
   GRADIENT ICONS
   ========================================== */

.gradient-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.gradient-secondary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.gradient-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.gradient-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.quick-action-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.quick-action-icon i {
  width: 32px;
  height: 32px;
  color: white;
}

/* ==========================================
   POLICY EXCEPTIONS
   ========================================== */

.exceptions-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.exceptions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.exceptions-header .header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.exception-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.exception-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e5e7eb;
}

.exceptions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Exception Cards */
.exception-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.exception-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.exception-card-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.exception-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exception-icon i {
  width: 24px;
  height: 24px;
  color: white;
}

.exception-info {
  flex: 1;
}

.exception-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.exception-requestor {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0 0 0.125rem 0;
}

.exception-date {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0;
}

.exception-reason {
  padding: 1rem;
  background: #fef3c7;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #92400e;
  margin-bottom: 1rem;
}

.exception-justification {
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 1rem;
}

.exception-expiration {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #dbeafe;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #1e40af;
  margin-bottom: 1rem;
}

.exception-expiration i {
  width: 18px;
  height: 18px;
}

.exception-comments {
  padding: 1rem;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 1rem;
}

.exception-comments strong {
  color: #1f2937;
}

.exception-card-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

/* Exception Modal */
.exception-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.exception-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.exception-modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: exceptionSlideIn 0.3s ease-out;
}

@keyframes exceptionSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.form-help {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.text-danger {
  color: #dc2626;
  font-weight: 600;
}

.text-warning {
  color: #d97706;
  font-weight: 600;
}

.text-sm {
  font-size: 0.875rem;
}

.text-gray {
  color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
  .exceptions-container {
    padding: 1rem;
  }

  .exceptions-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .exception-stats-grid {
    grid-template-columns: 1fr;
  }

  .exception-card-header {
    flex-direction: column;
  }

  .exception-card-actions {
    justify-content: flex-start;
  }

  .exception-modal-content {
    width: 95%;
    max-height: 95vh;
  }
}

/* ==========================================
   VERSION HISTORY
   ========================================== */

.version-history-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.version-history-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.version-history-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: versionSlideIn 0.3s ease-out;
}

@keyframes versionSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.version-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.version-stats .stat-item {
  text-align: center;
}

.version-stats .stat-item label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.version-stats .stat-item value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
}

.version-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.version-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.2s;
}

.version-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateX(4px);
}

.version-item.version-current {
  border-left: 4px solid #7c3aed;
  background: linear-gradient(90deg, #f3e8ff 0%, white 100%);
}

.version-badge {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.version-info {
  flex: 1;
}

.version-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.version-type {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.version-meta {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 0.5rem 0;
}

.version-description {
  font-size: 0.875rem;
  color: #4b5563;
  font-style: italic;
  margin: 0;
}

.version-actions {
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
  align-items: flex-end;
}

/* Compare Versions */
.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.compare-version {
  text-align: center;
}

.compare-version h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.compare-version p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.compare-arrow {
  color: #9ca3af;
}

.compare-arrow i {
  width: 32px;
  height: 32px;
}

.differences-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.differences-list h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 1rem 0;
}

.diff-item {
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #7c3aed;
}

.diff-item h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem 0;
}

.diff-content, .diff-tags, .diff-text {
  font-size: 0.875rem;
  color: #4b5563;
}

.diff-summary {
  padding: 0.75rem;
  background: #fef3c7;
  border-radius: 6px;
  color: #92400e;
  font-weight: 500;
}

.diff-old, .diff-new {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
}

.diff-old {
  background: #fee2e2;
  color: #991b1b;
}

.diff-new {
  background: #d1fae5;
  color: #065f46;
}

.diff-old strong, .diff-new strong {
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .version-history-content {
    width: 95%;
    max-height: 95vh;
  }

  .version-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .version-item {
    flex-direction: column;
  }

  .version-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .compare-header {
    flex-direction: column;
    gap: 1rem;
  }

  .compare-arrow {
    transform: rotate(90deg);
  }
}


/* ==========================================
   PAGINATION STYLES (POL-P1-4)
   ========================================== */

/* Results Summary */
.results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.results-count {
  font-size: 0.875rem;
  color: #6b7280;
}

.results-count strong {
  color: #374151;
  font-weight: 600;
}

/* Pagination Container */
.pagination-controls {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
  margin-top: 1rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Pagination Buttons */
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 2.5rem;
  height: 2.5rem;
}

.pagination-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
}

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

.pagination-btn.active {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
}

.pagination-btn.active:hover {
  background: #4f46e5;
  border-color: #4f46e5;
}

/* Pagination Icons */
.pagination-btn svg {
  width: 1rem;
  height: 1rem;
}

.pagination-prev svg {
  margin-right: 0.125rem;
}

.pagination-next svg {
  margin-left: 0.125rem;
}

/* Page Numbers Container */
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-page {
  min-width: 2.5rem;
  padding: 0.5rem;
}

/* Ellipsis */
.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: #9ca3af;
  font-weight: 500;
}

/* Responsive Pagination */
@media (max-width: 640px) {
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .pagination-pages {
    order: 2;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  .pagination-prev {
    order: 1;
  }
  
  .pagination-next {
    order: 3;
  }
  
  .pagination-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    min-width: 2.25rem;
    height: 2.25rem;
  }
}

/* Loading State for Grid */
.policy-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}

.policy-grid.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 3px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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


/* ==================== LOADING STATES (POL-P2-4) ==================== */

.policy-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
  min-height: 200px;
}

.policy-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: policy-spin 0.8s linear infinite;
}

.policy-loading-spinner.small {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

.policy-loading-spinner.large {
  width: 64px;
  height: 64px;
  border-width: 5px;
}

.policy-loading-text {
  margin-top: 1rem;
  color: #6b7280;
  font-size: 0.9375rem;
  font-weight: 500;
}

@keyframes policy-spin {
  to { transform: rotate(360deg); }
}

/* Inline loading indicator */
.policy-loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.policy-loading-inline .policy-loading-spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

/* Button loading state */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading .btn-text {
  visibility: hidden;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: policy-spin 0.6s linear infinite;
}

/* Container with relative positioning for overlay */
.policy-container-loading {
  position: relative;
  min-height: 200px;
}


/* ==================== CONFIRMATION DIALOG (POL-P2-5) ==================== */

.policy-confirm-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.policy-confirm-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.policy-confirm-dialog {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  transform: scale(0.9);
  transition: transform 0.2s;
}

.policy-confirm-backdrop.active .policy-confirm-dialog {
  transform: scale(1);
}

.policy-confirm-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.policy-confirm-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.policy-confirm-icon.warning {
  background: #fef3c7;
  color: #d97706;
}

.policy-confirm-icon.danger {
  background: #fee2e2;
  color: #dc2626;
}

.policy-confirm-icon.info {
  background: #dbeafe;
  color: #2563eb;
}

.policy-confirm-icon i {
  width: 20px;
  height: 20px;
}

.policy-confirm-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.policy-confirm-body {
  padding: 1.25rem 1.5rem;
}

.policy-confirm-message {
  color: #4b5563;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.policy-confirm-details {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #6b7280;
}

.policy-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

.policy-confirm-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.policy-confirm-btn-cancel {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.policy-confirm-btn-cancel:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.policy-confirm-btn-confirm {
  background: #6366f1;
  color: white;
}

.policy-confirm-btn-confirm:hover {
  background: #4f46e5;
}

.policy-confirm-btn-confirm.danger {
  background: #dc2626;
}

.policy-confirm-btn-confirm.danger:hover {
  background: #b91c1c;
}

.policy-confirm-btn-confirm.warning {
  background: #d97706;
}

.policy-confirm-btn-confirm.warning:hover {
  background: #b45309;
}
