/* Global textarea resizing */
textarea {
    resize: vertical;
    max-height: 200px;
    min-height: 60px;
}

/* Timesheets filters and report table readability */
#group_by_tasks_wrapper {
    display: flex;
    gap: 12px;
}

.table-timesheets-report tbody td:nth-child(6) {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    max-width: 250px;
    padding: 0;
    padding-top: 10px;
}

/* Expenses preview modal layout */
.expense-preview-modal {
    max-width: 1100px;
    width: calc(100% - 30px);
}

.expense-preview-modal #expense > .col-md-12 {
    float: none;
    padding: 0;
    width: 100%;
}

.expense-preview-modal #expense .panel_s {
    border: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.expense-preview-modal #expense .panel-body {
    padding: 0;
}

.expense-preview-modal #expense .toggle_view {
    display: none;
}

/* Invoices preview modal layout */
.invoice-preview-modal {
    width: min(1180px, calc(100vw - 32px));
}

.invoice-preview-modal .modal-content {
    border: 0;
    border-radius: 8px;
    overflow: hidden;
}

.invoice-preview-modal .modal-body {
    background: #f8fafc;
    max-height: calc(100vh - 145px);
    overflow-y: auto;
    padding: 18px;
}

.invoice-preview-modal #invoice_preview > .col-md-12 {
    float: none;
    width: 100%;
}

.invoice-preview-modal #invoice_preview .panel_s {
    margin-bottom: 0;
}

.invoice-preview-modal #invoice_preview .panel-body {
    border-radius: 8px;
}

.invoice-preview-modal #invoice_preview .toggle_view {
    display: none;
}

.invoice-preview-modal .mergeable-invoices {
    border: 1px solid #dbeafe;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    margin-bottom: 20px !important;
}

.invoice-preview-modal .mergeable-invoices + input + input + .invoice-preview-modern {
    margin-top: 4px;
}

.invoice-preview-modern > .panel_s,
.invoice-preview-modern > .panel_s > .panel-body {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.invoice-preview-modern > .panel_s > .panel-body {
    padding: 0;
}

.invoice-preview-modern .preview-tabs-top {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 14px;
    padding: 10px 12px 0;
}

.invoice-preview-modern > .panel_s > .panel-body > .row.mtop20 {
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding: 16px;
}

.invoice-preview-modern > .panel_s > .panel-body > .row.mtop20 > [class*="col-"] {
    float: none;
}

.invoice-preview-modern ._buttons {
    margin-left: auto;
}

.invoice-preview-modern .tab-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
}

.invoice-preview-modern .invoice-html {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.panel-full-width-tabs .nav {
    margin-top: 0 !important;
}

@media (max-width: 767px) {
    .invoice-preview-modal {
        margin: 10px auto;
        width: calc(100vw - 20px);
    }

    .invoice-preview-modal .modal-body {
        max-height: calc(100vh - 120px);
        padding: 12px;
    }

    .invoice-preview-modern > .panel_s > .panel-body > .row.mtop20 {
        display: block;
    }

    .invoice-preview-modern ._buttons {
        margin-top: 12px;
        text-align: left;
    }

    .invoice-preview-modern ._buttons .pull-right {
        float: none !important;
    }
}

/* Expenses preview modernized content */
.expense-preview-modern .panel_s,
.expense-preview-modern .panel-body {
    background: transparent;
}

.expense-preview-modern .panel-body {
    padding: 0;
}

.expense-preview-modern .preview-tabs-top {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px 10px 0;
}

.expense-preview-modern .nav-tabs {
    border-bottom: 0;
    margin-bottom: 0;
}

.expense-preview-modern .nav-tabs > li > a {
    border: 0;
    border-radius: 8px 8px 0 0;
    color: #64748b;
    font-weight: 600;
}

.expense-preview-modern .nav-tabs > li.active > a,
.expense-preview-modern .nav-tabs > li.active > a:focus,
.expense-preview-modern .nav-tabs > li.active > a:hover {
    background: #f8fafc;
    border: 0;
    color: #0f172a;
}

.expense-preview-modern > .panel_s > .panel-body > .row.mtop20 {
    align-items: center;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    gap: 16px;
    margin-left: 0;
    margin-right: 0;
    padding: 18px 0px;
}


.expense-preview-modern #expenseHeadings,
.expense-preview-modern ._buttons {
    float: none;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
}

.expense-preview-modern #expenseHeadings {
    flex: 1 1 auto;
}

.expense-preview-modern ._buttons {
    flex: 0 0 auto;
}
.expense-preview-modern ._buttons a  {
    margin-bottom: 10px;
}


.expense-preview-modern #expenseCategory {
    color: #0f172a;
    font-size: 22px;
    line-height: 1.25;
}

.expense-preview-modern #expenseName,
.expense-preview-modern #expenserCreator {
    line-height: 1.5;
}

.expense-preview-modern .hr-panel-separator {
    border-color: transparent;
    margin: 16px 0;
}

.expense-preview-modern #tab_expense > .row {
    display: grid;
    gap: 5px;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    margin-left: 0;
    margin-right: 0;
}

/* Bootstrap 3 agrega ::before/::after (clearfix) a .row. Dentro de un grid se vuelven
   items vacíos que ocupan celdas y desplazan las cards, dejando espacios en blanco. */
.expense-preview-modern #tab_expense > .row::before,
.expense-preview-modern #tab_expense > .row::after {
    content: none;
}

.expense-preview-modern #tab_expense > .row > .col-md-6,
.expense-preview-modern #tab_expense > .row > .col-md-12 {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    float: none;
    padding: 18px;
    width: auto;
}

.expense-preview-modern #tab_expense > .row > .col-md-12 {
    grid-column: 1 / -1;
}

.expense-preview-modern #tab_expense p {
    color: #334155;
    line-height: 1.5;
}

.expense-preview-modern #tab_expense .bold {
    color: #0f172a;
}

.expense-preview-modern #amountWrapper {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 14px 16px;
}

.expense-preview-modern #amountWrapper .text-danger {
    color: #dc2626;
    font-size: 20px;
}

.expense-preview-modern .expense-detail-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

.expense-preview-modern .expense-detail-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-width: 0;
    padding: 13px 14px;
}

.expense-preview-modern .expense-detail-label {
    color: #64748b;
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.expense-preview-modern .expense-detail-value {
    color: #0f172a;
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.expense-preview-modern .expense-detail-card-full {
    grid-column: 1 / -1;
}

.expense-preview-modern #expenseReceipt h4 {
    border-bottom: 1px solid #e5e7eb;
    color: #0f172a;
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.expense-preview-modern #expenseReceipt .dropzone {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    min-height: 150px;
}

.expense-preview-modern #expenseReceipt .row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    margin-left: 0;
    margin-right: 0;
    padding: 14px;
}

.expense-preview-modern #expenseReceipt .row > div {
    float: none;
}

/* Expenses preview: pestaña Recordatorios */
.expense-preview-modern #tab_reminders,
.expense-preview-modern #tab_tasks {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    margin-top: 20px;
    padding: 18px;
}

.expense-preview-modern #tab_tasks > hr {
    border-top-color: #e5e7eb;
    margin: 16px 0;
}

.expense-preview-modern #tab_reminders > .btn {
    margin-bottom: 16px;
}

