body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.app-body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at top left, rgba(219, 234, 254, 0.42), transparent 34rem),
        #f4f7fb;
    color: #172033;
}

.intranet-navbar {
    min-height: 4.5rem;
    background: linear-gradient(110deg, #10213f, #152d51 70%, #193861);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-right: 1.5rem;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.navbar-brand > span:last-child {
    overflow: hidden;
    max-width: 270px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-mark {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.15rem;
}

.intranet-nav-links {
    align-items: center;
    gap: 0.2rem;
}

.intranet-navbar .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.7rem !important;
    border-radius: 0.65rem;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.intranet-navbar .nav-link:hover,
.intranet-navbar .nav-link:focus-visible,
.intranet-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.intranet-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-account {
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.nav-account-name {
    color: rgba(255, 255, 255, 0.86);
    font-weight: 500;
    white-space: nowrap;
}

.app-main {
    min-height: calc(100vh - 4.5rem);
    max-width: 1540px;
    padding-top: 2rem !important;
    padding-bottom: 3rem !important;
}

.card {
    overflow: hidden;
    border: 1px solid rgba(29, 48, 80, 0.07);
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: 0 0.45rem 1.4rem rgba(29, 48, 80, 0.055);
}

.card-header {
    padding: 1.15rem 1.35rem;
}

.card-header h5,
.card-header h4 {
    color: #172033;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.card-body {
    padding: 1.35rem;
}

.alert {
    border: 0;
    border-radius: 0.85rem;
    box-shadow: 0 0.25rem 0.8rem rgba(29, 48, 80, 0.06);
}

.table tr th {
    white-space: nowrap;
}

.table {
    --bs-table-hover-bg: #f5f8fc;
    color: #344054;
}

.table > :not(caption) > * > * {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.table thead th {
    background: #f7f9fc;
    color: #667085;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.table tbody tr:last-child > * {
    border-bottom: 0;
}

.table-responsive {
    border-radius: 0 0 1rem 1rem;
}

.form-label {
    color: #344054;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-control,
.form-select {
    min-height: 2.8rem;
    border: 1px solid #d9e1ec;
    border-radius: 0.7rem;
    color: #172033;
}

.form-control:focus,
.form-select:focus {
    border-color: #7aa7f8;
    box-shadow: 0 0 0 0.22rem rgba(13, 110, 253, 0.12);
}

.input-group-text {
    border-color: #d9e1ec;
    background: #f8fafc;
    color: #667085;
}

.btn {
    border-radius: 0.7rem;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.btn-primary {
    border-color: #245cdb;
    background: linear-gradient(135deg, #2864e8, #1754c8);
    box-shadow: 0 0.2rem 0.55rem rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
    border-color: #1747b0;
    background: linear-gradient(135deg, #1d57d2, #1245ad);
    box-shadow: 0 0.3rem 0.8rem rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: #c6d7f8;
    color: #245cdb;
}

.btn-outline-primary:hover {
    border-color: #245cdb;
    background: #eff5ff;
    color: #1747b0;
}

.badge {
    font-weight: 600;
}

.sidebar-card {
    background: linear-gradient(145deg, #152d51, #214b7d);
    color: #fff;
}

.sidebar-card .card-title {
    font-weight: 700;
}

.sidebar-card .list-group-item {
    padding: 0.9rem 0;
    color: rgba(255, 255, 255, 0.76) !important;
}

.sidebar-card .list-group-item strong {
    color: #fff;
    font-size: 0.85rem;
}

.stat-card {
    min-height: 130px;
    border-radius: 1rem;
    box-shadow: 0 0.55rem 1.3rem rgba(29, 48, 80, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 0.8rem 1.8rem rgba(29, 48, 80, 0.17);
    transform: translateY(-3px);
}

.stat-card.bg-primary {
    background: linear-gradient(135deg, #2864e8, #1749b5) !important;
}

.stat-card.bg-success {
    background: linear-gradient(135deg, #16866a, #087252) !important;
}

.stat-card.bg-warning {
    background: linear-gradient(135deg, #ffc94a, #f3a90d) !important;
}

.stat-card.bg-secondary {
    background: linear-gradient(135deg, #65758b, #46576f) !important;
}

.stat-card .card-body {
    padding: 1.4rem;
}

.stat-icon {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.65rem;
}

.page-title {
    margin-bottom: 0.35rem;
    color: #172033;
    font-size: clamp(1.7rem, 3vw, 2.15rem);
    font-weight: 750;
    letter-spacing: -0.035em;
}

.dashboard-kicker {
    margin-bottom: 0.4rem;
    color: #2864e8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.dashboard-card-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 0.8rem;
    background: #eef4ff;
    color: #245cdb;
    font-size: 1.15rem;
}

#departmentChart {
    width: 100%;
    min-height: 260px;
}

.chart-fallback {
    display: grid;
    min-height: 260px;
    align-content: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.chart-fallback-row {
    display: grid;
    grid-template-columns: minmax(7rem, 1fr) minmax(4rem, 2fr) 2rem;
    align-items: center;
    gap: 0.8rem;
    color: #475467;
    font-size: 0.85rem;
}

.chart-fallback-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-fallback-track {
    display: block;
    height: 0.65rem;
    overflow: hidden;
    border-radius: 1rem;
    background: #edf2f8;
}

.chart-fallback-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4b83f3, #245cdb);
}

.chart-fallback-total {
    color: #172033;
    text-align: right;
}

.support-stat {
    border-radius: 0.9rem;
}

.support-stat-icon {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.85rem;
    background: #f2f5f9;
    font-size: 1.4rem;
}

.support-urgency-critical {
    background: #fde8e7;
    color: #a61b1b;
}

.support-urgency-high {
    background: #fff0dc;
    color: #995500;
}

.support-urgency-medium {
    background: #fff8d9;
    color: #765d00;
}

.support-urgency-low {
    background: #e7f5ed;
    color: #17643b;
}

.support-description {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.support-current-status {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    border-radius: 0.8rem;
    background: #f4f7fb;
}

.support-timeline-item {
    padding: 0 0 1.1rem 1rem;
    border-left: 2px solid #dce5f1;
}

.support-timeline-item:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.support-timeline-item::before {
    display: block;
    width: 0.65rem;
    height: 0.65rem;
    margin-left: -1.38rem;
    border-radius: 50%;
    background: #2864e8;
    content: "";
}

.support-timeline-item > div {
    margin-top: -0.75rem;
}

.support-own-requests {
    height: 100%;
}

.library-card {
    border-left: 0.25rem solid #d5e2fb;
}

.library-content {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    line-height: 1.7;
}

.sai-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
}

#sai-calendar {
    scroll-margin-top: 5.25rem;
}

.sai-file-preview-frame {
    width: 100%;
    height: 70vh;
    min-height: 30rem;
    max-height: 56rem;
    border: 1px solid #dfe5ec;
    border-radius: 0.75rem;
    background: #f8fafc;
}

.sai-file-preview-image-wrap {
    max-height: 70vh;
    overflow: auto;
    padding: 0.75rem;
    border: 1px solid #dfe5ec;
    border-radius: 0.75rem;
    background: #f8fafc;
    text-align: center;
}

.sai-file-preview-image {
    max-width: 100%;
    height: auto;
}

.sai-calendar-weekday {
    padding: 0.65rem 0.35rem;
    border-radius: 0.65rem;
    background: #f2f5f9;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
}

.sai-calendar-day {
    display: flex;
    min-width: 0;
    min-height: 6rem;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
    border: 1px solid #e3e9f1;
    border-radius: 0.75rem;
    background: #fff;
}

.sai-calendar-day.is-today {
    border-color: #2864e8;
    background: #f5f8ff;
    box-shadow: inset 0 0 0 1px rgba(40, 100, 232, 0.12);
}

.sai-calendar-date {
    color: #344054;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
}

.sai-calendar-day.is-today .sai-calendar-date {
    color: #245cdb;
}

.sai-calendar-event {
    display: block;
    min-width: 0;
    overflow: hidden;
    padding: 0.25rem 0.35rem;
    border-left: 3px solid #2864e8;
    border-radius: 0.35rem;
    background: #eaf1ff;
    color: #1747b0;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sai-calendar-event:hover,
.sai-calendar-event:focus-visible {
    background: #dce8ff;
    color: #123d9a;
}

.sai-calendar-event.is-review {
    border-left-color: #d18a00;
    background: #fff4d6;
    color: #795000;
}

.sai-calendar-event.is-review:hover,
.sai-calendar-event.is-review:focus-visible {
    background: #ffebba;
    color: #633f00;
}

.documents-table-card .dt-container {
    padding: 0.75rem 1rem;
}

.documents-table-card .dt-layout-row {
    align-items: center;
    row-gap: 0.65rem;
}

.documents-table-card .dt-layout-cell {
    min-width: 0;
}

.documents-table {
    min-width: 860px;
    table-layout: fixed;
}

.documents-table:not(.document-trash-table) th:nth-child(1) { width: 30%; }
.documents-table:not(.document-trash-table) th:nth-child(2) { width: 22%; }
.documents-table:not(.document-trash-table) th:nth-child(3) { width: 10%; }
.documents-table:not(.document-trash-table) th:nth-child(4) { width: 16%; }
.documents-table:not(.document-trash-table) th:nth-child(5) { width: 22%; }

.documents-table.document-trash-table th:nth-child(1) { width: 32%; }
.documents-table.document-trash-table th:nth-child(2) { width: 25%; }
.documents-table.document-trash-table th:nth-child(3) { width: 11%; }
.documents-table.document-trash-table th:nth-child(4) { width: 16%; }
.documents-table.document-trash-table th:nth-child(5) { width: 16%; }

.documents-table td {
    overflow-wrap: anywhere;
}

.document-type-icon {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    place-items: center;
    border-radius: 0.65rem;
    background: #edf3ff;
    color: #245cdb;
    font-size: 1.05rem;
}

.document-type-icon.is-muted {
    background: #f1f3f6;
    color: #667085;
}

.document-title {
    display: block;
    overflow: hidden;
    color: #172033;
    text-overflow: ellipsis;
}

.document-file-name {
    display: block;
    overflow: hidden;
    margin-top: 0.15rem;
    color: #667085;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-meta-line {
    display: block;
    line-height: 1.45;
}

.document-period {
    display: inline-flex;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #f2f5f9;
    color: #475467;
    font-size: 0.8rem;
    font-weight: 650;
    white-space: nowrap;
}

.document-date {
    color: #475467;
    font-size: 0.82rem;
    white-space: nowrap;
}

.document-actions {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
}

.document-actions .btn {
    white-space: nowrap;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.42);
    outline-offset: 2px;
}

.manual-hero {
    background: linear-gradient(120deg, #0d6efd, #0b5ed7 65%, #084298);
    color: #fff;
}

.manual-hero-icon {
    font-size: 5rem;
    opacity: 0.8;
}

.manual-accessibility-button {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1030;
    display: grid;
    width: 3.75rem;
    height: 3.75rem;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #0d6efd;
    box-shadow: 0 0.25rem 1rem rgba(15, 23, 42, 0.3);
    color: #fff;
    font-size: 2rem;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.manual-accessibility-button:hover,
.manual-accessibility-button:focus-visible {
    transform: translateY(-2px);
    background: #0b5ed7;
    color: #fff;
}

.manual-accessibility-label {
    position: absolute;
    right: calc(100% + 0.65rem);
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
    background: #212529;
    color: #fff;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.manual-accessibility-button:hover .manual-accessibility-label,
.manual-accessibility-button:focus-visible .manual-accessibility-label {
    opacity: 1;
}

.manual-accessibility-menu {
    position: fixed;
    right: 1.25rem;
    bottom: 5.75rem;
    z-index: 1029;
    display: flex;
    width: min(440px, calc(100vw - 2rem));
    max-height: calc(100vh - 7rem);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.22);
}

.manual-accessibility-menu[hidden] {
    display: none;
}

.manual-menu-header,
.manual-menu-tools,
.manual-full-link {
    padding: 1rem;
}

.manual-menu-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.manual-menu-tools {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.manual-menu-content {
    overflow-y: auto;
    padding: 0.5rem 1rem;
}

.manual-menu-content .manual-sections-list {
    display: grid;
    gap: 0.5rem;
}

.manual-menu-content .manual-topic summary {
    gap: 0.6rem !important;
    padding: 0.75rem;
}

.manual-menu-content .manual-topic-icon {
    width: 2rem;
    height: 2rem;
    flex-basis: 2rem;
    font-size: 1rem;
}

.manual-menu-content .manual-topic summary .badge {
    display: none;
}

.manual-menu-content .manual-topic-content {
    padding: 0.75rem;
    font-size: 0.9rem;
}

.manual-menu-content .manual-steps {
    padding-left: 1.25rem;
}

.manual-full-link {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    color: #0d6efd;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.manual-full-link:hover,
.manual-full-link:focus-visible {
    background: #f8f9fa;
    text-decoration: underline;
}

.manual-toolbar {
    position: sticky;
    top: 1rem;
    z-index: 2;
}

.manual-topic {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.manual-topic:hover {
    box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.12);
}

.manual-topic summary {
    cursor: pointer;
    list-style: none;
}

.manual-topic summary::-webkit-details-marker {
    display: none;
}

.manual-topic summary:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.45);
    outline-offset: -3px;
}

.manual-topic-icon {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    place-items: center;
    border-radius: 0.75rem;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 1.25rem;
}

.manual-chevron {
    transition: transform 0.2s ease;
}

.manual-topic[open] .manual-chevron {
    transform: rotate(180deg);
}

.manual-topic-content {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.manual-steps li {
    padding: 0.25rem 0 0.25rem 0.25rem;
}

@media (max-width: 768px) {
    .app-main {
        padding-top: 1.35rem !important;
    }

    .stat-card {
        min-height: auto;
    }

    .stat-card .card-body,
    .card-body {
        padding: 1.1rem;
    }

    .card-header {
        padding: 1rem 1.1rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.75rem;
    }

    .sai-calendar-grid {
        gap: 0.25rem;
    }

    .sai-calendar-weekday {
        padding: 0.5rem 0.15rem;
        font-size: 0.62rem;
        letter-spacing: 0;
    }

    .sai-calendar-day {
        min-height: 4.75rem;
        gap: 0.25rem;
        padding: 0.35rem 0.25rem;
        border-radius: 0.55rem;
    }

    .sai-calendar-date {
        font-size: 0.74rem;
    }

    .sai-calendar-event {
        padding: 0.2rem 0.22rem;
        font-size: 0.58rem;
    }

    .sai-file-preview-frame {
        height: 60vh;
        min-height: 24rem;
    }

    .documents-table-card .dt-container {
        padding: 0.65rem;
    }

    .documents-table-card .dt-layout-row {
        margin-right: 0;
        margin-left: 0;
    }

    .chart-fallback-row {
        grid-template-columns: minmax(6rem, 1fr) minmax(3rem, 1.5fr) 1.5rem;
        gap: 0.5rem;
        font-size: 0.78rem;
    }

    .manual-accessibility-menu {
        right: 0.75rem;
        bottom: 5.25rem;
        max-height: calc(100vh - 6.25rem);
    }

    .manual-accessibility-button {
        right: 0.75rem;
        bottom: 0.75rem;
    }
}

@media (max-width: 1199.98px) {
    .intranet-navbar .navbar-collapse {
        padding: 0.5rem 0 0.85rem;
    }

    .intranet-nav-links {
        align-items: stretch;
    }

    .intranet-navbar .nav-link {
        width: 100%;
    }

    .nav-account {
        justify-content: space-between;
        padding: 0.75rem 0 0;
        border-top: 1px solid rgba(255, 255, 255, 0.16);
        border-left: 0;
    }
}

@media (min-width: 1200px) and (max-width: 1599.98px) {
    .intranet-navbar.navbar-expand-xl .navbar-toggler {
        display: block;
    }

    .intranet-navbar.navbar-expand-xl .navbar-collapse:not(.show):not(.collapsing) {
        display: none !important;
    }

    .intranet-navbar.navbar-expand-xl .navbar-collapse {
        flex-basis: 100%;
    }

    .intranet-navbar.navbar-expand-xl .navbar-collapse.show {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
    }

    .intranet-navbar.navbar-expand-xl .navbar-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .intranet-navbar.navbar-expand-xl .nav-account {
        justify-content: space-between;
        padding: 0.75rem 0 0;
        border-top: 1px solid rgba(255, 255, 255, 0.16);
        border-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
