/* =====================
   BASE
   ===================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
}

.nowrap {
    white-space: nowrap;
}

.dl-horizontal dt {
    white-space: normal;
}

/* =====================
   NAVBAR
   ===================== */
.navbar {
    background-color: #436791;
    border-bottom: 3px double #2c4059;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    min-height: 50px;
    z-index: 1000;
}

.navbar-brand {
    color: whitesmoke !important;
    font-size: 18px;
    font-weight: 500;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.75) !important;
    font-size: 13px;
}

    .navbar-nav .nav-link:hover {
        color: #fff !important;
    }

.navbar-toggler {
    border-color: rgba(255,255,255,0.3);
}

.navbar-toggler-icon {
    filter: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.dropdown-menu-end .dropdown-item {
    font-size: 13px;
}

/* =====================
   SIDEBAR
   ===================== */
#sidebar {
    position: fixed;
    top: 50px;
    left: 0;
    bottom: 28px;
    width: 200px;
    background-color: #2e434d;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s ease;
    z-index: 900;
    box-shadow: 10px 3px 10px rgba(0,0,0,0.2);
}

    #sidebar.collapsed {
        width: 40px;
    }

#sidebar-toggle {
    display: block;
    width: 100%;
    padding: 10px 0;
    text-align: center;
    color: whitesmoke;
    font-size: 18px;
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

    #sidebar-toggle:hover {
        background-color: rgba(255,255,255,0.08);
    }

.sidebar-section {
    padding: 12px 14px 4px 14px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link {
    display: block;
    padding: 8px 14px 8px 24px;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

    .sidebar-link:hover,
    .sidebar-link.active {
        color: #fff;
        background-color: rgba(255,255,255,0.08);
        text-decoration: none;
    }

#sidebar.collapsed .sidebar-section,
#sidebar.collapsed .sidebar-link span {
    display: none;
}

#sidebar.collapsed .sidebar-link {
    padding: 8px 0;
    text-align: center;
}

/* =====================
   MAIN CONTENT
   ===================== */
#main-content {
    position: fixed;
    top: 50px;
    left: 200px;
    right: 0;
    bottom: 28px;
    overflow-y: auto;
    overflow-x: auto;
    transition: left 0.2s ease;
    padding: 20px 24px;
    background-color: #f4f4f4;
}

    #main-content.sidebar-collapsed {
        left: 40px;
    }

    #main-content.no-sidebar {
        left: 0;
    }

/* =====================
   FOOTER
   ===================== */
#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    line-height: 28px;
    background-color: #436791;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    text-align: center;
    z-index: 1000;
}

/* =====================
   BUTTONS
   ===================== */
.button {
    border: 1px solid #245580;
    border-radius: 4px;
    color: white;
    background-color: #245580;
    text-decoration: none;
    cursor: pointer;
    padding: 5px 12px;
}

    .button:hover {
        color: #245580;
        background-color: white;
    }

    .button:active {
        background-color: gray;
    }

.closeButton {
    border: 1px solid red;
    border-radius: 4px;
    color: white;
    background-color: red;
    text-decoration: none;
    cursor: pointer;
    padding: 5px 12px;
}

    .closeButton:hover {
        color: red;
        background-color: white;
    }

    .closeButton:active {
        background-color: gray;
    }

.btn-submit {
    height: 30px;
    padding: 0 16px;
    font-size: 13px;
    border: 1px solid #245580;
    border-radius: 3px;
    background-color: #245580;
    color: #fff;
    cursor: pointer;
}

    .btn-submit:hover {
        background-color: #436791;
        border-color: #436791;
    }


    .grid-controls .btn-submit {
        background-color: #245580;
        color: #fff;
        border-color: #245580;
    }

    .grid-controls .btn-submit:hover {
        background-color: #436791;
        border-color: #436791;
    }

/* =====================
   ALERTS
   ===================== */
.alert-error {
    padding: 10px;
    background-color: #ff594d;
    color: whitesmoke;
    width: 50%;
    margin-left: 25%;
    z-index: 101;
    border-radius: 4px;
}

.closebtn {
    margin-left: 15px;
    margin-top: -2px;
    color: whitesmoke;
    font-weight: bold;
    float: right;
    font-size: 22px;
    line-height: 20px;
    cursor: pointer;
    transition: 0.5s;
}

.error-box {
    font-size: 12px;
    color: maroon;
    margin-left: 6%;
    font-weight: 600;
}

.success-box {
    font-size: 12px;
    color: forestgreen;
    margin-left: 6%;
    font-weight: 600;
}

/* =====================
   PAGE STRUCTURE
   ===================== */
.page-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.page-header {
    flex-shrink: 0;
    margin-bottom: 8px;
}

    .page-header h3 {
        margin: 0 0 2px 0;
        font-size: 18px;
        font-weight: 500;
    }

    .page-header p {
        margin: 0;
        font-size: 13px;
        color: #666;
    }

/* =====================
   TABLES
   ===================== */
table {
    border-collapse: collapse;
    background-color: white;
    width: 100%;
}

th {
    font-weight: 500;
    text-align: left;
    vertical-align: top;
    z-index: 10;
    background: white;
}

td, tr {
    vertical-align: top;
}

.table-container {
    top: 0;
    border: solid 1px;
}

/* =====================
   DYNAMIC GRID
   ===================== */
