/* ===== ADMIN LAYOUT ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--primary-darker);
  color: white;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.sidebar-logo {
  font-family: 'Brush Script MT', 'Segoe Script', cursive;
  font-size: 24px;
  color: white;
  display: block;
}

.sidebar-badge {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 2px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: rgba(59,180,217,0.2); color: var(--primary); border-right: 3px solid var(--primary); }
.nav-item i { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.admin-name { font-size: 13px; }
.admin-role { font-size: 11px; opacity: 0.6; }

/* Main content */
.admin-main {
  flex: 1;
  margin-left: 260px;
  background: var(--bg-light);
}

.admin-topbar {
  background: white;
  padding: 16px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title { font-size: 20px; font-weight: 700; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #2ea3c7; }
.btn-danger { background: var(--accent-red); color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-secondary { background: #e5e7eb; color: var(--text-dark); }
.btn-secondary:hover { background: #d1d5db; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid #d1d5db; color: var(--text-dark); }
.btn-outline:hover { background: #f3f4f6; }

.admin-content {
  padding: 30px;
}

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.stat-icon.blue { background: var(--accent-blue); }
.stat-icon.green { background: var(--accent-green); }
.stat-icon.orange { background: var(--accent-orange); }
.stat-icon.red { background: var(--accent-red); }

.stat-number { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ===== DATA TABLE ===== */
.data-table-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

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

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border-radius: 8px;
  padding: 6px 14px;
}

.table-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  width: 180px;
}

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

.data-table th {
  text-align: left;
  padding: 12px 24px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: #fafbfc;
  border-bottom: 1px solid #e5e7eb;
}

.data-table td {
  padding: 14px 24px;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
}

.data-table tr:hover td { background: #f8fafc; }

.table-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(59,180,217,0.12);
  color: var(--primary-dark);
}

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

/* ===== FORMS ===== */
.form-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

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

.form-panel {
  background: white;
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.form-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-header h2 { font-size: 18px; font-weight: 700; }

.form-body { padding: 24px; }

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,180,217,0.15);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

/* ===== SECTIONS (hidden by default) ===== */
.admin-section { display: none; }
.admin-section.active { display: block; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary-dark);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ===== MOBILE SIDEBAR TOGGLE ===== */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary-dark);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
}

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-card .logo-title {
  font-size: 32px;
  margin-bottom: 4px;
}

.login-card .logo-subtitle {
  margin-bottom: 30px;
}

.login-card .form-group { text-align: left; }

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.login-btn:hover { background: #2ea3c7; }

.login-error {
  color: var(--accent-red);
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .stats-grid { grid-template-columns: 1fr; }

  .data-table-container { overflow-x: auto; }
  .data-table { min-width: 600px; }
}
