/**
 * Audit Management Styles
 * =======================
 */

/* Container */
.audit-management {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */
.audit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.audit-header h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

.audit-header h1 svg {
  width: 32px;
  height: 32px;
  color: #4f46e5;
}

.audit-subtitle {
  color: #6b7280;
  margin: 8px 0 0 0;
  font-size: 15px;
}

.audit-header-actions {
  display: flex;
  gap: 12px;
}

/* Tabs */
.audit-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
}

.audit-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.audit-tab svg {
  width: 18px;
  height: 18px;
}

.audit-tab:hover {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.05);
}

.audit-tab.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

/* Sections */
.audit-section {
  margin-bottom: 32px;
}

.audit-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 8px 0;
}

.audit-section-desc {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 20px 0;
}

.audit-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

/* Report Cards Grid */
.audit-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

.audit-report-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.audit-report-card:hover {
  border-color: #4f46e5;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
}

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

.audit-report-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

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

.audit-report-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 6px 0;
}

.audit-report-info p {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.audit-report-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.audit-tag {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  background: #f3f4f6;
  color: #4b5563;
}

.audit-report-action {
  flex-shrink: 0;
  color: #9ca3af;
}

.audit-report-action svg {
  width: 20px;
  height: 20px;
}

/* Package Cards */
.audit-package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.audit-package-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.audit-package-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.audit-package-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: #fafafa;
  border-bottom: 1px solid #f3f4f6;
}

.audit-package-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audit-package-icon svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.audit-package-icon.sox {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.audit-package-icon.soc2 {
  background: linear-gradient(135deg, #10b981, #059669);
}

.audit-package-icon.iso {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.audit-package-title h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 4px 0;
}

.audit-package-status {
  font-size: 12px;
  font-weight: 500;
}

.audit-package-status.ready {
  color: #10b981;
}

.audit-package-status.generating {
  color: #f59e0b;
}

.audit-package-body {
  padding: 20px;
}

.audit-package-body p {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 12px 0;
}

.audit-package-body ul {
  margin: 0;
  padding-left: 20px;
}

.audit-package-body li {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 6px;
}

.audit-package-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #fafafa;
  border-top: 1px solid #f3f4f6;
}

.audit-package-meta {
  font-size: 12px;
  color: #9ca3af;
}

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

.audit-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.audit-timeline-item {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
}

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

.audit-timeline-icon {
  position: absolute;
  left: -32px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #e5e7eb;
}

.audit-timeline-icon svg {
  width: 12px;
  height: 12px;
}

.audit-timeline-icon.green {
  border-color: #10b981;
  color: #10b981;
}

.audit-timeline-icon.red {
  border-color: #ef4444;
  color: #ef4444;
}

.audit-timeline-icon.blue {
  border-color: #3b82f6;
  color: #3b82f6;
}

.audit-timeline-icon.purple {
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.audit-timeline-icon.teal {
  border-color: #14b8a6;
  color: #14b8a6;
}

.audit-timeline-content {
  flex: 1;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
}

.audit-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.audit-timeline-header strong {
  font-size: 14px;
  color: #1a1a2e;
}

.audit-timeline-time {
  font-size: 12px;
  color: #9ca3af;
}

.audit-timeline-details {
  font-size: 13px;
  color: #6b7280;
}

.audit-timeline-target {
  font-weight: 500;
  color: #4b5563;
}

.audit-timeline-user {
  margin-left: 8px;
}

/* Tables */
.audit-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.audit-table th,
.audit-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.audit-table th {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafafa;
}

.audit-table td {
  font-size: 14px;
  color: #374151;
}

.audit-table tbody tr:last-child td {
  border-bottom: none;
}

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

/* Badges */
.audit-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
}

.audit-badge-pdf {
  background: #fef2f2;
  color: #dc2626;
}

.audit-badge-excel {
  background: #f0fdf4;
  color: #16a34a;
}

.audit-badge-csv {
  background: #fefce8;
  color: #ca8a04;
}

/* Buttons */
.audit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.audit-btn-primary {
  background: #4f46e5;
  color: #fff;
}

.audit-btn-primary:hover {
  background: #4338ca;
}

.audit-btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.audit-btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.audit-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
}

.audit-btn-icon:hover {
  background: #f3f4f6;
  color: #4f46e5;
}

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

/* Form Elements */
.audit-form-group {
  margin-bottom: 20px;
}

.audit-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.audit-input,
.audit-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.2s;
}

.audit-input:focus,
.audit-select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.audit-date-range {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audit-date-range .audit-input {
  flex: 1;
}

.audit-date-range span {
  color: #6b7280;
}

.audit-form-help {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}

/* Radio & Checkbox */
.audit-radio-group {
  display: flex;
  gap: 20px;
}

.audit-radio,
.audit-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
}

.audit-radio input,
.audit-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: #4f46e5;
}

/* Filters */
.audit-filters {
  display: flex;
  gap: 12px;
  align-items: center;
}

.audit-filters .audit-select,
.audit-filters .audit-input {
  width: auto;
  min-width: 160px;
}

/* Modal */
.audit-modal-overlay {
  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: 1000;
  animation: fadeIn 0.2s ease;
}

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

.audit-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.audit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.audit-modal-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
}

.audit-modal-header h3 svg {
  width: 22px;
  height: 22px;
  color: #4f46e5;
}

.audit-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.audit-modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.audit-modal-close svg {
  width: 20px;
  height: 20px;
}

.audit-modal-body {
  padding: 24px;
  overflow-y: auto;
}

.audit-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

/* Empty State */
.audit-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #6b7280;
}

.audit-empty-state svg {
  width: 48px;
  height: 48px;
  color: #d1d5db;
  margin-bottom: 16px;
}

.audit-empty-state p {
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  margin: 0 0 8px 0;
}

.audit-empty-state span {
  font-size: 14px;
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 1024px) {
  .audit-report-grid {
    grid-template-columns: 1fr;
  }
  
  .audit-package-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .audit-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .audit-tabs {
    overflow-x: auto;
  }
  
  .audit-section-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .audit-filters {
    flex-wrap: wrap;
  }
  
  .audit-table {
    display: block;
    overflow-x: auto;
  }
}
