:root {
    --simba-primary: #1769aa;
    --simba-secondary: #00b8d9;
    --simba-bg: #f4f7fb;
    --simba-sidebar-width: 260px;
}

body {
    background: var(--simba-bg);
    color: #1f2937;
}

body.is-loading {
    cursor: progress;
}

.btn-with-icon {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
    justify-content: center;
}

.btn-with-icon > .bi {
    flex: 0 0 auto;
    font-size: 0.9em;
    line-height: 1;
}

.global-loading {
    align-items: center;
    background: rgba(15, 23, 42, 0.46);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.16s ease;
    visibility: hidden;
    z-index: 2000;
}

.global-loading.is-active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.global-loading-panel {
    align-items: center;
    background: #fff;
    border-radius: 0.85rem;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
    display: flex;
    gap: 0.8rem;
    min-width: 190px;
    padding: 1rem 1.2rem;
}

.global-loading-spinner {
    animation: simba-spin 0.75s linear infinite;
    border: 3px solid #dbeafe;
    border-radius: 50%;
    border-top-color: var(--simba-primary);
    flex: 0 0 auto;
    height: 28px;
    width: 28px;
}

.global-loading-text {
    color: #1e293b;
    font-size: 0.92rem;
    font-weight: 600;
}

@keyframes simba-spin {
    to { transform: rotate(360deg); }
}