.expense-preview-modern #tab_child_expenses .list-group {
    margin-bottom: 0;
}

.expense-preview-modern #tab_child_expenses .list-group-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 14px 16px;
}

.expense-preview-modern #tab_child_expenses .list-group-item:last-child {
    margin-bottom: 0;
}

/* Sin gastos asociados: mensaje en card, centrado (mismo estilo que Tareas y Recordatorios) */
.expense-preview-modern #tab_child_expenses > p.bold {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    color: #64748b;
    margin: 20px 0 0;
    padding: 18px;
    text-align: center;
}

@media (max-width: 991px) {
    .expense-preview-modern > .panel_s > .panel-body > .row.mtop20 {
        align-items: flex-start;
        flex-direction: column;
    }

    .expense-preview-modern ._buttons {
        display: flex;
        margin: 10px 0px;
        gap: 10px;
    }

    .expense-preview-modern ._buttons .pull-right {
        float: none !important;
    }

    .expense-preview-modern #tab_expense > .row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .expense-preview-modern .expense-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .expense-preview-modern #amountWrapper {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .expense-preview-modern #expenseReceipt .row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}

/* DataTables pagination on narrow screens */
@media (max-width: 1024px) {
    .dataTables_paginate {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }

    div.dataTables_paging {
        display: flex;
        flex-direction: column-reverse;
        justify-content: center;
        align-items: center;
    }

    .dataTables_paginate .paginate_button.previous > a,
    .dataTables_paginate .paginate_button.next > a {
        font-size: 0;
    }

    .dataTables_paginate .paginate_button.previous > a::after,
    .dataTables_paginate .paginate_button.next > a::after {
        font-size: 13px;
    }

    .dataTables_paginate .paginate_button.previous > a::after {
        content: "<-";
    }

    .dataTables_paginate .paginate_button.next > a::after {
        content: "->";
    }

    .dataTables_paginate .dt-page-jump {
        flex: 1 0 100%;
        order: 10;
        width: 100%;
    }

    .dataTables_paging .dt-page-jump-select {
        width: 100% !important;
        float: none;
    }
}

/* Prevent wrapper/menu from keeping stale computed min-heights */
#menu,
#setup-menu-wrapper {
    min-height: auto !important;
}

/* Anula el min-height que calcula mainWrapperHeightFix() (main.js) y en su
   lugar llena al menos la ventana, para que en vistas con poco contenido no
   se vea el fondo oscuro del body debajo. 63px = alto de #header. Solo en
   admin: el portal de clientes maneja su altura con body.customers #wrapper. */
body.admin #wrapper {
    min-height: calc(100vh - 63px) !important;
}

/* DataTables info wrapping: a la izquierda en pantallas grandes y centrado
   por debajo de 1024px, junto con la paginación apilada (ver arriba). */
div.dataTables_wrapper div.dataTables_info {
    text-align: left;
    text-wrap: auto;
}

@media (max-width: 1024px) {
    div.dataTables_wrapper div.dataTables_info {
        text-align: center;
    }
}

/* DataTables pagination: botones separados y redondeados en lugar de la
   barra de cuadros pegados de Bootstrap. */
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0;
}

.dataTables_paginate .pagination > li > a,
.dataTables_paginate .pagination > li > span {
    float: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    margin-left: 0;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px !important;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.dataTables_paginate .pagination > li > a:hover,
.dataTables_paginate .pagination > li > a:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.dataTables_paginate .pagination > .active > a,
.dataTables_paginate .pagination > .active > a:hover,
.dataTables_paginate .pagination > .active > a:focus {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .3);
}

.dataTables_paginate .pagination > .disabled > a,
.dataTables_paginate .pagination > .disabled > a:hover,
.dataTables_paginate .pagination > .disabled > a:focus {
    background: #fff;
    border-color: #f1f5f9;
    color: #cbd5e1;
    box-shadow: none;
}

/* Puntos suspensivos ("…") sin caja */
.dataTables_paginate .pagination > .disabled:not(.previous):not(.next) > a {
    border-color: transparent;
    background: transparent;
    color: #94a3b8;
    min-width: 20px;
    padding: 0 2px;
}

/* Móvil pequeño: botones más compactos para que ← 1 2 3 4 5 … 10 → quepa
   en una sola línea */
@media (max-width: 576px) {
    div.dataTables_wrapper div.dataTables_paginate ul.pagination {
        gap: 4px;
    }

    .dataTables_paginate .pagination > li > a,
    .dataTables_paginate .pagination > li > span {
        min-width: 28px;
        height: 30px;
        padding: 0 6px;
        border-radius: 6px !important;
        font-size: 12px;
    }

    .dataTables_paginate .pagination > .disabled:not(.previous):not(.next) > a {
        min-width: 14px;
        padding: 0;
    }
}

/* ── Creación rápida (top bar) ──────────────────────────────────────────
   Cuadrícula de opciones en lugar de una lista larga. Se abre hacia la
   derecha del botón para no salirse de la pantalla con el sidebar cerrado. */
.open > .dropdown-menu.quick-create-menu {
    display: grid;
}

.dropdown-menu.quick-create-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    left: 0;
    right: auto;
    width: min(560px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}

[dir="rtl"] .dropdown-menu.quick-create-menu {
    left: auto;
    right: 0;
}

.quick-create-menu > .dropdown-header {
    grid-column: 1 / -1;
    padding: 4px 8px 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.quick-create-menu > li > a {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 10px !important;
    border-radius: 8px;
    color: #334155 !important;
    line-height: 1.25;
    white-space: normal;
}

.quick-create-menu > li > a > span {
    margin: 0 !important;
}

.quick-create-menu > li > a i {
    flex: 0 0 auto;
    text-align: center;
}

.quick-create-menu > li > a:hover,
.quick-create-menu > li > a:focus {
    background: #f1f5f9;
    color: #0f172a !important;
}

@media (max-width: 1199px) {
    .dropdown-menu.quick-create-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(400px, calc(100vw - 32px));
    }
}

/* ── Botones ────────────────────────────────────────────────────────────
   Solo forma y comportamiento (colores, alturas y rellenos no cambian):
   radio a juego con tablas/paginación, secundario con grises slate, sombra
   sutil y anillo de foco solo con teclado (:focus-visible) en lugar del
   anillo grueso con separación que quedaba pegado tras cada clic. */
.btn,
.btn-group > .btn {
    border-radius: 8px;
}

.btn-sm,
.btn-xs,
.btn-group > .btn-sm,
.btn-group > .btn-xs,
.btn-group-sm > .btn,
.btn-group-xs > .btn {
    border-radius: 6px;
}

