/* ==============================================
   BRIDGESCAN UNIFIED FRAMEWORK
   Fully Responsive Layout System
   ============================================== */

/* --- CORE RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --primary: #4d5e77ff;
  --primary-light: #eff3ff;
  --success: #06d6a0;
  --warning: #ffa62b;
  --danger: #ff6b6b;
  --text: #2d3748;
  --text-light: #718096;
  --border: #ccc;
  --bg: #ffffff;
  --card-bg: #fafbfc;
}
body {
  font-family: 'Roboto', sans-serif;
  background: #dcdddd;
  height: 100vh;
  overflow: hidden;
}

/* --- CSS VARIABLES FOR CONSISTENT SPACING --- */
:root {
  --header-height: 114px;
  --navbar-height: 40px;
  --footer-height: 30px;
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 60px;
  --top-offset: calc(var(--header-height) + var(--navbar-height));
}

/* --- LAYOUT STRUCTURE --- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.content-container {
  flex: 1 0 auto;
  overflow: hidden;
}

/* ==============================================
   UNIFIED HEADER SECTION - FULLY RESPONSIVE
   ============================================== */
/* ==============================================
   UNIFIED HEADER SECTION - FULLY RESPONSIVE
   ============================================== */
header.fixed-top {
  background: linear-gradient(135deg, #374d5f, #4d5a64);
  
  padding: 8px 0;
  z-index: 1050;
  box-shadow: 0 6px 25px rgba(0,0,0,0.4);
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  margin: 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

header .container-fluid {
  padding: 6px 12px;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

header .container-fluid > .d-flex {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Header Left Section */
.header-left {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

/* Header Emblem */
.header-emblem-img {
  height: 58px;
  width: auto;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.8));
  transition: height 0.3s ease;
}

/* Ministry Text Container */
.header-ministry-container {
  display: flex;
  flex-direction: column;
  margin-left: 12px;
  transition: opacity 0.3s ease;
}

.header-ministry-text {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.8px;
  line-height: 1.2;
  white-space: nowrap;
}

.header-ministry-subtext {
  font-size: 14.5px;
  font-weight: 600;
  color: #e2eeff;
  line-height: 1.2;
  white-space: nowrap;
}

/* Header Center - Title */
.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.header-title {
  font-size: 48px;
  font-weight: normal;
  letter-spacing: 8px;
  color: #fff;
  text-shadow: 0 0 18px rgba(255,255,255,0.4), 0 5px 18px rgba(0,0,0,0.6);
  white-space: nowrap;
  font-family: Arial, sans-serif;
  margin: 0;
  line-height: 1.1;
  transition: font-size 0.3s ease, letter-spacing 0.3s ease;
}

/* Header Subtitle */
.header-subtitle {
  font-size: 13px;
  color: #e8f4ff;
  letter-spacing: 4px;
  margin-top: 4px;
  white-space: nowrap;
  font-family: Arial, sans-serif;
  font-weight: normal;
  line-height: 1.2;
  transition: opacity 0.3s ease;
}

/* Header Right Section */
.header-right {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Header Logos */
.header-logos {
  background: rgba(255,255,255,0.95);
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: padding 0.3s ease;
}

.header-logo-cdac {
  height: 50px;
  width: auto;
  transition: height 0.3s ease;
}

.header-logo-iit {
  height: 65px;
  width: auto;
  transition: height 0.3s ease;
}

/* ==============================================
   NAVBAR SECTION
   ============================================== */
.navbar {
  background: linear-gradient(to right, #2a3a47, #3d4952);
  box-shadow: none;
  padding: 0;
  height: var(--navbar-height);
  margin: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  transition: height 0.3s ease;
  position: fixed !important;
  top: var(--header-height) !important;
  width: 100%;
  z-index: 1049;
  display: flex;
  align-items: center;
}

#sidebarCollapse {
  background: #d1e7ff;
  color: #003087;
  border: 2px solid #003087;
  padding: 6px 10px;
  margin: 0 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
}

#sidebarCollapse:hover {
  background: #e6f0fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-dark {
  background: #d1e7ff;
  color: #003087;
  border: none;
  padding: 6px 10px;
  margin-right: 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
}

.btn-dark:hover {
  background: #e6f0fa;
  transform: translateY(-2px);
}

.navbar-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
  height: 100%;
}

.nav-link {
  color: #ffffff;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.nav-link:hover {
  background: linear-gradient(135deg, #1b2a47, #5a87af) !important;
  color: #ffffff !important;
}

.nav-link.active:not(.custom-toggle),
.nav-link.custom-toggle.active {
  background: #fde8e4 !important;
  color: #003087 !important;
  font-weight: 700;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
}

.navbar-toggler[aria-expanded="true"] {
  background: #e6f0fa;
  color: #003087;
}

/* --- Navbar Layout --- */
.navbar-collapse {
  flex-grow: 1;
}

.nav-link i, .custom-dropdown-menu i {
  color: inherit;
}

/* Notification Badge */
.badge.notification {
  background: #dc3545;
  color: #ffffff;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 12px;
  margin-left: 8px !important; 
}

/* Custom Dropdown Logic */
.custom-dropdown {
  position: relative;
}

.custom-dropdown-menu {
  display: none;
  position: absolute;
  font-family: arial;
  font-size: 0.2rem !important;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #e6f0fa;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 1050;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.custom-dropdown:hover .custom-dropdown-menu,
.custom-dropdown.open .custom-dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.custom-dropdown-menu a {
  color: #003087;
  font-size: 0.85rem;
  padding: 4px 16px;
  font-family: arial;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.custom-dropdown-menu a:hover {
  background: linear-gradient(135deg, #e6f0fa, #d1e7ff);
  color: #002966;
  transform: translateX(4px);
}

.custom-dropdown-menu a.active {
  background: #d1e7ff;
  color: #003087;
  font-weight: 600;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
}

/* --- Pseudo-element to Bridge Gap --- */
.custom-dropdown .nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 10px;
  background: transparent;
  z-index: 1;
}

/* --- Dropdown Toggle Arrow --- */
.custom-toggle .fa-caret-down {
  margin-left: 6px;
  font-size: 0.8rem;
  color: #ffffff;
  transition: transform 0.3s ease, color 0.3s ease;
}

.custom-toggle:hover .fa-caret-down {
  transform: rotate(180deg);
  color: #003087;
}

.nav-link.custom-toggle.active .fa-caret-down {
  color: #003087;
}

.nav-link.custom-toggle:hover {
  background: #e6f0fa;
  color: #003087;
}

.nav-link.custom-toggle:hover .fa-caret-down {
  color: #003087;
}

/* ==============================================
   SIDEBAR SECTION
   ============================================== */
#sidebar {
  position: fixed;
  top: var(--top-offset);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--top-offset) - var(--footer-height));
  background: linear-gradient(to bottom, #3f5260, #354552);
  transition: width 0.3s ease, left 0.3s ease;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
  display: flex;
  flex-direction: column;
  border-top: none;
}

#sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.user-container {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(to bottom, #3f5260, rgba(63, 82, 96, 0.95));
  padding: 20px 12px 15px 12px;
  color: white;
  display: flex;
  align-items: center;
  min-height: 90px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  width: 100%;
}

.user-pic {
  margin-right: 10px;
  flex-shrink: 0;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 30px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
}

.user-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.user-details {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  margin-bottom: 4px;
}

.user-datetime {
  font-size: 11px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  opacity: 0.9;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-menu::-webkit-scrollbar {
  width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu ul li {
  margin: 0;
  padding: 0;
}

.sidebar-menu ul li a {
  color: #fff;
  display: flex;
  align-items: center;
  width: 100%;
  text-decoration: none;
  padding: 12px 15px;
  line-height: 1.5;
  transition: all 0.3s ease;
  min-height: 40px;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}

.sidebar-menu ul li a:hover {
  color: #2e0a05;
  background: #dbd2ca;
  border-left-color: #2e0a05;
}

.sidebar-menu ul li a.active,
.sidebar-menu ul li a.menu-item-active {
  color: #2e0a05;
  background: #dbd2ca;
  border-left-color: #2e0a05;
  font-weight: 600;
}

.sidebar-menu ul li a i {
  margin-right: 12px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.chart-container {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, #354552, rgba(53, 69, 82, 0.95));
  width: 100%;
  height: 180px;
  padding: 15px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 0;
}

#myChart {
  width: 100%;
  height: 100%;
}

.free-space {
  display: none;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 20px;
}

#sidebar.collapsed .chart-container,
#sidebar.collapsed .user-info {
  display: none;
}

#sidebar.collapsed .user-container {
  padding: 15px 5px;
  justify-content: center;
}

#sidebar.collapsed .avatar {
  width: 40px;
  height: 40px;
  font-size: 24px;
}

#sidebar.collapsed .sidebar-menu a {
  padding: 12px 0;
  justify-content: center;
  border-left: none;
}

