@import url('https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900|Raleway:500,600,700,800');

:root {
    --app-brand-green: #1d9538;
    --app-brand-green-rgb: 29, 149, 56;
    --app-brand-green-soft: #6faf66;
    --app-brand-green-soft-rgb: 111, 175, 102;
    --app-brand-blue: #184d9b;
    --app-brand-blue-rgb: 24, 77, 155;
    --app-brand-red: #e51521;
    --app-brand-red-rgb: 229, 21, 33;
    --app-brand-ink: #203128;
    --app-brand-sidebar: #f7faf7;
    --app-brand-sidebar-text: #31413a;
    --app-brand-sidebar-muted: #5f7168;
    --app-brand-sidebar-border: rgba(29, 149, 56, 0.14);
    --app-brand-sidebar-hover: rgba(29, 149, 56, 0.08);
    --app-brand-sidebar-active: linear-gradient(135deg, rgba(29, 149, 56, 0.14), rgba(24, 77, 155, 0.10));
    --app-brand-card-highlight: linear-gradient(90deg, rgba(29, 149, 56, 0.10), rgba(24, 77, 155, 0.04));
    --app-brand-soft-surface: rgba(29, 149, 56, 0.05);
    --app-brand-soft-border: rgba(29, 149, 56, 0.16);
}

[data-bs-theme="dark"] {
    --app-brand-sidebar: #171d19;
    --app-brand-sidebar-text: #ffffff;
    --app-brand-sidebar-muted: rgba(255, 255, 255, 0.8);
    --app-brand-sidebar-border: rgba(111, 175, 102, 0.16);
    --app-brand-sidebar-hover: rgba(111, 175, 102, 0.12);
    --app-brand-sidebar-active: linear-gradient(135deg, rgba(29, 149, 56, 0.24), rgba(24, 77, 155, 0.26));
    --app-brand-card-highlight: linear-gradient(90deg, rgba(29, 149, 56, 0.16), rgba(24, 77, 155, 0.08));
    --app-brand-soft-surface: rgba(111, 175, 102, 0.08);
    --app-brand-soft-border: rgba(111, 175, 102, 0.20);
}

body {
    font-family: 'Poppins', sans-serif;
    background: #fafafa;
}

body.app-soft-top-bg {
    background:
        linear-gradient(180deg, rgba(var(--app-brand-green-rgb), 0.10) 0%, rgba(var(--app-brand-green-rgb), 0.05) 10%, rgba(var(--app-brand-green-rgb), 0.02) 18%, rgba(255, 255, 255, 0) 30%) fixed,
        var(--bs-body-bg);
}

/* Compatibilidad tema oscuro */
[data-bs-theme="dark"] body {
    background: #0f1115;
    color: #e7eaf0;
}

[data-bs-theme="dark"] body.app-soft-top-bg {
    background:
        linear-gradient(180deg, rgba(var(--app-brand-green-soft-rgb), 0.14) 0%, rgba(var(--app-brand-green-soft-rgb), 0.08) 10%, rgba(var(--app-brand-green-soft-rgb), 0.03) 18%, rgba(0, 0, 0, 0) 30%) fixed,
        var(--bs-body-bg);
}

[data-bs-theme="dark"] p {
    color: #b8c0cc;
}

/* Ajustes de utilidades Bootstrap en modo oscuro */
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bs-tertiary-bg) !important;
}

[data-bs-theme="dark"] body.bg-light {
    background-color: var(--bs-body-bg) !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: var(--bs-body-bg) !important;
}

.card > .card-header {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
    border-bottom: 1px solid var(--bs-border-color) !important;
    background-image: var(--app-brand-card-highlight);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.card > .card-header > h1,
.card > .card-header > h2,
.card > .card-header > h3,
.card > .card-header > h4,
.card > .card-header > h5,
.card > .card-header > h6 {
    margin: 0;
    font-size: 1.25rem;
    font-family: 'Raleway', 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.2;
}

#content > .container-fluid > .d-flex > h2,
#content > .container-fluid > .d-flex > div > h2,
.app-page-title {
    color: #146c43;
    font-family: 'Raleway', 'Poppins', sans-serif;
    font-weight: 800;
    letter-spacing: -.02em;
}

[data-bs-theme="dark"] #content > .container-fluid > .d-flex > h2,
[data-bs-theme="dark"] #content > .container-fluid > .d-flex > div > h2,
[data-bs-theme="dark"] .app-page-title {
    color: #d9f0dc;
}

.btn .bi-plus,
.btn .bi-plus-lg {
    font-weight: 700;
    -webkit-text-stroke: 0.35px currentColor;
}

.app-add-btn {
    width: 50px;
    height: 50px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.app-add-btn .bi-plus-lg,
.app-add-btn .bi-plus {
    font-size: 1.2rem;
    font-weight: 800;
    -webkit-text-stroke: 0.35px currentColor;
}

[data-bs-theme="dark"] .card > .card-header {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .table-light {
    --bs-table-color: var(--bs-body-color);
    --bs-table-bg: var(--bs-tertiary-bg);
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.05);
    --bs-table-striped-color: var(--bs-body-color);
    --bs-table-active-bg: rgba(var(--bs-emphasis-color-rgb), 0.10);
    --bs-table-active-color: var(--bs-body-color);
    --bs-table-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.075);
    --bs-table-hover-color: var(--bs-body-color);
}

p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    font-weight: 300;
    line-height: 1.7em;
    color: #999;
}

