html,
body,
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
    /* Prevent scrolling on html/body */
}

body {
    font-family: sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Use 100% of html height */
}

#content {
    height: 100%;
}

.top-pane {
    background-color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    position: relative;
    transition: height 0.3s, padding 0.3s;
    height: 80px;
    z-index: 1001;
}

.top-pane.collapsed {
    height: 0;
    padding: 0 20px;
    overflow: hidden;
}

.top-pane-left {
    display: flex;
    align-items: center;
}

.top-pane .logo {
    width: 150px;
    margin-right: 20px;
}

.vertical-separator {
    width: 3px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(102, 153, 204, 0), #6699CC, rgba(102, 153, 204, 0));
    margin: 0 20px;
}

.title {
    margin-left: 25px;
}

.title h1 {
    margin: 0;
    font-size: 24px;
    color: #003366;
}

.title p {
    margin: 0;
    font-size: 14px;
    color: #6699CC;
}

.top-pane-right {
    display: flex;
    align-items: center;
}

.date-container,
.tasks-container,
.user-container {
    display: flex;
    align-items: center;
    margin-left: 30px;
}

.date-container,
.user-container a {
    color: #6699CC;
}

#user-menu-trigger {
    text-decoration: underline;
    font-weight: bold;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-info-card {
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    width: 250px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1004;
}

.user-info-card.hidden {
    display: none;
}

.user-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.user-initials {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #003366;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
}

.user-details p {
    margin: 0;
}

.user-name {
    font-weight: bold;
    color: #003366;
}

.user-position {
    color: #6699CC;
}

.user-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: #003366;
    text-decoration: none;
    border-top: 1px solid #f0f2f5;
}

.user-menu-item:first-child {
    border-top: none;
}

.user-menu-item img {
    width: 20px;
    margin-right: 10px;
}

.user-menu-item:hover {
    background-color: #f0f2f5;
}

.top-pane-right i {
    font-size: 20px;
    color: #003366;
    margin-right: 10px;
}

.tasks-container {
    position: relative;
}

.task-icon {
    height: 30px;
}

.task-count {
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    position: absolute;
    top: -5px;
    right: -5px;
}

.content-wrapper {
    display: flex;
    height: 100%;
}

.sidebar {
    width: 250px;
    background-color: #003366;
    color: white;
    padding: 0;
    /* Removed all padding */
    box-sizing: border-box;
    position: relative;
    transition: width 0.3s, padding 0.3s;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 0;
    padding: 20px 0;
    overflow: hidden;
}

.sidebar.collapsed .menu {
    display: none;
}

.toggle-pane-btn {
    background-color: #6699CC;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    position: fixed;
    z-index: 1003;
}

#toggle-top-pane {
    top: 80px;
    right: 10px;
    border-radius: 0 0 5px 5px;
    transition: top 0.3s;
}

#toggle-sidebar {
    top: 85px;
    left: 250px;
    border-radius: 0 5px 5px 0;
    transition: left 0.3s;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 10px 5px;
}

.menu {
    list-style: none;
    padding: 10px;
    margin: 0;
}

.menu>ul {
    padding-top: 10px;
}

.menu>li {
    position: relative;
    /* Needed for absolute positioning of pseudo-element */
    padding-bottom: 10px;
    /* Adjusted padding for separator */
    margin-bottom: 10px;
    /* Adjusted margin for separator */
}

.menu>li::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    /* Smooth gray */
}

.menu>li>a {
    display: flex;
    /* Changed to flex */
    align-items: center;
    /* Vertically align items */
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    font-size: 18px;
    transition: background-color 0.3s;
}

.menu>li>a:hover {
    background-color: #6699CC;
}

.submenu {
    list-style: none;
    padding-left: 20px;
    display: none;
}

.submenu li {
    position: relative;
    /* Needed for absolute positioning of pseudo-element */
    padding-bottom: 5px;
    /* Adjusted padding for separator */
    margin-bottom: 5px;
    /* Adjusted margin for separator */
}