#sidebar.collapsed .sidebar-menu a span {
  display: none;
}

#sidebar.collapsed .sidebar-menu a i {
  font-size: 22px;
  margin: 0;
}

#sidebar.collapsed .sidebar-menu a:hover::after {
  content: attr(title);
  position: absolute;
  left: 65px;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 1000;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ---- Collapsed: navigation (project link) + dropdown toggles ---- */
#sidebar.collapsed .navigation a,
#sidebar.collapsed .header-menu a,
#sidebar.collapsed .sidebar-dropdown > a {
  padding: 12px 0;
  justify-content: center;
  border-left: none;
  position: relative;
}

#sidebar.collapsed .navigation a span,
#sidebar.collapsed .header-menu a span,
#sidebar.collapsed .sidebar-dropdown > a span,
#sidebar.collapsed .sidebar-dropdown > a .arrow {
  display: none !important;
}

#sidebar.collapsed .navigation a i,
#sidebar.collapsed .header-menu a i,
#sidebar.collapsed .sidebar-dropdown > a i:not(.arrow) {
  font-size: 20px;
  margin: 0;
  width: auto;
  text-align: center;
}

#sidebar.collapsed .sidebar-menu a {
  position: relative;
}

#sidebar.collapsed .navigation a:hover::after,
#sidebar.collapsed .header-menu a:hover::after,
#sidebar.collapsed .sidebar-dropdown > a:hover::after {
  content: attr(title);
  position: absolute;
  left: 65px;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 1000;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  pointer-events: none;
}