a,
a:hover,
a:focus {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s;
}

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: var(--sidebar-width, 250px);
    max-width: var(--sidebar-width, 250px);
    background:
        radial-gradient(circle at top right, rgba(24, 77, 155, 0.22), transparent 34%),
        linear-gradient(180deg, rgba(29, 149, 56, 0.12), rgba(29, 149, 56, 0) 22%),
        var(--app-brand-sidebar);
    color: var(--app-brand-sidebar-text);
    border-right: 1px solid var(--app-brand-sidebar-border);
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.08);
    transition: all 0.3s;
    position: fixed;
    left: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width, 250px));
}

/* Sidebar y contenido */
#content {
    width: 100%;
    transition: all 0.3s;
}

body.has-sidebar #sidebar + #content {
    margin-left: var(--sidebar-width, 250px);
    width: calc(100% - var(--sidebar-width, 250px));
}

body.fact-analysis-full-width.has-sidebar #sidebar + #content {
    padding-right: 2rem;
}

body.fact-analysis-full-width #content > .container-fluid.fact-analysis-page {
    max-width: none;
}

body.has-sidebar #sidebar.active + #content {
    margin-left: 0;
    width: 100%;
}

/* Boton de despliegue del sidebar */
#sidebarCollapseInside {
    cursor: pointer;
    transition: all 0.3s;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: transparent !important;
}

/* Sidebar cerrado */
#sidebar.active #sidebarCollapseInside {
    color: var(--app-brand-sidebar-text) !important;
}

/* Ajuste del boton en modo oscuro */
[data-bs-theme="dark"] #sidebar.active #sidebarCollapseInside,
[data-bs-theme="dark"] #sidebar.active #sidebarCollapseInside i {
    color: #e7eaf0 !important;
}

/* Sidebar abierto */
#sidebar #sidebarCollapseInside {
    color: var(--app-brand-sidebar-text) !important;
}

#sidebar h1 {
    margin-bottom: 20px;
    font-weight: 700;
}

#sidebar > .p-4.pt-0 {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1.25rem !important;
}

#sidebar > .p-4.pt-0::-webkit-scrollbar {
    width: 10px;
}

#sidebar > .p-4.pt-0::-webkit-scrollbar-thumb {
    background: rgba(127, 127, 127, 0.35);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

#sidebar > .p-4.pt-0::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar ul.components {
    padding: 20px 0;
    border-bottom: 1px solid var(--app-brand-sidebar-border);
}

#sidebar ul p {
    color: var(--app-brand-sidebar-text);
    padding: 10px;
}

#sidebar ul li a {
    padding: 10px 14px;
    font-size: 1.16rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    color: var(--app-brand-sidebar-muted);
    border-radius: .8rem;
    margin: 0 .65rem .2rem;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

#sidebar ul li a .bi {
    width: 1.35em;
    text-align: center;
    color: inherit;
}

#sidebar ul li a:hover {
    color: var(--app-brand-sidebar-text);
    background: var(--app-brand-sidebar-hover);
    transform: translateX(2px);
}

#sidebar ul li.active>a,
a[aria-expanded="true"] {
    color: var(--app-brand-sidebar-text);
    background: var(--app-brand-sidebar-active);
    box-shadow: inset 0 0 0 1px rgba(29, 149, 56, 0.10);
}

#sidebar .dropdown-toggle::after {
    color: currentColor;
    opacity: .8;
}

[data-bs-theme="light"] #sidebar {
    box-shadow: 14px 0 28px rgba(29, 67, 40, 0.08);
}

[data-bs-theme="light"] #sidebar ul li a:hover,
[data-bs-theme="light"] #sidebar ul li.active > a,
[data-bs-theme="light"] #sidebar a[aria-expanded="true"] {
    color: var(--app-brand-ink);
}

ul ul a {
    font-size: 1.02rem !important;
    padding-left: 14px !important;
    background: rgba(29, 149, 56, 0.03);
}

/* Tercer nivel */
ul ul ul a {
    padding-left: 14px !important;
    background: rgba(29, 149, 56, 0.04);
}

/* Cuarto nivel */
ul ul ul ul a {
    padding-left: 14px !important;
    background: rgba(29, 149, 56, 0.05);
}

#sidebar ul ul {
    margin-top: .2rem;
}

#sidebar ul ul li a .bi {
    width: 1.2em;
}

#sidebar ul ul li a {
    margin-left: .25rem;
    margin-right: .25rem;
}

@media (max-width: 768px) {
    #sidebar ul li a {
        font-size: 1.08rem;
    }

    ul ul a {
        font-size: 0.98rem !important;
    }
}

[data-bs-theme="dark"] #sidebar ul li.active>a,
[data-bs-theme="dark"] a[aria-expanded="true"] {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] ul ul a {
    background: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] ul ul ul a {
    background: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] ul ul ul ul a {
    background: rgba(255, 255, 255, 0.05);
}

