/* 
   निर्माणलहर (Nirman Lahar) CMS - Admin Dashboard Stylesheet
   Modern, Clean, Responsive Management Console
*/

@import url('https://fonts.googleapis.com/css2?family=Mukta:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --admin-primary: #c21807;
  --admin-primary-dark: #9e1204;
  --admin-bg: #f1f5f9;
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-hover: #1e293b;
  --admin-card-bg: #ffffff;
  --admin-text: #1e293b;
  --admin-text-muted: #64748b;
  --admin-border: #e2e8f0;
  --admin-success: #16a34a;
  --admin-warning: #d97706;
  --admin-info: #0284c7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: 'Mukta', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

/* -----------------------------
   Login Overlay
----------------------------- */
.login-overlay {
  position: fixed;
  inset: 0;
  background: #0f172a;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 36px 30px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2);
  text-align: center;
}

.login-logo {
  font-size: 32px;
  font-weight: 800;
  color: var(--admin-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--admin-text-muted);
  margin-bottom: 24px;
}

.demo-credentials-box {
  background: #f8fafc;
  border: 1px dashed var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 20px;
  text-align: left;
  font-size: 13px;
}

.demo-btn-group {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.demo-btn {
  flex: 1;
  background: #e2e8f0;
  border: none;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.demo-btn:hover {
  background: var(--admin-primary);
  color: #fff;
}

/* -----------------------------
   Admin Layout: Sidebar + Main
----------------------------- */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar-bg);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 100vh;
  position: sticky;
  top: 0;
  z-index: 50;
}

.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid #1e293b;
}

.sidebar-brand-title {
  font-size: 24px;
  font-weight: 800;
  color: #ef4444;
}

.sidebar-brand-sub {
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.user-profile-widget {
  padding: 16px 20px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.user-details-box {
  overflow: hidden;
}

.user-name-text {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.role-admin { background: #fee2e2; color: #991b1b; }
.role-editor { background: #dbeafe; color: #1e40af; }
.role-reporter { background: #dcfce7; color: #166534; }

.sidebar-nav {
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item:hover, .nav-item.active {
  background: var(--admin-sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--admin-primary);
  color: #ffffff;
}

.nav-badge-pill {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
}

/* Admin Main Content Container */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.admin-topbar-title {
  font-size: 22px;
  font-weight: 800;
}

.admin-content-area {
  padding: 28px;
  flex: 1;
}

/* -----------------------------
   Stat Cards (Dashboard)
----------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--admin-card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.red { background: #fee2e2; color: #dc2626; }
.stat-icon.blue { background: #e0f2fe; color: #0284c7; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  font-size: 14px;
  color: var(--admin-text-muted);
}

/* -----------------------------
   Tables & Data Presentation
----------------------------- */
.table-card {
  background: var(--admin-card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 28px;
}

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

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

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

.data-table th {
  background: #f8fafc;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text-muted);
  border-bottom: 1px solid var(--admin-border);
  text-transform: uppercase;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 15px;
  vertical-align: middle;
}

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

.status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.status-published { background: #dcfce7; color: #15803d; }
.status-pending { background: #fef3c7; color: #b45309; }
.status-draft { background: #f1f5f9; color: #475569; }
.status-rejected { background: #fee2e2; color: #b91c1c; }

/* -----------------------------
   Buttons & Form Controls
----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary { background: var(--admin-primary); color: #fff; }
.btn-primary:hover { background: var(--admin-primary-dark); }

.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; }

.btn-success { background: var(--admin-success); color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 4px 10px; font-size: 13px; }

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

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--admin-text);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: #ffffff;
}

.form-control:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(194, 24, 7, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Modal Windows */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal {
  background: #fff;
  border-radius: var(--radius-md);
  max-width: 750px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2);
}

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

.admin-modal-body {
  padding: 24px;
}

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

/* Toast Notifications */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: #1e293b;
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 10000;
  animation: slideIn 0.25s ease;
}

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