:root {
  --primary-color: #4f46e5;
  --primary-dark: #3730a3;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --light-bg: #f8fafc;
  --dark-bg: #1e293b;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --sidebar-width: 280px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-primary);
}

/* Header */
.admin-header {
  background: white;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: between;
  align-items: center;
  padding: 0 2rem;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  text-align: right;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.user-role {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.logout-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: #dc2626;
  color: white;
  text-decoration: none;
}

/* Sidebar */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0.25rem 0;
}
.sidebar .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}
.sidebar .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}
.main-content {
    background: #f8f9fa;
}
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.75rem;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}
.badge {
    font-size: 0.75rem;
}
.badge-local {
    background: var(--success-color);
}
.badge-global {
    background: var(--warning-color);
}

.admin-sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--border-color);
  height: calc(100vh - 80px);
  position: fixed;
  left: 0;
  top: 80px;
  overflow-y: auto;
  z-index: 999;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
}

.nav-item {
  margin: 0.25rem 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  transition: all 0.2s;
  font-weight: 500;
}

.nav-link:hover {
  background: var(--light-bg);
  color: var(--primary-color);
  text-decoration: none;
}

.nav-link.active {
  background: var(--primary-color);
  color: white;
}

.nav-link i {
  width: 1.25rem;
  margin-right: 0.75rem;
  text-align: center;
}

/* Main Content */
.admin-main {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: calc(100vh - 80px);
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.page-subtitle {
  color: var(--text-secondary);
  margin: 0;
}

.content-card {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-header {
  background: white;
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-body {
  padding: 1.5rem;
}

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

.stat-card {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card.primary {
  border-left: 4px solid var(--primary-color);
}

.stat-card.success {
  border-left: 4px solid var(--success-color);
}

.stat-card.warning {
  border-left: 4px solid var(--warning-color);
}

.stat-card.danger {
  border-left: 4px solid var(--danger-color);
}

.stat-card.info {
  border-left: 4px solid #17a2b8;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0.25rem 0 0 0;
}

.stat-change {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.stat-change.positive {
  color: var(--success-color);
}

.stat-change.negative {
  color: var(--danger-color);
}

/* Buttons */
.btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  border-radius: 0.5rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-success {
  background: var(--success-color);
  border-color: var(--success-color);
  border-radius: 0.5rem;
  font-weight: 500;
}

.btn-warning {
  background: var(--warning-color);
  border-color: var(--warning-color);
  border-radius: 0.5rem;
  font-weight: 500;
}

.btn-danger {
  background: var(--danger-color);
  border-color: var(--danger-color);
  border-radius: 0.5rem;
  font-weight: 500;
}

/* Tables */
.table {
  margin: 0;
}

.table th {
  background: var(--light-bg);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-primary);
  padding: 1rem;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--light-bg);
}

/* Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.badge-primary {
  background: var(--primary-color);
  color: white;
}

.badge-success {
  background: var(--success-color);
  color: white;
}

.badge-warning {
  background: var(--warning-color);
  color: white;
}

.badge-danger {
  background: var(--danger-color);
  color: white;
}

.badge-secondary {
  background: var(--secondary-color);
  color: white;
}

.badge-info {
  background: #06b6d4;
  color: white;
}

.badge-user-group {
  background: #8b5cf6;
  color: white;
}

.badge-level {
  background: #f59e0b;
  color: white;
}

/* Footer */
.admin-footer {
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .admin-sidebar.show {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
    padding: 1rem;
  }

  .header-content {
    padding: 0 1rem;
  }

  .footer-content {
    padding: 0 1rem;
  }
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* Timeline styles for stats page */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.625rem;
  top: 1rem;
  width: 1px;
  height: calc(100% + 0.5rem);
  background: var(--border-color);
}

.timeline-item:last-child::before {
  display: none;
}

/* Avatar styles */
.avatar-sm {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Text utilities */
.text-primary {
  color: var(--primary-color) !important;
}

.text-success {
  color: var(--success-color) !important;
}

.text-warning {
  color: var(--warning-color) !important;
}

.text-danger {
  color: var(--danger-color) !important;
}

.text-info {
  color: #17a2b8 !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.text-muted {
  color: var(--text-secondary) !important;
}

/* Font weight utilities */
.fw-bold {
  font-weight: 700 !important;
}

.fw-500 {
  font-weight: 500 !important;
}

.fw-600 {
  font-weight: 600 !important;
}

/* Margin utilities */
.mb-0 {
  margin-bottom: 0 !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.me-1 {
  margin-right: 0.25rem !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

/* Padding utilities */
.p-0 {
  padding: 0 !important;
}

/* Display utilities */
.d-flex {
  display: flex !important;
}

.d-grid {
  display: grid !important;
}

.d-none {
  display: none !important;
}

/* Flex utilities */
.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-center {
  justify-content: center !important;
}

.align-items-center {
  align-items: center !important;
}

.align-items-start {
  align-items: flex-start !important;
}

.flex-column {
  flex-direction: column !important;
}

/* Grid utilities */
.gap-3 {
  gap: 1rem !important;
}

/* Position utilities */
.position-relative {
  position: relative !important;
}

.position-absolute {
  position: absolute !important;
}

.position-sticky {
  position: sticky !important;
}

.position-fixed {
  position: fixed !important;
}

/* Z-index utilities */
.z-index-999 {
  z-index: 999 !important;
}

.z-index-1000 {
  z-index: 1000 !important;
}

/* Overflow utilities */
.overflow-hidden {
  overflow: hidden !important;
}

.overflow-y-auto {
  overflow-y: auto !important;
}

/* Border utilities */
.border-0 {
  border: 0 !important;
}

.border-radius-0 {
  border-radius: 0 !important;
}

.border-radius-05 {
  border-radius: 0.5rem !important;
}

.border-radius-075 {
  border-radius: 0.75rem !important;
}

.border-radius-0375 {
  border-radius: 0.375rem !important;
}

/* Box shadow utilities */
.box-shadow-1 {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.box-shadow-2 {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.075) !important;
}

/* Transition utilities */
.transition-all {
  transition: all 0.2s !important;
}

.transition-transform {
  transition: transform 0.3s ease !important;
}

/* Transform utilities */
.transform-translate-x-100 {
  transform: translateX(-100%) !important;
}

.transform-translate-x-0 {
  transform: translateX(0) !important;
}

/* Width and height utilities */
.w-100 {
  width: 100% !important;
}

.h-100 {
  height: 100% !important;
}

.min-h-100vh {
  min-height: 100vh !important;
}

/* Background utilities */
.bg-white {
  background: white !important;
}

.bg-light {
  background: var(--light-bg) !important;
}

/* Border color utilities */
.border-color-primary {
  border-color: var(--primary-color) !important;
}

.border-color-success {
  border-color: var(--success-color) !important;
}

.border-color-warning {
  border-color: var(--warning-color) !important;
}

.border-color-danger {
  border-color: var(--danger-color) !important;
}

.border-color-light {
  border-color: var(--border-color) !important;
}

/* Login Page Styles */
.login-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  background: white;
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h2 {
  color: #333;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: #666;
  margin: 0;
}

.login-form .form-control {
  border-radius: 10px;
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.login-form .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-login {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  width: 100%;
  transition: all 0.3s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.login-alert {
  border-radius: 10px;
  border: none;
}

.back-link {
  text-align: center;
  margin-top: 1rem;
}

.back-link a {
  color: #667eea;
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}
