/* Custom CSS for enhanced styling */
    :root {
        --primary-color: #2563eb;
        --success-color: #059669;
        --info-color: #0891b2;
        --warning-color: #d97706;
        --danger-color: #dc2626;
        --sidebar-bg: #f8fafc;
        --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
        --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }

    body {
        background-color: #f1f5f9;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }
    /* Navbar Enhancements */
/* --- PROFESSIONAL GRAY GRADIENT NAVBAR --- */
/* --- PROFESSIONAL GRAY GRADIENT NAVBAR --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0.85rem 0;

    background: linear-gradient(
        135deg,
        #2a5298  0%,
        #1e3c72 40%,
        #2a5298 100%
    ) !important;

    border-bottom: 1px solid rgba(0, 0, 0, 0.08);

    box-shadow: 
        0 2px 4px rgba(0,0,0,0.08),
        0 8px 18px rgba(0,0,0,0.06);

    backdrop-filter: blur(6px); /* soft modern glass effect */
}

/* Brand text */
.navbar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #e2e2e2 !important;
}

/* User dropdown button */
.navbar .dropdown-toggle {
    border: 1px solid #bfbfbf;
    background: var(--sidebar-bg);
    color: #333 !important;
    padding: 0.45rem 1.2rem;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.navbar .dropdown-toggle:hover {
    background: linear-gradient(135deg, #ededed, #dcdcdc);
    border-color: #999;
}


/* Login Page Sticky Header Styles */
.login-sticky-header {
  z-index: 1040;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px) saturate(180%);
}

.login-header-brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff !important;
}