#sidebar.collapsed .sidebar-dropdown {
  position: relative;
}

#sidebar.collapsed .custom-collapse.custom-show {
  display: block;
  position: fixed;
  left: var(--sidebar-collapsed-width);
  min-width: 200px;
  background: linear-gradient(to bottom, #3f5260, #354552);
  box-shadow: 4px 4px 15px rgba(0,0,0,0.4);
  border-radius: 0 6px 6px 0;
  z-index: 9999;
  padding: 4px 0;
  max-height: none !important;
  opacity: 1;
  overflow: visible;
}

#sidebar.collapsed .custom-collapse.custom-show a {
  padding: 10px 16px !important;
  justify-content: flex-start !important;
  white-space: nowrap;
  color: #fff;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
}

#sidebar.collapsed .custom-collapse.custom-show a span {
  display: inline !important;
}

#sidebar.collapsed .custom-collapse.custom-show a i {
  font-size: 14px !important;
  margin-right: 10px !important;
  width: 16px !important;
}

#sidebar.collapsed .custom-collapse.custom-show a:hover {
  background: rgba(255,255,255,0.15) !important;
}

#sidebar.collapsed .custom-collapse.custom-show a::after {
  display: none !important;
}

.custom-collapse {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    position: relative;
    z-index: 50;
    margin-bottom: -1px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 2px;
  }

  .custom-collapse.custom-show {
    opacity: 1;
    max-height: 1000px;
  }

/* ==============================================
   MAIN CONTENT SECTION
   ============================================== */
.content-wrapper {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  margin-left: var(--sidebar-width);
  margin-top: var(--top-offset);
  transition: margin-left 0.3s ease;
  padding: 20px;
  overflow: hidden;
}

.content-wrapper.collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

.body-content {
  flex: 1;
  width: 100%;
  padding: 20px;
  border: 1px solid #4682B4;
  border-radius: 8px;
  background-color: #D3D3D3;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - var(--top-offset) - var(--footer-height) - 40px);
  margin-bottom: 10px;
}

/* ==============================================
   FOOTER SECTION
   ============================================== */
.custom-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.5rem;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  background: rgba(9, 32, 63, 0.95);
  color: #fff;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1040;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ==============================================
   UTILITY CLASSES
   ============================================== */
.card {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  background-color: #f1f1f1;
  transition: 0.3s;
  border: 1px solid #4682B4;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.card-body {
  padding: 1.8rem;
  flex-grow: 1;
}

.card-title {
  text-align: center;
  color: #333;
  font-weight: bold;
}

table {
  border-collapse: collapse;
  width: 100%;
}

table th, table td {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

table th {
  background-color: #f2f2f2;
}

.badge {
  margin-left: 42px !important;
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 0.75rem;
  background-color: #28a745;
  display: inline-flex;
  align-items: center;
}

/* ==============================================
   PROJECT EXECUTION - COMPACT PROFESSIONAL DESIGN
   Matching validation_styles.css approach
   ============================================== */
/* --- Page Title --- */
.card-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
  margin-bottom: 12px;
  color: var(--text);
}

/* --- Messages/Alerts --- */
#popup-message {
  margin-bottom: 8px;
}