/* Ajustes moviles */
@media (max-width: 768px) {
    #sidebar {
        margin-left: 0;
        max-width: min(86vw, var(--sidebar-width, 250px));
        min-width: min(86vw, var(--sidebar-width, 250px));
    }

    #sidebar.active {
        margin-left: calc(-1 * var(--sidebar-width, 250px));
    }

    body.has-sidebar #sidebar + #content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    #sidebar > .p-4.pt-0 {
        padding-left: .9rem !important;
        padding-right: .9rem !important;
        padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    }

    #sidebar #sidebarCollapseInside {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        color: #333 !important;
        background: transparent !important;
    }

    #sidebar.active #sidebarCollapseInside,
    #sidebar.active #sidebarCollapseInside i {
        color: #ffffff !important;
    }

    [data-bs-theme="dark"] #sidebar #sidebarCollapseInside,
    [data-bs-theme="dark"] #sidebar #sidebarCollapseInside i {
        color: #e7eaf0 !important;
    }

    [data-bs-theme="dark"] #sidebar.active #sidebarCollapseInside,
    [data-bs-theme="dark"] #sidebar.active #sidebarCollapseInside i {
        color: #e7eaf0 !important;
    }

}

/* Ajustes Tom Select */
.ts-dropdown {
    z-index: 3000 !important;
    border-radius: 0 0 .45rem .45rem;
    border: 1px solid var(--bs-border-color);
    border-top: none !important;
    margin-top: 0 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    background: var(--bs-tertiary-bg);
}

.ts-wrapper.form-select {
    padding: 0 !important;
    border: none;
    width: 100%;
    display: block;
}

.input-group > .ts-wrapper {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .ts-wrapper.form-select {
    margin-left: -1px;
}

.input-group > .ts-wrapper .ts-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    padding-left: .45rem;
}

.ts-control {
    border-radius: var(--bs-border-radius) !important;
    padding: .375rem .75rem;
    border: 1px solid var(--bs-border-color) !important;
    min-height: calc(2.25rem + 2px);
    background: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color);
    box-shadow: none !important;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
    padding-right: 2rem;
}

.ts-wrapper.single.has-items .ts-control > input {
    display: none;
}

.ts-wrapper.single .ts-control > .item {
    max-width: calc(100% - 1.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.input-group .ts-wrapper.single .ts-control > input {
    display: none !important;
}

.ts-wrapper.single.has-items .ts-control > input,
.ts-control.has-items > input {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
}

.ts-wrapper.single.has-items .ts-control > input::placeholder,
.ts-control.has-items > input::placeholder {
    color: transparent !important;
}

.ts-wrapper.has-items .ts-control > input::placeholder {
    color: transparent !important;
}

.ts-wrapper.has-items .ts-control > .item {
    display: inline-block;
    background: transparent;
    margin-right: 5px;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15) !important;
}

.ts-control input {
    color: var(--bs-body-color) !important;
    min-width: 3rem !important;
}

.form-floating {
    position: relative;
}

.form-floating .ts-wrapper .ts-control {
    padding-top: 1.625rem !important;
    padding-bottom: 0.625rem !important;
    border: 1px solid #dee2e6 !important;
    border-radius: var(--bs-border-radius) !important;
    min-height: calc(3.5rem + 2px) !important;
}

.form-floating > .ts-wrapper ~ label {
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    transform-origin: 0 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    padding: .625rem .75rem;
    color: var(--bs-secondary-color);
}

.form-floating > .ts-wrapper.focus ~ label,
.form-floating > .ts-wrapper.has-items ~ label {
    opacity: 0.65;
    transform: scale(0.82) translateY(-0.45rem) translateX(0.2rem);
}

.ts-dropdown .option,
.ts-dropdown .no-results,
.ts-dropdown .create {
    padding: .45rem .7rem;
    color: var(--bs-body-color);
}

.ts-dropdown .active,
.ts-dropdown .option:hover {
    background: rgba(13, 110, 253, 0.10);
    color: var(--bs-body-color);
}

.ts-wrapper.multi .ts-control > div {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, 0.18);
    border-radius: 999px;
}

.ts-wrapper.single .ts-control:after {
    border-color: #6c757d transparent transparent transparent;
}

.ts-wrapper.single .ts-control > .item,
.ts-wrapper.single .ts-control > input {
    line-height: 1.35rem;
}

.ts-wrapper .ts-control > input::placeholder {
    color: var(--bs-secondary-color) !important;
    opacity: .55;
}

.ts-wrapper.ts-has-placeholder-selection .ts-control > .item {
    opacity: .58;
}

.ts-wrapper.ts-has-placeholder-selection.ts-is-typing .ts-control > .item {
    opacity: .12;
}

.ts-wrapper.ts-is-typing .ts-control > input::placeholder {
    opacity: 0;
}

[data-bs-theme="dark"] .ts-wrapper.single .ts-control,
[data-bs-theme="dark"] .ts-wrapper.multi .ts-control {
    border-color: rgba(255, 255, 255, 0.40) !important;
}

/* Refuerzo visual en modales/detalle IT */
#detailTaskContent .ts-wrapper,
.modal .ts-wrapper {
    width: 100% !important;
}