.login-download-btn {
  padding: 0.5rem 1rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.login-btn-report {
  background-color: #1b4aca;
  color: #eaeaec;
  border:#242424;
  
}
.login-btn-ward{
  background-color: #afafaf;
  color: #181822;
  border:#161616;
  
}

.login-btn-report:hover {

  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.login-btn-excel {
  background-color: #198754;
  color: #ffffff;
}

.login-btn-excel:hover {
  background-color: #157347;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(25,135,84,0.3);
}

/* Adjust login page background for navbar */
.login-page-bg {
  padding-top: 80px; /* Account for navbar height */
  min-height: 100vh;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .login-header-brand {
    font-size: 1rem;
  }
  
  .login-download-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .login-page-bg {
    padding-top: 70px;
  }
}

/* Badge for AC number */
.badge.ac-badge {
    background: linear-gradient(135deg, #fafafa, #dedede);
    color: #333 !important;
    border: 1px solid #c6c6c6;
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

.user-profile{
  background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
  color: #fff9e6
}

/* Message bar below navbar */
.blinker-bar {
    background: #ffffc1;
    color: #b33300;
    border-bottom: 1px solid #cfe8ff;
    width: 100%;
}

/* Soft blinking animation */
.blink {
    animation: blinkAnim 1.5s ease-in-out infinite;
}

@keyframes blinkAnim {
    0% { opacity: 1; }
    50% { opacity: 0.35; }
    100% { opacity: 1; }
}




    /* Sidebar Enhancements */
    .sidebar {
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.05);
        position: fixed;
        top: 70px;
        left: 0;
        height: calc(100vh - 76px);
        overflow-y: auto;
    }

    .sidebar .nav-link {
        color: #64748b;
        padding: 0.5rem 1.5rem;
        margin: 0.25rem 0.75rem;
        border-radius: 0.5rem;
        font-weight: 500;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
    }

    .sidebar .nav-link:hover {
        background-color: #e0e7ff;
        color: var(--primary-color);
        transform: translateX(5px);
    }

    .sidebar .nav-link.active {
        background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
        color: white;
        box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
    }

    .sidebar .nav-link i {
        font-size: 1.1rem;
        width: 24px;
    }

    /* Main Content Area */
    main {
        margin-left: 16.666667%;
        margin-top: 76px;
        padding: 2rem !important;
    }

    @media (max-width: 768px) {
        main {
            margin-left: 0;
        }
    }

    /* Dashboard Header */
    .dashboard-header {
        background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
        border-radius: 1rem;
        padding: 1.5rem 2rem;
        margin-bottom: 2rem;
        color: white;
        box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
    }

    .dashboard-header h2 {
        margin: 0;
        font-size: 1.75rem;
        font-weight: 700;
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* Enhanced Summary Cards */
    .summary-card {
        border: none;
        border-radius: 1rem;
        padding: 1.5rem;
        height: 100%;
        transition: all 0.3s ease;
        box-shadow: var(--card-shadow);
        background: white;
        position: relative;
        overflow: hidden;
    }

    .summary-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--card-color) 0%, var(--card-color-light) 100%);
    }

    .summary-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--card-shadow-hover);
    }

    .summary-card.primary {
        --card-color: var(--primary-color);
        --card-color-light: #60a5fa;
    }

    .summary-card.success {
        --card-color: var(--success-color);
        --card-color-light: #34d399;
    }

    .summary-card.info {
        --card-color: var(--info-color);
        --card-color-light: #22d3ee;
    }

    .summary-card .card-icon {
        width: 60px;
        height: 60px;
        border-radius: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.75rem;
        margin-bottom: 1rem;
        background: linear-gradient(135deg, var(--card-color) 0%, var(--card-color-light) 100%);
        color: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .summary-card .card-title {
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #64748b;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    .summary-card .card-value {
        font-size: 2.25rem;
        font-weight: 700;
        color: var(--card-color);
        line-height: 1;
    }

    /* Enhanced Table Cards */
    .table-card {
        border: none;
        border-radius: 1rem;
        box-shadow: var(--card-shadow);
        margin-bottom: 2rem;
        overflow: hidden;
        background: white;
    }

    .table-card .card-header {
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
        border-bottom: 2px solid #e2e8f0;
        padding: 1.25rem 1.5rem;
    }

    .table-card .card-header h5 {
        margin: 0;
        color: #1e293b;
        font-weight: 700;
        font-size: 1.125rem;
        display: flex;
        align-items: center;
    }

    .table-card .card-header h5 i {
        margin-right: 0.75rem;
        color: var(--primary-color);
        font-size: 1.25rem;
    }

   
  /* Enhanced Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
   position: sticky;
    top: 0;
    z-index: 10;  /* keeps header above cells */
    background-color: var(--color-bg); /* required so text doesn't blend */
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #cbd5e1;
    padding: 1rem 0.75rem;
    white-space: nowrap;
    text-align: center;
    border: 1px solid #cbd5e1;       /* NEW: column border for header */
}

.table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    color: #334155;
    font-size: 0.875rem;
    text-align: center;
    border: 1px solid #cbd5e1;       /* NEW: border for each cell */
}


    /* Apply border to all table rows & columns */
.table tbody td,
.table thead th {
    border: 1px solid #cbd5e1 !important;   /* Light gray border */
}


    /* Status Badges */
    .badge {
        padding: 0.5rem 1rem;
        font-weight: 600;
        font-size: 1rem;
        border-radius: 2rem;
        letter-spacing: 0.3px;
    }

    .badge.bg-success {
        background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
        box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
    }

    .badge.bg-warning {
        background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
        box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
    }

    .badge.bg-secondary {
        background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%) !important;
        box-shadow: 0 2px 4px rgba(100, 116, 139, 0.3);
    }

   /* --- Footer --- */
.app-footer {
    background-color: #ffffff;                 /* White background */
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-3) var(--spacing-4);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);

    width: 100%;
    margin-top: auto;  
    z-index: 1000;                        /* Keeps footer at bottom */
}

    .app-footer .company-logo img {
      width: 42px;
      height: 42px;
    }
    .app-footer a {
      font-weight: 600;
    }

    /* Responsive Adjustments */
    @media (max-width: 768px) {
        .dashboard-header h2 {
            font-size: 1.25rem;
        }

        .summary-card .card-value {
            font-size: 1.75rem;
        }

        main {
            padding: 1rem !important;
        }
    }

    /* Scrollbar Styling */
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }

    .table-responsive::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

    /* Loading Animation */
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .fade-in {
        animation: fadeIn 0.5s ease-out;
    }

    /* ============================
   MAIN CONTENT LAYOUT
   ============================ */