#popup-message .alert {
  font-size: 12px;
  padding: 6px 10px;
  margin-bottom: 4px;
  border-radius: 4px;
}

#popup-message .btn-close {
  font-size: 11px;
  padding: 4px;
}

ul.messages {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

/* --- Fieldset Styling - COMPACT --- */
fieldset {
  margin-bottom: 8px;
  border: 1.5px solid #2b2929;
  border-radius: 6px;
  padding: 10px 12px;
  background-color: #e9ecef;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}
fieldset:focus-within {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

fieldset legend {
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  padding: 0 6px;
  background: #e9ecef;
  border-radius: 17px;
  color: var(--primary);
  float: none;
  width: auto;
}

/* --- Form Controls - COMPACT --- */
.form-control,
.form-select {
  font-size: 12px !important;
  padding: 4px 6px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
  background-color: var(--bg);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(77, 94, 119, 0.1);
}

.form-control:disabled,
.form-select:disabled {
  background-color: #f1f5f9;
  color: var(--text-light);
  cursor: not-allowed;
}

/* --- Labels - COMPACT --- */
.col-form-label,
.col-form-label-sm,
.form-label,
label {
  font-size: 12px !important;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  text-align: right;
}

/* --- Input Groups --- */
.input-group-text {
  font-size: 11px !important;
  padding: 4px 8px;
  height: 28px;
  background: linear-gradient(135deg, #bcc2d5 0%, #7383b3 100%);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
}

.input-group .form-control,
.input-group .form-select {
  border-radius: 4px;
}

/* --- Selection Type Radio Buttons (Inline Pills) - COMPACT --- */
.validation-mode-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 8px;
  margin-bottom: 4px;
  user-select: none;
}

.validation-mode-label:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.validation-mode-label input[type="radio"] {
  margin-right: 6px;
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--primary);
}

.validation-mode-label:has(input:checked) {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

/* --- Custom Dropdown - COMPACT --- */
.dropdown-toggle {
  background: var(--bg);
  /* border: 1px solid var(--border);
  border-radius: 4px; */
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  height: 28px;
}

.dropdown-toggle:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropdown-toggle:focus:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(77, 94, 119, 0.1);
}

.dropdown-toggle:disabled {
  background-color: #f1f5f9;
  color: var(--text-light);
  cursor: not-allowed;
}
/* --- Dropdown Menu - COMPACT --- */
.dropdown-menu {
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 4px 0;
  margin-top: 2px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 12px;
}

/* Search Input in Dropdown */
.dropdown-item.p-2 {
  padding: 6px !important;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
}

.dropdown-item.p-2 .form-control {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  height: 26px;
}

/* Dropdown Items */
.dropdown-item {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Checkbox Styling - COMPACT */
.form-check-input {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  margin-right: 8px;
  accent-color: var(--primary);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 2px rgba(77, 94, 119, 0.15);
  outline: none;
}

/* Span/Support Names */
.span-name,
.support-name {
  font-weight: 500;
  color: var(--text);
  font-size: 12px;
}

/* --- Status Badges - COMPACT --- */
.badge {
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.span-status-badge,
.support-status-badge {
  background: #e9ecef;
  color: var(--text-light);
  border: 1px solid var(--border);
}

/* --- Warning Messages - COMPACT --- */
.alert-warning {
  background: #fff4e6;
  border: 1px solid var(--warning);
  border-left-width: 3px;
  color: #92400e;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 6px;
}

.alert-warning i {
  color: var(--warning);
  font-size: 12px;
}

/* --- Buttons - COMPACT --- */
.btn {
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  transition: all 0.2s ease;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #05b589;
  box-shadow: 0 2px 6px rgba(6, 214, 160, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #e85555;
  box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #3d4e67;
  box-shadow: 0 2px 6px rgba(77, 94, 119, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Collapsible Section - COMPACT --- */
.collapse-header {
  padding: 8px 12px;
  background: linear-gradient(135deg, #4d5e77ff 0%, #3d4e67 100%);
  border: none;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.collapse-header:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.collapse-header .fw-semibold {
  font-weight: 600;
  font-size: 13px;
}

.btn-toggle {
  background: white;
  color: var(--primary);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle:hover {
  background: #f0f0f0;
  transform: rotate(90deg);
}

.btn-toggle.collapsed {
  transform: rotate(0deg);
}

.btn-toggle:not(.collapsed) {
  transform: rotate(45deg);
}

/* --- Test Cycle Information - COMPACT --- */
#collapseTestCycle {
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-top: 4px;
}

#collapseTestCycle .row {
  margin-bottom: 8px;
}

#collapseTestCycle fieldset {
  background: white;
  padding: 10px;
}

/* --- Row Spacing - COMPACT --- */
.row.mb-1 {
  margin-bottom: 6px !important;
}

.row.mb-2 {
  margin-bottom: 8px !important;
}

.row.mb-3 {
  margin-bottom: 10px !important;
}

.mt-2 {
  margin-top: 10px !important;
}
/* --- Close Button for Dropdowns --- */
.position-absolute[id$="CloseBtn"] {
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  color: var(--text-light);
  transition: color 0.2s ease;
  font-weight: 600;
}

.position-absolute[id$="CloseBtn"]:hover {
  color: var(--danger);
}

/* --- Spinner --- */
.spinner-border-sm {
  width: 12px;
  height: 12px;
  border-width: 0.15em;
}

/* --- Hidden Utility --- */
.hidden,
.d-none {
  display: none !important;
}




/* ==============================================
   RESPONSIVE DESIGN - COMPREHENSIVE BREAKPOINTS
   ============================================== */

/* Below 1400px - Hide ministry text and subtitle */
@media (max-width: 1400px) {
  :root {
    --header-height: 74px;
  }
  
  .header-ministry-container,
  .header-subtitle {
    display: none !important;
  }
  
  /* Adjust header height */
  header.fixed-top {
    padding: 6px 0;
  }
  
  .header-title {
    font-size: 42px;
    letter-spacing: 6px;
  }
  .header-logos {
    padding: 5px;
    gap: 6px;
  }
}

/* Large Tablets - 1200px */
@media (max-width: 1200px) {
  :root {
    --header-height: 70px;
  }

  .header-title {
    font-size: 38px;
    letter-spacing: 5px;
  }

  .header-emblem-img {
    height: 50px;
  }

  .header-logo-cdac {
    height: 45px;
  }

  .header-logo-iit {
    height: 58px;
  }
}

/* Standard Tablets - 992px */
@media (max-width: 992px) {
  :root {
    --header-height: 66px;
    --navbar-height: 38px;
  }

  .header-title {
    font-size: 34px;
    letter-spacing: 4px;
  }

  .header-emblem-img {
    height: 46px;
  }

  .header-logos {
    padding: 8px;
    gap: 10px;
  }

  .header-logo-cdac {
    height: 40px;
  }

  .header-logo-iit {
    height: 52px;
  }

  /* ── Navbar bar stays fixed at its set height ── */
  .navbar {
    height: var(--navbar-height) !important;
    overflow: visible !important;   /* allow the collapse panel to escape */
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  /* ── Expanded collapse panel drops below the navbar bar ── */
  .navbar-collapse {
    position: absolute !important;
    top: var(--navbar-height) !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(135deg, #09203F, #537895) !important;
    z-index: 1048 !important;
    border-radius: 0 0 10px 10px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35) !important;
    padding: 8px 12px 12px !important;
    max-height: 75vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  /* Hide when not shown */
  .navbar-collapse:not(.show) {
    display: none !important;
  }

  .navbar-nav {
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .navbar-nav > li {
    width: 100%;
  }

  .navbar-nav .nav-link {
    width: 100%;
    padding: 10px 12px !important;
    border-radius: 6px !important;
    font-size: 0.88rem !important;
  }

  /* ── Custom dropdown — flows inline, no absolute positioning ── */
  .custom-dropdown {
    width: 100%;
  }

  .custom-dropdown-menu {
    position: static !important;
    display: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 6px !important;
    background: rgba(255,255,255,0.08) !important;
    padding: 4px 0 4px 16px !important;
    min-width: unset !important;
    width: 100% !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    margin-top: 2px !important;
  }

  .custom-dropdown.open .custom-dropdown-menu {
    display: block !important;
  }

  /* Disable hover-open on mobile — only click/open class works */
  .custom-dropdown:hover .custom-dropdown-menu {
    display: none !important;
  }
  .custom-dropdown.open:hover .custom-dropdown-menu {
    display: block !important;
  }

  .custom-dropdown-menu a {
    color: #e2e8f0 !important;
    font-size: 0.82rem !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .custom-dropdown-menu a:hover {
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
    transform: none !important;
  }
}

/* Small Tablets and Large Phones - 768px */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --navbar-height: 36px;
    --sidebar-width: 60px;
  }

  header .container-fluid {
    padding: 6px 12px;
  }

  .header-title {
    font-size: 28px;
    letter-spacing: 3px;
  }

  .header-emblem-img {
    height: 40px;
  }

  .header-logos {
    padding: 6px;
    gap: 8px;
  }

  .header-logo-cdac {
    height: 34px;
  }

  .header-logo-iit {
    height: 44px;
  }

  #sidebarCollapse,
  .btn-dark {
    padding: 5px 8px;
    margin: 0 8px;
  }

  .nav-link {
    font-size: 0.875rem;
    padding: 6px 10px;
  }

  /* ── Mobile sidebar: hidden off-screen by default ── */
  #sidebar {
    left: -250px;          /* fully off-screen — no dead strip */
    width: 250px;          /* full panel width ready to slide in */
    transition: left 0.3s ease, width 0.3s ease;
    z-index: 200;          /* above content overlay */
  }

  /* Collapsed = hidden (slide left) */
  #sidebar.collapsed {
    left: -250px;
    width: 250px;
  }

  /* Expanded = slide in from left as an overlay */
  #sidebar:not(.collapsed) {
    left: 0;
    width: 250px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.55);
  }

  /* Dark overlay behind the open sidebar */
  #sidebar:not(.collapsed)::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.40);
    z-index: -1;
    pointer-events: none;
  }

  /* Content fills the full width — no left margin needed */
  .content-wrapper {
    margin-left: 0 !important;
    padding: 10px;
    width: 100%;
  }

  .content-wrapper.collapsed {
    margin-left: 0 !important;
  }

  .body-content {
    padding: 15px;
  }

  /* Mobile sidebar visibility — icon-only when open (labels shown) */
  #sidebar .user-info,
  #sidebar .chart-container {
    display: none;
  }

  #sidebar .user-container {
    padding: 15px 5px;
    justify-content: center;
    min-height: 70px;
  }

  #sidebar .avatar {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  #sidebar ul li a {
    padding: 12px 0;
    justify-content: center;
    border-left: none;
  }

  #sidebar ul li a span {
    display: none;
  }

  #sidebar ul li a i {
    font-size: 22px;
    margin: 0;
  }

  /* Show when expanded */
  #sidebar:not(.collapsed) .user-info {
    display: flex !important;
  }

  #sidebar:not(.collapsed) .user-container {
    padding: 20px 12px 15px 12px;
    justify-content: flex-start;
  }

  #sidebar:not(.collapsed) .avatar {
    width: 50px;
    height: 50px;
    font-size: 30px;
  }

  #sidebar:not(.collapsed) .sidebar-menu a {
    padding: 12px 15px;
    justify-content: flex-start;
    border-left: 3px solid transparent;
  }

  #sidebar:not(.collapsed) .sidebar-menu a span {
    display: inline !important;
  }

  #sidebar:not(.collapsed) .sidebar-menu a i {
    font-size: inherit !important;
    margin-right: 12px !important;
  }

  #sidebar:not(.collapsed) .chart-container {
    display: block !important;
  }
}