#detailTaskContent .ts-wrapper .ts-control,
.modal .ts-wrapper .ts-control {
    border: 1px solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
    min-height: calc(3.5rem + 2px) !important;
}

[data-bs-theme="dark"] .ts-control {
    background: var(--bs-tertiary-bg) !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
    color: #e7eaf0;
}

[data-bs-theme="dark"] .form-floating > .ts-wrapper ~ label {
    color: rgba(231, 234, 240, .72);
}

[data-bs-theme="dark"] .ts-control input {
    color: #e7eaf0 !important;
}

[data-bs-theme="dark"] .ts-dropdown {
    background: var(--bs-body-bg);
    border-color: rgba(255, 255, 255, 0.14);
}

[data-bs-theme="dark"] .ts-dropdown .option,
[data-bs-theme="dark"] .ts-dropdown .no-results,
[data-bs-theme="dark"] .ts-dropdown .create {
    color: #e7eaf0;
}

[data-bs-theme="dark"] .ts-dropdown .active,
[data-bs-theme="dark"] .ts-dropdown .option:hover {
    background: rgba(13, 110, 253, 0.28);
    color: #fff;
}

[data-bs-theme="dark"] .ts-wrapper.multi .ts-control > div {
    background: rgba(13, 110, 253, 0.22);
    color: #dce7ff;
    border-color: rgba(13, 110, 253, 0.35);
}

/* Ajustes Tabulator */
.tabulator-toolbar .btn {
    white-space: nowrap;
}

.tabulator-columns-menu .dropdown-item {
    border-radius: 0.25rem;
}

