/* css/dashboard.css - Complete dashboard styles */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --sidebar-width: 280px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f1f5f9;
  overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(145deg, #ffffff 0%, #fefefe 100%);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.03), 1px 0 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1), width 0.3s ease;
  flex-shrink: 0;
  z-index: 1050;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.sidebar-brand {
  padding: 1.6rem 1.5rem 1rem 1.5rem;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.3px;
  border-bottom: 1px solid #ecf3fa;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand span {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Sidebar Navigation */
.nav-link-custom {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0.75rem 1.2rem;
  margin: 6px 12px;
  border-radius: 14px;
  color: #1e2a3e;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-link-custom i, .nav-link-custom svg {
  width: 22px;
  height: 22px;
}

.nav-link-custom:hover {
  background: #eef2ff;
  color: #2563eb;
}

.nav-link-custom.active {
  background: #eef2ff;
  color: #1d4ed8;
  font-weight: 600;
}

/* Main Content */
.main-content {
  flex: 1;
  transition: margin-left 0.2s ease;
  background: #f8fafc;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

/* Navbar */
.navbar-dashboard {
  background: white;
  border-radius: 0;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #e9eef3;
}

.toggle-sidebar-btn {
  background: white;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-radius: 12px;
  padding: 8px 12px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-sidebar-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.system-badge {
  background: #eef2ff;
  color: #2563eb;
  border-radius: 40px;
  padding: 0.25rem 1rem;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Cards */
.stat-card {
  background: white;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  padding: 1.25rem;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -12px rgba(0, 0, 0, 0.12);
  border-color: #e2e8f0;
}

.insight-card {
  background: white;
  border-radius: 24px;
  border: 1px solid #edf2f7;
  padding: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.insight-card:hover {
  box-shadow: 0 8px 25px -12px rgba(0, 0, 0, 0.1);
}

/* Progress indicator for completion rate */
.completion-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 40px;
  overflow: hidden;
  margin-top: 1rem;
}

.completion-fill {
  background: #10b981;
  height: 100%;
  border-radius: 40px;
  transition: width 0.3s ease;
}

/* Status badges */
.badge-success-subtle,
.bg-success-subtle {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.badge-warning-subtle,
.bg-warning-subtle {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.badge-danger-subtle,
.bg-danger-subtle {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.badge-info-subtle,
.bg-info-subtle {
  background: #e0f2fe !important;
  color: #075985 !important;
}

/* Chart containers */
canvas {
  max-height: 100%;
  width: 100% !important;
}

/* Jurisdiction bars (reference style) */
.jurisdiction-item {
  margin-bottom: 1rem;
}

.jurisdiction-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

/* Jurisdiction bars */
.jurisdiction-bar {
  background: #eef2ff;
  border-radius: 40px;
  height: 8px;
  overflow: hidden;
}

.jurisdiction-fill {
  background: #2563eb;
  height: 100%;
  border-radius: 40px;
}

/* Responsive */
@media (min-width: 769px) {
  .sidebar.collapsed {
    width: 0;
    border-right: 0;
    box-shadow: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1060;
    transform: translateX(0);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.08);
  }
  .sidebar.collapsed {
    transform: translateX(-100%);
  }
  .navbar-dashboard .page-title {
    font-size: 1.2rem;
  }
  .display-4 {
    font-size: 2rem;
  }
  .insight-card {
    padding: 1rem;
  }
}

/* Utilities */
.lucide {
  stroke-width: 1.8;
}

.container-fluid {
  max-width: 1600px;
  margin: 0 auto;
}

/* Loading skeleton animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading-skeleton {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Recent changes sidebar */
.audit-sidebar {
  width: 360px;
  flex-shrink: 0;
  position: sticky;
  top: 1rem;
  align-self: flex-start;
}

.audit-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid #edf2f7;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.audit-header {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audit-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.audit-badge {
  background: #dbeafe;
  color: #2563eb;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.audit-more-btn {
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 10px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.audit-timeline {
  max-height: 520px;
  overflow-y: auto;
}

.audit-item {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #edf2f7;
}

.audit-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.audit-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.audit-action.create { background: #dcfce7; color: #166534; }
.audit-action.edit { background: #e0e7ff; color: #1e40af; }
.audit-action.delete { background: #fee2e2; color: #991b1b; }
.audit-action.status { background: #fef3c7; color: #92400e; }

.audit-time {
  font-size: 0.75rem;
  color: #94a3b8;
}

.audit-details {
  font-size: 0.95rem;
  color: #0f172a;
  font-weight: 600;
}

.audit-change {
  font-size: 0.8rem;
  color: #64748b;
}

.audit-footer {
  padding: 0.85rem 1.1rem;
  background: #fff;
  display: flex;
  justify-content: center;
}

.audit-footer-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 992px) {
  .audit-sidebar {
    width: 100%;
    position: static;
    margin-top: 1rem;
  }
}