main {
    padding-top: 30px !important;
    padding-bottom: 40px !important;
}

/* Page Title */
main h2.h4 {
    font-weight: 700;
    font-size: 1.6rem;
    color: #2c3e50;
}

/* ============================
   CARD STYLING
   ============================ */


/* Center the card */
.card-center-container {
    display: flex;
    justify-content: center;
    width: 100%;
    /* padding-top: 20px; */
    padding-bottom: 20px;
}

.page-container {
    display: flex;
    justify-content: center;   /* Horizontal center */
    padding-top: 40px;
}


/* Sticky card */
.card {
    border: none;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
    z-index: 100;
}


/* Card title (AC Part Number) */
.card-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
}



/* ============================
   FORM ELEMENTS
   ============================ */

form label {
    font-weight: 600;
    color: #34495e;
}

form .form-select {
    height: 55px;
    font-size: 1rem;
    border-radius: 12px;
    border: 2px solid #28a745;
    padding-left: 15px;
    
}


/* START button */
#startbutton {
    padding: 12px 0;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: 0.2s ease-in-out;
}


/* --- Login Page Specific --- */
.login-page-bg {
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-4) 0;
}
.login-card {
  max-width: 400px;
  width: 100%;
  position: fixed;
  top: 100px; /* Distance from the top of the viewport */
      right: 250px; /* Distance from the right of the viewport */
      
     
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  border-radius: var(--border-radius);
}
.login-header {
  text-align: center;
}
.login-header .logo-img {
  height: 60px;
  margin-bottom: var(--spacing-3);
}
.login-header .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}
.login-header .logo-subtext {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}
.btn-login {
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}
/* put inside your {% block css %} */
.helpline-box {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 65px;            /* Default position above footer */
  z-index: 1050;           /* Above typical footer z-index */
  background: rgba(0,0,0,0.80);
  color: #fff;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 0.75rem 1rem;
  text-align: center;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.25);
}
.helpline-box .contacts { display: flex; justify-content:center; gap:1.25rem; flex-wrap:wrap; align-items:center; }
.helpline-box h6 { margin:0 0 0.25rem 0; font-weight:700; }

/* --- 2FA Page Specific --- */
.tfa-card {
  max-width: 420px;
  margin: var(--spacing-5) auto;
}
.tfa-card .form-control[name="otp"] {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
}

    /* ============================
       MATRIX ENTRY PAGE - STICKY TOP PANEL
       ============================ */
    .sticky-top-panel {
        position: sticky;
        top: 61px;
        z-index: 1010;
        background-color: var(--color-bg);
        padding: var(--spacing-3);
        margin: 0;
        border-bottom: 1px solid var(--color-border);
        max-height: 50vh;
        overflow-y: auto;
    }

    /* Logout button style */
    .logout-button {
        display: inline-block;
        background-color: var(--danger-color);
        color: white !important;
        padding: 0.375rem 0.75rem;
        border-radius: 0.375rem;
        border: none;
        font-weight: 600;
        text-align: center;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    .logout-button:hover,
    .logout-button:focus {
        background-color: #b91c1c; /* Darker red on hover/focus */
        color: white !important;
        text-decoration: none;
    }

/* ============================
   TOP GRID LAYOUT - Stats Left, Form Right
   ============================ */
.top-grid {
  display: flex;
  gap: 10px;
  max-height: 45vh;
  flex-direction: row-reverse;
  flex-wrap: nowrap;
}

@media (max-width: 1200px) {
  .top-grid {
    flex-direction: column;
    max-height: none;
  }
}

/* Left Stats Box - Dark theme */
.stats-box {
  display: flex;
  position: sticky;
  top: 0;                       /* REQUIRED for sticky to work */
  gap: 5px;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  justify-content: space-evenly;
  z-index: 999;                 /* Keeps it above other content */
}


/* Individual stat cards - Dark theme */
.stats-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1f1f1f;
  background-color: #f5f9ff;                /* Light text on dark */
  text-align: center;         /* Dark card background */
  border: 1px solid #444;         /* Subtle border */
}