.simba-navbar {
    background: linear-gradient(120deg, var(--simba-primary), var(--simba-secondary));
    min-height: 64px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.simba-page {
    display: flex;
    flex-direction: column;
    margin-left: var(--simba-sidebar-width);
    min-height: 100vh;
}

.simba-content {
    flex: 1 0 auto;
    max-width: 1440px;
    width: 100%;
}

.simba-page > footer {
    flex: 0 0 auto;
}

.simba-sidebar {
    background: #fff;
    border-right: 1px solid #e7ebf0;
    bottom: 0;
    box-shadow: 0 0 24px rgba(15, 23, 42, 0.05);
    left: 0;
    position: fixed;
    top: 0;
    width: var(--simba-sidebar-width);
    z-index: 1040;
}

.sidebar-brand {
    border-bottom: 1px solid #edf0f4;
    min-height: 96px;
    padding: 18px 20px;
}

.sidebar-brand a {
    align-items: center;
    color: #172033;
    display: flex;
    gap: 12px;
    text-decoration: none;
}

.sidebar-brand img {
    object-fit: contain;
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand strong {
    font-size: 1.25rem;
}

.sidebar-brand small {
    color: #7b8191;
    font-size: 0.7rem;
    line-height: 1.35;
}

.sidebar-navigation {
    padding: 24px 14px;
}

.sidebar-heading {
    color: #8a92a3;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 12px 10px;
    text-transform: uppercase;
}

.sidebar-link {
    align-items: center;
    border-radius: 0.55rem;
    color: #4b5565;
    display: flex;
    gap: 12px;
    margin-bottom: 5px;
    padding: 12px 14px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 20px;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #eef4ff;
    color: #6259ca;
}

.sidebar-link.active {
    font-weight: 600;
}

.sidebar-toggle-control {
    height: 1px;
    opacity: 0;
    position: fixed;
    width: 1px;
}

.sidebar-toggle-button {
    cursor: pointer;
    display: none;
    height: 26px;
    padding: 3px;
    width: 30px;
}

.sidebar-toggle-button span {
    background: #fff;
    border-radius: 2px;
    display: block;
    height: 2px;
    margin: 4px 0;
}

.navbar-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.simba-navbar-actions {
    align-items: center;
    display: flex;
    gap: 0.55rem;
    margin-left: auto;
    white-space: nowrap;
}

.simba-user-menu {
    position: relative;
}

.simba-user-menu > summary {
    list-style: none;
}

.simba-user-menu > summary::-webkit-details-marker {
    display: none;
}

.simba-user-menu-toggle {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 0.45rem;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    gap: 0.5rem;
    min-height: 34px;
    padding: 0.25rem 0.65rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.simba-user-menu-toggle:hover,
.simba-user-menu-toggle:focus-visible,
.simba-user-menu[open] .simba-user-menu-toggle {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    outline: none;
}

.simba-user-menu-avatar {
    font-size: 1.1rem;
    line-height: 1;
}

.simba-user-menu-trigger-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.simba-user-menu-chevron {
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}

.simba-user-menu[open] .simba-user-menu-chevron {
    transform: rotate(180deg);
}

.simba-user-menu-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
    color: #1f2937;
    min-width: 270px;
    padding: 0.75rem 0;
    position: absolute;
    right: 0;
    top: calc(100% + 0.65rem);
    z-index: 1060;
}

.simba-user-menu-panel::before {
    background: #fff;
    border-left: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
    content: "";
    height: 12px;
    position: absolute;
    right: 22px;
    top: -7px;
    transform: rotate(45deg);
    width: 12px;
}

.simba-user-menu-profile {
    align-items: center;
    display: flex;
    gap: 0.8rem;
    padding: 0.4rem 1rem 0.8rem;
}

.simba-user-menu-profile-icon {
    align-items: center;
    background: #eef4ff;
    border-radius: 50%;
    color: var(--simba-primary);
    display: flex;
    flex: 0 0 42px;
    font-size: 1.15rem;
    height: 42px;
    justify-content: center;
}

.simba-user-menu-profile-text {
    min-width: 0;
}

.simba-user-menu-name {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.simba-user-menu-role {
    color: #7b8191;
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.simba-user-menu-divider {
    border-top: 1px solid #edf0f4;
    margin: 0.2rem 0;
}

.simba-user-menu-item {
    align-items: center;
    background: transparent;
    border: 0;
    color: #334155;
    display: flex;
    gap: 0.7rem;
    padding: 0.65rem 1rem;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.simba-user-menu-item:hover,
.simba-user-menu-item:focus-visible {
    background: #f5f7fb;
    color: var(--simba-primary);
    outline: none;
}

.simba-user-menu-item .bi {
    flex: 0 0 18px;
    font-size: 1rem;
    text-align: center;
}

.simba-user-menu-logout {
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
}

.navbar-brand img {
    object-fit: contain;
}

.login-page {
    align-items: center;
    animation: loginBackgroundShift 12s ease-in-out infinite;
    background: linear-gradient(
        -45deg,
        #cfeeff 0%,
        #dfe4ff 30%,
        #d3f6ee 62%,
        #e7f7ff 82%,
        #f4fbff 100%
    );
    background-size: 400% 400%;
    display: flex;
    min-height: 100vh;
    padding: 1.5rem;
}

@keyframes loginBackgroundShift {
    0% {
        background-position: 0% 50%;
    }

    25% {
        background-position: 45% 35%;
    }

    50% {
        background-position: 100% 50%;
    }

    75% {
        background-position: 55% 70%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.login-shell {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 1.25rem;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.14);
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.86fr);
    margin: auto;
    max-width: 980px;
    min-height: 500px;
    overflow: hidden;
    width: 100%;
}

.login-brand-panel {
    background: #fff;
    border-right: 1px solid #e6edf5;
    display: flex;
    padding: 2.35rem 2.4rem;
}

.login-brand-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.login-brand-logo {
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    width: min(100%, 430px);
}

.login-brand-copy {
    margin-top: 1.8rem;
    max-width: 500px;
}

.login-brand-kicker {
    color: var(--simba-primary);
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    margin-bottom: 0.65rem;
    text-transform: uppercase;
}

.login-brand-copy h1 {
    color: #172033;
    font-size: clamp(1.7rem, 2.2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin-bottom: 0.85rem;
}

.login-brand-copy p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 0;
}

.login-brand-footer {
    align-items: center;
    color: #64748b;
    display: flex;
    font-size: 0.82rem;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 2rem;
}

.login-form-panel {
    align-items: center;
    background: linear-gradient(180deg, #fcfdff 0%, #f8fbff 100%);
    display: flex;
    justify-content: center;
    padding: 2.35rem;
}

.login-form-card {
    max-width: 360px;
    width: 100%;
}

.login-form-heading {
    margin-bottom: 1.7rem;
}

.login-greeting {
    color: var(--simba-primary);
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.login-form-heading h2 {
    color: #172033;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.45rem;
}

.login-form-heading p {
    color: #64748b;
    font-size: 0.94rem;
    margin-bottom: 0;
}

.login-heading-mobile {
    display: none;
}

.login-form-card .form-label {
    color: #334155;
    font-size: 0.88rem;
    font-weight: 600;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap > .bi {
    color: #94a3b8;
    font-size: 1rem;
    left: 0.95rem;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.login-input-wrap .form-control {
    border-color: #cbd5e1;
    min-height: 44px;
    padding-left: 2.65rem;
}

.login-input-wrap .form-control:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.22rem rgba(59, 130, 246, 0.14);
}

.login-submit {
    min-height: 44px;
}

.login-form-note {
    align-items: flex-start;
    color: #64748b;
    display: flex;
    font-size: 0.76rem;
    gap: 0.5rem;
    line-height: 1.45;
    margin-top: 1rem;
}

.login-form-note .bi {
    color: #16a34a;
    flex: 0 0 auto;
    margin-top: 0.05rem;
}

@media (max-width: 991.98px) {
    .login-page {
        padding: 1rem;
    }

    .login-shell {
        grid-template-columns: 1fr;
        max-width: 620px;
        min-height: 0;
    }

    .login-brand-panel {
        border-bottom: 1px solid #e6edf5;
        border-right: 0;
        padding: 1.75rem;
    }

    .login-brand-logo {
        margin-left: auto;
        margin-right: auto;
        width: min(100%, 460px);
    }

    .login-brand-copy {
        margin-top: 1.35rem;
        max-width: none;
        text-align: center;
    }

    .login-brand-copy h1 {
        font-size: clamp(1.7rem, 6vw, 2.15rem);
    }

    .login-brand-copy p {
        font-size: 0.92rem;
    }

    .login-brand-footer {
        justify-content: center;
        margin-top: 1.25rem;
        padding-top: 0;
    }

    .login-form-panel {
        padding: 1.75rem;
    }
}

@media (max-width: 575.98px) {
    .login-page {
        align-items: center;
        padding: 1rem;
    }

    .login-shell {
        border: 1px solid rgba(148, 163, 184, 0.22);
        border-radius: 1rem;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.11);
        grid-template-columns: 1fr;
        max-width: 390px;
        min-height: 0;
        overflow: hidden;
    }

    .login-brand-panel {
        background: #fff;
        border-bottom: 0;
        border-right: 0;
        padding: 1.25rem 1.25rem 0.4rem;
    }

    .login-brand-content {
        justify-content: flex-start;
    }

    .login-brand-logo {
        margin: 0 auto;
        width: 100%;
    }

    .login-brand-copy,
    .login-brand-footer {
        display: none;
    }

    .login-form-panel {
        align-items: flex-start;
        background: #fff;
        padding: 0.95rem 1.25rem 1.4rem;
    }

    .login-form-card {
        max-width: none;
    }

    .login-form-heading {
        margin-bottom: 1.3rem;
        text-align: center;
    }

    .login-heading-desktop {
        display: none;
    }

    .login-heading-mobile {
        display: block;
    }

    .login-greeting {
        font-size: 0.82rem;
        margin-bottom: 0.35rem;
        text-align: center;
    }

    .login-heading-mobile h2 {
        font-size: 1.55rem;
        margin-bottom: 0.18rem;
        text-align: center;
    }

    .login-heading-mobile p {
        font-size: 0.86rem;
        line-height: 1.4;
        text-align: center;
    }

    .login-form-card .form-label {
        font-size: 0.84rem;
    }

    .login-input-wrap .form-control,
    .login-submit {
        min-height: 44px;
    }

    .login-form-note {
        font-size: 0.73rem;
        margin-top: 0.9rem;
    }
}

.card {
    border-radius: 0.85rem;
}

.table thead th {
    background: #eef6fb;
    color: #334155;
    white-space: nowrap;
}

.detail-list dt,
.detail-list dd {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid #edf2f7;
}

.detail-card-title {
    background: var(--simba-secondary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.7rem 1rem;
    text-align: center;
}

.detail-card-title-action {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    text-align: left;
}

.detail-card-title-action .btn {
    flex: 0 0 auto;
    font-weight: 600;
}

.detail-panels .card {
    min-height: 325px;
    overflow: hidden;
}

.signature-preview {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.65rem;
    color: #64748b;
    display: flex;
    justify-content: center;
    min-height: 105px;
    padding: 0.75rem;
    text-align: center;
}

.signature-preview img {
    max-height: 85px;
    max-width: 100%;
}

.employee-results {
    left: 0;
    max-height: 280px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% - 20px);
    z-index: 20;
}

.signature-dialog {
    border: 0;
    border-radius: 0.85rem;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.28);
    max-width: 680px;
    padding: 1.5rem;
    width: calc(100% - 2rem);
}

.signature-dialog form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.signature-dialog-header {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.signature-dialog-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.ts-wrapper.form-select {
    border: 0;
    height: auto;
    padding: 0;
}

.ts-wrapper .ts-control {
    min-height: 38px;
}

.ts-wrapper.focus .ts-control {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.signature-label-short {
    display: none;
}

.signature-workspace {
    flex: 1 1 auto;
    min-height: 0;
}

.signature-dialog::backdrop {
    background: rgba(15, 23, 42, 0.58);
}

.signature-canvas {
    aspect-ratio: 5 / 2;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 0.5rem;
    display: block;
    max-width: 100%;
    touch-action: none;
    width: 100%;
}

.signature-dialog.is-fullscreen {
    box-sizing: border-box;
    height: calc(100dvh - 1rem);
    inset: 0;
    margin: auto;
    max-height: none;
    max-width: none;
    overflow: hidden;
    padding: 1rem;
    position: fixed;
    width: calc(100vw - 1rem);
}

html.signature-fullscreen-open,
html.signature-fullscreen-open body {
    overscroll-behavior: none;
    overflow: hidden;
}

.signature-dialog.is-fullscreen form {
    height: 100%;
}

.signature-dialog.is-fullscreen .signature-help {
    margin-bottom: 0.5rem;
}

.signature-dialog.is-fullscreen .signature-workspace {
    min-height: 180px;
    overflow: hidden;
}

.signature-dialog.is-fullscreen .signature-canvas {
    aspect-ratio: auto;
    height: 100%;
}

.signature-dialog.is-fullscreen .signature-dialog-header {
    margin-bottom: 0.5rem;
}

@media (max-width: 575.98px) {
    .simba-navbar-actions {
        gap: 0.4rem;
    }

    .simba-user-menu-toggle {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .simba-user-menu-panel {
        min-width: min(270px, calc(100vw - 1.5rem));
        right: 0;
    }

    .signature-dialog {
        padding: 1rem;
    }

    .signature-dialog-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .signature-dialog-toolbar {
        justify-content: flex-start;
        width: 100%;
    }

    .signature-label-wide {
        display: none;
    }

    .signature-label-short {
        display: inline;
    }

    .signature-dialog.is-fullscreen {
        border-radius: 0;
        height: 100dvh;
        margin: 0;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
        padding-top: max(0.5rem, env(safe-area-inset-top));
        width: 100vw;
    }

    .signature-dialog.is-fullscreen .signature-dialog-header {
        gap: 0.4rem;
    }

    .signature-dialog.is-fullscreen .signature-dialog-header h2 {
        font-size: 1rem;
    }

    .signature-dialog.is-fullscreen .signature-dialog-toolbar {
        display: grid;
        gap: 0.35rem;
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    }

    .signature-dialog.is-fullscreen .signature-dialog-toolbar .btn {
        min-height: 40px;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .signature-dialog.is-fullscreen .signature-dialog-toolbar .btn-close {
        align-self: center;
        margin-left: 0.2rem !important;
    }

    .signature-dialog.is-fullscreen .signature-help {
        display: none;
    }

    .signature-dialog.is-fullscreen .signature-workspace {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-page {
        animation: none;
    }

    .global-loading,
    .global-loading-spinner {
        animation-duration: 0.01ms;
        transition-duration: 0.01ms;
    }
}

@media (max-width: 767.98px) {
    .table:not(.people-table) {
        min-width: 860px;
    }

    .detail-panels .card {
        min-height: 0;
    }
}

@media (max-width: 991.98px) {
    .simba-page {
        margin-left: 0;
    }

    .simba-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .sidebar-toggle-button {
        display: block;
    }

    .sidebar-toggle-control:checked ~ .simba-sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle-control:checked ~ .sidebar-overlay {
        background: rgba(15, 23, 42, 0.45);
        bottom: 0;
        display: block;
        left: 0;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 1030;
    }
}

/* Authenticated application dark mode. Login intentionally remains light. */
html.theme-dark body.simba-app {
    --simba-bg: #0f172a;
    --bs-body-bg: #0f172a;
    --bs-body-color: #e5e7eb;
    --bs-border-color: #334155;
    --bs-secondary-color: #94a3b8;
    background: var(--simba-bg);
    color: #e5e7eb;
    color-scheme: dark;
}

html.theme-dark body.simba-app .simba-sidebar {
    background: #111827;
    border-right-color: #263449;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
}

html.theme-dark body.simba-app .sidebar-brand {
    border-bottom-color: #263449;
}

html.theme-dark body.simba-app .sidebar-brand a,
html.theme-dark body.simba-app .sidebar-link {
    color: #cbd5e1;
}

html.theme-dark body.simba-app .sidebar-brand small,
html.theme-dark body.simba-app .sidebar-heading,
html.theme-dark body.simba-app .text-secondary,
html.theme-dark body.simba-app .form-text {
    color: #94a3b8 !important;
}

html.theme-dark body.simba-app .sidebar-link:hover,
html.theme-dark body.simba-app .sidebar-link.active {
    background: #1e293b;
    color: #a5b4fc;
}

body.simba-app .theme-toggle {
    align-items: center;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    padding: 0;
    width: 36px;
}

body.simba-app .theme-toggle .bi {
    font-size: 0.95rem;
    line-height: 1;
}

html.theme-dark body.simba-app .card,
html.theme-dark body.simba-app .signature-dialog,
html.theme-dark body.simba-app .dropdown-menu,
html.theme-dark body.simba-app .list-group,
html.theme-dark body.simba-app .list-group-item {
    background-color: #172033;
    border-color: #334155;
    color: #e5e7eb;
}

html.theme-dark body.simba-app .simba-user-menu-panel {
    background: #172033;
    border-color: #334155;
    color: #e5e7eb;
}

html.theme-dark body.simba-app .simba-user-menu-panel::before {
    background: #172033;
    border-color: #334155;
}

html.theme-dark body.simba-app .simba-user-menu-profile-icon {
    background: #1e293b;
    color: #a5b4fc;
}

html.theme-dark body.simba-app .simba-user-menu-role {
    color: #94a3b8;
}

html.theme-dark body.simba-app .simba-user-menu-divider {
    border-top-color: #334155;
}

html.theme-dark body.simba-app .simba-user-menu-item {
    color: #e5e7eb;
}

html.theme-dark body.simba-app .simba-user-menu-item:hover,
html.theme-dark body.simba-app .simba-user-menu-item:focus-visible {
    background: #1e293b;
    color: #c7d2fe;
}

html.theme-dark body.simba-app .card-footer,
html.theme-dark body.simba-app .bg-white {
    background-color: #172033 !important;
    border-color: #334155 !important;
}

html.theme-dark body.simba-app .detail-list dt,
html.theme-dark body.simba-app .detail-list dd {
    border-bottom-color: #334155;
}

html.theme-dark body.simba-app .form-control,
html.theme-dark body.simba-app .form-select,
html.theme-dark body.simba-app .create-berita-acara .ts-wrapper.form-select,
html.theme-dark body.simba-app .edit-berita-acara .ts-wrapper.form-select,
html.theme-dark body.simba-app .ts-wrapper.form-select.unit-filter-tomselect {
    background-color: #0f172a;
    border-color: #475569;
    color: #e5e7eb;
}

html.theme-dark body.simba-app .form-control::placeholder {
    color: #64748b;
    opacity: 1;
}

html.theme-dark body.simba-app .form-control:focus,
html.theme-dark body.simba-app .form-select:focus {
    background-color: #111827;
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.2);
    color: #f8fafc;
}

html.theme-dark body.simba-app .form-control:disabled,
html.theme-dark body.simba-app .form-control[readonly],
html.theme-dark body.simba-app .form-select:disabled,
html.theme-dark body.simba-app .create-berita-acara .flatpickr-input[readonly],
html.theme-dark body.simba-app .edit-berita-acara .flatpickr-input[readonly] {
    background-color: #1e293b;
    color: #cbd5e1;
}

html.theme-dark body.simba-app .ts-wrapper .ts-control,
html.theme-dark body.simba-app .ts-wrapper .ts-control input,
html.theme-dark body.simba-app .create-berita-acara .ts-wrapper.form-select .ts-control,
html.theme-dark body.simba-app .edit-berita-acara .ts-wrapper.form-select .ts-control {
    background: transparent !important;
    color: #e5e7eb !important;
}

html.theme-dark body.simba-app .ts-wrapper .ts-control .item {
    color: #e5e7eb;
}

html.theme-dark body.simba-app .ts-dropdown {
    background: #172033;
    border-color: #475569 !important;
    color: #e5e7eb;
}

html.theme-dark body.simba-app .ts-dropdown .option,
html.theme-dark body.simba-app .ts-dropdown .create {
    color: #e5e7eb;
}

html.theme-dark body.simba-app .ts-dropdown .active,
html.theme-dark body.simba-app .ts-dropdown .option:hover {
    background: #273449;
    color: #fff;
}

html.theme-dark body.simba-app .dropdown-item {
    color: #e2e8f0;
}

html.theme-dark body.simba-app .dropdown-item:hover,
html.theme-dark body.simba-app .dropdown-item:focus {
    background-color: #273449;
    color: #fff;
}

html.theme-dark body.simba-app .list-group-item-action:hover,
html.theme-dark body.simba-app .list-group-item-action:focus {
    background-color: #273449;
    color: #fff;
}

html.theme-dark body.simba-app .btn-outline-secondary {
    border-color: #64748b;
    color: #cbd5e1;
}

html.theme-dark body.simba-app .btn-outline-secondary:hover,
html.theme-dark body.simba-app .btn-outline-secondary:focus {
    background-color: #475569;
    border-color: #64748b;
    color: #fff;
}

html.theme-dark body.simba-app .dropdown-divider {
    border-top-color: #475569;
}

html.theme-dark body.simba-app .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e5e7eb;
    --bs-table-border-color: #334155;
    --bs-table-striped-bg: rgba(148, 163, 184, 0.04);
    --bs-table-striped-color: #e5e7eb;
    --bs-table-hover-bg: rgba(96, 165, 250, 0.08);
    --bs-table-hover-color: #fff;
    color: #e5e7eb;
}

html.theme-dark body.simba-app .table thead th {
    background: #1e293b;
    color: #e2e8f0;
}

html.theme-dark body.simba-app .table > :not(caption) > * > * {
    border-bottom-color: #334155;
}

html.theme-dark body.simba-app .page-link {
    background-color: #172033;
    border-color: #334155;
    color: #93c5fd;
}

html.theme-dark body.simba-app .page-link:hover,
html.theme-dark body.simba-app .page-item.active .page-link {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

html.theme-dark body.simba-app .page-item.disabled .page-link {
    background-color: #111827;
    border-color: #334155;
    color: #64748b;
}

html.theme-dark body.simba-app .dt-container .dt-info,
html.theme-dark body.simba-app .dt-container .dt-length,
html.theme-dark body.simba-app .dt-container .dt-search,
html.theme-dark body.simba-app .dt-container .dt-paging {
    color: #cbd5e1;
}

html.theme-dark body.simba-app .global-loading-panel {
    background: #172033;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

html.theme-dark body.simba-app .global-loading-spinner {
    border-color: #334155;
    border-top-color: #60a5fa;
}

html.theme-dark body.simba-app .global-loading-text {
    color: #e5e7eb;
}

html.theme-dark body.simba-app .signature-dialog {
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.48);
}

html.theme-dark body.simba-app .signature-dialog .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

/* Keep the signature surface light so black ink remains visible and export stays predictable. */
html.theme-dark body.simba-app .signature-preview,
html.theme-dark body.simba-app .signature-canvas {
    background: #fff;
    border-color: #94a3b8;
}

html.theme-dark body.simba-app .signature-preview {
    color: #475569;
}

html.theme-dark .flatpickr-calendar {
    background: #172033;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html.theme-dark .flatpickr-calendar.arrowTop::before,
html.theme-dark .flatpickr-calendar.arrowTop::after {
    border-bottom-color: #172033;
}

html.theme-dark .flatpickr-months .flatpickr-month,
html.theme-dark .flatpickr-current-month .flatpickr-monthDropdown-months,
html.theme-dark .flatpickr-current-month input.cur-year,
html.theme-dark span.flatpickr-weekday,
html.theme-dark .flatpickr-day {
    background: transparent;
    color: #e5e7eb;
}

html.theme-dark .flatpickr-day:hover,
html.theme-dark .flatpickr-day:focus {
    background: #273449;
    border-color: #475569;
}

html.theme-dark .flatpickr-day.prevMonthDay,
html.theme-dark .flatpickr-day.nextMonthDay {
    color: #64748b;
}

html.theme-dark .flatpickr-day.today {
    border-color: #60a5fa;
}

html.theme-dark .flatpickr-day.selected,
html.theme-dark .flatpickr-day.startRange,
html.theme-dark .flatpickr-day.endRange {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

html.theme-dark .flatpickr-months .flatpickr-prev-month,
html.theme-dark .flatpickr-months .flatpickr-next-month,
html.theme-dark .flatpickr-months .flatpickr-prev-month svg,
html.theme-dark .flatpickr-months .flatpickr-next-month svg {
    color: #cbd5e1;
    fill: #cbd5e1;
}

html.theme-dark .swal2-popup {
    background: #172033;
    color: #e5e7eb;
}

html.theme-dark .swal2-title,
html.theme-dark .swal2-html-container {
    color: #e5e7eb;
}