.btn {
    --app-btn-shadow: none;
    --app-btn-ring: rgba(37, 99, 235, .25);
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.btn-default,
.btn-primary,
.btn-success,
.btn-danger,
.btn-info,
.btn-warning {
    --app-btn-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    box-shadow: var(--app-btn-shadow);
}

.btn-success {
    --app-btn-ring: rgba(22, 163, 74, .25);
}

.btn-danger {
    --app-btn-ring: rgba(220, 38, 38, .25);
}

/* Secundario */
.btn-default {
    background: #fff;
    border-color: #e2e8f0;
    color: #334155;
}

.btn-default:hover,
.open > .dropdown-toggle.btn-default {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* Primario: el borde acompaña al fondo en hover */
.btn-primary:hover,
.open > .dropdown-toggle.btn-primary {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Sin anillo al hacer clic; el botón vuelve a su color al quitar el mouse */
.btn:focus,
.btn.focus,
.btn:active,
.btn.active,
.btn:active:focus,
.btn.active:focus,
.btn:active.focus,
.btn.active.focus,
.open > .dropdown-toggle.btn,
.open > .dropdown-toggle.btn:focus {
    box-shadow: var(--app-btn-shadow) !important;
    outline: none;
}

.btn-default:focus:not(:hover):not(:focus-visible) {
    background: #fff;
    border-color: #e2e8f0;
    color: #334155;
}

.btn-primary:focus:not(:hover):not(:focus-visible) {
    background: #2563eb;
    border-color: #2563eb;
}

/* Anillo solo al navegar con teclado */
.btn:focus-visible {
    box-shadow: 0 0 0 3px var(--app-btn-ring) !important;
}

/* ── Paneles (.panel_s) ─────────────────────────────────────────────────
   Borde más suave, radio mayor y sombra sutil, a juego con el marco de las
   tablas. Las variantes contextuales (kanban, pestañas de proyecto, etc.)
   tienen más especificidad y siguen aplicando. */
.panel_s {
    border-color: #e9eef4;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
}

.panel_s > .panel-body {
    border-radius: 12px;
}

.panel_s > .panel-heading {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* ── DataTables: barra de herramientas ──────────────────────────────────
   Mismo alto (34px) y radio (8px) que la paginación, controles separados
   en lugar de cajas pegadas. */
.dataTables_wrapper .dataTables_length select {
    height: 34px;
    border-radius: 8px;
    border-color: #e2e8f0;
}

.dataTables_wrapper .dt-buttons.btn-group {
    display: inline-flex;
    gap: 6px;
}

.dataTables_wrapper .dt-buttons.btn-group > .btn {
    float: none;
    display: inline-flex;
    align-items: center;
    height: 34px;
    margin-left: 0;
    border-color: #e2e8f0;
    border-radius: 8px !important;
    background: #fff;
    color: #475569;
}

.dataTables_wrapper .dt-buttons.btn-group > .btn:hover,
.dataTables_wrapper .dt-buttons.btn-group > .btn:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

/* Buscador: un solo campo redondeado con la lupa adentro */
.dataTables_wrapper .dataTables_filter .input-group {
    display: inline-flex;
    align-items: center;
    height: 34px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.dataTables_wrapper .dataTables_filter .input-group:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.dataTables_wrapper .dataTables_filter .input-group-addon {
    width: auto;
    padding: 0 2px 0 11px;
    background: transparent;
    border: 0;
    color: #94a3b8;
}

.dataTables_wrapper .dataTables_filter input {
    height: 32px;
    padding-left: 6px;
    background: transparent;
    border: 0 !important;
    box-shadow: none !important;
}

@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_filter .input-group {
        display: flex;
        width: 100%;
    }
}

/* ── DataTables: tabla ───────────────────────────────────────────────────
   Marco redondeado, encabezado con tinte suave sin separadores verticales
   y filas con líneas claras + hover. */
.dataTables_wrapper .table-responsive,
.panel-table-full .dataTables_wrapper .table-responsive {
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    border: 1px solid #e9eef4;
    border-radius: 12px;
}

.dataTables_wrapper .table-responsive table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.dataTables_wrapper table.dataTable thead > tr > th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid #e9eef4;
}

.dataTables_wrapper table.dataTable thead > tr > th.sorting_asc,
.dataTables_wrapper table.dataTable thead > tr > th.sorting_desc {
    background: #f1f5f9;
    color: #1e293b;
}

.dataTables_wrapper table.dataTable tbody > tr > td {
    border-top-color: #f1f5f9;
}

.dataTables_wrapper table.dataTable tbody > tr:not(.danger):not(.warning):not(.info):not(.success):hover > td {
    background: #f8fafc;
}

/* Scroll de la tabla delgado y sutil. scrollbar-width/color para Firefox y
   Chrome 121+; ::-webkit-scrollbar para Safari y Chrome anteriores. */
.dataTables_wrapper .table-responsive,
.dataTables_wrapper .dataTables_scrollBody {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.dataTables_wrapper .table-responsive::-webkit-scrollbar,
.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.dataTables_wrapper .table-responsive::-webkit-scrollbar-track,
.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-track {
    background: transparent;
}

.dataTables_wrapper .table-responsive::-webkit-scrollbar-thumb,
.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.dataTables_wrapper .table-responsive::-webkit-scrollbar-thumb:hover,
.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Selector de salto de página a juego con los botones */
.dt-page-jump .dt-page-jump-select {
    height: 34px;
    border-radius: 8px;
    border-color: #e2e8f0;
}

/* Dashboard screen options drawer */
.dashboard-screen-options-drawer .screen-options-btn {
    align-items: center;
    background: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px 0 0 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    gap: 7px;
    padding: 9px;
    position: fixed;
    right: 0;
    top: 90px;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-screen-options-drawer .screen-options-btn svg {
    margin-right: 0;
}

.dashboard-screen-options-drawer .screen-options-btn:hover,
.dashboard-screen-options-drawer .screen-options-btn:focus {
    background: #1e293b;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
    outline: none;
    transform: translateY(-1px);
}

.dashboard-screen-options-drawer .screen-options-overlay {
    background: rgba(15, 23, 42, 0.28);
    bottom: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 0;
    transition: opacity 0.2s ease;
    z-index: 998;
}

.dashboard-screen-options-drawer .screen-options-area {
    background: #fff;
    border: 0;
    border-left: 1px solid #e5e7eb;
    bottom: 0;
    box-shadow: -22px 0 50px rgba(15, 23, 42, 0.16);
    display: block !important;
    max-width: calc(100vw - 28px);
    overflow-y: auto;
    padding: 0;
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(105%);
    transition: transform 0.24s ease;
    visibility: hidden;
    width: 390px;
    z-index: 999;
}

body.dashboard-options-open .dashboard-screen-options-drawer .screen-options-overlay {
    opacity: 1;
    pointer-events: auto;
}

body.dashboard-options-open .dashboard-screen-options-drawer .screen-options-area {
    transform: translateX(0);
    visibility: visible;
}

.dashboard-screen-options-drawer .screen-options-drawer-header {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    padding: 20px 22px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.dashboard-screen-options-drawer .screen-options-drawer-eyebrow {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.dashboard-screen-options-drawer .screen-options-drawer-header h4 {
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.dashboard-screen-options-drawer .screen-options-close {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    width: 34px;
}

.dashboard-screen-options-drawer .screen-options-close:hover,
.dashboard-screen-options-drawer .screen-options-close:focus {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    outline: none;
}

.dashboard-screen-options-drawer #dashboard-options {
    padding: 18px 22px 22px;
}

.dashboard-screen-options-drawer #dashboard-options > .tw-flex {
    align-items: flex-start;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.dashboard-screen-options-drawer #dashboard-options h4 {
    display: none;
}

.dashboard-screen-options-drawer #dashboard-options a {
    align-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-weight: 600;
    line-height: 1.2;
    padding: 7px 11px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dashboard-screen-options-drawer #dashboard-options a:hover,
.dashboard-screen-options-drawer #dashboard-options a:focus {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
    outline: none;
    text-decoration: none;
}

.dashboard-screen-options-drawer #dashboard-options .checkbox {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    margin: 0 0 10px;
    min-height: 44px;
    padding: 10px 12px;
}

.dashboard-screen-options-drawer #dashboard-options .checkbox label {
    color: #1e293b;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    padding-left: 9px;
}

.dashboard-screen-options-drawer #dashboard-options .checkbox input[type="checkbox"] {
    margin-left: 0;
    margin-top: 0;
    position: static;
}

[dir="rtl"] .dashboard-screen-options-drawer .screen-options-btn {
    left: 32px;
    right: auto;
}

[dir="rtl"] .dashboard-screen-options-drawer .screen-options-area {
    border-left: 0;
    border-right: 1px solid #e5e7eb;
    left: 0;
    right: auto;
    transform: translateX(-105%);
}

[dir="rtl"] body.dashboard-options-open .dashboard-screen-options-drawer .screen-options-area {
    transform: translateX(0);
}

@media (max-width: 767px) {
    /* .dashboard-screen-options-drawer .screen-options-btn {
        right: 14px;
        top: 10px;
    } */

    .dashboard-screen-options-drawer .screen-options-area {
        width: 360px;
    }
}

/* Ticket scroll navigation controls */
.scroll-nav-group {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(203, 213, 225, 0.75);
    border-radius: 999px;
    bottom: 90px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
    opacity: 0.68;
    overflow: hidden;
    position: fixed;
    right: 18px;
    transform: none;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    z-index: 99;
}

.scroll-nav-group:hover,
.scroll-nav-group:focus-within {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    opacity: 1;
    transform: none;
}

.scroll-nav-group #toplink,
.scroll-nav-group #botlink {
    align-items: center;
    background: transparent;
    color: #64748b;
    display: flex;
    height: 30px;
    justify-content: center;
    margin: 0;
    padding: 0;
    position: static !important;
    width: 30px;
}

.scroll-nav-group #toplink {
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.scroll-nav-group #toplink:hover,
.scroll-nav-group #botlink:hover,
.scroll-nav-group #toplink:focus,
.scroll-nav-group #botlink:focus {
    background: #f8fafc;
    color: #0f172a;
    outline: none;
}