/* Mobile Phones - 600px */
@media (max-width: 600px) {
  :root {
    --header-height: 54px;
    --navbar-height: 34px;
  }

  .header-title {
    font-size: 22px;
    letter-spacing: 2px;
  }

  .header-emblem-img {
    height: 34px;
  }

  .header-logos {
    padding: 5px;
    gap: 6px;
  }

  .header-logo-cdac {
    height: 30px;
  }

  .header-logo-iit {
    height: 38px;
  }

  .body-content {
    padding: 12px;
  }

  /* Hide chart completely on mobile */
  #sidebar .chart-container {
    display: none !important;
  }

  #sidebar:not(.collapsed) .chart-container {
    display: none !important;
  }

  #myChart {
    display: none;
  }

  .free-space {
    display: none !important;
  }
}

/* Extra Small Phones - 400px */
@media (max-width: 400px) {
  :root {
    --header-height: 50px;
    --navbar-height: 32px;
    --footer-height: 28px;
  }

  header .container-fluid {
    padding: 6px 12px;
  }

  .header-title {
    font-size: 18px;
    letter-spacing: 1.5px;
  }

  .header-emblem-img {
    height: 30px;
  }

  .header-logos {
    padding: 4px;
    gap: 5px;
  }

  .header-logo-cdac {
    height: 26px;
  }

  .header-logo-iit {
    height: 34px;
  }

  #sidebarCollapse,
  .btn-dark {
    padding: 4px 6px;
    margin: 0 6px;
    font-size: 0.875rem;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 5px 8px;
  }

  .content-wrapper {
    padding: 6px;
  }

  .body-content {
    padding: 10px;
  }

  .custom-footer {
    font-size: 10px;
    padding: 0.3rem;
  }

  /* Hide chart completely on extra small mobile */
  #sidebar .chart-container {
    display: none !important;
  }

  #sidebar:not(.collapsed) .chart-container {
    display: none !important;
  }
}

