/* ============ VARIABLES ============ */
:root {
  --admin-bg: #0a1929;
  --admin-surface: #132f4c;
  --admin-surface-2: #1a3a5c;
  --admin-border: #1e3a5f;
  --admin-accent: #f0b90b;
  --admin-accent-hover: #d4a00a;
  --admin-text: #e7ebf0;
  --admin-text-muted: #9fadbc;
  --admin-success: #00c853;
  --admin-danger: #ff3d57;
  --admin-warning: #ffab00;
  --admin-info: #29b6f6;
  --admin-sidebar-w: 260px;
  --admin-header-h: 64px;
}

* { box-sizing: border-box; }

.icon_img{
  width: 2rem;
  margin-right: -0.2rem;
}

.admin-app {
  min-height: 100vh;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-family: 'Segoe UI', Tahoma, sans-serif;
  display: flex;
}

/* ============ SIDEBAR ============ */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
}

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

.sidebar-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--admin-accent);
}
.sidebar-logo span { color: var(--admin-text); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 11px;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 12px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 8px;
  color: var(--admin-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--admin-surface-2);
  color: var(--admin-text);
}

.nav-item.active {
  background: rgba(240, 185, 11, 0.15);
  color: var(--admin-accent);
}

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

.nav-badge {
  margin-left: auto;
  background: var(--admin-danger);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}

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

/* ============ MAIN AREA ============ */
.admin-main {
  flex: 1;
  margin-left: var(--admin-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ HEADER ============ */
.admin-header {
  height: var(--admin-header-h);
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--admin-text);
  font-size: 24px;
  cursor: pointer;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
}

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

.search-box {
  position: relative;
}

.search-box input {
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  padding: 8px 12px 8px 36px;
  border-radius: 6px;
  font-size: 14px;
  width: 240px;
  transition: border 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--admin-accent);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--admin-text-muted);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--admin-surface-2);
  border-color: var(--admin-accent);
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--admin-danger);
  border-radius: 50%;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}

.user-profile:hover { background: var(--admin-surface-2); }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--admin-accent), #ff8a00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--admin-bg);
  font-size: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--admin-text-muted); }

/* ============ CONTENT ============ */
.admin-content {
  flex: 1;
  padding: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
  /* width: 80%;
  float: inline-end;
  margin-right: 2%; */
}
.pages-container {
    width: 80%;
    float: inline-end;
    margin-right: 2%;
    margin-top: 2%;
}

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

.page-header p {
  color: var(--admin-text-muted);
  font-size: 14px;
  margin-top: 4px;
}

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

.btn-primary {
  background: var(--admin-accent);
  color: var(--admin-bg);
}
.btn-primary:hover { background: var(--admin-accent-hover); }

.btn-secondary {
  background: var(--admin-surface-2);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
}
.btn-secondary:hover { background: var(--admin-surface); border-color: var(--admin-accent); }

.btn-danger {
  background: transparent;
  color: var(--admin-danger);
  border: 1px solid var(--admin-danger);
}
.btn-danger:hover { background: var(--admin-danger); color: #fff; }

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

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

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

.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--admin-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-accent, var(--admin-accent));
}

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

.stat-label {
  font-size: 13px;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(240, 185, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--card-accent, var(--admin-accent));
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}

.stat-change {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

/* ============ DATA TABLE ============ */
.table-container {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--admin-border);
  flex-wrap: wrap;
  gap: 12px;
}

.table-toolbar h3 {
  font-size: 16px;
  font-weight: 700;
}

.table-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select, .filter-input {
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.filter-select:focus, .filter-input:focus {
  outline: none;
  border-color: var(--admin-accent);
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.data-table th {
  background: var(--admin-surface-2);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--admin-border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 14px;
}

.data-table tr:hover td {
  background: rgba(240, 185, 11, 0.04);
}

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

/* Status badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: rgba(0, 200, 83, 0.15); color: var(--admin-success); }
.badge-danger { background: rgba(255, 61, 87, 0.15); color: var(--admin-danger); }
.badge-warning { background: rgba(255, 171, 0, 0.15); color: var(--admin-warning); }
.badge-info { background: rgba(41, 182, 246, 0.15); color: var(--admin-info); }
.badge-neutral { background: rgba(159, 173, 188, 0.15); color: var(--admin-text-muted); }

.actions-cell {
  display: flex;
  gap: 6px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: transparent;
  color: var(--admin-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--admin-surface-2);
  color: var(--admin-accent);
  border-color: var(--admin-accent);
}

.action-btn.danger:hover {
  color: var(--admin-danger);
  border-color: var(--admin-danger);
}

.action-btn svg { width: 14px; height: 14px; }

/* Pagination */
.table-footer {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--admin-border);
  flex-wrap: wrap;
  gap: 12px;
}

.table-info {
  font-size: 13px;
  color: var(--admin-text-muted);
}

.pagination {
  display: flex;
  gap: 4px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: transparent;
  color: var(--admin-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.page-btn.active {
  background: var(--admin-accent);
  color: var(--admin-bg);
  border-color: var(--admin-accent);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

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

.modal {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

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

.modal-header h3 { font-size: 18px; font-weight: 700; }

.modal-close {
  background: transparent;
  border: none;
  color: var(--admin-text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text-muted);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--admin-accent);
}

/* ============ CHARTS / EXTRA BOXES ============ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card, .info-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 20px;
}

.chart-card h3, .info-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.chart-placeholder {
  height: 260px;
  background: linear-gradient(180deg, transparent, rgba(240, 185, 11, 0.05));
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  gap: 8px;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--admin-accent), transparent);
  border-radius: 4px 4px 0 0;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.chart-bar:hover { opacity: 1; }

.activity-list { list-style: none; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--admin-border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--admin-accent);
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-text { font-size: 13px; line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--admin-text-muted); margin-top: 2px; }

/* ============ MOBILE OVERLAY ============ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .search-box input { width: 180px; }
  .pages-container {
      width:  96%;
      float: inline-end;
      margin-right: 2%;
      margin-top: 2%;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .pages-container {
      width:  96%;
      float: inline-end;
      margin-right: 2%;
      margin-top: 2%;
  }
  .sidebar-overlay.open { display: block; }
  .admin-main { margin-left: 0; }
  .menu-toggle { display: block; }
  .admin-content { padding: 16px; }
  .search-box { display: none; }
  .user-info { display: none; }
  .page-header h1 { font-size: 20px; }
  .stat-value { font-size: 24px; }

}

@media (max-width: 480px) {
  .pages-container {
      width:  96%;
      float: inline-end;
      margin-right: 2%;
      margin-top: 2%;
  }
  .admin-header { padding: 0 14px; }
  .stats-grid { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .table-filters { width: 100%; }
  .filter-select, .filter-input { flex: 1; }
}