/* Ensure the body doesn't get hidden behind the fixed navbar */
body {
    padding-top: 70px; /* Adjust based on your navbar height */
    background-color: #f8f9fa;
}

/* Make tables scrollable on mobile without breaking layout */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* UI Improvement for mobile dropdowns */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #343a40; /* Match bg-dark */
        padding: 1rem;
        border-radius: 8px;
        margin-top: 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
    
    .nav-item.dropdown .dropdown-menu {
        border: none;
        background-color: #3e444a;
        margin-left: 10px;
    }
    
    .dropdown-item {
        color: rgba(255,255,255,.8) !important;
    }
}

/* Fix for DayPilot or Calendar plugins if they use fixed widths */
.calendar-container {
    max-width: 100%;
    overflow-x: auto;
}

/* 1. Offset for the fixed-top navbar */
.content-wrapper {
    margin-top: 2px; /* Standard Bootstrap 5 navbar height */
    padding: 2px;
    min-height: calc(100vh - 56px); /* Ensures background covers full screen */
    background-color: #f8f9fa; /* Light grey background for professional look */
    transition: all 0.3s ease; /* Smooth transition for responsiveness */
}

/* 2. Container for the AngularJS view */
#main {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
}

/* 3. Mobile-Specific Adjustments */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 5px; /* Reduce padding on small screens to save space */
        margin-top: 5px; /* Adjust if your mobile navbar is shorter */
    }
}

/* 4. Ensure child elements don't overflow the container */
[ng-view] {
    display: block;
    width: 100%;
    overflow-x: hidden; /* Prevents horizontal scroll glitches during animations */
}

/* Simple fade transition for ng-view */
.view-animate.ng-enter {
    transition: all 0.3s ease;
    opacity: 0;
}
.view-animate.ng-enter.ng-enter-active {
    opacity: 1;
}

/* Ensure inputs don't look squashed on mobile */
.form-control-sm, .form-select-sm {
    height: 35px;
}

/* Force table headers to stay on one line so arrows don't jump */
.table th {
    white-space: nowrap;
    cursor: pointer;
    vertical-align: middle;
}

/* Make sure the date inputs are usable on small touch screens */
@media (max-width: 576px) {
    .datepicker {
        font-size: 12px;
    }
    h3 {
        font-size: 1.25rem;
        margin-bottom: 10px !important;
    }
}

.table tr[ng-style] td {
    background-color: inherit !important;
}

.table tr[ng-style] {
    background-clip: padding-box; /* Fix for border rendering */
}

@media (max-width: 768px) {
    /* Make filter inputs full width on mobile */
    input[type="text"], input[type="date"], select {
        width: 100% !important;
        margin-bottom: 10px;
    }
    
    /* Ensure the header section stacks */
    .col-sm-12 {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

.lb-sm { padding: 0.2rem 0.4rem; font-size: 0.75rem; }
.lb-md { padding: 0.35rem 0.7rem; font-size: 1rem; }
.lb-lg { padding: 0.5rem 1rem; font-size: 1.25rem; }

.badge {
    border-radius: 0.25rem;
    font-weight: 500;
}

.badge.lb-sm { padding: 0.25em 0.4em; font-size: 0.75em; }
.badge.lb-md { padding: 0.4em 0.8em; font-size: 0.9em; }
.badge.lb-lg { padding: 0.6em 1.2em; font-size: 1.1em; }

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 0.2rem;
}