/* Landscape mode */
@media (max-height: 600px) and (orientation: landscape) {
  :root {
    --header-height: 58px;
    --navbar-height: 34px;
    --footer-height: 25px;
  }

  .header-emblem-img {
    height: 35px;
  }

  .header-title {
    font-size: 26px;
  }

  .header-logo-cdac {
    height: 32px;
  }

  .header-logo-iit {
    height: 42px;
  }
}


/* --- Smooth Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}



/* ==============================================
   REACT COLOR SYSTEM INTEGRATION
   Tokens ported from App.css + index.css
   Applied to home.html framework
   ============================================== */

/* ── 1. Updated CSS Custom Properties ────────────────────────────
   New color tokens from React project layered on top of the
   existing :root block — no existing token is removed.          */
:root {
  /* React React app palette */
  --react-navy-deep:   #0f2540;   /* Navy & Coral: darkest navy */
  --react-navy-mid:    #1e3a5f;   /* Navy & Coral: mid navy */
  --react-indigo:      #6c757d;   /* Navy & Coral: coral accent */
  --react-bg-content:  #eef3f8;   /* Navy & Coral: light navy tint */
  --react-bg-sidebar:  #e8eef5;   /* Navy & Coral: sidebar tint */
  --react-border:      #c8d8e8;   /* Navy & Coral: steel blue border */
  --react-card-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);  /* App.css card */
  --react-white-92:    rgba(255, 255, 255, 0.92);
  --react-text:        #1e3a5f;   /* Navy & Coral: navy text */

  /* Override framework primary chain with richer React navy */
  --primary:           #1e3a5f;
  --primary-light:     #eef3f8;
  --bg:                #ffffff;
  --card-bg:           #f5f9fd;
  --border:            #c8d8e8;
  --text:              #1e3a5f;
  --text-light:        #5a7fa0;
}