/* Values - Bright highlight */
.stats-item span {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1f1f1f;                /* Brighter text */
  margin-top: 4px;
  display: block;
}


/* Right Form Box - Takes remaining space, scrollable */
.section-split-box {
  flex: 1;
  background: #f1f1f1;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid #cfcfcf;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  overflow-y: auto;
  max-height: 46vh;
}

.section-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* First Row: Section Number + SPLIT Radio Buttons */
.section-left {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
  width: 100%;          /* FULL WIDTH */
  max-width: 100%;      /* Prevent shrinking */
  margin: 0;            /* Remove auto margins */
  padding: 0;
}


/* Inner divs expand properly */
.section-left > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}


/* Section select box container */
.section-left > div:first-child {
  min-width: 250px;
  flex: 1;
}


/* Stretch the white card fully */
.section-left .p-4 {
  width: 100%;
  max-width: 100%;
  margin: 0;
}


#sectionSelect {

  height: 42px;
  border-radius: 10px;
  border: 2px solid #dee2e6;
  padding: 0 10px;
  font-size: 0.9rem;
}

/* Split Group Styling */
.split-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.split-group label.form-label {
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.split-group > div {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.split-group .form-check-label {
  border: 2px solid #dee2e6;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  background: #f8f9fa;
  font-size: 0.9rem;
}

.split-group .form-check-label:has(input:checked) {
 
  color: rgb(175, 11, 11);
  border-color: #0d6efd;
}

.split-group .form-check-label:hover {
  border-color: #0d6efd;
  background: #e7f1ff;
}

.split-group .form-check-input {
  margin: 0;
}

/* ADD Section Button */
#addSectionBtn {
  height: 42px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  align-self: flex-end;
}

/* Section Form (Hidden by default) */
#sectionForm {
  display: none;
  background: rgba(13, 110, 253, 0.05);
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #cfe2ff;
}

#sectionForm .d-flex {
  justify-content: center;
  gap: 12px;
}

#sectionForm > div > div {
  flex: 1;
  min-width: 180px;
}

#sectionForm input {
  height: 40px;
  border-radius: 8px;
  border: 2px solid #dee2e6;
  padding: 0 10px;
  font-size: 0.9rem;
}

#sectionForm button {
  height: 42px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.9rem;
}

/* Second Row: Ward, PS, From, To, ADD Button - Compact */
.entry-line-2 {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-line-2 > div {
  display: flex;
  flex-direction: column;
  min-width: 120px;
  flex: 1;
}

.entry-line-2 label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.entry-line-2 select,
.entry-line-2 input {
  height: 42px;
  border-radius: 8px;
  border: 2px solid #dee2e6;
  padding: 0 10px;
  font-size: 0.9rem;
}

.entry-line-2 select:focus,
.entry-line-2 input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  outline: none;
}

/* ADD Button - Compact */
.add-btn {
  height: 42px;
  padding: 0 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  align-self: flex-end;
  background: #198754;
  border: none;
  color: white;
  transition: all 0.2s ease;
}

.add-btn:hover {
  background: #157347;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(25, 135, 84, 0.3);
}

/* Form Labels Consistency */
.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

