/* ============================================
   ADMIN DASHBOARD - RS AMC CMS
   ============================================ */

:root {
  --primary: #396cf0;
  --primary-dark: #0f61ef;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #0f61ef;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f1f5f9;
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: all 0.3s ease;
}

.sidebar-brand {
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.sidebar-brand h5 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.sidebar-brand small {
  color: #94a3b8;
  font-size: 11px;
}

.sidebar-menu {
  padding: 12px 0;
}

.sidebar-menu .menu-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 20px 8px;
}

.sidebar-menu .nav-item {
  display: block;
}

.sidebar-menu .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
}

.sidebar-menu .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--primary);
}

.sidebar-menu .nav-link.active {
  background: rgba(57, 108, 240, 0.15);
  color: #fff;
  border-left-color: var(--primary);
}

.sidebar-menu .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-menu .nav-link .badge {
  margin-left: auto;
  font-size: 11px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOP NAVBAR ===== */
.topbar {
  background: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 999;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left h4 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.topbar-left .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right .user-info {
  text-align: right;
}

.topbar-right .user-info small {
  color: #64748b;
  font-size: 12px;
}

.topbar-right .user-info strong {
  display: block;
  font-size: 14px;
  color: #1e293b;
}

/* ===== PAGE CONTENT ===== */
.page-content {
  padding: 24px;
  flex: 1;
}

/* ===== STAT CARDS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-card .stat-icon.blue {
  background: #eff6ff;
  color: #2563eb;
}

.stat-card .stat-icon.green {
  background: #f0fdf4;
  color: #16a34a;
}

.stat-card .stat-icon.purple {
  background: #faf5ff;
  color: #9333ea;
}

.stat-card .stat-icon.orange {
  background: #fff7ed;
  color: #ea580c;
}

.stat-card .stat-icon.red {
  background: #fef2f2;
  color: #dc2626;
}

.stat-card .stat-icon.teal {
  background: #f0fdfa;
  color: #0d9488;
}

.stat-card .stat-info h3 {
  font-size: 26px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 2px;
  line-height: 1.2;
}

.stat-card .stat-info p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

/* ===== CARDS ===== */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  border: none;
  margin-bottom: 24px;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid #f1f5f9;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h5 {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.card-body {
  padding: 24px;
}

/* ===== TABLES ===== */
.table {
  margin-bottom: 0;
}

.table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 2px solid #e2e8f0;
}

.table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  color: #334155;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:hover {
  background: #f8fafc;
}

.table .btn-action {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 8px;
  margin: 0 2px;
}

.table .img-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

/* ===== FORMS ===== */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-control, .form-select {
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  padding: 10px 14px;
  font-size: 14px;
  transition: all 0.25s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(57, 108, 240, 0.12);
}

.form-control-lg {
  padding: 14px 18px;
  font-size: 16px;
}

textarea.form-control {
  min-height: 120px;
}

/* ===== BUTTONS ===== */
.btn {
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 22px;
  transition: all 0.25s ease;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-success {
  background: #16a34a;
  border-color: #16a34a;
}

.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-warning {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

.btn-info {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #fff;
}

/* ===== ALERTS ===== */
.alert {
  border-radius: 12px;
  border: none;
  padding: 14px 20px;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  margin: 0;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-card .login-logo img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 12px;
}

.login-card .login-logo h4 {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

.login-card .login-logo p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.login-card .form-control {
  padding: 12px 16px;
  font-size: 15px;
}

.login-card .btn {
  padding: 12px;
  font-size: 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .sidebar {
    width: 220px;
  }
  .main-content {
    margin-left: 220px;
  }
}

@media (max-width: 767px) {
  .sidebar {
    width: 0;
    overflow: hidden;
  }
  .sidebar.show {
    width: 260px;
  }
  .main-content {
    margin-left: 0;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .topbar-left h4 {
    font-size: 15px;
  }
  .page-content {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== MISC ===== */
.text-primary { color: var(--primary) !important; }
.bg-primary { background: var(--primary) !important; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h5 {
  font-size: 18px;
  color: #64748b;
  margin-bottom: 8px;
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Preview Image */
.preview-img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 4px;
  margin-top: 8px;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.active {
  background: #dcfce7;
  color: #166534;
}

.status-badge.inactive {
  background: #fef2f2;
  color: #991b1b;
}

