/*
 * AYURKSHETHRA Admin Dashboard Stylesheet — Premium & Modern Theme
 */

:root {
  --admin-primary: #0d5c3a;
  --admin-primary-light: #e8f5ee;
  --admin-dark: #062e1c;
  --admin-dark-grad: linear-gradient(180deg, #052417 0%, #0c4a2f 100%);
  --admin-accent: #d99b26;
  --admin-accent-hover: #b8801c;
  --admin-bg: #f1f5f9;
  --admin-card: #ffffff;
  --admin-text: #0f172a;
  --admin-muted: #64748b;
  --admin-border: #cbd5e1;
  --admin-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  --admin-shadow-hover: 0 12px 28px rgba(13, 92, 58, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'Montserrat', -apple-system, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── AUTH PAGES (Login & Register) ── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #041f14 0%, #0d5c3a 100%);
  padding: 20px;
}

.auth-card {
  background: var(--admin-card);
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--admin-primary);
  margin-bottom: 6px;
}

.auth-header p {
  font-size: 0.875rem;
  color: var(--admin-muted);
}

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

.auth-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--admin-text);
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(13, 92, 58, 0.15);
}

.auth-btn {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--admin-primary) 0%, #0a4d2e 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(13, 92, 58, 0.25);
  transition: all 0.2s ease;
}

.auth-btn:hover {
  background: linear-gradient(135deg, #073823 0%, var(--admin-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(13, 92, 58, 0.35);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--admin-muted);
}

.auth-footer a {
  color: var(--admin-primary);
  font-weight: 600;
  text-decoration: none;
}

/* ── DASHBOARD LAYOUT ── */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 275px;
  background: var(--admin-dark-grad);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--admin-accent);
  letter-spacing: 0.6px;
}

.sidebar-group-label {
  padding: 18px 24px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.sidebar-menu {
  padding: 10px 0 20px;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-left-color: var(--admin-accent);
  padding-left: 28px;
}

.menu-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-weight: 700;
  border-left-color: var(--admin-accent);
}

.menu-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-badge {
  background: var(--admin-accent);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
}

.sidebar-footer {
  padding: 18px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

/* ── MAIN CONTENT AREA ── */
.main-content {
  margin-left: 275px;
  flex-grow: 1;
  padding: 32px 36px;
  max-width: calc(100vw - 275px);
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  background: var(--admin-card);
  padding: 20px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  box-shadow: var(--admin-shadow);
}

.page-title h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--admin-primary);
  letter-spacing: -0.3px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--admin-primary) 0%, #15803d 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(13, 92, 58, 0.25);
}

/* ── SECTION JUMP PILLS ── */
.editor-section-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  background: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: var(--admin-shadow);
  align-items: center;
}

.section-pill-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--admin-primary);
  text-transform: uppercase;
  margin-right: 4px;
}

.section-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
  cursor: pointer;
}

.section-pill-btn:hover {
  background: var(--admin-primary);
  color: white;
  border-color: var(--admin-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(13, 92, 58, 0.2);
}

/* ── METRICS CARDS ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--admin-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--admin-shadow);
  border: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.25s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--admin-shadow-hover);
  border-color: rgba(13, 92, 58, 0.2);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #e8f5ee;
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.metric-info h4 {
  font-size: 0.8rem;
  color: var(--admin-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-info .count {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--admin-text);
  line-height: 1.2;
}

/* ── FORM CARDS & EDITORS ── */
.page-section-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--admin-shadow);
  transition: box-shadow 0.2s ease;
}

.page-section-card:hover {
  box-shadow: var(--admin-shadow-hover);
}

.page-section-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--admin-text);
  background: #ffffff;
  transition: all 0.2s ease;
}

.form-input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(13, 92, 58, 0.12);
  background: #ffffff;
}

.auth-btn, .btn-submit-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--admin-primary) 0%, #0a4d2e 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 92, 58, 0.2);
  transition: all 0.2s ease;
}

.auth-btn:hover, .btn-submit-card:hover {
  background: linear-gradient(135deg, #073823 0%, var(--admin-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(13, 92, 58, 0.3);
}

/* ── DATA TABLES ── */
.data-card {
  background: var(--admin-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow);
  margin-bottom: 30px;
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--admin-primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table th {
  background: #f1f5f9;
  padding: 14px 20px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--admin-border);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}

.admin-table tr:hover {
  background-color: #f8fafc;
}

/* ── BADGES & BUTTONS ── */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-new { background: #dbeafe; color: #1e40af; }
.badge-contacted { background: #fef3c7; color: #92400e; }
.badge-enrolled { background: #d1fae5; color: #065f46; }
.badge-archived { background: #f3f4f6; color: #4b5563; }

.btn-action {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-edit { background: #e0f2fe; color: #0369a1; }
.btn-delete { background: #fee2e2; color: #b91c1c; }

/* ── DESKTOP GRID LAYOUT OPTIMIZATIONS ── */
.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.admin-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.admin-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.img-upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-upload-img {
  background: #f1f5f9;
  color: var(--admin-primary);
  border: 1px solid var(--admin-border);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-upload-img:hover {
  background: var(--admin-primary);
  color: white;
  border-color: var(--admin-primary);
}

.img-preview-box {
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  margin-top: 10px;
  object-fit: cover;
}

/* Sticky Section Jump Pills Bar for Desktop */
.editor-section-pills {
  position: sticky;
  top: 12px;
  z-index: 95;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}

/* Sticky Desktop Table Headers */
.admin-table th {
  position: sticky;
  top: 0;
  z-index: 5;
}

@media (min-width: 1400px) {
  .main-content {
    padding: 36px 48px;
  }
}

@media (max-width: 1200px) {
  .admin-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; max-width: calc(100vw - 220px); padding: 20px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-2, .admin-grid-3, .admin-grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dashboard-container { flex-direction: column; }
  .sidebar { width: 100%; position: relative; }
  .main-content { margin-left: 0; max-width: 100%; padding: 16px; }
  .metrics-grid { grid-template-columns: 1fr; }
}
