/* Global */
body {
    background: linear-gradient(to right, #e8eaf6, #f3e5f5);
    font-family: 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
}

/* Layout */
.main-content {
    flex: 1;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-top: 70px;
}

/* Navbar */
.navbar-modern {
    font-weight: 500;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}
.navbar-modern .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #4a148c !important;
    text-transform: uppercase;
}
.navbar-modern .nav-link {
    color: #3a3a3a;
    transition: color 0.25s ease, transform 0.25s ease;
}
.navbar-modern .nav-link:hover,
.navbar-modern .nav-link:focus {
    color: #6a1b9a;
}
.navbar-modern .nav-link i {
    font-size: 1rem;
}
.navbar-modern .dropdown-menu {
    border-radius: 18px;
    border: none;
    padding: 1rem;
}
.mega-menu {
    width: min(92vw, 1000px);
    background: linear-gradient(145deg, rgba(255,255,255,0.96), rgba(233,229,255,0.92));
    border-radius: 24px;
    border: 1px solid rgba(111, 66, 193, 0.3);
    padding: 1.25rem 1.75rem;
    box-shadow: 0 25px 45px rgba(79, 70, 229, 0.18);
    position: relative;
    max-height: 70vh;
    overflow-y: auto;
}

.mega-menu::-webkit-scrollbar {
    width: 6px;
}

.mega-menu::-webkit-scrollbar-thumb {
    background: rgba(111, 66, 193, 0.5);
    border-radius: 3px;
}
.mega-menu::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
    z-index: -1;
}
.mega-menu-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c549c;
    font-weight: 600;
}
.mega-menu .dropdown-item {
    border-radius: 12px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    color: #3a3a3a;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
}
.mega-menu .dropdown-item:hover {
    background-color: rgba(111, 66, 193, 0.1);
    color: #5a1da1;
}
.mega-menu .dropdown-item i {
    font-size: 1.1rem;
    color: #6f42c1;
}
.mega-menu .dropdown-column {
    padding-right: 1rem;
}
.mega-columns-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1.5rem;
    margin-bottom: -0.5rem;
}
.mega-column {
    flex: 1 1 220px;
    min-width: 220px;
    padding-right: 1rem;
}
.mega-column:first-child {
    padding-left: 0.5rem;
}

@media (max-width: 992px) {
    .mega-menu {
        width: min(95vw, 600px);
        padding: 1rem;
    }

    .mega-columns-row {
        flex-direction: column;
    }

    .mega-column {
        min-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }
}
.navbar-toggler {
    filter: invert(0.3);
}

/* Welcome Card & Buttons */
.welcome-card {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}
.login-btn {
    background-color: #6a1b9a;
    border: none;
}
.login-btn:hover {
    background-color: #4a148c;
}

/* Footer */
footer {
    text-align: center;
    padding: 15px;
    background: #ede7f6;
    font-size: 0.9rem;
    color: #555;
}

/* Forms */
form .form-label {
    font-weight: 600;
    color: #4a148c;
}
form .form-control {
    border-radius: 10px;
    border: 1px solid #ccc;
    padding: 10px;
}
form .form-control:focus {
    border-color: #6a1b9a;
    box-shadow: 0 0 0 0.2rem rgba(106, 27, 154, 0.25);
}

/* Minimal change to match your existing rule */
form .form-select { 
  padding: 10px; 
  border-radius: 10px; 
  border: 1px solid #ccc;
}
form .form-select-sm { 
  padding: 10px; 
  border-radius: 10px; 
}

/* Alerts & Toasts */
.alert {
    padding: 10px 15px;
    font-size: 0.95rem;
    margin-bottom: 20px;
    border-radius: 8px;
}
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}
.toast {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
}
.toast.fade-out {
    opacity: 0;
    transform: translateX(100%);
}
.toast-header {
    padding: 0.5rem 1rem;
    color: #fff;
    font-weight: 600;
}
.toast-body {
    padding: 0.75rem 1rem;
    background: #fff;
    color: #333;
}
.toast.info    .toast-header {
    background: #4a148c;
}
.toast.error   .toast-header {
    background: #c62828;
}
.toast.success .toast-header {
    background: #2e7d32;
}
.toast.show {
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to   {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}
.card:hover {
    transform: translateY(-5px);
}
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
}
.card h2 {
    font-size: 2.8rem;
    margin-top: 10px;
    font-weight: bold;
}

/* Tables */
.page-heading {
    font-size: 2rem;
    font-weight: 600;
    color: #4a148c;
    margin-bottom: 20px;
}
.table {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.table th {
    background-color: #ede7f6;
    color: #4a148c;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.table td {
    vertical-align: middle;
    font-size: 0.95rem;
}
.table-hover tbody tr:hover {
    background-color: #f8f4fb;
}

/* Modals & Badges */
.modal-content {
    border-radius: 16px;
}
.badge {
    font-size: 0.85rem;
    padding: 0.35em 0.6em;
}

/* Dropdown Submenu */
.dropdown-submenu {
    position: relative;
}
.dropdown-submenu .dropdown-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-top: -1px;
    display: none;
}
.dropdown-submenu:hover .dropdown-menu {
    display: block;
}

/* Beauty Tabs */
.beauty-tabs .nav-link {
    background-color: transparent;
    color: #4a148c;
    border: 1px solid transparent;
    margin-right: 0.25rem;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}
.beauty-tabs .nav-link:hover {
    background-color: #ede7f6;
}
.beauty-tabs .nav-link.active {
    background-color: #6a1b9a;
    color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Searchable Multi-Col Dropdown */
.search-dropdown {
    width: 100%;
}
.search-dropdown .dropdown-menu {
    max-height: 300px;
    width: 600px;
    overflow-y: auto;
}
.search-dropdown .search-input {
    border-radius: 4px;
    padding: 0.25rem;
}
.search-dropdown .dropdown-toggle {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    color: #4a148c;
    padding: 0.5rem 1rem;
    text-align: left;
    position: relative;
}
.search-dropdown .dropdown-toggle::after {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #4a148c;
}
.search-dropdown .table thead th {
    background: #ede7f6;
    padding: 0.25rem;
}
.search-dropdown .table {
    font-size: 0.85rem;
}
.search-dropdown .table th:nth-child(4),
.search-dropdown .table td:nth-child(4) {
    min-width: 110px;
    white-space: nowrap;
}
.search-dropdown .table th:nth-child(1),
.search-dropdown .table td:nth-child(1) {
    min-width: 90px;
    white-space: nowrap;
}
.search-dropdown .table tbody tr {
    cursor: pointer;
}
.search-dropdown .table tbody tr:hover {
    background: #f8f4fb;
}
/* -----------------------------
   Grid-only overrides
   ----------------------------- */

/* 1) Table wrapper for scoping */
.table-responsive .table {
    border-radius: 0.5rem;              /* keep nice rounded corners */
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* 2) Header row */
.table-responsive .table thead {
    background-color: #ece1fa;          /* very light purple */
    color: #4b3b69;                     /* darker purple text */
}
.table-responsive .table thead th {
    border: none;
}

/* 3) All body rows */
.table-responsive .table tbody tr {
    background-color: #ffffff;          /* plain white instead of blue */
    transition: background-color 0.2s;
}

/* 4) Hover state */
.table-responsive .table tbody tr:hover {
    background-color: #f4e1f7;          /* subtle lavender highlight */
}

/* 5) Head‐of‐family rows */
/* Override Bootstrap’s blue .table-primary for Head-of-Family rows */
.table-responsive .table tbody tr.table-primary {
    background-color: #f6e0fc !important;  /* soft purple */
    color: #4b3b69 !important;             /* dark purple text */
}

.table-responsive .table tbody tr.table-primary:hover {
    background-color: #ffffff !important;  /* white on hover */
}

/* 6) Indent child rows (unchanged) */
.table-responsive .table tbody td.ps-5 {
    padding-left: 3rem !important;
}

/* override bootstrap’s table-primary on the <td> and <th> */
.table-responsive .table tbody tr.table-primary > td,
.table-responsive .table tbody tr.table-primary > th {
    background-color: #ECE8F6 !important;  /* soft purple */
    color:            #4b3b69 !important;  /* dark purple text */
}

/* keep the white-on-hover effect */
.table-responsive .table tbody tr.table-primary:hover > td,
.table-responsive .table tbody tr.table-primary:hover > th {
    background-color: #ffffff !important;
    color:            #4b3b69 !important;
}

/* smooth collapse */
.table-responsive .collapse {
    transition: all 0.3s ease;
}

/* custom.css */

/* 1) Constrain the main container to a fixed max width */
.container {
    max-width: 1200px !important;  /* adjust to taste: 960px, 1100px, etc */
    margin-left: auto;
    margin-right: auto;
}

/* 2) Optional: ensure nested .container-fluid sections also obey the max width */
.container-fluid > .container {
    max-width: 1200px;
}

/* 3) Optional: if you have a .main-wrapper or <body> wrapper */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* 4) Make sure no horizontal scrollbar appears */
body {
    overflow-x: hidden;
}

/* custom.css */
.dataTables_filter {
    display: none !important;
}
/* make sure both controls share the same vertical alignment */
div.dataTables_length,
div.dt-search-container {
    display: flex;
    align-items: center;
}

/* shrink the dropdown so it doesn’t eat up all the space */
div.dataTables_length select {
    width: auto;
    margin-right: 1rem;
}

/* same for your input */
div.dt-search-container input {
    width: 200px;    /* or whatever makes sense */
}

#addGroupBy:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.clearable-wrapper input {
    padding-right: 24px;
}

.beauty-tabs .nav-link.disabled {
    opacity: .5;
    pointer-events: none;
}

/* 1) Keep modal above navbar */
.navbar, .glass-navbar { z-index: 1200; }
.modal-backdrop       { z-index: 2000 !important; }
.modal                { z-index: 2001 !important; }

/* 2) Start the modal **below** your fixed navbar (≈70px high) */
#reportModal .modal-dialog {
  margin-top: 80px;                /* tweak to your navbar height */
}

/* 3) Make the injected content area scroll vertically */
#reportModalContent {
  max-height: calc(100vh - 80px - 2rem);  /* viewport - navbar offset - dialog margin */
  overflow-y: auto;
}

/* Optional: constrain width just a bit on small screens */
#reportModal .modal-dialog.modal-xl {
  max-width: min(1200px, 95vw);
}

.selectable-row:hover { background-color: #eef6ff; cursor: pointer; }
.table-primary { background-color: #d4e8ff !important; }
