/* ====================================================================
   Admin CMS Master Stylesheet — State-wise E-Lottery & Tender Portal
   ==================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --admin-sidebar-bg: #0b192c;
  --admin-sidebar-hover: #1e3e62;
  --admin-primary: #1a3a6b;
  --admin-secondary: #ff6b00;
  --admin-bg: #f8fafc;
  --admin-card: #ffffff;
  --admin-text: #0f172a;
  --admin-muted: #64748b;
  --admin-border: #e2e8f0;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  margin: 0;
  padding: 0;
}

/* Layout */
.admin-wrapper,
.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.admin-sidebar {
  width: 275px;
  min-width: 275px;
  max-width: 275px;
  background: var(--admin-sidebar-bg);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 100vh;
  position: sticky;
  top: 0;
  z-index: 1030;
}

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

.sidebar-nav,
.sidebar-menu {
  list-style: none;
  padding: 15px 0;
  margin: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.nav-section-label,
.sidebar-heading {
  padding: 14px 20px 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #475569;
  font-weight: 700;
}

.nav-link-item,
.sidebar-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
}

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

.nav-link-item i,
.sidebar-item a i {
  font-size: 16px;
}

/* Sidebar Collapsible Submenu Structure */
.sidebar-group {
  display: flex;
  flex-direction: column;
}

.sidebar-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sidebar-chevron-btn {
  background: transparent;
  border: none;
  color: #64748b;
  padding: 3px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-left: auto;
  transition: all 0.2s ease;
}

.sidebar-chevron-btn:hover {
  color: #f59e0b;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-group-chevron {
  font-size: 11px;
  transition: transform 0.25s ease;
  color: #64748b;
}

.sidebar-group.open .sidebar-group-chevron,
.sidebar-group.open .sidebar-chevron-btn .sidebar-group-chevron {
  transform: rotate(90deg);
  color: #f59e0b;
}

.sidebar-submenu {
  display: none;
  flex-direction: column;
  background: rgba(4, 11, 22, 0.45);
  padding: 4px 0 6px 0;
  border-left: 2px solid rgba(255, 107, 0, 0.25);
  margin-left: 20px;
  margin-right: 10px;
  border-radius: 0 8px 8px 0;
}

.sidebar-group.open .sidebar-submenu {
  display: flex;
}

.submenu-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 14px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
  border-radius: 4px;
}

.submenu-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.submenu-link.active {
  color: #ff9933;
  background: rgba(255, 107, 0, 0.12);
  font-weight: 600;
}

.submenu-link i {
  font-size: 13px;
  opacity: 0.85;
}

