:root {
    --ad-navy: #11243c;
    --ad-blue: #2454a6;
    --ad-sky: #eef5ff;
    --ad-border: #dfe7f2;
    --ad-muted: #6c757d;
    --ad-radius: 1rem;
}

body {
    background: #f5f7fb;
    color: #1f2937;
}

.ad-navbar {
    background: var(--ad-navy);
}

.ad-navbar .navbar-brand,
.ad-navbar .nav-link,
.ad-navbar .navbar-toggler {
    color: #fff !important;
}

.ad-logo {
    max-height: 42px;
    width: auto;
}

.ad-sidebar {
    background: #fff;
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: 0 10px 24px rgba(17, 36, 60, .05);
}

.ad-sidebar .nav-link {
    color: #24364b;
    border-radius: .7rem;
    padding: .65rem .8rem;
    font-size: .94rem;
}

.ad-sidebar .nav-link:hover,
.ad-sidebar .nav-link.active {
    background: var(--ad-sky);
    color: var(--ad-blue);
}

.ad-card {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: 0 12px 28px rgba(17, 36, 60, .06);
}

.ad-card-header {
    background: #fff;
    border-bottom: 1px solid var(--ad-border);
    border-radius: var(--ad-radius) var(--ad-radius) 0 0 !important;
}

.ad-page-title {
    font-weight: 700;
    letter-spacing: -.02em;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.btn-sm {
    border-radius: .55rem;
    padding: .32rem .65rem;
}

.ad-action-buttons {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.ad-search-input {
    max-width: 360px;
}

.ad-badge {
    border-radius: 999px;
    padding: .35rem .6rem;
    font-size: .78rem;
}

@media (max-width: 991.98px) {
    .ad-sidebar {
        margin-bottom: 1rem;
    }

    .ad-search-input {
        max-width: 100%;
    }

    .ad-action-buttons {
        justify-content: flex-start;
    }
}

/* AccessDesk UI refinements */
.ad-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: nowrap;
}

.ad-toolbar .form-control,
.ad-toolbar .btn {
    height: 31px;
}

.ad-search-input {
    width: 300px;
    max-width: 300px;
    min-width: 220px;
}

.btn-sm {
    min-height: 30px;
    line-height: 1.5;
    padding: .28rem .85rem;
    font-size: .82rem;
    white-space: nowrap;
}

.ad-action-buttons {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: nowrap;
}

.ad-action-buttons form {
    display: inline-flex;
    margin: 0;
}

.table td,
.table th {
    white-space: nowrap;
}

.table td:first-child,
.table th:first-child {
    white-space: normal;
}

.pagination {
    margin-bottom: 0;
    gap: .2rem;
    flex-wrap: wrap;
}

.page-link {
    border-radius: .45rem;
    font-size: .82rem;
    padding: .25rem .55rem;
}

.ad-card .card-footer nav {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 767.98px) {
    .ad-toolbar {
        justify-content: stretch;
        flex-wrap: wrap;
        width: 100%;
    }

    .ad-search-input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    .ad-toolbar .btn {
        flex: 1 1 auto;
    }

    .table td,
    .table th {
        white-space: normal;
    }

    .ad-action-buttons {
        flex-wrap: wrap;
        justify-content: flex-start !important;
    }
}
