/* Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap");

:root {
  /* THEME OVERHAUL: Deep Violet #35168b */
  --primary-color: #35168b;
  --primary-dark: #240d66;
  --primary-light: #5a3ab8;
  --primary-color-2: #513796;

  /* Contrast Accents */
  --accent-gold: #ffd700; /* High contrast against deep purple */
  --accent-orange: #ff9f1c; /* Kept for warmth */

  --primary-gradient: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );

  /* Text Colors */
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --text-on-primary: #ffffff;

  /* Backgrounds */
  --bg-light: #f3f4f6;
  --bg-white: #ffffff;

  --radius-lg: 1.5rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
}

body {
  font-family: "Outfit", sans-serif;
  color: var(--text-dark);
  margin: 0;
  overflow-x: auto;
  background-color: var(--bg-light);
}

.dropdown-toggle::after {
  color: azure;
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

/* ===========================
   LOGIN PAGE STYLES
   =========================== */

.auth-page-wrapper {
  min-height: 100vh;
  width: 100%;
  background:
    linear-gradient(rgb(53 22 139 / 53%), rgb(36 13 102)),
    url("https://images.unsplash.com/photo-1541339907198-e08756dedf3f?q=80&w=1920&auto=format&fit=crop");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 1000px;
  min-height: 600px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  overflow: hidden;
  position: relative;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-side-panel {
  flex: 1;
  background: var(--primary-gradient);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  text-align: center;
  position: relative;
  color: var(--text-on-primary);
}

.auth-side-panel h4,
.auth-side-panel h6,
.auth-side-panel p {
  color: var(--text-on-primary) !important;
}

.auth-form-panel {
  flex: 1;
  padding: 4rem 3rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-label {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.input-group-text {
  border-color: #e2e8f0;
  background-color: #f8fafc;
  color: var(--text-muted);
}

.form-control {
  border-color: #e2e8f0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(53, 22, 139, 0.15);
}

.btn-primary-dark {
  background-color: var(--primary-color);
  color: white;
  padding: 0.8rem;
  border-radius: 0.5rem;
  font-weight: 600;
  border: none;
  transition: var(--transition);
}

.btn-primary-dark:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  color: var(--accent-gold);
}

.captcha-box {
  background: #f1f5f9;
  padding: 0.8rem;
  border-radius: 0.5rem;
  font-family: monospace;
  font-weight: bold;
  font-size: 1.2rem;
  letter-spacing: 5px;
  text-align: center;
  border: 1px dashed #cbd5e1;
  color: var(--primary-color);
}

.illustration-container {
  margin-bottom: 2rem;
  position: relative;
}

.ill-circle-bg {
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@media (max-width: 992px) {
  .auth-card {
    flex-direction: column;
    max-width: 500px;
    min-height: auto;
  }
  .auth-side-panel {
    display: none;
  }
  .auth-form-panel {
    padding: 2rem;
  }
}

/* ===========================
   DASHBOARD / INDEX PAGE STYLES
   =========================== */

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary-color);
  background: linear-gradient(
    180deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  border-right: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
  padding: 1.5rem 1rem;
  flex: 1;
  overflow-y: auto;
  /* Smooth Custom Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Chrome/Safari/Edge Scrollbar */
.sidebar-menu::-webkit-scrollbar {
  width: 6px;
}
.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

/* Sidebar Navigation Items */
.nav-link {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
  transition: var(--transition);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.nav-link i {
  margin-right: 12px;
  font-size: 1.25rem;
  color: var(--accent-gold);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  border-left: 4px solid var(--accent-gold);
  color: #ffffff;
  box-shadow: none;
}
.nav-link:focus,
.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Dropdown / Submenu Styles */
.toggle-icon {
  font-size: 0.8rem;
  margin-right: 0 !important;
  transition: transform 0.3s ease;
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Fixed submenu display */
.submenu {
  padding-left: 2.5rem;
  display: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  margin-top: 5px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.submenu.show {
  display: block !important;
  animation: fadeIn 0.3s ease;
}

.submenu-link {
  display: block;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.submenu-link:hover {
  color: var(--accent-gold);
  transform: translateX(5px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  width: stretch;
  margin-left: var(--sidebar-width);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  background-color: var(--bg-light);
}

/* Navbar */
.top-navbar {
  height: 70px;
  background: var(--primary-color-2);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 999;
}

/* Content Area */
.content-area {
  padding: 2rem;
  flex: 1;
}

/* Section Header Styling - NEW REQUEST */
.section-header-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  background: #fff;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--primary-color);
}

.section-title {
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
}

.section-title i {
  color: var(--primary-light);
  margin-right: 0.75rem;
}

/* Card Styling */
.card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  background: #fff;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-primary:disabled,
.btn-primary.disabled {
  	background-color: #e9ecef !important;
    border-color: #64748b !important;
    border-width: 1px !important;
    color: #000000 !important;
    cursor: not-allowed;
}

.btn-secondary {
  background-color: #64748b;
  border-color: #64748b;
  color: white;
}

/* Datatables Overrides */
.table thead th {
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
  font-weight: 600;
  border-bottom: none;
  padding: 12px 16px;
}
.table thead th:first-child {
  border-top-left-radius: 10px;
}
.table thead th:last-child {
  border-top-right-radius: 10px;
}

.page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}
.page-link {
  color: var(--primary-color);
}

/* Upload Overlay Styling */
.upload-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.upload-overlay.show {
  opacity: 1;
  visibility: visible;
}

.upload-progress-container {
  width: 300px;
  text-align: center;
}

.upload-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid #e2e8f0;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .sidebar.active {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
  }
}

/* ===========================
   FILE UPLOAD DRAG & DROP
   =========================== */

.file-drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  background-color: #f8fafc;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  width: 100%;
}

.file-drop-zone:hover {
  border-color: var(--primary-color);
  background-color: #f1f5f9;
}

.file-drop-zone.drag-over {
  border-color: var(--primary-color);
  background-color: rgba(53, 22, 139, 0.05); /* Light violet tint */
  transform: scale(1.01);
}

.file-drop-zone input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-icon {
  font-size: 2.5rem;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

.drop-zone-text {
  font-weight: 500;
  color: var(--text-dark);
}

.drop-zone-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* File Selected State */
.file-drop-zone.has-file {
  border-style: solid;
  border-color: var(--primary-color);
  background-color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.file-info {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.file-drop-zone.has-file .default-content {
  display: none;
}
.file-drop-zone.has-file .file-info {
  display: flex;
}

    /* Top-right toast container */
    .toast-container {
      position: fixed;
      top: 1rem;
      right: 1rem;
      z-index: 1080; /* above modals/backdrops if needed */
    }

    .status-success { color: #28a745; font-weight: 600; }
.status-failed  { color: #dc3545; font-weight: 600; }
.status-pending { color: #ffc107; font-weight: 600; }
.status-partial { color: rgb(255, 128, 0); font-weight: 600; }
.status-unknown { color: #6c757d; font-weight: 600; }
.status-na      { color: #999; }
.download-link  { color: #007bff; text-decoration: none; }
.download-link:hover { text-decoration: underline; }
    
    .required-asterisk{
    font-weight: 700;
	  color:  #dc3545;
	  font-size: 1.25rem;
  }
  
  #historyTable {
    /* width: 100% !important; */
    min-width: 1600px;
}
#historyTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--primary-color);
  color: white;
}
#historyTable td {
	white-space: wrap;
	vertical-align: middle;
}

table.dataTable {
		  width: 100% !important;
		  overflow: auto;
		}
table.dataTable thead th {
	white-space: normal !important; /* allow wrapping */
	word-wrap: break-word;
	text-align: center; /* optional */
	vertical-align: middle;
}
.dataTables_wrapper {
    width: 100%;
    overflow-x: auto;
}

/* -------- Desktop: hide sidebar completely -------- */
@media (min-width: 992px) {
  /* When hidden on desktop, slide it out and remove margin from content */
  body.sidebar-hidden-desktop .sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-hidden-desktop .main-wrapper {
    margin-left: 0;
  }
}

/* -------- Mobile: off-canvas behavior -------- */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%); /* closed by default */
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0; /* no fixed margin on mobile */
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1025;
    opacity: 0;
    transition: opacity var(--transition), visibility var(--transition);
    visibility: hidden;
  }
  body.sidebar-open .sidebar-overlay {
    visibility: visible;
    opacity: 1;
  }
  .sidebar-overlay[hidden] { display: none; }
}

/* Rule list styling */
#passwordRules .rule {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6c757d; /* muted default */
  line-height: 1.3;
  margin: 0.25rem 0;
}

#passwordRules .rule .icon {
  width: 1rem;
  display: inline-flex;
  justify-content: center;
  color: #dc3545; /* default red for ✖ */
}

/* Valid/invalid states for rules */
#passwordRules .rule.valid {
  color: #16a34a; /* green */
}
#passwordRules .rule.valid .icon {
  color: #16a34a;
}

#passwordRules .rule.invalid {
  color: #dc3545; /* red */
}
#passwordRules .rule.invalid .icon {
  color: #dc3545;
}

#phNumber.is-invalid ~ #phNumberHelp { color: #dc3545; } /* red */
#phNumber.is-valid ~ #phNumberHelp { color: #16a34a; }   /* green */

#emailId.is-invalid ~ #emailHelp { color: #dc3545; } /* red */
#emailId.is-valid ~ #emailHelp { color: #16a34a; }   /* green */