/* Section Chips (if visible) */
#sectionChips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.section-chip {
  background-color: #0d6efd;
  color: white;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-chip span {
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.section-chip span:hover {
  opacity: 1;
}

/* ============================
   TABLE SECTION - Visible on Load
   ============================ */
.table-section {
  background: #ffffff;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid #e8e8f0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  margin-top: 16px;
  margin-bottom: 60px;
  position: sticky;
  z-index: 999; 
}

/* TOP BAR (delete, total, save all) */
.table-section .d-flex {
  padding-bottom: 6px;
}

/* ============================
   SCROLLABLE TABLE WRAPPER
   ============================ */
.table-wrapper {
  max-height: 380px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e4e4e4;
  background: #ffffff;
}

/* Scrollbar styling */
.table-wrapper::-webkit-scrollbar,
.stats-box::-webkit-scrollbar,
.section-split-box::-webkit-scrollbar,
.sticky-top-panel::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-wrapper::-webkit-scrollbar-track,
.stats-box::-webkit-scrollbar-track,
.section-split-box::-webkit-scrollbar-track,
.sticky-top-panel::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb,
.stats-box::-webkit-scrollbar-thumb,
.section-split-box::-webkit-scrollbar-thumb,
.sticky-top-panel::-webkit-scrollbar-thumb {
  background: #c7c7c7;
  border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover,
.stats-box::-webkit-scrollbar-thumb:hover,
.section-split-box::-webkit-scrollbar-thumb:hover,
.sticky-top-panel::-webkit-scrollbar-thumb:hover {
  background: #a5a5a5;
}



.table tbody td {
    padding: 12px 12px;   /* Increased padding */
    font-size: var(--font-size-base);
    border: 1px solid var(--color-border);
    text-align: center;
    vertical-align: middle;
}


.table tbody tr:last-child td {
  border-bottom: 2px solid var(--color-border);
}

.table tbody tr:hover {
  background-color: rgba(0, 90, 156, 0.02);
}

/* --- Alert / Flashed Messages --- */
#alert-container {
  position: fixed;
  top: var(--spacing-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-2);
  min-width: 350px;
}

.alert {
  box-shadow: var(--shadow);
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .section-left {
    flex-direction: column;
    align-items: stretch;
  }
  
  .section-left > div:first-child {
    width: 100%;
  }
  
  .split-group {
    width: 100%;
  }
  
  #addSectionBtn {
    width: 100%;
  }
  
  .top-grid {
    max-height: none;
  }
  
  .sticky-top-panel {
    max-height: none;
  }
  
  .stats-box,
  .section-split-box {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .stats-box {
    max-width: 100%;
    width: 100%;
  }
  
  .entry-line-2 {
    gap: 10px;
  }
  
  .entry-line-2 > div {
    min-width: 100px;
  }
  
  .add-btn {
    width: 100%;
  }
  
  #sectionForm .d-flex {
    flex-direction: column;
  }
}

table { 
  background: #fff; 
  border-radius: 8px; 
  box-shadow: 0 4px 15px rgba(0,0,0,.05); 
}

td, th { 
  text-align: center; 
  vertical-align: middle !important; 
}

.preview { 
  width: 100px; 
  height: 100px; 
  object-fit: cover; 
  border: 1px solid #e2e8f0; 
  border-radius: 6px; 
}

 .error { 
  color: #c1121f; 
  font-size: .9rem; 
}
    .ok { 
      color: #0a8754; font-size: .9rem; 
    }
    .small-note { 
      font-size: .82rem; color: #6b7280; 
    }
.btn-outline-back {
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
    background: transparent !important;
    padding: 0.45rem 1rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.25s ease;
}

.btn-outline-back:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

  /* Distinguish existing vs new records */
tr.existing-record {
  background-color: #f0f8ff;
  font-weight: 500;
  border-left: 3px solid #0d6efd;
}

tr.new-record {
  background-color: #fffef0;
  border-left: 3px solid #ffc107;
}

tr.existing-record:hover {
  background-color: #e3f2ff;
}

tr.new-record:hover {
  background-color: #fffacd;
}

/* Checkbox styling */
tr.existing-record .rowCheck {
  cursor: pointer;
}

tr.existing-record .rowCheck:hover {
  transform: scale(1.1);
}

.footerTotal{
  font-weight: 700;
  font-size: 1.5rem;
}