@media (max-width: 767px) {
    .scroll-nav-group {
        bottom: 72px;
        right: 10px;
        transform: none;
        transform-origin: right bottom;
    }

    .scroll-nav-group:hover,
    .scroll-nav-group:focus-within {
        transform: none;
    }
}

.table-responsive {
    overflow: auto;
    max-height: 60vh;
}

.home-activity .tab-content {
    height: auto;
}

/* Reusable summary KPI cards */
.app-kpi-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.app-kpi-card {
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
    display: flex;
    gap: 13px;
    min-height: 96px;
    padding: 16px;
}

.app-kpi-link {
    align-items: center;
    color: inherit;
    display: flex;
    gap: 13px;
    text-decoration: none;
    width: 100%;
}

.app-kpi-link:hover,
.app-kpi-link:focus {
    color: inherit;
    opacity: .82;
    text-decoration: none;
}

.app-kpi-icon {
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    color: #475569;
    display: inline-flex;
    flex: 0 0 40px;
    font-size: 17px;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.app-kpi-value {
    color: #0f172a;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 4px;
}

.app-kpi-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.app-kpi-note {
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    margin: 6px 0 0;
}

.app-kpi-card-success .app-kpi-icon {
    background: #e8f7ef;
    color: #15803d;
}

.app-kpi-card-danger .app-kpi-icon {
    background: #fef0f0;
    color: #dc2626;
}

.app-kpi-card-warning .app-kpi-icon {
    background: #fff6df;
    color: #b7791f;
}

.app-kpi-card-info .app-kpi-icon {
    background: #eaf4ff;
    color: #2563eb;
}

.app-kpi-card-muted .app-kpi-icon {
    background: #f4f4f5;
    color: #71717a;
}

/* Client portal project summary KPIs */
.client-project-summary {
    margin-bottom: 34px;
}

.client-project-summary .app-kpi-card {
    min-height: 108px;
}

.client-project-summary .app-kpi-card.client-project-summary-active {
    border-color: #bfdbfe;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
    background-color: #ecf5ff;
}

.client-project-summary .app-kpi-label {
    text-transform: none;
}

/* Client portal ticket summary KPIs */
.client-tickets-summary-header,
.client-tickets-list-heading {
    align-items: center;
    display: flex;
    gap: 12px;
}

.client-tickets-summary-header {
    margin-bottom: 14px;
}

.client-tickets-summary-icon {
    align-items: center;
    background: #eff6ff;
    border-radius: 8px;
    color: #2563eb;
    display: inline-flex;
    flex: 0 0 40px;
    font-size: 17px;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.client-tickets-summary-eyebrow {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.client-tickets-summary-header h4,
.client-tickets-list-heading h4 {
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.client-tickets-summary {
    margin-bottom: 34px;
}

.client-tickets-summary .app-kpi-card {
    min-height: 108px;
}

.client-tickets-summary .app-kpi-card.client-tickets-summary-active {
    border-color: #bfdbfe;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.client-tickets-summary .app-kpi-label {
    text-transform: none;
}

.client-tickets-list-header {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.client-tickets-list-header .new-ticket {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

@media (max-width: 767px) {
    .client-tickets-list-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-tickets-list-header .new-ticket {
        justify-content: center;
        width: 100%;
    }
}

/* Client portal sticky footer */
body.customers {
    min-height: 100vh;
}

body.customers #wrapper {
    flex: 1 0 auto;
    margin-bottom: 50px;
}

body.customers .footer {
    flex-shrink: 0;
    margin-top: auto;
    position: fixed;
    bottom: 0;
}
@media (min-width: 1200px) {
    .container {
        width: 80%;
    }
}

/* Client portal project overview */
.client-project-overview {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
}

.client-project-overview > [class*="col-"] {
    margin-bottom: 16px;
}

.client-project-overview-card,
.client-project-description-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
    margin-top: 4px;
    overflow: hidden;
}

.client-project-overview-card {
    height: 100%;
    padding-bottom: 16px;
}

.client-project-overview-card-header,
.client-project-description-header {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    padding: 16px 18px;
}

.client-project-overview-meta {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px 18px 0;
}

.client-project-overview-meta > div {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    display: block !important;
    min-width: 0;
    padding: 11px 12px;
}

.client-project-overview-meta p {
    color: #0f172a;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
}

.client-project-overview-meta p.bold {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.client-project-overview-progress .client-project-overview-card > .tw-rounded-md,
.client-project-overview-progress .project-progress-bars > .tw-rounded-md {
    background: #f8fafc;
    border-color: #eef2f7;
    border-radius: 8px;
    margin: 14px 18px 0;
    padding: 14px;
}

.client-project-overview-progress .progress {
    background: #e2e8f0;
    border-radius: 999px;
    box-shadow: none;
    height: 7px;
    overflow: hidden;
}

.client-project-overview-progress .progress-bar {
    border-radius: 999px;
}

.client-project-overview-finance {
    height: auto;
    padding: 0 18px 18px;
}

.client-project-overview-finance > .row {
    margin-left: -6px;
    margin-right: -6px;
}

.client-project-overview-finance > .row > [class*="col-"],
.client-project-overview-finance .row .row > [class*="col-"] {
    padding-left: 6px;
    padding-right: 6px;
}

.client-project-overview-finance .row .row > [class*="col-"] {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    margin-bottom: 12px;
    min-height: 78px;
    padding-bottom: 12px;
    padding-top: 12px;
}

.client-project-overview-finance p:first-child {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.client-project-overview-finance p:last-child {
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
}

.client-project-overview .col-md-12 > hr {
    display: none;
}

.client-project-description-icon {
    align-items: center;
    background: #eff6ff;
    border-radius: 8px;
    color: #2563eb;
    display: inline-flex;
    flex: 0 0 40px;
    font-size: 17px;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.client-project-description-eyebrow {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.client-project-overview-card-header h4,
.client-project-description-header h4 {
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.client-project-description-body {
    color: #334155;
    font-size: 14px;
    line-height: 1.65;
    padding: 18px;
}

.client-project-description-body > :last-child {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .client-project-overview {
        display: block;
    }

    .client-project-overview-meta {
        grid-template-columns: 1fr;
    }

    .client-project-overview-card-header,
    .client-project-description-header {
        align-items: flex-start;
    }
}

/* Client portal ticket detail */
.client-ticket-view {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
}

.client-ticket-view > [class*="col-"] {
    margin-bottom: 16px;
}

.client-ticket-project-alert {
    background: #eff6ff;
    border-color: #bfdbfe;
    border-radius: 8px;
    color: #1e3a8a;
}

.client-ticket-project-alert a {
    color: #1d4ed8;
}

.client-ticket-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
    margin-bottom: 18px;
    overflow: hidden;
}

.client-ticket-card .panel-body,
.client-ticket-card .panel-footer {
    border: 0;
}

.client-ticket-card-header {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    padding: 16px 18px;
}

.client-ticket-card-icon {
    align-items: center;
    background: #eff6ff;
    border-radius: 8px;
    color: #2563eb;
    display: inline-flex;
    flex: 0 0 40px;
    font-size: 17px;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.client-ticket-card-eyebrow {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.client-ticket-card-header h4 {
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.client-ticket-subject {
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 14px;
    overflow-wrap: anywhere;
}

.client-ticket-info-card .panel-body,
.client-ticket-compose-card .panel-body,
.client-ticket-thread-item .panel-body {
    padding: 18px;
}

.client-ticket-info-list {
    display: grid;
    gap: 10px;
}

.client-ticket-info-list > p,
.client-ticket-status-row {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    color: #64748b;
    line-height: 1.45;
    margin: 0;
    padding: 11px 12px;
}

.client-ticket-info-list span:not(.label) {
    color: #0f172a;
    font-weight: 500;
}

.client-ticket-status-row .label {
    border-radius: 999px;
    display: inline-flex;
    gap: 6px;
    line-height: 1.2;
    padding: 6px 10px;
}

.client-ticket-compose-card textarea.form-control {
    background: #f8fafc;
    border-color: #e2e8f0;
    border-radius: 8px;
    box-shadow: none;
    min-height: 150px;
}

.client-ticket-compose-card .attachments_area {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 14px;
}

.client-ticket-compose-card .panel-footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 14px 18px;
}

.client-ticket-thread-item.client-reply {
    border-left: 4px solid #2563eb;
}

.client-ticket-author {
    color: #0f172a;
    font-weight: 800;
}

.client-ticket-author p {
    margin-bottom: 5px;
    overflow-wrap: anywhere;
}

.client-ticket-message {
    color: #334155;
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.client-ticket-message-separator {
    background: #e5e7eb;
    display: block;
    height: 1px;
    margin: 14px 0;
    width: 100%;
}

.client-ticket-message a[href*="download/file/ticket"] {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #1d4ed8;
    display: inline-flex;
    gap: 8px;
    margin: 4px 8px 4px 0;
    padding: 8px 10px;
}

.client-ticket-message .preview_image img {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-width: 100%;
}

.client-ticket-thread-footer {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    padding: 12px 18px;
}

.client-ticket-tabs .nav-tabs {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: inline-flex;
    gap: 6px;
    padding: 6px;
}

.client-ticket-tabs .nav-tabs > li {
    margin: 0;
}

.client-ticket-tabs .nav-tabs > li > a {
    align-items: center;
    border: 0;
    border-radius: 6px;
    color: #64748b;
    display: inline-flex;
    font-weight: 800;
    gap: 8px;
    line-height: 1.2;
    margin: 0;
    padding: 10px 14px;
}

.client-ticket-tabs .nav-tabs > li > a:hover,
.client-ticket-tabs .nav-tabs > li > a:focus {
    background: #eef2f7;
    color: #0f172a;
}

.client-ticket-tabs .nav-tabs > li.active > a,
.client-ticket-tabs .nav-tabs > li.active > a:hover,
.client-ticket-tabs .nav-tabs > li.active > a:focus {
    background: #fff;
    border: 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    color: #2563eb;
}

.client-ticket-tab-content {
    clear: both;
    margin-bottom: 50px;
    max-height: 500px;
    overflow: auto;
}

.client-ticket-scroll-nav {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(203, 213, 225, 0.75);
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
    opacity: 0.72;
    overflow: hidden;
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    z-index: 99;
}

.client-ticket-scroll-nav:hover,
.client-ticket-scroll-nav:focus-within {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    opacity: 1;
}

.client-ticket-scroll-nav #toplink,
.client-ticket-scroll-nav #botlink {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    bottom: auto;
    color: #64748b;
    display: flex;
    font-size: 13px;
    height: 32px;
    justify-content: center;
    left: auto;
    margin: 0;
    padding: 0;
    position: static !important;
    right: auto;
    text-decoration: none;
    top: auto;
    width: 32px;
}

.client-ticket-scroll-nav #toplink {
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.client-ticket-scroll-nav #toplink:hover,
.client-ticket-scroll-nav #botlink:hover,
.client-ticket-scroll-nav #toplink:focus,
.client-ticket-scroll-nav #botlink:focus {
    background: #f8fafc;
    color: #0f172a;
    outline: none;
}

@media (max-width: 991px) {
    .client-ticket-view {
        display: block;
    }
}

@media (max-width: 767px) {
    .client-ticket-card-header {
        align-items: flex-start;
    }

    .client-ticket-author {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .client-ticket-tabs .nav-tabs {
        display: flex;
        width: 100%;
    }

    .client-ticket-tabs .nav-tabs > li {
        flex: 1;
    }

    .client-ticket-tabs .nav-tabs > li > a {
        justify-content: center;
        width: 100%;
    }
}

/* Task filters use the same cards and labelled controls as the reports workspace. */
.task-filters {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 0 0 20px;
    padding: 14px 16px;
    clear: both;
}

.task-filters-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.task-filters-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: #334155;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
    padding: 4px 0;
}

.task-filters-toggle:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 4px;
}

.task-filters-chevron {
    font-size: 10px;
    transition: transform .15s ease;
}

.task-filters-toggle[aria-expanded="true"] .task-filters-chevron {
    transform: rotate(180deg);
}

.task-filters-count {
    background: #dbeafe;
    border-radius: 12px;
    color: #1d4ed8;
    font-size: 12px;
    padding: 2px 7px;
}

.task-filters-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 16px;
}

.task-filter-field {
    min-width: 0;
}

.task-filter-field > label {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.task-filter-field .bootstrap-select > .btn {
    min-height: 40px;
    border-radius: 6px;
}

.task-filter-active .bootstrap-select > .btn {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.task-filter-field .bootstrap-select .dropdown-menu > li > a {
    padding: 10px 16px;
    white-space: normal;
}

.task-filter-field .bootstrap-select .bs-searchbox input {
    min-height: 36px;
}

.task-filters-extra.checkbox {
    margin: 14px 0 0;
}

@media (max-width: 991px) {
    .task-filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .task-filters {
        padding: 12px;
    }

    .task-filters-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .task-filters-grid {
        grid-template-columns: 1fr;
    }
}

/* Sales reports workspace */
.sales-report-page {
    color: #0f172a;
}

.sales-report-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    min-width: 0;
    padding: 18px;
}

.sales-report-picker-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, .9fr) minmax(280px, .85fr);
}

.sales-report-option-section {
    min-width: 0;
}

.sales-report-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.sales-report-options li {
    min-width: 0;
}

.sales-report-nav-link {
    align-items: center;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    color: #64748b;
    display: flex;
    font-weight: 700;
    line-height: 1.3;
    min-height: 38px;
    padding: 9px 11px;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
    width: auto;
}

.sales-report-nav-link:hover,
.sales-report-nav-link:focus,
.sales-report-nav-link[data-active="true"] {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #0f172a;
    text-decoration: none;
}

.sales-report-nav-link[data-active="true"] svg,
.sales-report-nav-link:hover svg,
.sales-report-nav-link:focus svg {
    color: #2563eb;
}

.sales-report-filter-card label {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.sales-report-filter-section {
    border-left: 1px solid #e5e7eb;
    padding-left: 18px;
}

.sales-report-filter-card .form-group,
.sales-report-filter-card #income-years,
.sales-report-filter-card #date-range {
    margin-bottom: 14px;
}

.sales-report-result-title {
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
    margin: 24px 0 12px;
}

.sales-report-result-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.sales-report-result-card .panel-body {
    padding: 18px;
}

.sales-report-result-card canvas {
    max-width: 100%;
}

@media (max-width: 1199px) {
    .sales-report-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sales-report-filter-section {
        border-left: 0;
        border-top: 1px solid #e5e7eb;
        grid-column: 1 / -1;
        padding-left: 0;
        padding-top: 16px;
    }
}

@media (max-width: 767px) {
    .sales-report-picker-grid {
        grid-template-columns: 1fr;
    }

    .sales-report-card {
        padding: 14px;
    }
}

/* Task add/edit modal: wider dialog, two-column layout */
@media (min-width: 992px) {
    #_task_modal .task-add-edit-modal-dialog {
        width: 95%;
        max-width: 1400px;
    }

    #_task_modal .task-modal-side {
        border-left: 1px solid #e5e7eb;
    }
}

#_task_modal .task-modal-side .custom-fields-form-row > [class*="col-md-"] {
    width: 100%;
}

/* Task add/edit modal: subject shown as a title instead of a boxed input */
#_task_modal .task-title-field > .control-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

#_task_modal .task-title-field input#name {
    height: auto;
    padding: 4px 0 6px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #0f172a;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    transition: border-color 0.15s ease;
}

#_task_modal .task-title-field input#name::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

#_task_modal .task-title-field input#name:hover {
    border-bottom-color: #e2e8f0;
}

#_task_modal .task-title-field input#name:focus {
    border-bottom-color: #2563eb;
    outline: 0;
}

