:root {
    --primary: #008c95;
    --primary-dark: #06656b;
    --primary-soft: #d9f3f3;
    --sidebar: #0b7b83;
    --bg: #f3f7f8;
    --surface: #ffffff;
    --surface-soft: #f8fbfc;
    --ink: #25313b;
    --muted: #687782;
    --line: #dfe8eb;
    --accent-coral: #e76f51;
    --accent-gold: #d99a19;
    --accent-indigo: #5568c9;
    --accent-green: #2a9d8f;
    --shadow: 0 14px 36px rgba(28, 55, 68, .10);
}

body {
    margin: 0;
    background:
        linear-gradient(135deg, rgba(0, 140, 149, .08), rgba(231, 111, 81, .05) 42%, rgba(85, 104, 201, .06)),
        var(--bg);
    color: var(--ink);
    font-size: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background:
        linear-gradient(180deg, #086a71 0%, #0b8b92 58%, #0f6970 100%);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 1040;
    box-shadow: 18px 0 38px rgba(8, 84, 91, .18);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: #fff;
    font-size: 21px;
    font-weight: 700;
    text-decoration: none;
    background: rgba(4, 63, 68, .45);
    border-bottom: 1px solid rgba(255, 255, 255, .16);
    letter-spacing: .2px;
}

.menu {
    padding: 12px;
}

.menu a {
    color: #fff;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 13px;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 3px;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, .92);
    transition: background .18s ease, transform .18s ease, border-color .18s ease;
}

.menu a:hover,
.menu a.active {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .20);
    transform: translateX(2px);
    color: #fff;
}

.menu a i {
    width: 18px;
    text-align: center;
}

.menu-label {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(0, 70, 76, .28);
    padding: 11px 12px;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: 8px;
    margin-top: 8px;
    font-family: inherit;
    text-align: left;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.menu-label:hover,
.menu-label:focus {
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
    outline: none;
    border-color: rgba(255, 255, 255, .28);
}

.menu-label.open {
    background: rgba(255, 255, 255, .18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, .32);
}

.menu-label .menu-plus::before {
    content: "+";
    font-size: 18px;
    line-height: 1;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .20);
    color: #ffffff;
}

.menu-label.open .menu-plus::before {
    content: "-";
    background: rgba(255, 255, 255, .30);
    color: #ffffff;
}

.submenu {
    display: none;
    margin-bottom: 6px;
}

.submenu.open {
    display: block;
}

.app-main {
    margin-left: 260px;
    width: calc(100% - 260px);
    transition: margin-left .18s ease, width .18s ease;
}

.sidebar {
    transition: width .18s ease, transform .2s ease;
}

body.sidebar-collapsed .sidebar {
    width: 82px;
}

body.sidebar-collapsed .app-main {
    margin-left: 82px;
    width: calc(100% - 82px);
}

body.sidebar-collapsed .brand span,
body.sidebar-collapsed .menu a span,
body.sidebar-collapsed .menu-label span:first-child,
body.sidebar-collapsed .menu-plus {
    display: none;
}

body.sidebar-collapsed .brand {
    justify-content: center;
    padding: 20px 10px;
}

body.sidebar-collapsed .menu a {
    justify-content: center;
    padding: 12px 8px;
    font-size: 0;
}

body.sidebar-collapsed .menu a i {
    width: auto;
    font-size: 15px;
}

body.sidebar-collapsed .submenu {
    display: block !important;
}

body.sidebar-collapsed .menu-label {
    justify-content: center;
    padding: 8px;
    min-height: 12px;
    opacity: .45;
}