[data-bs-theme="dark"] .tabulator {
    background-color: #151922;
    color: #e7eaf0;
    border-color: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .tabulator .tabulator-header,
[data-bs-theme="dark"] .tabulator .tabulator-footer {
    background-color: #1f2632;
    color: #e7eaf0;
    border-color: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .tabulator .tabulator-row {
    background-color: #151922;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .tabulator .tabulator-row.tabulator-row-even {
    background-color: #1a202b;
}

[data-bs-theme="dark"] .tabulator .tabulator-cell {
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col input,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col select {
    background-color: #1f2632;
    color: #e7eaf0;
}

[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col:hover,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-col-sorter-element:hover {
    background-color: #2a3342;
    color: #f8fafc;
}

[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col:hover .tabulator-col-title,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover .tabulator-col-title,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-col-sorter-element:hover .tabulator-col-title,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col:hover .tabulator-arrow,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover .tabulator-arrow,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-col-sorter-element:hover .tabulator-arrow {
    color: #f8fafc;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter {
    padding-top: .2rem;
    padding-bottom: .2rem;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input,
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter select {
    min-height: 32px;
    padding: .22rem .5rem;
    border-radius: .4rem;
    border: 1px solid rgba(33, 37, 41, .12);
    background-color: rgba(255, 255, 255, .58) !important;
    color: rgba(33, 37, 41, .78) !important;
    box-shadow: none !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::placeholder {
    color: rgba(33, 37, 41, .45) !important;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:hover,
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter select:hover,
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus,
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter select:focus {
    background-color: rgba(255, 255, 255, .88) !important;
    border-color: rgba(255, 255, 255, .95) !important;
    color: rgba(33, 37, 41, .92) !important;
}

[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-header-filter select {
    background-color: rgba(255, 255, 255, .08) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: rgba(231, 234, 240, .82) !important;
}

[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::placeholder {
    color: rgba(231, 234, 240, .48) !important;
}

[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:hover,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-header-filter select:hover,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus,
[data-bs-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-header-filter select:focus {
    background-color: rgba(255, 255, 255, .14) !important;
    border-color: rgba(255, 255, 255, .34) !important;
    color: rgba(255, 255, 255, .98) !important;
}

/* Barra de progreso de toasts */
.toast {
    overflow: hidden;
}

.toast-progress {
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.25);
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
}

/* Estado de carga unificado para botones */
.btn.is-loading,
a.btn.is-loading {
    pointer-events: none;
    opacity: .92;
}

.btn.is-loading .spinner-border,
a.btn.is-loading .spinner-border {
    vertical-align: text-bottom;
}

/* Timeline reutilizable */
.app-timeline {
    border: 1px solid var(--bs-border-color);
    border-radius: .9rem;
    background: var(--bs-body-bg);
}

.app-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.app-timeline-empty {
    padding: .9rem;
    color: var(--bs-secondary-color);
}

.app-timeline-scroll {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    padding: .85rem .8rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--app-brand-green-rgb), .42) rgba(var(--app-brand-green-rgb), .10);
    scrollbar-gutter: stable both-edges;
    scroll-snap-type: x proximity;
}

.app-timeline-scroll::-webkit-scrollbar {
    height: 10px;
}

.app-timeline-scroll::-webkit-scrollbar-track {
    background: rgba(var(--app-brand-green-rgb), .10);
    border-radius: 999px;
}

.app-timeline-scroll::-webkit-scrollbar-thumb {
    background: rgba(var(--app-brand-green-rgb), .42);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.app-timeline-track {
    --tl-dot-size: 14px;
    --tl-card-width: 260px;
    position: relative;
    display: flex;
    gap: 1rem;
    align-items: stretch;
    min-width: max-content;
    padding-top: 1.1rem;
}

.app-timeline-track::before {
    content: '';
    position: absolute;
    left: calc(var(--tl-card-width) / 2);
    right: calc(var(--tl-card-width) / 2);
    top: calc(var(--tl-dot-size) / 2);
    border-top: 2px solid rgba(var(--app-brand-green-rgb), .42);
}

.app-timeline-item {
    position: relative;
    width: var(--tl-card-width);
    min-width: var(--tl-card-width);
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.app-timeline-dot {
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--tl-dot-size);
    height: var(--tl-dot-size);
    transform: translateX(-50%);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 .16rem rgba(var(--app-brand-green-rgb), .14);
    background: #6c757d;
}

.app-timeline-dot--secondary { background: #6c757d; }
.app-timeline-dot--primary { background: var(--app-brand-blue); }
.app-timeline-dot--info { background: #0dcaf0; }
.app-timeline-dot--warning { background: #f59f00; }
.app-timeline-dot--success { background: var(--app-brand-green); }
.app-timeline-dot--danger { background: #dc3545; }

.app-timeline-card {
    margin-top: 1.05rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    padding: .7rem .75rem;
    background: linear-gradient(180deg, var(--bs-tertiary-bg), rgba(var(--app-brand-green-rgb), .03));
    min-height: 140px;
}

.app-timeline-title {
    line-height: 1.2;
}

.app-timeline-comment {
    font-size: .84rem;
    color: var(--bs-body-color);
    background: rgba(var(--app-brand-green-rgb), .06);
    border: 1px solid rgba(var(--app-brand-green-rgb), .13);
    border-radius: .6rem;
    padding: .45rem .5rem;
}

[data-bs-theme="dark"] .app-timeline-track::before {
    border-top-color: rgba(var(--app-brand-green-soft-rgb), .42);
}

[data-bs-theme="dark"] .app-timeline-scroll {
    scrollbar-color: rgba(var(--app-brand-green-soft-rgb), .55) rgba(var(--app-brand-green-soft-rgb), .18);
}

[data-bs-theme="dark"] .app-timeline-scroll::-webkit-scrollbar-track {
    background: rgba(var(--app-brand-green-soft-rgb), .16);
}

[data-bs-theme="dark"] .app-timeline-scroll::-webkit-scrollbar-thumb {
    background: rgba(var(--app-brand-green-soft-rgb), .55);
}

[data-bs-theme="dark"] .app-timeline-dot {
    border-color: #1b2230;
}

[data-bs-theme="dark"] .app-timeline-comment {
    background: rgba(var(--app-brand-green-soft-rgb), .12);
    border-color: rgba(var(--app-brand-green-soft-rgb), .24);
    color: #e4f5e4;
}

.comments-widget-card .card-header {
    padding: .55rem .8rem;
}

.comments-widget-list-wrap {
    border: 1px solid var(--bs-border-color);
    border-radius: .65rem;
    background: var(--bs-body-bg);
    max-height: 290px;
    overflow: auto;
}

.comments-item {
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.comments-item:last-child {
    border-bottom: 0;
}

.comments-item-body {
    padding: .5rem .65rem;
}

.comments-meta {
    font-size: .75rem;
}

.task-docs-upload-preview-list {
    border: 1px solid var(--bs-border-color);
    border-radius: .6rem;
    padding: .5rem;
    max-height: 280px;
    overflow: auto;
    background: var(--bs-body-bg);
}

.task-docs-upload-item {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .45rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.task-docs-upload-item:last-child {
    border-bottom: 0;
}

.task-docs-upload-media {
    width: 68px;
    min-width: 68px;
    height: 52px;
    border: 1px solid var(--bs-border-color);
    border-radius: .45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-tertiary-bg);
    overflow: hidden;
}

.task-docs-preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.task-docs-preview-icon {
    font-size: 1.25rem;
    color: var(--bs-secondary-color);
}

.task-docs-upload-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.task-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .55rem;
}

.task-doc-card {
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.doc-preview-stage {
    border: 1px solid var(--bs-border-color);
    border-radius: .6rem;
    background: var(--bs-body-bg);
    min-height: 62vh;
    overflow: auto;
}

.doc-preview-toolbar {
    flex-wrap: wrap;
}

.doc-preview-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    font-weight: 600;
    white-space: nowrap;
}

.doc-preview-toolbar .js-doc-open-new,
.doc-preview-toolbar .js-doc-download {
    min-width: 148px;
}

.doc-preview-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 1rem;
    overflow: auto;
}

.doc-preview-image {
    max-width: 100%;
    max-height: 80vh;
    transform-origin: center center;
    transition: transform .15s ease;
}

.doc-preview-pdf {
    width: 100%;
    min-height: 75vh;
    border: 0;
    background: #fff;
}

.doc-preview-dialog-resizable .modal-content {
    height: 100%;
}

.doc-preview-dialog-resizable {
    min-width: 360px;
    min-height: 240px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    box-sizing: border-box;
}

.doc-preview-dialog-resizable .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.doc-preview-dialog-resizable .doc-preview-stage {
    flex: 1 1 auto;
    min-height: 120px;
}

.doc-preview-dialog-resizable .doc-preview-pdf {
    min-height: 120px;
    height: 100%;
}

[data-bs-theme="dark"] .doc-preview-pdf {
    background: #1a1f2b;
}

/* Tabulator: resaltar columnas con filtro activo */
.tabulator .tabulator-col.tabulator-col-filtered {
    background: rgba(253, 126, 20, 0.18);
}

.tabulator .tabulator-header .tabulator-col.tabulator-col-filtered .tabulator-col-title {
    font-weight: 700;
}

.tabulator .tabulator-header-filter .is-active-filter {
    border-color: #fd7e14 !important;
    box-shadow: 0 0 0 .2rem rgba(253, 126, 20, .2) !important;
}

[data-bs-theme="dark"] .tabulator .tabulator-col.tabulator-col-filtered {
    background: rgba(253, 126, 20, 0.26);
}

.tabulator .tabulator-tableholder .tabulator-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 84px;
    padding: 1rem;
}

.app-tabulator-empty {
    width: 100%;
    text-align: center;
    color: var(--bs-secondary-color);
    font-weight: 500;
}

.app-notifications-trigger {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1035;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(33, 37, 41, 0.42), rgba(52, 58, 64, 0.42)) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    backdrop-filter: blur(10px);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease, background .18s ease;
    opacity: .42;
}

.app-notifications-trigger:hover {
    transform: translateY(-2px);
    opacity: .6;
}

.app-notifications-trigger.has-unread {
    opacity: 1;
    background: linear-gradient(135deg, var(--app-brand-green), var(--app-brand-blue)) !important;
    box-shadow: 0 20px 44px rgba(var(--app-brand-blue-rgb), 0.24);
}

.app-notifications-badge {
    position: absolute;
    top: .18rem;
    right: .18rem;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff, #e2e8f0);
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(6px);
    transform: scale(.92);
}

.app-notifications-trigger.has-unread .app-notifications-badge {
    background: linear-gradient(135deg, #fff7ed, #fdba74);
    color: #7c2d12;
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.28);
    transform: scale(1);
}

.app-notifications-trigger:not(.has-unread) .app-notifications-badge {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(226, 232, 240, 0.78));
    color: #334155;
}

.app-notifications-trigger .bi {
    transform: translateY(.5px);
}

.app-notifications-trigger.has-unread .bi {
    filter: drop-shadow(0 4px 10px rgba(255, 255, 255, 0.16));
}

.app-notifications-badge {
    font-size: .72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
}

.app-notifications-dialog {
    max-width: min(920px, calc(100vw - 2rem));
    margin: 1rem auto;
}

.app-notifications-modal-content {
    min-height: min(80vh, 780px);
    max-height: calc(100vh - 2rem);
    border: 0;
    border-radius: 1.4rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(251, 252, 254, 0.98), rgba(242, 247, 243, 0.98));
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.24);
}

.app-notifications-modal-content .modal-header {
    padding: 1.2rem 1.35rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 248, 0.72));
    backdrop-filter: blur(14px);
}

.app-notifications-modal-content .modal-title {
    font-size: 1.5rem;
    font-family: 'Raleway', 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--app-brand-ink);
}

.app-notifications-modal-content .modal-body {
    background: transparent;
}

.app-notifications-headline {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.app-notifications-title-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.app-notifications-title-count {
    display: inline-flex;
    align-items: center;
    padding: .28rem .62rem;
    border-radius: 999px;
    background: rgba(var(--app-brand-green-rgb), 0.10);
    color: var(--app-brand-green);
    font-size: .82rem;
    font-weight: 600;
}

#appNotificationsSummary {
    color: #5c6b63;
}

.app-notifications-close {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.72);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.app-notifications-close:hover {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 23, 42, 0.16);
}

.app-notifications-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .85rem;
    padding: .95rem 1.25rem;
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.app-notifications-filter {
    min-width: 260px;
    min-height: 2.6rem;
    border-radius: .8rem;
    border: 1px solid rgba(var(--app-brand-green-rgb), 0.18);
    background: rgba(255, 255, 255, 0.82);
    padding-left: .9rem;
}

.app-notifications-filter:focus {
    border-color: rgba(var(--app-brand-green-rgb), 0.45);
    box-shadow: 0 0 0 .2rem rgba(var(--app-brand-green-rgb), 0.12);
}

.app-notifications-list {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    background: transparent;
    min-height: 420px;
}

.app-notifications-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1.25rem 1.1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.7);
}

.app-notifications-footer-text {
    color: #5c6b63;
    font-size: .92rem;
    font-weight: 600;
}

.app-notifications-state {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    color: var(--bs-secondary-color);
    text-align: center;
    padding: 1.5rem;
}

.app-notifications-empty {
    position: relative;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: .7rem;
    padding: 2rem;
    border: 1px dashed rgba(var(--app-brand-green-rgb), 0.22);
    border-radius: 1.25rem;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.94), rgba(243, 248, 244, 0.9));
    overflow: hidden;
}