#_task_modal .task-title-field.has-error input#name {
    border-bottom-color: #ef4444;
}

/* Task view modal: same width as the add/edit modal (overrides the task_modal_class option) */
@media (min-width: 992px) {
    #task-modal > .modal-dialog {
        width: 95%;
        max-width: 1400px;
    }
}

/* Task view modal: header (title, context line, status + actions) */
#task-modal .task-single-header {
    padding: 20px 24px 16px;
}

#task-modal .task-view-title {
    margin: 0 32px 6px 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

#task-modal .task-view-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 4px;
    color: #64748b;
    font-size: 13px;
}

#task-modal .task-view-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#task-modal .task-view-meta-item + .task-view-meta-item::before {
    content: "·";
    margin: 0 8px;
    color: #cbd5e1;
}

#task-modal .task-view-meta-strong {
    color: #334155;
    font-weight: 500;
}

#task-modal .task-view-meta-sub {
    margin-left: 6px;
    color: #64748b;
}

#task-modal .task-view-billed {
    margin: 6px 0 0;
    font-size: 13px;
}

#task-modal .task-view-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

#task-modal .task-view-actions .btn {
    margin: 0;
}

#task-modal .task-view-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--task-status-color) 35%, #fff);
    border-radius: 999px;
    background: color-mix(in srgb, var(--task-status-color) 10%, #fff);
    color: var(--task-status-color);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

#task-modal .task-view-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--task-status-color);
}