.topbar {
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(14px);
    min-height: 68px;
    border-bottom: 1px solid rgba(223, 232, 235, .86);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title {
    font-size: 21px;
    font-weight: 700;
    color: #1c2f37;
}

.topbar-clock {
    color: var(--muted);
    font-size: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-pill {
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 999px;
    padding: 7px 11px;
    font-weight: 700;
    border: 1px solid rgba(0, 140, 149, .16);
}

.content-wrap {
    padding: 26px;
    position: relative;
}

.content-wrap::before {
    content: "";
    position: fixed;
    inset: 68px 0 auto 260px;
    height: 180px;
    background: linear-gradient(90deg, rgba(0, 140, 149, .12), rgba(85, 104, 201, .08), rgba(231, 111, 81, .08));
    pointer-events: none;
    z-index: -1;
}

body.sidebar-collapsed .content-wrap::before {
    left: 82px;
}

.panel {
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(223, 232, 235, .95);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.panel h2,
.panel h3,
.panel .h5,
.panel .h6 {
    color: #18343b;
    font-weight: 800;
}

.stat-card {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 251, 252, .92));
    border: 1px solid rgba(223, 232, 235, .95);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 96px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stat-card-link {
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.stat-card-link:hover {
    color: inherit;
    transform: translateY(-3px);
    border-color: rgba(0, 140, 149, .32);
    box-shadow: 0 18px 42px rgba(28, 55, 68, .15);
}

.stat-card-link:hover .label {
    color: var(--primary);
}

.stat-card-link::after {
    content: "\f061";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 18px;
    bottom: 12px;
    color: rgba(0, 140, 149, .32);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .18s ease, transform .18s ease;
}

.stat-card-link:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--primary);
}

.row > div:nth-child(4n + 2) .stat-card::before {
    background: var(--accent-coral);
}

.row > div:nth-child(4n + 3) .stat-card::before {
    background: var(--accent-indigo);
}

.row > div:nth-child(4n + 4) .stat-card::before {
    background: var(--accent-gold);
}

.stat-card i {
    color: #fff;
    background: var(--primary);
    font-size: 20px;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 22px rgba(0, 140, 149, .24);
}

.row > div:nth-child(4n + 2) .stat-card i {
    background: var(--accent-coral);
    box-shadow: 0 10px 22px rgba(231, 111, 81, .22);
}

.row > div:nth-child(4n + 3) .stat-card i {
    background: var(--accent-indigo);
    box-shadow: 0 10px 22px rgba(85, 104, 201, .22);
}

.row > div:nth-child(4n + 4) .stat-card i {
    background: var(--accent-gold);
    box-shadow: 0 10px 22px rgba(217, 154, 25, .22);
}

.stat-card .number {
    font-size: 28px;
    font-weight: 800;
    color: #17282f;
}

.stat-card .label {
    color: var(--muted);
    font-weight: 600;
}

.btn-primary,
.bg-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-primary {
    box-shadow: 0 8px 18px rgba(0, 140, 149, .18);
}

.btn-primary:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-secondary,
.btn-dark {
    background-color: #2f3d46 !important;
    border-color: #2f3d46 !important;
}

.form-control,
.form-select {
    border-color: #d8e3e7;
    border-radius: 8px;
    min-height: 40px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(0, 140, 149, .15);
}

.form-label {
    color: #334650;
    font-weight: 650;
}

.required::after {
    content: " *";
    color: #dc3545;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.table {
    --bs-table-striped-bg: #f7fbfb;
    border-color: var(--line);
}

.table thead th {
    background: linear-gradient(180deg, #eefafa, #e8f2f5);
    color: #254149;
    border-bottom: 1px solid #d5e6ea;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.table tbody tr {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    --bs-table-bg: #eefafa;
}

.badge {
    font-weight: 700;
    letter-spacing: .2px;
}

.dataTables_wrapper .dt-buttons .btn {
    border-radius: 8px;
    background: #008c95 !important;
    border-color: #008c95 !important;
    color: #ffffff !important;
    font-weight: 700;
    margin-right: 4px;
    box-shadow: 0 8px 18px rgba(0, 140, 149, .18);
}

.dataTables_wrapper .dt-buttons .btn:hover {
    background: #06656b !important;
    border-color: #06656b !important;
    color: #ffffff !important;
}

.dataTables_wrapper .dt-buttons .btn:focus,
.dataTables_wrapper .dt-buttons .btn:active {
    background: #064f55 !important;
    border-color: #064f55 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 .2rem rgba(0, 140, 149, .20);
}

.dataTables_filter input,
.dataTables_length select {
    border-radius: 8px;
    border-color: #d8e3e7;
}

.alert {
    border-radius: 8px;
    border-width: 1px;
    box-shadow: 0 8px 20px rgba(28, 55, 68, .08);
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.permission-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #d8e3e7;
    border-radius: 8px;
    background: #f8fbfc;
    font-weight: 650;
}

.bulk-assign-bar {
    background: #f8fbfc;
    border: 1px solid #d8e3e7;
    border-radius: 8px;
    padding: 14px;
}

.tender-cursor-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.cursor-spacer {
    flex: 1;
}

@media (max-width: 767px) {
    .tender-cursor-bar {
        flex-wrap: wrap;
    }

    .cursor-spacer {
        display: none;
    }
}

.topbar .btn-dark {
    border-radius: 8px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
}

.brand i {
    background: rgba(255, 255, 255, .18);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}

body > .panel {
    border-top: 5px solid var(--primary);
}

body.d-flex {
    background:
        linear-gradient(145deg, rgba(0, 140, 149, .18), rgba(85, 104, 201, .10) 48%, rgba(231, 111, 81, .12)),
        #f3f7f8;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
        width: 100%;
    }

    .content-wrap::before {
        left: 0;
    }
}

/* Sidebar accordion readability override */
.sidebar .menu .menu-label,
.sidebar .menu button.menu-label,
.sidebar .menu div.menu-label,
.sidebar .menu .menu-label:visited {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 100% !important;
    background: #064f55 !important;
    background-color: #064f55 !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, .28) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12) !important;
    text-shadow: none !important;
}

.sidebar .menu .menu-label:hover,
.sidebar .menu .menu-label:focus,
.sidebar .menu .menu-label:active,
.sidebar .menu .menu-label.open {
    background: #0a767d !important;
    background-color: #0a767d !important;
    color: #ffffff !important;
    outline: none !important;
}

.sidebar .menu .menu-label span,
.sidebar .menu .menu-label .menu-plus,
.sidebar .menu .menu-label .menu-plus::before {
    color: #ffffff !important;
    opacity: 1 !important;
}