.app-notifications-empty-orb {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(var(--app-brand-green-rgb), 0.14), rgba(var(--app-brand-blue-rgb), 0.02));
    filter: blur(8px);
    pointer-events: none;
}

.app-notifications-empty-icon {
    position: relative;
    width: 5rem;
    height: 5rem;
    border-radius: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff, rgba(var(--app-brand-green-rgb), 0.08));
    box-shadow: 0 18px 40px rgba(var(--app-brand-green-rgb), 0.16);
    color: var(--app-brand-green);
    font-size: 1.8rem;
}

.app-notifications-empty-title {
    position: relative;
    font-size: 1.4rem;
    font-family: 'Raleway', 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--app-brand-ink);
    letter-spacing: -.02em;
}

.app-notifications-empty-text {
    position: relative;
    max-width: 420px;
    color: #425349;
    font-size: 1rem;
}

.app-notifications-empty-tip {
    position: relative;
    max-width: 460px;
    color: #7d8f84;
    font-size: .92rem;
}

.app-notification-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.05rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.app-notification-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.app-notification-item.is-unread {
    border-color: rgba(var(--app-brand-green-rgb), 0.30);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 243, 0.98));
    box-shadow: 0 16px 36px rgba(var(--app-brand-green-rgb), 0.10);
}

