/* Admin Panel Styles */
:root {
  --primary: #e63946;
  --secondary: #1d3557;
  --accent: #457b9d;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --border: #dee2e6;
  --sidebar-w: 240px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; background: #f0f2f5; color: #212529; }
a { text-decoration: none; color: var(--accent); }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--secondary);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
}
.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 16px;
  font-weight: 800;
}
.sidebar-logo span { color: var(--primary); }
.sidebar-logo small { display: block; font-size: 10px; font-weight: 400; opacity: .6; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section { 
  font-size: 10px; 
  font-weight: 700; 
  text-transform: uppercase; 
  letter-spacing: 1px; 
  color: rgba(255,255,255,.4);
  padding: 12px 16px 4px;
}
.nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,.8);
  transition: all .15s;
  font-size: 13px;
}
.nav-item a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active a { background: var(--primary); color: #fff; }
.nav-item a .icon { width: 18px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--warning);
  color: #000;
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
  color: rgba(255,255,255,.5);
}

/* Main Content */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: #fff;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.admin-content { padding: 24px; flex: 1; }

/* Cards */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.stat-icon.blue { background: #e3f2fd; }
.stat-icon.red { background: #fce4ec; }
.stat-icon.green { background: #e8f5e9; }
.stat-icon.orange { background: #fff3e0; }
.stat-icon.purple { background: #f3e5f5; }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 12px; color: var(--gray); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  white-space: nowrap;
}
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #c1121f; color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #162d4a; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1e7e34; color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #e0a800; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #bd2130; color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--dark); }
.btn-outline:hover { background: var(--light); }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--light); font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--gray); white-space: nowrap; }
tr:hover td { background: #fafbff; }
.table-img { width: 50px; height: 40px; object-fit: cover; border-radius: 4px; background: #f0f2f5; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-secondary { background: #e2e3e5; color: #383d41; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  background: #fff;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(69,123,157,.15); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-danger { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }
.alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--info); }

/* Problem items */
.problem-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #f8d7da; color: #721c24; margin: 2px; }

/* Checkbox */
.checkbox-all, .row-check { cursor: pointer; width: 16px; height: 16px; }

/* Bulk actions bar */
.bulk-actions-bar {
  background: var(--secondary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  display: none;
}
.bulk-actions-bar.visible { display: flex; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--light);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: #f0f7ff;
}
.upload-zone .icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone p { color: var(--gray); font-size: 14px; }

/* Charts */
.chart-wrap { position: relative; height: 280px; }

/* Tabs */
.tab-nav { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray); }

/* Search in admin */
.admin-search { display: flex; gap: 8px; }
.admin-search input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; width: 240px; }

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .3s; }
  .admin-sidebar.open { transform: none; }
  .admin-main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