/* ── 2. Body / Root ───────────────────────────────────────────────
   index.css: better font stack, line-height, font-smoothing      */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: var(--react-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--react-bg-content);
}

/* ── 3. Body Content Area ─────────────────────────────────────────
   App.css content-area: cleaner background, better overflow       */
.body-content {
  background-color: var(--react-bg-content) !important;
  border: 1px solid var(--react-border) !important;
  box-shadow: var(--react-card-shadow) !important;
}


/* ── 5. Footer ────────────────────────────────────────────────────
   App.css app-footer: richer navy, cleaner border                 */
.custom-footer {
  background: var(--react-navy-deep) !important;
  border-top: 1px solid var(--react-navy-mid) !important;
  font-weight: 500 !important;
  letter-spacing: 0.2px;
}

/* ── 6. Cards ─────────────────────────────────────────────────────
   App.css card: cleaner white background, better shadow           */
.card {
  background: #ffffff !important;
  border: 1px solid var(--react-border) !important;
  box-shadow: var(--react-card-shadow) !important;
  border-radius: 8px;
}

/* main-card (design system) gets the same treatment */
.main-card {
  background: #ffffff;
  border: 1px solid var(--react-border);
  box-shadow: var(--react-card-shadow);
}

/* ── 7. Fieldsets ─────────────────────────────────────────────────
   Slightly lighter background matching #f8f9fa card-bg           */
fieldset {
  background-color: #f8f9fa !important;
  border-color: var(--react-border) !important;
}

fieldset:focus-within {
  border-color: #1e3a5f !important;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.12) !important;
}

fieldset legend {
  color: #1e3a5f !important;
  background: #f5f9fd !important;
}

/* ── 8. Form Controls ─────────────────────────────────────────────
   Better focus ring using React indigo accent                     */
.form-control:focus,
.form-select:focus {
  border-color: #1e3a5f !important;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.12) !important;
  outline: none !important;
}

/* ── 9. Buttons ───────────────────────────────────────────────────
   Primary gets the React deep navy → mid-navy gradient           */