.submenu-badge {
  margin-left: auto;
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Floating Admin Toast Notification System */
.admin-toast-container {
  position: fixed;
  top: 20px;
  right: 25px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.admin-toast {
  pointer-events: auto;
  background: #0f172a;
  color: #ffffff;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border-left: 4px solid #10b981;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  animation: toastSlideIn 0.3s ease-out;
  transition: all 0.3s ease;
}

.admin-toast.toast-danger { border-left-color: #ef4444; }
.admin-toast.toast-warning { border-left-color: #f59e0b; }
.admin-toast.toast-info { border-left-color: #0ea5e9; }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

/* Main Content Area */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Top Navbar & Standardized Topbar */
.admin-navbar, .admin-topbar {
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  position: relative;
  z-index: 100;
}

.admin-navbar > div:first-child, .admin-topbar > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.admin-navbar .fw-semibold, .admin-topbar h5 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

.admin-navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Content Body */
.admin-content {
  padding: 25px;
  flex-grow: 1;
}

/* Stat Cards */
.stat-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* Tables */
.admin-table-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
}

.admin-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  font-size: 13.5px;
  vertical-align: middle;
}

/* Admin Notification Bell with Red Pulsing Symbol */
.admin-notif-btn {
  position: relative;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.admin-notif-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.admin-notif-btn.has-alerts {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.admin-red-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #dc2626;
  border: 2px solid #ffffff;
  animation: admin-pulse 1.6s infinite;
}

/* Header Live Status & Server Uptime Widget */
.admin-live-widget {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.admin-live-divider {
  width: 1px;
  height: 12px;
  background: #cbd5e1;
  display: inline-block;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: uptime-pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes uptime-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes admin-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Payments Module Sub-Menu / Tabs */
.payments-subnav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--admin-border);
  padding-bottom: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.payments-tab-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.payments-tab-btn:hover {
  background: #f8fafc;
  color: var(--admin-primary);
  border-color: #cbd5e1;
}

.payments-tab-btn.active {
  background: var(--admin-primary);
  color: #ffffff;
  border-color: var(--admin-primary);
  box-shadow: 0 4px 12px rgba(26, 58, 107, 0.25);
}

/* QR Code Card in Admin */
.qr-admin-preview-box {
  width: 130px;
  height: 130px;
  border-radius: 8px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.qr-admin-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Strict Sizing for All Admin Toggle Switches (Prevents Long/Stretched Buttons) */
.form-check.form-switch {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 24px;
}

.form-check.form-switch .form-check-input {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  margin-top: 0 !important;
  background-size: contain !important;
  border-radius: 20px !important;
}

.form-check.form-switch .form-check-label {
  cursor: pointer;
  user-select: none;
}

/* ====================================================================
   MOBILE & TABLET RESPONSIVE ERGONOMICS (ALL VIEWPORTS)
   ==================================================================== */
.admin-mobile-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-primary);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 25, 44, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1045;
  transition: opacity 0.3s ease;
}

.admin-sidebar-backdrop.show {
  display: block;
}

@media (max-width: 991.98px) {
  .admin-mobile-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -285px;
    width: 280px;
    max-width: 280px;
    min-width: 280px;
    height: 100vh;
    z-index: 1050;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.45);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .admin-sidebar.show {
    left: 0;
  }

  .admin-main {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }

  .admin-navbar, .admin-topbar {
    padding: 0 12px;
    height: 56px;
    min-height: 56px;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .admin-live-widget {
    padding: 2px 8px;
    font-size: 10.5px;
    gap: 6px;
  }

  .admin-content {
    padding: 16px 12px;
  }

  .payments-subnav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: thin;
  }

  .payments-tab-btn {
    padding: 7px 14px;
    font-size: 12.5px;
  }

  .upi-account-card .col-md-2.text-center {
    margin-bottom: 12px;
  }

  .qr-admin-preview-box {
    margin: 0 auto 8px auto;
  }
}

/* Ensure Wide Scrutiny & Payment Tables Scroll Horizontally without Crushing Content */
.table-responsive .table {
  min-width: 960px;
}

.table-responsive {
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Responsive UPI Card Grid */
.upi-account-card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  background: #ffffff;
}

.upi-account-card:hover {
  border-color: #93c5fd !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
}

@media (max-width: 767.98px) {
  .upi-account-card .row.g-2 > div {
    margin-bottom: 6px;
  }

  .stat-card {
    padding: 14px;
  }

  .admin-navbar .fw-semibold, .admin-topbar h5 {
    font-size: 12px !important;
    max-width: 150px;
  }

  .admin-navbar-actions .btn {
    padding: 3px 8px;
    font-size: 11px;
  }
}

/* Real-Time Live Sync & Analytics Indicators */
.live-pulse-dot {
  width: 10px;
  height: 10px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* State Distribution Leaderboard */
.state-progress-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
}

.state-progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Real-Time Live Activity Stream */
.activity-stream-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 14px;
}

.activity-stream-item::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.activity-stream-item:last-child::before {
  display: none;
}

.activity-stream-dot {
  position: absolute;
  left: 3px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
}

/* Screenshot Lightbox Preview Modal Controls */
.screenshot-preview-wrapper {
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  position: relative;
  min-height: 240px;
}

.screenshot-preview-wrapper img {
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.screenshot-preview-wrapper.zoomed img {
  transform: scale(1.65);
  cursor: zoom-out;
}