#task-modal .task-view-status .fa-caret-down {
    opacity: 0.7;
}

#task-modal .task-view-timer-btn .fa-clock {
    color: #16a34a;
}

#task-modal .task-view-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Task view modal: sidebar sections (people, details, time, reminders, collapsibles) */
#task-modal .task-view-sidebar {
    padding-top: 16px;
}

#task-modal .task-view-section {
    padding: 14px 4px;
    border-bottom: 1px solid #eef2f6;
}

#task-modal .task-view-section:last-child {
    border-bottom: 0;
}

#task-modal .task-view-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

#task-modal .task-view-section-title-spaced {
    margin-top: 16px;
}

#task-modal .task-view-section-icon {
    width: 18px;
    height: 18px;
    color: #64748b;
}

#task-modal .task-view-count {
    padding: 0 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
}

#task-modal .task-view-section-action {
    margin-left: auto;
    font-size: 13px;
    font-weight: 500;
}

/* Label / value rows */
#task-modal .task-view-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 32px;
    margin: 0;
    font-size: 13px;
}

#task-modal .task-view-row-label {
    flex-shrink: 0;
    color: #64748b;
}

#task-modal .task-view-row-value {
    min-width: 0;
    color: #0f172a;
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

#task-modal .task-view-row-stacked {
    display: block;
    padding-top: 6px;
}

#task-modal .task-view-row-stacked .task-view-row-label {
    display: block;
    margin-bottom: 4px;
}

#task-modal .task-view-row-note {
    margin: -4px 0 4px;
    color: #94a3b8;
    font-size: 12px;
    text-align: right;
}

#task-modal .task-view-row .task-info-inline-input-edit {
    width: 110px;
    margin: 0;
    padding: 2px 0;
    border-bottom: 1px dashed transparent;
    background: transparent;
    color: #0f172a;
    font-weight: 500;
    text-align: right;
    cursor: pointer;
}

#task-modal .task-view-row .task-info-inline-input-edit:hover,
#task-modal .task-view-row .task-info-inline-input-edit:focus {
    border-bottom-color: #94a3b8;
}

#task-modal .task-view-row-overdue .task-view-row-value,
#task-modal .task-view-row-overdue .task-info-inline-input-edit {
    color: #dc2626;
}