.app-notification-select {
    padding-top: .35rem;
}

.app-notification-body {
    min-width: 0;
}

.app-notification-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.app-notification-title-wrap {
    min-width: 0;
}

.app-notification-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--bs-emphasis-color);
    margin-bottom: .4rem;
}

.app-notification-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    font-size: .83rem;
    color: #6a7d73;
}

.app-notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: flex-end;
    align-items: center;
}

.app-notification-message {
    margin-top: .8rem;
    color: #31413a;
    line-height: 1.6;
}

.app-notifications-toolbar .btn,
.app-notification-actions .btn,
.app-notifications-modal-content .form-select {
    border-radius: .9rem;
}

.app-notification-actions .btn {
    min-width: 2.5rem;
}

.app-notification-actions .btn i {
    font-size: .95rem;
}

.app-notification-actions .btn-outline-danger {
    padding-inline: .78rem;
}

.app-notifications-toolbar .btn {
    min-height: 2.6rem;
    padding-inline: .95rem;
    font-weight: 600;
}

.app-notifications-segmented {
    padding: .2rem;
    border-radius: 999px;
    background: rgba(var(--app-brand-green-rgb), 0.08);
}

.app-notifications-segmented .btn {
    min-height: 2.35rem;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent;
    color: #476056;
    padding-inline: 1rem;
    box-shadow: none !important;
}

.app-notifications-segmented .btn.active,
.app-notifications-segmented .btn:active {
    background: linear-gradient(135deg, #ffffff, rgba(var(--app-brand-green-rgb), 0.08));
    color: var(--app-brand-ink);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

.app-notification-actions .btn-primary,
.app-notifications-toolbar .btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--app-brand-green), var(--app-brand-blue));
    border-color: var(--app-brand-green);
}

.app-notifications-toolbar .btn-outline-primary,
.app-notification-actions .btn-outline-primary {
    color: var(--app-brand-green);
    border-color: rgba(var(--app-brand-green-rgb), 0.34);
    background: rgba(255, 255, 255, 0.58);
}

.app-notifications-toolbar .btn-outline-danger,
.app-notification-actions .btn-outline-danger {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.28);
    background: rgba(255, 255, 255, 0.58);
}

.app-notifications-toolbar .btn-outline-secondary {
    color: #476056;
    border-color: rgba(var(--app-brand-green-rgb), 0.20);
    background: rgba(255, 255, 255, 0.58);
}

