@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { background: #f5f5f5; min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed; height: 100%; width: 240px; background: #0A2558;
  transition: all 0.5s ease; z-index: 1000;
}
.sidebar.active { width: 60px; }
.sidebar .logo-details {
  height: 80px; display: flex; align-items: center; padding: 0 16px;
}
.sidebar .logo-details img { height: 32px; width: 32px; object-fit: contain; min-width: 32px; }
.sidebar .logo-details .logo_name {
  color: #fff; font-size: 18px; font-weight: 500; margin-left: 10px; white-space: nowrap;
}
.sidebar .nav-links { margin-top: 10px; padding: 0; list-style: none; }
.sidebar .nav-links li { position: relative; list-style: none; }
.sidebar .nav-links li a {
  height: 50px; width: 100%; display: flex; align-items: center;
  text-decoration: none; transition: all 0.4s ease; color: #fff;
}
.sidebar .nav-links li a:hover, .sidebar .nav-links li a.active { background: #081D45; }
.sidebar .nav-links li i {
  min-width: 60px; text-align: center; font-size: 18px; color: #fff;
}
.sidebar .nav-links li a .links_name { font-size: 15px; font-weight: 400; white-space: nowrap; }
.sidebar .nav-links .log_out { position: absolute; bottom: 0; width: 100%; }

/* Main layout */
.home-section {
  position: relative; background: #f5f5f5; min-height: 100vh;
  width: calc(100% - 240px); left: 240px; transition: all 0.5s ease;
}
.sidebar.active ~ .home-section { width: calc(100% - 60px); left: 60px; }

/* Topbar */
.home-section nav {
  display: flex; justify-content: space-between; align-items: center;
  height: 80px; background: #fff; position: fixed; z-index: 100;
  width: calc(100% - 240px); left: 240px; padding: 0 20px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1); transition: all 0.5s ease;
}
.sidebar.active ~ .home-section nav { left: 60px; width: calc(100% - 60px); }
.home-section nav .sidebar-button { display: flex; align-items: center; font-size: 24px; font-weight: 500; }
nav .sidebar-button i { font-size: 35px; margin-right: 10px; cursor: pointer; color: #0A2558; }
.home-section nav .profile-details {
  display: flex; align-items: center; gap: 16px;
}
nav .profile-details .avatar {
  width: 40px; height: 40px; border-radius: 50%; background: #0A2558;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
nav .profile-details .admin_name { font-size: 15px; font-weight: 500; color: #333; white-space: nowrap; }

/* Page content */
.page-content { padding: 100px 20px 20px; }

/* Dashcards (MIPS style) */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }
.dashcard {
  border-radius: 16px; padding: 20px 24px; color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 16px;
}
.dashcard .icon-badge {
  width: 50px; height: 50px; border-radius: 12px; background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.dashcard .dash-body { flex: 1; }
.dashcard .dash-label { font-size: 12px; opacity: 0.85; font-weight: 400; margin: 0; }
.dashcard .dash-value { font-size: 28px; font-weight: 700; margin: 2px 0; line-height: 1.2; }
.dashcard .dash-sub { font-size: 11px; opacity: 0.75; margin: 0; }
.color-one { background: linear-gradient(135deg, #667eea, #764ba2); }
.color-two { background: linear-gradient(135deg, #f093fb, #f5576c); }
.color-three { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.color-four { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.color-five { background: linear-gradient(135deg, #fa709a, #fee140); }
.color-six { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }

/* Quick stat cards */
.quick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.quick-stat-card {
  background: #fff; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  padding: 18px 20px; display: flex; align-items: center; gap: 14px;
}
.quick-stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; flex-shrink: 0;
}
.quick-stat-icon.blue { background: linear-gradient(135deg, #0A2558, #1a3a7a); }
.quick-stat-icon.orange { background: linear-gradient(135deg, #fd7e14, #ff9f43); }
.quick-stat-icon.red { background: linear-gradient(135deg, #dc3545, #e66767); }
.quick-stat-icon.green { background: linear-gradient(135deg, #198754, #2dd4a8); }
.quick-stat-icon.purple { background: linear-gradient(135deg, #6f42c1, #8b5cf6); }
.quick-stat-body h4 { font-size: 22px; font-weight: 700; color: #0A2558; margin: 0; line-height: 1.2; }
.quick-stat-body p { font-size: 12px; color: #64748b; margin: 2px 0 0; font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }

/* Charts grid */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 800px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card {
  background: #fff; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  padding: 24px; margin-bottom: 0;
}
.chart-card h5 { font-size: 16px; font-weight: 600; color: #0A2558; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.chart-card .chart-wrap { position: relative; width: 100%; height: 300px; }
.chart-card .chart-wrap-sm { height: 240px; }
.chart-card .chart-wrap-low { height: 200px; }
@media (max-width: 640px) { .chart-card .chart-wrap { height: 220px; } .chart-card .chart-wrap-sm { height: 200px; } .chart-card .chart-wrap-low { height: 160px; } }

/* Activity card */
.activity-card { background: #fff; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,0.08); padding: 20px; }
.activity-card h4 { font-size: 16px; font-weight: 600; color: #0A2558; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-dot.green { background: #198754; }
.activity-dot.orange { background: #fd7e14; }
.activity-dot.blue { background: #0d6efd; }
.activity-dot.red { background: #dc3545; }
.activity-dot.purple { background: #6f42c1; }
.activity-text { flex: 1; font-size: 13px; }
.activity-text strong { color: #0A2558; }
.activity-text .time { color: #999; font-size: 11px; display: block; margin-top: 2px; }

/* Dashboard row with sidebar panel */
.dashboard-row { display: flex; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.dashboard-main { flex: 1; min-width: 0; }
.dashboard-sidebar-panel { width: 340px; flex-shrink: 0; }
@media (max-width: 900px) { .dashboard-sidebar-panel { width: 100%; } }

/* Page Header */
.page-header {
  margin-bottom: 24px;
}
.page-header h2 { font-size: 24px; font-weight: 600; color: #0A2558; display: flex; align-items: center; gap: 8px; }
.page-header p { color: #64748b; font-size: 14px; margin: 4px 0 0; }

/* Overview boxes (original MIPS style) */
.overview-boxes { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; margin-bottom: 26px; }
.overview-boxes .box {
  flex: 1; min-width: 180px; background: #fff; padding: 15px 14px;
  border-radius: 12px; box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}
.overview-boxes .box-topic { font-size: 20px; font-weight: 500; }
.overview-boxes .box .number { font-size: 35px; font-weight: 500; }
.overview-boxes .box .cart {
  font-size: 32px; height: 50px; width: 50px; background: #cce5ff;
  line-height: 50px; text-align: center; color: #66b0ff; border-radius: 12px;
  margin: -15px 0 0 6px; float: right;
}
.overview-boxes .box .cart.two { color: #2BD47D; background: #C0F2D8; }
.overview-boxes .box .cart.three { color: #ffc233; background: #ffe8b3; }
.overview-boxes .box .cart.four { color: #e05260; background: #f7d4d7; }

/* Cards (general purpose) */
.card { background: #fff; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,0.08); margin-bottom: 20px; }
.card-header { padding: 20px 24px 0; display: flex; justify-content: space-between; align-items: center; }
.card-header h5 { font-size: 16px; font-weight: 600; color: #0A2558; }
.card-body { padding: 20px 24px; }

/* Tables */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table thead { background: #f8fafc; }
table th { padding: 12px 16px; text-align: left; font-weight: 600; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 2px solid #e2e8f0; }
table td { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; color: #334155; }
table tbody tr:hover { background: #f8fafc; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #475569; margin-bottom: 4px; }
.form-group label i { margin-right: 6px; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; font-family: 'Poppins', sans-serif; transition: border-color 0.2s;
  background: #fff;
}
.form-control:focus { outline: none; border-color: #0A2558; box-shadow: 0 0 0 3px rgba(10,37,88,0.1); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-text { font-size: 12px; color: #94a3b8; margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border-radius: 8px; font-size: 14px; font-weight: 500; font-family: 'Poppins', sans-serif;
  border: none; cursor: pointer; text-decoration: none; transition: all 0.3s;
}
.btn-primary { background: #0A2558; color: #fff; }
.btn-primary:hover { background: #0d3073; }
.btn-success { background: #198754; color: #fff; }
.btn-success:hover { background: #157347; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #bb2d3b; }
.btn-warning { background: #ffc107; color: #000; }
.btn-warning:hover { background: #ffca2c; }
.btn-outline { background: transparent; color: #0A2558; border: 1.5px solid #0A2558; }
.btn-outline:hover { background: #0A2558; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 500;
}
.badge-primary { background: #e8eeff; color: #0A2558; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-accent { background: #dbeafe; color: #1e40af; }

/* Alert */
.alert {
  padding: 14px 18px; border-radius: 12px; font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.alert-info { background: #e8eeff; color: #0A2558; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }

/* Grid utilities */
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.row > .col { flex: 1; min-width: 0; }
.col-12 { width: 100%; }
.col-md-6 { width: calc(50% - 10px); }
.col-md-4 { width: calc(33.33% - 14px); }
.col-md-3 { width: calc(25% - 15px); }
@media (max-width: 768px) {
  .col-md-6, .col-md-4, .col-md-3 { width: 100%; }
}

/* Flex helpers */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.me-1 { margin-right: 8px; }
.me-2 { margin-right: 16px; }
.ms-1 { margin-left: 8px; }
.ms-2 { margin-left: 16px; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: #94a3b8; }
.w-100 { width: 100%; }
.d-none { display: none; }
.d-block { display: block; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 999; display: none;
}
.sidebar-overlay.show { display: block; }

/* Print */
@media print {
  .sidebar, .home-section nav, .no-print { display: none !important; }
  .home-section { width: 100% !important; left: 0 !important; }
  .page-content { padding: 20px !important; }
}

/* Responsive */
@media (max-width: 1240px) {
  .sidebar { width: 60px; }
  .sidebar.active { width: 220px; }
  .home-section { width: calc(100% - 60px); left: 60px; }
  .sidebar.active ~ .home-section { left: 220px; }
  .home-section nav { width: calc(100% - 60px); left: 60px; }
  .sidebar.active ~ .home-section nav { width: calc(100% - 220px); left: 220px; }
}
@media (max-width: 700px) {
  nav .sidebar-button .dashboard, nav .profile-details .admin_name { display: none; }
  .home-section nav .profile-details { min-width: 40px; }
}
@media (max-width: 550px) {
  .dash-grid { grid-template-columns: 1fr; }
  .quick-stats { grid-template-columns: 1fr; }
  .sidebar.active ~ .home-section nav .profile-details { display: none; }
}
@media (max-width: 400px) {
  .sidebar { width: 0; }
  .sidebar.active { width: 60px; }
  .home-section { width: 100%; left: 0; }
  .sidebar.active ~ .home-section { left: 60px; width: calc(100% - 60px); }
  .home-section nav { width: 100%; left: 0; }
  .sidebar.active ~ .home-section nav { left: 60px; width: calc(100% - 60px); }
}

/* Legacy compatibility aliases */
.page-header-modern { margin-bottom: 24px; }
.page-header-modern h2 { font-size: 24px; font-weight: 600; color: #0A2558; display: flex; align-items: center; gap: 8px; }
.page-header-modern p { color: #64748b; font-size: 14px; margin: 4px 0 0; }
.card-modern { background: #fff; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,0.08); margin-bottom: 20px; }
.card-modern-header { padding: 20px 24px 0; display: flex; justify-content: space-between; align-items: center; }
.card-modern-header h5 { font-size: 16px; font-weight: 600; color: #0A2558; }
.card-modern-body { padding: 20px 24px; }
.stat-card-modern { background: #fff; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.06); padding: 18px 20px; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex: 1; min-width: 180px; }
.stat-card-modern .stat-value { font-size: 22px; font-weight: 700; color: #0A2558; line-height: 1.2; }
.stat-card-modern .stat-label { font-size: 12px; color: #64748b; font-weight: 500; text-transform: uppercase; letter-spacing: .3px; margin: 2px 0 0; }
.stat-card-modern .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; flex-shrink: 0; }
.stat-card-modern .stat-trend { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.row-modern, .row-modern-2 { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.row-modern-2 > * { flex: 1; min-width: 0; }
.btn-modern { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; border: none; cursor: pointer; text-decoration: none; transition: all 0.3s; font-family: 'Poppins', sans-serif; }
.btn-modern-accent { background: #0A2558; color: #fff; }
.btn-modern-accent:hover { background: #0d3073; }
.btn-modern-outline { background: transparent; color: #0A2558; border: 1.5px solid #0A2558; }
.btn-modern-outline:hover { background: #0A2558; color: #fff; }
.btn-modern-primary { background: #0A2558; color: #fff; }
.btn-modern-primary:hover { background: #0d3073; }
.btn-modern-danger { background: #dc3545; color: #fff; }
.btn-modern-danger:hover { background: #bb2d3b; }
.btn-modern-sm { padding: 6px 12px; font-size: 12px; }
.btn-modern-lg { padding: 14px 28px; font-size: 16px; }
.alert-modern { padding: 14px 18px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.alert-modern-success { background: #d1fae5; color: #065f46; }
.alert-modern-danger { background: #fee2e2; color: #991b1b; }
.alert-modern-info { background: #e8eeff; color: #0A2558; }
.badge-modern { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-modern-primary { background: #e8eeff; color: #0A2558; }
.badge-modern-accent { background: #dbeafe; color: #1e40af; }
.badge-modern-success { background: #d1fae5; color: #065f46; }
.badge-modern-danger { background: #fee2e2; color: #991b1b; }
.form-modern { /* no special style needed, basic form */ }
.chart-card-modern { background: #fff; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,0.08); padding: 24px; margin-bottom: 20px; }
.chart-card-modern .chart-title { font-size: 16px; font-weight: 600; color: #0A2558; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }


