/* Branding Overrides - Modern UI */
@import url(https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700);

body, html, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: "Poppins", sans-serif !important;
}

/* 1. Global Colors & Alerts */
.alert-success, .toast-success, .jq-toast-success {
    background-color: #00a2a7 !important;
    color: #ffffff !important;
    border-color: #00a2a7 !important;
}
.alert-danger, .alert-error, .toast-error, .jq-toast-error, .toast-danger {
    background-color: #E1FA66 !important;
    color: red !important;
    border-color: #E1FA66 !important;
}

/* 2. Modern Cards (White Box) */
.white-box, .white-box-custom {
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important;
    padding: 12px !important; /* Further reduced from 15px */
    position: relative;
    margin-bottom: 12px !important; /* Further reduced from 15px */
    border: none !important;
}
.white-box::before, .white-box-custom::before {
    content: "";
    display: block;
    height: 5px;
    background: #ffffff !important; /* Clean look, no colored stripe */
    border-radius: 8px 8px 0 0 !important;
}

/* 3. Typography */
h3.box-title, .white-box h3, .white-box-custom h3 {
    font-family: "Poppins", sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 16px !important; /* Slightly smaller */
    margin-bottom: 10px !important; /* Reduced from 20px */
    letter-spacing: 0.5px !important;
    color: #333 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}
.white-box h3.box-title i {
    font-size: 1.2em;
    color: #00a2a7 !important;
}

/* 4. Modern Tables */
.table, .period-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-top: 10px !important; /* Reduced from 20px */
    background: #fff !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
}
.table thead th, .period-table th, .white-box .table th {
    background-color: #00a2a7 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    padding: 10px 12px !important;
    border-bottom: 2px solid #008a8e !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    font-family: "Poppins", sans-serif !important;
}
.table tbody td, .period-table td, .white-box .table td {
    padding: 8px 10px !important; /* Reduced vertical padding */
    border-bottom: 1px solid #f5f5f5 !important;
    vertical-align: middle !important;
    /* color: #555 !important; */
    font-size: 13px !important; /* Slightly smaller font */
    transition: all 0.2s !important;
    font-weight: 450 !important;
    font-family: "Poppins", sans-serif !important;
}
.table tbody tr:hover, .period-table tr:hover {
    background-color: #f8fcfc !important;
    transform: scale(1.001);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02) !important;
}

/* 5. Modern Forms */
.form-control, .form-control-custom, select.form-control {
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
    padding: 6px 10px !important; /* Reduced padding */
    height: 36px !important; /* Reduced height from 40px */
    box-shadow: none !important;
    font-size: 13px !important; /* Slightly smaller font */
    color: #333 !important;
    transition: all 0.3s ease !important;
    background-color: #fcfcfc !important;
}

.form-control:focus {
    border-color: #00a2a7 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 162, 167, 0.1) !important;
}

.modern-label {
    text-align: right !important;
    font-weight: 600 !important;
    color: #555 !important;
    font-size: 12px !important; /* Slightly smaller */
    padding-top: 8px !important; /* Reduced from 10px */
    margin-bottom: 0 !important;
    padding-right: 10px !important; /* Reduce gap between label and input */
}

.form-group.row {
    margin-bottom: 5px !important; /* Further reduced from 8px */
    display: flex;
    align-items: center;
}

/* Multi-column grid for forms */
.modern-form-container {
    padding: 0 !important; /* Removed vertical padding */
}

.modern-field-wrapper {
    margin-bottom: 0 !important; /* Removed bottom margin to rely on form-group.row */
    padding-left: 5px !important; /* Tighter horizontal spacing */
    padding-right: 5px !important; /* Tighter horizontal spacing */
}

.row.g-3.modern-form-container {
    --bs-gutter-x: 0.5rem !important; /* Reduce bootstrap horizontal gutter */
    --bs-gutter-y: 0rem !important; /* Reduce bootstrap vertical gutter */
}

/* Radio and Checkbox Styling */
.grid-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #00a2a7;
    cursor: pointer;
}
.form-control:focus, .form-control-custom:focus {
    border-color: #00a2a7 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 162, 167, 0.1) !important;
}

/* 6. Buttons (Teal Theme) - Increased Specificity */
body .btn-info, body .btn-primary, body .btn-success, body .dt-button, body .btn-teal, 
body a.btn-info, body a.btn-primary, body a.btn-success, body a.dt-button, body a.btn-teal,
html body .btn-info, html body .btn-primary, html body .btn-success {
    background-color: #00a2a7 !important;
    border-color: #00a2a7 !important;
    color: #fff !important;
    border-radius: 6px;
    padding: 8px 18px !important; /* Increased from 6px 15px */
    font-weight: normal !important; /* Removed bold */
    text-transform: uppercase;
    font-size: 13px !important; /* Increased from 12px */
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 162, 167, 0.2) !important;
    background-image: none !important; /* Remove gradients */
    text-shadow: none !important;
    transition: all 0.3s ease;
}

/* Compact Buttons inside Tables - Higher Specificity */
.table tbody td .btn-sm, 
.table tbody td .btn-info, 
.table tbody td .btn-primary, 
.table tbody td .btn-success,
.table tbody td .btn,
.white-box .table tbody td .btn-sm,
.white-box .table tbody td .btn-info {
    padding: 4px 8px !important; /* Increased from 2px 6px */
    font-size: 11px !important; /* Increased from 10px */
    margin: 0 2px !important;
    line-height: 1.2 !important;
    min-width: auto !important;
    height: auto !important;
    display: inline-block !important;
}

/* Ensure the icons inside are also slightly larger */
.table tbody td .btn-sm i, 
.table tbody td .btn-info i {
    font-size: 11px !important; /* Increased from 10px */
}

body .btn-info:hover, body .btn-primary:hover, body .btn-success:hover, body .dt-button:hover, body .btn-teal:hover, 
body a.btn-info:hover, body a.btn-primary:hover, body a.btn-success:hover, body a.dt-button:hover, body a.btn-teal:hover {
    background-color: #00a2a7 !important;
    border-color: #00a2a7 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 162, 167, 0.3) !important;
    background-image: none !important;
}

/* 7. Pagination */
.pagination > li > a, .pagination > li > span, .dataTables_paginate .paginate_button {
    color: #555 !important;
    background-color: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    margin: 0 3px !important;
    padding: 8px 14px !important;
    transition: all 0.2s;
}
.pagination > .active > a, .pagination > .active > span, 
.dataTables_paginate .paginate_button.current, 
.dataTables_paginate .paginate_button:hover {
    background-color: #00a2a7 !important;
    border-color: #00a2a7 !important;
    color: #fff !important;
    font-weight: normal !important;
}

/* 8. Sidebar Menu Styling */
.sidebar, .navbar-static-side, .left-sidebar {
    background-color: #ffffff !important; /* White Horizontal Bar */
}

#sidebarnav ul {
    background-color: #dcdcdc !important; /* Grey Dropdown Menus */
}

.sidebar-nav ul li a {
    font-family: "Poppins", sans-serif !important;
    font-size: 14px;
    padding: 5px 5px !important; /* Further reduced vertical padding */
    color: #777777 !important; /* Grey Menu Text */
    font-weight: 700 !important; /* Bold Menu Text */
    transition: all 0.3s ease;
    position: relative;
}

/* Horizontal Main Menu Underline */
#sidebarnav > li > a {
    padding-bottom: 8px !important;
}

#sidebarnav > li > a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: #ff6b35; /* Orange color from My Favourite */
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

#sidebarnav > li > a.active::after {
    width: 80%;
}

#sidebarnav > li > a.active {
    background-color: transparent !important;
    color: #777777 !important;
    font-weight: 700 !important;
}

/* Top-level nav items retain original hover/active behaviour (white-on-teal). */
/* Section 12 below scopes the teal-border style to dropdown panels only. */
.sidebar-nav ul li a:hover, .sidebar-nav ul li a.active {
    color: #ffffff !important;
    background-color: #00a2a7 !important;
    font-weight: 500;
}
.sidebar-nav ul li a.has-arrow.active {
    background-color: transparent !important;
    color: #00a2a7 !important;
}
/* Level 1 active with has-arrow should still be green as per diagram */
.sidebar-nav > ul > li > a.has-arrow.active {
    background-color: #00a2a7 !important;
    color: #ffffff !important;
}
.submenu-icon {
    font-size: 10px;
    margin-right: 8px;
    color: #00a2a7;
    transition: all 0.3s ease;
}
.sidebar-nav ul li a:hover .submenu-icon {
    transform: translateX(3px);
    color: #00a2a7;
}
/* Dropdown Items (2nd Level) */
.sidebar-nav > ul > li > ul > li > a {
    padding-left: 10px !important; /* Level 2: 10px */
    font-size: 14px;
    display: flex;
    align-items: center;
    color: #777777 !important;
    font-weight: normal !important; /* Only bold main menus */
}
/* Dropdown Hover - Teal Background with White Text */
.sidebar-nav > ul > li > ul > li > a:hover, 
.sidebar-nav > ul > li > ul > li > a.active {
    padding-left: 15px !important; /* Slight shift for effect */
}

/* 3rd Level Menus */
.sidebar-nav > ul > li > ul > li > ul > li > a {
    padding-left: 15px !important; /* Level 3: 15px */
    font-weight: normal !important;
}
.sidebar-nav > ul > li > ul > li > ul > li > a:hover,
.sidebar-nav > ul > li > ul > li > ul > li > a.active {
    padding-left: 20px !important;
}

/* 4th Level Menus */
.sidebar-nav > ul > li > ul > li > ul > li > ul > li > a {
    padding-left: 20px !important; /* Level 4: 20px */
    font-weight: normal !important;
}
.sidebar-nav > ul > li > ul > li > ul > li > ul > li > a:hover,
.sidebar-nav > ul > li > ul > li > ul > li > ul > li > a.active {
    padding-left: 25px !important;
}

/* 5th Level Menus */
.sidebar-nav > ul > li > ul > li > ul > li > ul > li > ul > li > a {
    padding-left: 25px !important; /* Level 5: 25px */
    font-weight: normal !important;
}
.sidebar-nav > ul > li > ul > li > ul > li > ul > li > ul > li > a:hover,
.sidebar-nav > ul > li > ul > li > ul > li > ul > li > ul > li > a.active {
    padding-left: 30px !important;
}

/* General Reset for deeper levels just in case */
.sidebar-nav > ul > li > ul ul a {
    font-size: 14px !important;
}

/* 9. Sidebar Width & Layout */
@media (min-width: 768px) {
        /* .navbar-nav > li.dropdown > .dropdown-menu,
    .navbar-nav > li > .dropdown-menu {
        min-width: 340px !important;
    }
    .sidebar-nav > ul > li > ul {
        min-width: 340px !important;
    } */
    /* Widen the sidebar and the logo area */
    .navbar-header, .top-left-part {
        width: 260px !important;
    }
    .navbar-static-side, .sidebar {
        width: 260px !important;
    }
    #page-wrapper {
        margin-left: 260px !important;
    }
}

#row_viewer .tab-content > .tab-pane {
    display: none !important;
}

#row_viewer .tab-content > .tab-pane.active {
    display: block !important;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    background-color: #00a2a7 !important;
    color: #ffffff !important;
    border-color: #00a2a7 !important;
}

.nav-tabs .nav-link {
    color: #333333 !important;
}

#row_viewer [id^="new"] {
    width: auto !important;
    padding: 0 !important;
    margin-top: 8px !important;
    margin-left: 0 !important;
    display: inline-block !important;
}

#row_viewer [id^="new"] .btn,
#row_viewer [id^="new"] .btn-info {
    padding: 2px 10px !important;
    font-size: 10px !important;
    height: 26px !important;
    line-height: 1.1 !important;
    min-height: 0 !important;
    border-radius: 6px !important;
}

/* 10. Dashboard Styling */
.r-icon-stats {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; /* Center the icons and content */
}

.r-icon-stats i {
    margin-right: 15px !important; /* Space between icon and text */
}

.r-icon-stats .bodystate {
    padding-left: 0 !important; /* Remove original padding */
    text-align: left !important;
}

.r-icon-stats .bodystate h2, 
.r-icon-stats .bodystate h2 a {
    font-weight: normal !important; /* Remove bolding from numbers */
}

/* 11. Layout Compaction */
.container-fluid {
    padding: 10px 15px !important; /* Reduced from default */
}
.page-wrapper {
    padding-bottom: 20px !important;
}
.row.bg-title {
    margin-bottom: 10px !important; /* Reduced from 15px */
    padding-top: 10px !important;
    padding-bottom: 5px !important;
}
.page-title {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    font-size: 16px !important;
}
.breadcrumb {
    margin-bottom: 0 !important;
    padding: 5px 0 !important;
}
.breadcrumb-item {
    font-size: 12px !important;
}
#grid_content.row {
    margin-top: 0 !important;
}
/* Reduce spacing between action buttons and search area */
.dataTables_wrapper .row:first-child {
    margin-top: -10px !important;
    margin-bottom: 5px !important;
}
.dataTables_wrapper .row {
    margin-bottom: 5px !important;
}

/* 12. Menu Dropdown Redesign */

/* Override grey dropdown background — make panels white */
#sidebarnav ul {
    background-color: #ffffff !important;
}

/* Dropdown panel: white with subtle shadow and border */
.sidebar-nav > ul > li > ul.collapse,
.sidebar-nav > ul > li > ul.collapsing {
    background: #ffffff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10) !important;
    border-top: 2px solid #00a2a7 !important;
    padding: 4px 0 !important;
}

/* Reset all dropdown item styles */
.sidebar-nav > ul > li > ul > li > a {
    background: #ffffff !important;
    color: #555555 !important;
    border-left: 3px solid transparent !important;
    padding: 9px 16px !important;
    font-weight: 400 !important;
    font-size: 13px !important;
    transition: border-left-color 0.2s ease, color 0.2s ease, font-weight 0.1s ease !important;
}

/* Hover state */
.sidebar-nav > ul > li > ul > li > a:hover {
    background: #f5fafa !important;
    color: #00a2a7 !important;
    border-left-color: #00a2a7 !important;
    font-weight: 600 !important;
    padding-left: 16px !important;
}

/* Active / selected item — teal left border, bold */
.sidebar-nav > ul > li > ul > li.active > a,
.sidebar-nav > ul > li > ul > li > a.active {
    background: #f0f8f8 !important;
    color: #00a2a7 !important;
    border-left-color: #00a2a7 !important;
    font-weight: 700 !important;
}

/* Deeper levels (level 3+) inherit the same style */
.sidebar-nav > ul > li > ul > li > ul > li > a {
    background: #ffffff !important;
    color: #666666 !important;
    border-left: 3px solid transparent !important;
    padding: 8px 16px 8px 24px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
}
.sidebar-nav > ul > li > ul > li > ul > li > a:hover,
.sidebar-nav > ul > li > ul > li > ul > li.active > a {
    background: #f5fafa !important;
    color: #00a2a7 !important;
    border-left-color: #00a2a7 !important;
    font-weight: 600 !important;
    padding-left: 24px !important;
}