/* Collapsible sections (Vivify, other fields, billing) */
#task-modal .task-view-collapsible > summary {
    margin: 0;
    color: #475569;
    cursor: pointer;
    list-style: none;
}

#task-modal .task-view-collapsible > summary::-webkit-details-marker {
    display: none;
}

#task-modal .task-view-collapsible > summary::after {
    content: "\f078";
    margin-left: auto;
    color: #94a3b8;
    font-family: "Font Awesome 6 Free";
    font-size: 11px;
    font-weight: 900;
    transition: transform 0.15s ease;
}

#task-modal .task-view-collapsible[open] > summary {
    margin-bottom: 8px;
}

#task-modal .task-view-collapsible[open] > summary::after {
    transform: rotate(180deg);
}

/* Task view modal: main column blocks (description, work log, attachments, checklist, comments) */
#task-modal .task-single-col-left {
    padding-top: 8px;
}

#task-modal .task-view-block {
    padding: 18px 0;
    border-bottom: 1px solid #eef2f6;
}

#task-modal .task-view-block:last-child {
    border-bottom: 0;
}

#task-modal .task-view-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: inherit;
    text-decoration: none;
}

#task-modal .task-view-block-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
}

#task-modal .task-view-block-subtitle {
    color: #64748b;
    font-size: 13px;
    font-weight: 400;
}

#task-modal .task-view-block-subtitle strong {
    color: #16a34a;
    font-weight: 600;
}

#task-modal .task-view-block-icon-action {
    color: #94a3b8;
}

#task-modal .task-view-block-icon-action:hover {
    color: #2563eb;
}

#task-modal .task-view-block-chevron {
    color: #94a3b8;
    font-size: 12px;
}

#task-modal .task-view-empty {
    padding: 12px 0;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
}

/* Work log */
#task-modal .task-view-block-timesheets .add-timesheet .panel {
    border-color: #dbeafe;
    background: #f8fbff;
}

#task-modal .task-view-log {
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: none;
}

#task-modal .task-view-log > .panel-body {
    padding: 10px 14px;
}

#task-modal .task-view-log-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    font-size: 13px;
}

#task-modal .task-view-log-author {
    color: #0f172a;
    font-weight: 600;
}

#task-modal .task-view-log .timesheet-time-spent {
    color: #16a34a;
    font-weight: 500;
}

#task-modal .task-view-log .timesheet-date {
    color: #94a3b8;
}

#task-modal .task-view-log .timesheet-note {
    margin-top: 4px;
    color: #334155;
    font-size: 13px;
    line-height: 1.5;
}

#task-modal .task-view-logs-toggle {
    display: block;
    padding: 6px 0 0;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

/* Attachments */
#task-modal .task-view-upload-extra {
    display: flex;
    align-items: center;
    gap: 6px;
}

#task-modal .task-view-dropzone.dropzone {
    min-height: 0;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

#task-modal .task-view-dropzone.dropzone .dz-message {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

#task-modal .task-view-dropzone.dropzone:hover {
    border-color: #2563eb;
}

#task-modal .task-view-row-empty {
    color: #cbd5e1;
    font-weight: 400;
}

/* Task view modal: tags as pills + an always-visible "+ Add" pill */
#task-modal .task-info-tags-edit ul.tagit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
}

#task-modal .task-info-tags-edit ul.tagit li {
    float: none;
    margin: 0;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-choice,
#task-modal .task-view-tags-readonly .label-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-choice-editable {
    padding-right: 24px;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-choice:hover {
    border-color: #93c5fd;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-choice .tagit-label {
    color: inherit;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-choice a.tagit-close {
    position: absolute;
    top: 50%;
    right: 8px;
    margin: 0;
    transform: translateY(-50%);
    color: #60a5fa;
    line-height: 1;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-choice a.tagit-close:hover {
    color: #1d4ed8;
}

/* "+ Add" pill: the tag-it input lives inside it */
#task-modal .task-info-tags-edit ul.tagit li.tagit-new {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0;
    border: 1px dashed #cbd5e1;
    border-radius: 999px;
    background: #f1f5f9;
    cursor: pointer;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-new:hover {
    border-color: #94a3b8;
    background: #e2e8f0;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-new::before {
    content: var(--tags-add-label, "+");
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-new input[type="text"] {
    width: 78px !important;
    height: 24px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: transparent;
    font-size: 12px;
    cursor: pointer;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-new input[type="text"]::placeholder {
    color: transparent;
}

/* While typing: hide the label and show the text */
#task-modal .task-info-tags-edit ul.tagit li.tagit-new:focus-within {
    border-style: solid;
    border-color: #93c5fd;
    background: #fff;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-new:focus-within::before {
    content: none;
}

#task-modal .task-info-tags-edit ul.tagit li.tagit-new:focus-within input[type="text"] {
    width: 140px !important;
    color: #0f172a;
    cursor: text;
}

#task-modal .task-view-tags-readonly .tags-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Task view modal: long description collapsed with a fade + "show more" */
#task-modal .task-view-description-body {
    position: relative;
}

#task-modal .task-view-description-body.is-clamped {
    max-height: 300px;
    overflow: hidden;
}

#task-modal .task-view-description-body.is-clamped::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 56px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 85%);
    pointer-events: none;
}

#task-modal .task-view-description-body:has(.mce-content-body) {
    max-height: none;
    overflow: visible;
}

#task-modal .task-view-description-body:has(.mce-content-body)::after {
    content: none;
}

#task-modal .task-view-description-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 500;
}

#task-modal .task-view-description-toggle:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    text-decoration: none;
}

#task-modal .task-view-description-toggle.hide {
    display: none;
}

/* Task view modal: attachment cards (attachments block and comments share the same markup) */
#task-modal .task-attachment-wrapper {
    max-height: none;
    margin: 0;
    overflow: visible;
}

#task-modal li.task-attachment {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: none;
    margin-bottom: 12px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#task-modal li.task-attachment:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

#task-modal li.task-attachment > .clearfix {
    display: none;
}

/* Preview area (image, video or file) goes first */
#task-modal li.task-attachment > div:not(.task-attachment-user) {
    order: 1;
}

#task-modal .task-attachment .preview-image img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
}

#task-modal .task-attachment video {
    display: block;
    max-height: 180px;
    background: #0f172a;
}

#task-modal .task-attachment .task-attachment-no-preview {
    margin: 0;
    padding: 12px;
    text-align: left;
}

#task-modal .task-attachment .task-attachment-no-preview a {
    position: relative;
    display: block;
    min-height: 38px;
    padding-left: 48px;
    overflow: hidden;
    color: #0f172a;
    font-size: 13px;
    font-weight: 500;
    line-height: 38px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#task-modal .task-attachment .task-attachment-no-preview a:hover {
    color: #2563eb;
}

#task-modal .task-attachment .task-attachment-no-preview i.mime {
    position: absolute;
    top: 0;
    left: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 8px;
    background-color: #f1f5f9;
    background-position: center;
}

/* Uploader + date line, with the remove button at the end */
#task-modal .task-attachment .task-attachment-user {
    order: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 7px 12px;
    float: none !important;
    border-top: 1px solid #f1f5f9;
    border-bottom: 0;
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}