.submenu li::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.05);
    /* Even smoother gray for sub-items */
}

.submenu li:last-child::after {
    display: none;
    /* Remove separator from the last child of submenus */
}

.submenu li a {
    display: flex;
    /* Use flex to align icon and text */
    align-items: center;
    /* Vertically center icon and text */
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    background-color: #003366;
    /* Default background, same as sidebar */
    transition: background-color 0.3s;
}

.submenu li a::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid white;
    /* White triangle pointing right */
    margin-right: 8px;
    /* Space between bullet and text */
    display: inline-block;
    vertical-align: middle;
}

.submenu li a:hover {
    background-color: #4A7CA8;
    /* Slightly lighter blue on hover */
}

.menu-icon {
    height: 20px;
    filter: invert(100%);
    /* Makes SVG white */
    margin-right: 10px;
    /* Spacing between icon and text */
}

.main-content {
    flex-grow: 1;
    flex-shrink: 1;
    /* Allow it to shrink if needed */
    flex-basis: 0;
    /* Important for proper flex item sizing with overflow */
    padding: 20px;
    overflow-y: auto;
    height: 100%;
    /* Explicitly set height to 100% of parent (.content-wrapper) */
    min-height: 0;
    /* Allow flex item to shrink below its content size */
}

.header {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.header h2 {
    margin: 0;
    color: #003366;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 20px;
}

.chart-container,
.table-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
}

h3 {
    color: #003366;
    margin-top: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f2f2f2;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    border: 8px solid #f3f3f3;
    /* Light grey */
    border-top: 8px solid #003366;
    /* Dark Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
}

#loader-wrapper p {
    margin-top: 15px;
    color: #003366;
    font-size: 18px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none;
}

.catalog-container {
    padding: 20px;
    padding-bottom: 100px !important;
}

.catalog-container .header {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.catalog-container .header h2 {
    margin: 0;
    color: #003366;
}

.catalog-container .filter-pane {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.catalog-container .filter-group {
    display: flex;
    flex-direction: column;
}

.catalog-container .filter-group label {
    margin-bottom: 5px;
    color: #003366;
    font-weight: bold;
}

.catalog-container .filter-group input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.catalog-container .filter-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.catalog-container .button-group {
    display: flex;
    gap: 10px;
}

.catalog-container .button-group button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.catalog-container .button-group button img {
    height: 20px;
}

.catalog-container .action-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #003366;
    color: white;
}

.catalog-container .action-button:hover {
    background-color: #6699CC;
}

.catalog-container .action-button img {
    height: 20px;
    width: 20px;
    filter: invert(100%) sepia(100%) saturate(0) hue-rotate(0deg) brightness(100%) contrast(100%);
}

.catalog-container #clear-btn img {
    filter: invert(13%) sepia(28%) saturate(5570%) hue-rotate(187deg) brightness(94%) contrast(101%);
}

.catalog-container #clear-btn {
    background-color: #f0f2f5;
    color: #003366;
    border: 1px solid #003366;
}

.catalog-container #clear-btn:hover {
    background-color: #e0e2e5;
}

.catalog-container #search-results {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 100px;
}

.employees-table-container {
    overflow-x: auto;
}

.top-scrollbar-container {
    overflow-x: auto;
    height: 20px;
}

.top-scrollbar-dummy {
    width: 2000px;
    /* Adjust as needed */
    height: 1px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.catalog-container .catalog-table {
    width: 100%;
    border-collapse: collapse;
    display: table;
}

.catalog-container .catalog-table th,
.catalog-container .catalog-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.catalog-container .catalog-table th {
    background-color: #f2f2f2;
    cursor: pointer;
}

.catalog-container .catalog-table th:hover {
    background-color: #e0e2e5;
}

.catalog-container .catalog-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.catalog-container .catalog-table tbody tr:hover {
    background-color: #f1f1f1;
}

.action-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    filter: invert(9%) sepia(93%) saturate(2990%) hue-rotate(200deg) brightness(90%) contrast(101%);
    /* Color for action icons #003366 */
}