.app-notifications-toolbar .btn:disabled {
    opacity: .5;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.app-notification-meta .badge {
    padding: .45rem .7rem;
    border-radius: 999px;
    font-weight: 600;
    background: rgba(var(--app-brand-green-rgb), 0.08) !important;
    color: var(--app-brand-green) !important;
    border-color: rgba(var(--app-brand-green-rgb), 0.12) !important;
}

[data-bs-theme="dark"] .app-notification-item {
    background: rgba(24, 28, 34, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

[data-bs-theme="dark"] .app-notification-item.is-unread {
    background: linear-gradient(180deg, rgba(20, 25, 33, 0.98), rgba(18, 42, 29, 0.95));
    border-color: rgba(var(--app-brand-green-soft-rgb), 0.42);
}

[data-bs-theme="dark"] .app-notifications-modal-content {
    background: linear-gradient(180deg, rgba(18, 22, 28, 0.98), rgba(12, 19, 17, 0.99));
}

[data-bs-theme="dark"] .app-notifications-modal-content .modal-header,
[data-bs-theme="dark"] .app-notifications-toolbar {
    background: rgba(18, 22, 28, 0.72);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .app-notifications-modal-content .modal-title,
[data-bs-theme="dark"] .app-notifications-empty-title {
    color: #f8fafc;
}

[data-bs-theme="dark"] #appNotificationsSummary,
[data-bs-theme="dark"] .app-notification-meta,
[data-bs-theme="dark"] .app-notifications-empty-tip {
    color: #9ab3a3;
}

[data-bs-theme="dark"] .app-notification-message,
[data-bs-theme="dark"] .app-notifications-empty-text {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .app-notifications-close {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .app-notifications-close:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

[data-bs-theme="dark"] .app-notifications-filter {
    background-color: #1f2937;
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.26);
}

[data-bs-theme="dark"] .app-notifications-filter:focus {
    background-color: #111827;
    color: #f8fafc;
    border-color: rgba(var(--app-brand-green-soft-rgb), 0.48);
    box-shadow: 0 0 0 .2rem rgba(var(--app-brand-green-rgb), 0.18);
}

[data-bs-theme="dark"] .app-notifications-filter option {
    background: #111827;
    color: #f8fafc;
}

[data-bs-theme="dark"] .app-notifications-title-count {
    background: rgba(var(--app-brand-green-soft-rgb), 0.18);
    color: #c2e6c0;
}

[data-bs-theme="dark"] .app-notifications-footer {
    background: rgba(18, 22, 28, 0.72);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .app-notifications-footer-text {
    color: #9ab3a3;
}

[data-bs-theme="dark"] .app-notifications-empty {
    background: radial-gradient(circle at center, rgba(20, 31, 25, 0.82), rgba(14, 18, 24, 0.9));
    border-color: rgba(148, 163, 184, 0.14);
}

[data-bs-theme="dark"] .app-notifications-empty-icon {
    background: linear-gradient(135deg, rgba(21, 51, 33, 0.95), rgba(15, 23, 42, 0.95));
    color: #8fd28a;
    box-shadow: 0 18px 40px rgba(var(--app-brand-green-rgb), 0.18);
}

[data-bs-theme="dark"] .app-notifications-segmented {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .app-notifications-segmented .btn {
    color: #9ab3a3;
}

[data-bs-theme="dark"] .app-notifications-segmented .btn.active,
[data-bs-theme="dark"] .app-notifications-segmented .btn:active {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.95), rgba(30, 41, 59, 0.95));
    color: #f8fafc;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22) !important;
}

[data-bs-theme="dark"] .app-notifications-toolbar .btn-outline-primary,
[data-bs-theme="dark"] .app-notification-actions .btn-outline-primary,
[data-bs-theme="dark"] .app-notifications-toolbar .btn-outline-danger,
[data-bs-theme="dark"] .app-notification-actions .btn-outline-danger,
[data-bs-theme="dark"] .app-notifications-toolbar .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .app-notification-meta .badge {
    background: rgba(var(--app-brand-green-soft-rgb), 0.16) !important;
    color: #c2e6c0 !important;
    border-color: rgba(var(--app-brand-green-soft-rgb), 0.18) !important;
}

[data-bs-theme="dark"] .app-notifications-badge {
    color: #0f172a;
}

[data-bs-theme="dark"] .app-notifications-trigger {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.46), rgba(30, 41, 59, 0.46)) !important;
    border-color: rgba(148, 163, 184, 0.16) !important;
}

[data-bs-theme="dark"] .app-notifications-trigger.has-unread {
    background: linear-gradient(135deg, var(--app-brand-green), var(--app-brand-blue)) !important;
    box-shadow: 0 20px 44px rgba(var(--app-brand-green-rgb), 0.22);
}

@media (max-width: 768px) {
    .app-notifications-trigger {
        bottom: .9rem;
        right: .9rem;
        width: 3rem;
        height: 3rem;
    }

    .app-notifications-dialog {
        max-width: calc(100vw - 1rem);
        margin: .5rem auto;
    }

    .app-notifications-modal-content {
        min-height: calc(100vh - 1rem);
        max-height: calc(100vh - 1rem);
        border-radius: 1rem;
    }

    .app-notifications-modal-content .modal-header {
        padding: 1rem 1rem .9rem;
    }

    .app-notifications-modal-content .modal-title {
        font-size: 1.28rem;
    }

    .app-notifications-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: .9rem 1rem;
    }

    .app-notifications-toolbar > div {
        width: 100%;
    }

    .app-notifications-toolbar .d-flex.flex-wrap.gap-2 {
        justify-content: stretch;
    }

    .app-notifications-toolbar .btn {
        flex: 1 1 auto;
    }

    .app-notifications-list {
        padding: .85rem;
        min-height: 360px;
    }

    .app-notifications-footer {
        padding: .85rem 1rem 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .app-notifications-footer .d-flex {
        width: 100%;
    }

    .app-notifications-footer .btn {
        flex: 1 1 auto;
    }

    .app-notification-item {
        grid-template-columns: 1fr;
        padding: .95rem;
    }

    .app-notifications-filter {
        min-width: 100%;
    }

    .app-notifications-empty {
        min-height: 340px;
        padding: 1.5rem 1rem;
    }

    .app-notifications-empty-icon {
        width: 4.3rem;
        height: 4.3rem;
        border-radius: 1.2rem;
        font-size: 1.55rem;
    }

    .app-notifications-empty-title {
        font-size: 1.2rem;
    }

    .app-notification-select {
        padding-top: 0;
    }

    .app-notification-top {
        flex-direction: column;
    }

    .app-notification-actions {
        justify-content: flex-start;
    }
}