.btn-primary {
  background: linear-gradient(135deg, #0f2540, #1e3a5f) !important;
  color: #ffffff !important;
  border: none !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #1e3a5f, #2a5080) !important;
  box-shadow: 0 3px 10px rgba(11, 61, 141, 0.35) !important;
  color: #ffffff !important;
}

/* ── 10. Input Groups ─────────────────────────────────────────────
   Match React navy palette                                        */
.input-group-text {
  background: linear-gradient(135deg, #0f2540 0%, #1e3a5f 100%) !important;
  color: #ffffff !important;
  border: none !important;
}

/* ── 11. Navbar Active Link ───────────────────────────────────────
   App.css nav-link.active uses #d1e7ff bg + #003087 text — match */
.nav-link.active:not(.custom-toggle),
.nav-link.custom-toggle.active {
  background: #d1e7ff !important;
  color: #6c757d !important;
}

/* ── 12. Sidebar Active Menu Item ────────────────────────────────
   Bring sidebar active state in line with React indigo palette   */
.sidebar-menu ul li a.active,
.sidebar-menu ul li a.menu-item-active {
  background: rgba(30, 58, 95, 0.15) !important;
  color: #fde8e4 !important;
  border-left-color: #6c757d !important;
}

.sidebar-menu ul li a:hover {
  background: rgba(30, 58, 95, 0.20) !important;
  color: #ffffff !important;
  border-left-color: #6c757d !important;
}

/* ── 13. Accessibility Focus Ring ────────────────────────────────
   index.css: 2px solid #646cff (React indigo) on all interactive */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #6c757d !important;
  outline-offset: 2px !important;
}

/* ── 14. Collapse / Accordion Headers ────────────────────────────
   Use React navy gradient instead of plain primary               */
.collapse-header {
  background: linear-gradient(135deg, #0f2540 0%, #1e3a5f 100%) !important;
}

/* ── 15. Validation Mode Pills ───────────────────────────────────
   Checked state uses React navy                                  */
.validation-mode-label:has(input:checked) {
  background: #6c757d !important;
  border-color: #6c757d !important;
}

/* ── 16. Dropdown Menu ───────────────────────────────────────────
   Hover state aligns with React light-blue (#d1e7ff) palette    */
.custom-dropdown-menu a:hover,
.dropdown-item:hover {
  background: linear-gradient(135deg, #fde8e4, #fde0da) !important;
  color: #0f2540 !important;
}

/* ── 17. Table headers ───────────────────────────────────────────
   Matches React content-area background for cleaner table look  */
.custom-table thead th {
  background: #eef3f8 !important;
  color: #1e3a5f !important;
  border-bottom: 2px solid #1e3a5f !important;
}

/* ── 18. Page heading ─────────────────────────────────────────────
   Title text in the React navy palette                           */
.page-heading {
  color: #1e3a5f !important;
  border-left-color: #6c757d !important;
}

/* ── 19. Scrollbar (react palette) ───────────────────────────────
   index.css uses subtle greys — already close, just refine      */
::-webkit-scrollbar-thumb {
  background: #b0bec5;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6c757d;
}

/* ── 20. Link base style ─────────────────────────────────────────
   index.css: color:inherit, no underline by default              */
a {
  color: inherit;
  text-decoration: none;
}
a:hover,
a:focus {
  text-decoration: none;
}

/* ── 21. Large-screen font enhancements ──────────────────────────
   Requested: increase font on large screens (≥1400px)           */
@media (min-width: 1400px) {
  body                          { font-size: 14px; }
  .form-control, .form-select   { font-size: 13px !important; height: 30px; }
  label, .form-label,
  .col-form-label,
  .col-form-label-sm            { font-size: 13px !important; }
  .input-group-text             { font-size: 12px !important; height: 30px; }
  fieldset legend               { font-size: 14px; }
  .page-heading                 { font-size: 1.05rem !important; }
  .btn                          { font-size: 13px; }
  .btn-sm                       { font-size: 12px; }
  td, th                        { font-size: 13px; }
  .nav-link                     { font-size: 1rem; }
  .custom-footer                { font-size: 13px; }
  .user-details                 { font-size: 14px; }
  .user-datetime                { font-size: 12px !important; }
}

@media (min-width: 1600px) {
  body                          { font-size: 14.5px; }
  .form-control, .form-select   { font-size: 13.5px !important; height: 31px; }
  label, .form-label,
  .col-form-label,
  .col-form-label-sm            { font-size: 13.5px !important; }
  fieldset legend               { font-size: 15px; }
  .page-heading                 { font-size: 1.1rem !important; }
  .btn                          { font-size: 13.5px; }
  td, th                        { font-size: 13.5px; }
}

@media (min-width: 1920px) {
  body                          { font-size: 15px; }
  .form-control, .form-select   { font-size: 14px !important; height: 32px; }
  label, .form-label,
  .col-form-label,
  .col-form-label-sm            { font-size: 14px !important; }
  fieldset legend               { font-size: 15.5px; }
  .page-heading                 { font-size: 1.15rem !important; }
  .btn                          { font-size: 14px; }
  td, th                        { font-size: 14px; }
  .header-title                 { font-size: 54px; letter-spacing: 10px; }
}