#task-modal .task-attachment .task-attachment-user a {
    overflow: hidden;
    color: #475569;
    text-overflow: ellipsis;
}

#task-modal .task-attachment .task-attachment-user .text-has-action {
    font-size: 12px;
}

#task-modal .task-attachment .task-attachment-user > a.pull-right {
    order: 10;
    float: none !important;
    margin-left: auto;
    padding-left: 8px;
    color: #94a3b8;
}

#task-modal .task-attachment .task-attachment-user > a.pull-right:hover {
    color: #dc2626;
}

/* Inside comments: compact cards without the fixed 135px height */
#task-modal .task-comment .task-attachment {
    min-height: 0;
    max-height: none;
    padding: 0;
}

#task-modal .task-comment .task-attachment-col {
    padding-right: 12px;
}

/* Work log: author avatar */
#task-modal .task-view-log-avatar {
    flex-shrink: 0;
    margin-right: 12px;
}

#task-modal .task-view-log-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Task view modal: remove (×) badge on assignee/follower avatars, on the top-right corner
   so it is never hidden behind the next row of avatars */
#task-modal .task_users_wrapper .task-user:hover {
    z-index: 3;
}

#task-modal .task_users_wrapper .remove-task-user {
    top: -4px;
    right: -4px;
    left: auto;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #fecaca;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
    font-size: 10px;
    line-height: 1;
    transition: opacity 0.15s ease;
}

#task-modal .task_users_wrapper .remove-task-user:hover {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff !important;
}

/* Work log cards: calm at rest, subtle shadow and coloured actions on hover */
#task-modal .task-view-log {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#task-modal .task-view-log:hover {
    border-color: #d8dee6;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

#task-modal .task-view-log .task-single-delete-timesheet,
#task-modal .task-view-log .task-single-edit-timesheet {
    color: #475569 !important;
    transition: color 0.15s ease;
}

#task-modal .task-view-log:hover .task-single-delete-timesheet {
    color: #dc2626 !important;
}

#task-modal .task-view-log:hover .task-single-edit-timesheet {
    color: #2563eb !important;
}

/* Client portal: task detail page (clients/project?group=project_tasks&taskid=),
   same visual language as the staff #task-modal task view but scoped to its own id
   since this is a full page, not a Bootstrap modal */
#client-task-view {
    padding-top: 4px;
}

#client-task-view .task-view-title {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

#client-task-view .task-view-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 4px;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 13px;
}

#client-task-view .task-view-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#client-task-view .task-view-meta-item + .task-view-meta-item::before {
    content: "·";
    margin: 0 8px;
    color: #cbd5e1;
}

#client-task-view .task-view-billed {
    margin: 6px 0 0;
    font-size: 13px;
}

#client-task-view .task-view-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--task-status-color, #64748b) 35%, #fff);
    border-radius: 999px;
    background: color-mix(in srgb, var(--task-status-color, #64748b) 10%, #fff);
    color: var(--task-status-color, #64748b);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

#client-task-view .task-view-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--task-status-color, #64748b);
}

/* Total logged time: highlighted stat chip next to the title */
#client-task-view .task-view-time-highlight {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

#client-task-view .task-view-time-highlight i {
    font-size: 12px;
}

/* Sidebar: assignees + details cards */
#client-task-view .task-view-sidebar {
    padding-top: 8px;
}

#client-task-view .task-view-section {
    padding: 14px 16px;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    margin-bottom: 16px;
    background: #fff;
}

#client-task-view .task-view-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

#client-task-view .task-view-section-icon {
    width: 18px;
    height: 18px;
    color: #64748b;
}

#client-task-view .task-view-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 30px;
    margin: 0;
    font-size: 13px;
}

#client-task-view .task-view-row-label {
    flex-shrink: 0;
    color: #64748b;
}

#client-task-view .task-view-row-value {
    min-width: 0;
    color: #0f172a;
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

#client-task-view .task-view-row-value.task-view-row-value-highlight {
    color: #16a34a;
    font-weight: 600;
}

#client-task-view .task-view-row-overdue .task-view-row-value {
    color: #dc2626;
}

/* Main column blocks (description, work log, attachments, checklist, comments) */
#client-task-view .task-view-block {
    padding: 18px 0;
    border-bottom: 1px solid #eef2f6;
}

#client-task-view .task-view-block:first-child {
    padding-top: 0;
}

#client-task-view .task-view-block:last-child {
    border-bottom: 0;
}

#client-task-view .task-view-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

#client-task-view .task-view-block-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
}

#client-task-view .task-view-count {
    padding: 0 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
}

/* Description: collapsed with a fade + "show more" */
#client-task-view .task-view-description-body {
    position: relative;
}

#client-task-view .task-view-description-body.is-clamped {
    max-height: 220px;
    overflow: hidden;
}

#client-task-view .task-view-description-body.is-clamped::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 56px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 85%);
    pointer-events: none;
}

#client-task-view .task-view-description-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 500;
}

#client-task-view .task-view-description-toggle:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    text-decoration: none;
}

#client-task-view .task-view-description-toggle.hide {
    display: none;
}

/* Work log entries */
#client-task-view .task-view-log {
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#client-task-view .task-view-log:hover {
    border-color: #d8dee6;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

#client-task-view .task-view-log-body {
    display: flex;
    padding: 10px 14px;
}

#client-task-view .task-view-log-avatar {
    flex-shrink: 0;
    margin-right: 12px;
}

#client-task-view .task-view-log-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

#client-task-view .task-view-log-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    font-size: 13px;
}

#client-task-view .task-view-log-author {
    color: #0f172a;
    font-weight: 600;
}

#client-task-view .task-view-log-time {
    color: #16a34a;
    font-weight: 500;
}

#client-task-view .task-view-log-date {
    color: #94a3b8;
}

#client-task-view .task-view-log-note {
    margin-top: 4px;
    color: #334155;
    font-size: 13px;
    line-height: 1.5;
}

#client-task-view .task-view-log-note.is-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

#client-task-view .task-view-log-note-toggle {
    display: inline-block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 500;
}

#client-task-view .task-view-logs-toggle {
    display: block;
    padding: 6px 0 0;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

#client-task-view .task-view-empty {
    padding: 12px 0;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
}

/* Assignees */
#client-task-view .task_users_wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#client-task-view .task-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border: 1px solid #eef2f6;
    border-radius: 999px;
    background: #f8fafc;
    font-size: 13px;
    color: #334155;
}

#client-task-view .task-user img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 767px) {
    #client-task-view .task-view-sidebar {
        padding-top: 20px;
    }
}

/* Filter dropdown items of filter_by_template.php (Sonar Web:S6844: <a> -> <button>) */
._filter_data .dropdown-menu > li > button {
    display: block;
    width: 100%;
    padding: 3px 20px;
    clear: both;
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    line-height: 1.42857143;
    color: #333;
    text-align: left;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

._filter_data .dropdown-menu > li > button:hover,
._filter_data .dropdown-menu > li > button:focus {
    color: #262626;
    text-decoration: none;
    background-color: #f5f5f5;
}

._filter_data .dropdown-menu > .active > button,
._filter_data .dropdown-menu > .active > button:hover,
._filter_data .dropdown-menu > .active > button:focus {
    color: #fff;
    text-decoration: none;
    background-color: #337ab7;
    outline: 0;
}