.catalog-container .catalog-table td:nth-child(4),
.catalog-container .catalog-table td:nth-child(5) {
    text-align: center;
}

/* Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in place */
    z-index: 1005;
    /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.4);
    /* Black w/ opacity */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1200px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    -webkit-animation-name: animatetop;
    -webkit-animation-duration: 0.4s;
    animation-name: animatetop;
    animation-duration: 0.4s;
    overflow-y: auto;
    max-height: 90vh;
}

.tab-container {
    width: 100%;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #ccc;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 16px;
    font-weight: bold;
    color: #003366;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

.tab-button.active {
    border-bottom: 2px solid #003366;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.form-grid-two {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 25px;
}

/* Add Animation */
@-webkit-keyframes animatetop {
    from {
        top: -300px;
        opacity: 0
    }

    to {
        top: 0;
        opacity: 1
    }
}

@keyframes animatetop {
    from {
        top: -300px;
        opacity: 0
    }

    to {
        top: 0;
        opacity: 1
    }
}

/* The Close Button */
.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 5px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    color: #003366;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #003366;
    font-weight: bold;
}

.modal-content .form-group input[type="text"],
.modal-content .form-group input[type="password"],
.modal-content .form-group input[type="email"],
.modal-content .form-group input[type="date"],
.modal-content .form-group input[type="number"],
.modal-content .form-group select,
.modal-content .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.modal-content .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-content .button-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-content .button-group button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-content .button-group button .button-icon {
    height: 20px;
    filter: invert(100%) sepia(100%) saturate(0) hue-rotate(0deg) brightness(100%) contrast(100%);
    /* Default to white for dark buttons */
}

.cancel-button-style {
    background-color: #f0f2f5;
    color: #003366;
    border: 1px solid #003366 !important;
}

.cancel-button-style:hover {
    background-color: #e0e2e5;
}

.cancel-button-style .button-icon {
    filter: invert(13%) sepia(28%) saturate(5570%) hue-rotate(187deg) brightness(94%) contrast(101%) !important;
}

.save-button-style {
    background-color: #003366;
    color: white;
}

.save-button-style:hover {
    background-color: #6699CC;
}

.save-button-style .button-icon {
    filter: invert(100%) sepia(100%) saturate(0) hue-rotate(0deg) brightness(100%) contrast(100%);
    /* Color for save icon */
}

/* Original #cancel-edit-btn and #save-edit-btn styles are now handled by .cancel-button-style and .save-button-style */

/* Login Page Styles */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    /* Full viewport height */
    background-color: #f0f2f5;
    /* Match body background */
    padding: 20px;
    box-sizing: border-box;
}

.login-container .logo {
    width: 300px;
    /* Adjust as needed */
    margin-bottom: 0;
}

.login-container h1 {
    color: #003366;
    margin-bottom: 5px;
    font-size: 36px;
}

.login-container h2 {
    color: #6699CC;
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 30px;
    text-align: center;
}

.login-container div {
    /* Targeting the div containing inputs and button */
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center items horizontally */
    width: 100%;
    max-width: 450px;
}

.login-container input[type="text"],
.login-container input[type="password"],
.login-container input[type="email"] {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    width: 350px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.login-container button {
    padding: 12px;
    background-color: #003366;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 15px;
}

.login-container button:hover {
    background-color: #6699CC;
}

#error-message {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
}

#results-count-message {
    margin-bottom: 15px;
    color: #6699CC;
}

#loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-bottom: 15px;
    color: #003366;
}

.force-hide {
    display: none !important;
}


/* Badge styles for roles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px;
    background-color: #6699CC;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Multi-select styles */
select[multiple] {
    min-height: 120px;
    padding: 8px;
}

select[multiple] option {
    padding: 6px;
    margin: 2px 0;
}

select[multiple] option:checked {
    background-color: #6699CC !important;
    color: white;
}

/* Full width form group for textareas */
.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    font-style: italic;
}