.dynamic-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background-color: #fff;
    min-width: max-content;
}

    .dynamic-grid thead .header-row {
        background-color: #436791;
        color: rgba(255,255,255,0.85);
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .dynamic-grid thead .filter-row {
        background-color: #f4f4f4;
        position: sticky;
        top: 36px;
        z-index: 1;
    }

    .dynamic-grid thead .filter-row th {
        padding: 6px 8px;
        background-color: #f4f4f4;
    }

    .dynamic-grid th {
        padding: 9px 12px;
        text-align: left;
        font-size: 12px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        white-space: nowrap;
        color: white;
        background-color: #436791;
    }

    .dynamic-grid th:hover {
        background-color: #2c4059;
        cursor: pointer;
    }

    .dynamic-grid td {
        padding: 8px 12px;
        border-bottom: 1px solid #eee;
        color: #333;
        white-space: nowrap;
        text-align: left;
    }

    .dynamic-grid tbody tr:hover {
        background-color: #f7f9fc;
    }

/* =====================
   GRID WRAPPER & SCROLLBAR
   ===================== */
#gridContainerWrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
}

    #gridContainerWrapper::-webkit-scrollbar {
        height: 8px;
        width: 8px;
    }

    #gridContainerWrapper::-webkit-scrollbar-track {
        background: #e0e0e0;
        border-radius: 4px;
    }

    #gridContainerWrapper::-webkit-scrollbar-thumb {
        background: #436791;
        border-radius: 4px;
    }

        #gridContainerWrapper::-webkit-scrollbar-thumb:hover {
            background: #2c4059;
        }

    #gridContainerWrapper::-webkit-scrollbar-corner {
        background: transparent;
    }

/* =====================
   GRID CONTROLS
   ===================== */
.grid-controls {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

    .grid-controls input[type="text"] {
        height: 30px;
        padding: 0 24px 0 8px;
        font-size: 13px;
        border: 1px solid #ccc;
        border-radius: 3px;
        max-width: 200px;
    }

    .grid-controls button,
    .grid-controls select {
        height: 30px;
        padding: 0 12px;
        font-size: 13px;
        border: 1px solid #ccc;
        border-radius: 3px;
        background-color: #fff;
        cursor: pointer;
    }

        .grid-controls button:hover {
            background-color: #f0f0f0;
        }

/* =====================
   GRID PAGINATION
   ===================== */
.grid-pagination {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
}

    .grid-pagination button {
        height: 30px;
        padding: 0 12px;
        font-size: 13px;
        border: 1px solid #ccc;
        border-radius: 3px;
        background-color: #fff;
        cursor: pointer;
    }

        .grid-pagination button:hover {
            background-color: #f0f0f0;
        }

    .grid-pagination select {
        height: 30px;
        font-size: 13px;
        border: 1px solid #ccc;
        border-radius: 3px;
        max-width: 80px;
    }

/* =====================
   CLEARABLE SEARCH
   ===================== */
.clearable {
    position: relative;
    display: inline-block;
}

    .clearable input {
        padding-right: 24px;
    }

.clearable__clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 16px;
    line-height: 1;
}

    .clearable__clear:hover {
        color: #333;
    }

/* =====================
   AP APPROVALS
   ===================== */
.ap-totals {
    display: flex;
    gap: 32px;
    padding: 10px 4px;
    font-size: 13px;
    color: #555;
    flex-shrink: 0;
    border-top: 2px solid #436791;
    margin-top: 8px;
}

    .ap-totals strong {
        color: #333;
    }

/* =====================
   LOGIN
   ===================== */
.login-box {
    width: 320px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0px 5px 25px rgba(0,0,0,0.2);
    border-radius: 5px;
    background-color: #fff;
    padding-bottom: 20px;
}

    .login-box h1 {
        font-size: 28px;
        font-weight: bold;
        margin-bottom: 20px;
        padding: 7px;
        width: 100%;
    }

.textbox {
    width: 100%;
    overflow: hidden;
    font-size: 18px;
    padding: 8px 0;
    margin: 2px 0;
}

.login-box input[type="email"],
.login-box input[type="password"],
.login-box input[type="text"] {
    max-width: 100%;
}

.login-box .btn-primary {
    background-color: #245580;
    border-color: #245580;
    width: 90%;
    margin-left: 5%;
    margin-top: 8px;
}

    .login-box .btn-primary:hover {
        background-color: #436791;
        border-color: #436791;
    }

/* =====================
   PROFILE SELECTOR
   ===================== */
.profile-btn {
    display: flex;
    flex-direction: column;
    width: 90%;
    margin-left: 5%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .profile-btn:hover {
        background-color: #e0e8f0;
    }

.profile-name {
    font-size: 14px;
    font-weight: 500;
}

.profile-company {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* =====================
   DASHBOARD
   ===================== */
.dashboard-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.dash-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px 18px;
    min-width: 160px;
    flex: 1;
}

.dash-card-title {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.dash-card-value {
    font-size: 28px;
    font-weight: 500;
    color: #333;
}

    .dash-card-value.pending {
        color: #854F0B;
    }

    .dash-card-value.approved {
        color: #3B6D11;
    }

    .dash-card-value.rejected {
        color: #A32D2D;
    }

.dash-card-sub {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.dashboard-section-header {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    flex-shrink: 0;
}

/* =====================
   POPUP / MODAL
   ===================== */
.docNum_popup {
    display: none;
    position: fixed;
    z-index: 1025;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.docNum_content {
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    padding: 16px;
    border: 1px solid black;
    background-color: white;
    z-index: 900;
    overflow: auto;
}


/* PROFILE / WORK INDICATOR DOT */
.profile-badge-dot,
.work-indicator-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cc0000;
    vertical-align: middle;
}

.profile-badge-dot {
    margin-left: 8px;
}

.work-indicator-dot {
    margin-left: 6px;
}