:root {
  --blue: #0D5C9F;
  --blue-dark: #094A7F;
  --blue-light: #E3F2FD;
  --orange: #F37021;
  --orange-dark: #D85A0A;
  --orange-light: #FFF3E0;
  --green: #2E7D32;
  --green-dark: #1B5E20;
  --green-light: #E8F5E9;
  --red: #D32F2F;
  --red-light: #FFEBEE;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-300: #E0E0E0;
  --gray-400: #BDBDBD;
  --gray-500: #9E9E9E;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;
  --white: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #666666;
  --border: #E0E0E0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --sidebar-width: 260px;
  --header-height: 70px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--gray-50);
  line-height: 1.6;
  overflow-x: hidden;
}

.admin-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--border);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  height: 36px;
  width: auto;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
}

.sidebar-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: 0.3s;
}

.admin-profile {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--orange));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

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

.admin-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  padding: 0 20px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--gray-50);
  color: var(--blue);
}

.nav-item.active {
  background: var(--blue-light);
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 600;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--gray-100);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--red-light);
  color: var(--red);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.content-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  padding: 8px 16px;
  border-radius: 8px;
  width: 300px;
}

.search-box svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--text-secondary);
}

.btn-icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-100);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--gray-200);
}

.btn-icon .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: white;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.content-body {
  flex: 1;
  padding: 32px;
}

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

.stat-card {
  background: var(--white);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

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

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.stat-icon.blue {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
}

.stat-icon.orange {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
}

.stat-icon.green {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.stat-icon.red {
  background: linear-gradient(135deg, var(--red), #B71C1C);
}

.stat-trend {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.stat-trend.up {
  background: var(--green-light);
  color: var(--green);
}

.stat-trend.down {
  background: var(--red-light);
  color: var(--red);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-change {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-body {
  padding: 24px;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

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

thead {
  background: var(--gray-50);
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

tr:hover {
  background: var(--gray-50);
}

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

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

.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--gray-300);
}

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

.btn-success:hover {
  background: var(--green-dark);
}

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

.btn-danger:hover {
  background: #B71C1C;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

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

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

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

.badge-info {
  background: var(--blue-light);
  color: var(--blue);
}

.badge-secondary {
  background: var(--gray-200);
  color: var(--text-secondary);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--white);
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
}

.toast.success {
  border-left: 4px solid var(--green);
}

.toast.error {
  border-left: 4px solid var(--red);
}

.toast.warning {
  border-left: 4px solid var(--orange);
}

.toast.info {
  border-left: 4px solid var(--blue);
}

/* Charts */
.chart-container {
  height: 300px;
  position: relative;
}

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

select, input[type="text"], input[type="date"], input[type="number"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

select:focus, input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .content-header {
    padding: 0 16px;
  }

  .content-header h1 {
    font-size: 20px;
  }

  .search-box {
    width: 200px;
  }

  .content-body {
    padding: 16px;
  }

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

  table {
    font-size: 13px;
  }

  th, td {
    padding: 12px 8px;
  }
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state-description {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.quick-action {
  background: var(--white);
  padding: 20px;
  border-radius: 12px;
  border: 2px solid var(--border);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
}

.quick-action:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background: var(--blue-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}

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