body {
    background-color: #f8f9fa;
}

/* ===== RAPOARTE ===== */

.report-page {
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
}

.report-toolbar {
    margin-bottom: 10px;
}

.report-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.compact-table-wrapper,
.text-report-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.compact-table {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    line-height: 1.15;
    white-space: nowrap;
    margin-bottom: 0;
}

.compact-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e9ecef;
    border-bottom: 1px solid #adb5bd;
    padding: 0.32rem 0.45rem;
    vertical-align: middle;
}

.compact-table td {
    padding: 0.22rem 0.45rem;
    vertical-align: middle;
}

.compact-table tr:nth-child(even) td {
    background-color: #fcfcfc;
}

.text-report {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.76rem;
    line-height: 1.18;
    white-space: pre;
    margin: 0;
    padding: 0.6rem;
    background: white;
    color: #212529;
}

.report-title {
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.report-description {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
    color: #6c757d;
}

.btn-compact {
    padding: 0.28rem 0.5rem;
    font-size: 0.82rem;
}

.num-col {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.btn-edit-custom {
    color: #fd7e14;
    border: 1px solid #fd7e14;
    background: transparent;
}

.btn-edit-custom:hover,
.btn-edit-custom:focus {
    color: #ffffff;
    background: #fd7e14;
    border-color: #fd7e14;
}

.btn-edit-custom:active {
    color: #ffffff;
    background: #e46f12;
    border-color: #e46f12;
}

/* ===== INDEX ===== */

.index-card .card-body {
    padding: 0.8rem;
}

.index-card .card-title {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.index-card .card-text {
    font-size: 0.82rem;
    margin-bottom: 0.6rem;
}

/* ===== PROGRAM MEDIC ===== */

.scheduler-page {
    max-width: 1400px;
    margin: 0 auto;
}

.scheduler-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.scheduler-title {
    font-size: 1.15rem;
    margin-bottom: 0.15rem;
}

.scheduler-subtitle {
    font-size: 0.88rem;
    color: #6c757d;
}

.scheduler-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.04);
    margin-bottom: 12px;
}

.scheduler-form-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.scheduler-field label {
    font-size: 0.84rem;
    margin-bottom: 0.3rem;
}

.scheduler-helper-text {
    margin-top: 10px;
    font-size: 0.84rem;
    color: #6c757d;
}

.scheduler-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scheduler-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.scheduler-status-card {
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #dee2e6;
    background: #ffffff;
}

.status-label {
    font-size: 0.82rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.status-value {
    font-size: 0.96rem;
    font-weight: 600;
}

.status-ok {
    border-color: #badbcc;
    background: #f0fff4;
}

.status-bad {
    border-color: #f5c2c7;
    background: #fff5f5;
}

.scheduler-tables-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.scheduler-table-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.04);
}

.table-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.scheduler-row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.delete-summary {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

/* ===== CALENDAR PROGRAMĂRI ===== */

.calendar-page {
    max-width: 1500px;
    margin: 0 auto;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.calendar-title {
    font-size: 1.15rem;
    margin-bottom: 0.15rem;
}

.calendar-subtitle {
    font-size: 0.88rem;
    color: #6c757d;
}

.calendar-current-period {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.calendar-grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(190px, 1fr));
    gap: 8px;
    min-width: 1330px;
}

.calendar-weekday {
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    text-align: center;
}

.calendar-cell {
    min-height: 175px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-cell-muted {
    background: #f5f5f5;
    opacity: 0.65;
}

.calendar-cell-today {
    border: 2px solid #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
}

.calendar-day-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.calendar-day-number {
    font-weight: 700;
    font-size: 0.9rem;
}

.calendar-day-link {
    font-size: 0.72rem;
    text-decoration: none;
}

.calendar-day-total {
    font-size: 0.72rem;
    color: #6c757d;
    font-weight: 600;
}

.calendar-day-entries {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-entry {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.70rem;
    line-height: 1.15;
    padding: 4px 5px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.calendar-entry-line1,
.calendar-entry-line2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.calendar-entry-finished {
    font-size: 0.72rem;
    font-weight: 700;
    color: #198754;
    background: rgba(25, 135, 84, 0.1);
    padding: 0 4px;
    border-radius: 4px;
}

.calendar-entry-left {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.calendar-entry-right {
    font-weight: 700;
    min-width: 20px;
    text-align: right;
}

.calendar-entry-empty {
    font-size: 0.74rem;
    color: #adb5bd;
    padding: 2px 0;
}

.calendar-entry-completed {
    border: 1px solid #198754;
    background-color: rgba(25, 135, 84, 0.12) !important;
    box-shadow: inset 0 0 0 1px rgba(25, 135, 84, 0.2);
}

.calendar-inline-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 4px;
}

/* culori cabinete */
.clinic-color-1 {
    background: #e7f1ff;
    border-color: #b6d4fe;
    color: #084298;
}

.clinic-color-2 {
    background: #e8fff1;
    border-color: #badbcc;
    color: #146c43;
}

.clinic-color-3 {
    background: #fff4e5;
    border-color: #ffda9e;
    color: #b35c00;
}

.clinic-color-4 {
    background: #f4e8ff;
    border-color: #d9b8ff;
    color: #6f42c1;
}

.clinic-color-5 {
    background: #ffe8ef;
    border-color: #f5c2c7;
    color: #b02a37;
}

.clinic-color-6 {
    background: #e8fbff;
    border-color: #9eeaf9;
    color: #087990;
}

.clinic-color-7 {
    background: #f3f4f6;
    border-color: #ced4da;
    color: #495057;
}

.clinic-color-8 {
    background: #eefbe7;
    border-color: #c6e0b4;
    color: #3d6b1f;
}

/* ===== DESKTOP ===== */

@media (min-width: 992px) {
    .compact-table-wrapper {
        max-width: 1200px;
        margin: 0 auto;
    }

    .text-report-wrapper {
        max-width: 1000px;
        margin: 0 auto;
    }
}

/* ===== MOBILE ===== */

@media (max-width: 992px) {
    .scheduler-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .scheduler-tables-grid {
        grid-template-columns: 1fr;
    }

    .scheduler-status-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container.py-4 {
        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
    }

    .container-fluid.py-2 {
        padding-left: 0.3rem !important;
        padding-right: 0.3rem !important;
    }

    .navbar .navbar-brand {
        font-size: 0.95rem;
    }

    .report-title {
        font-size: 0.95rem;
    }

    .report-description {
        font-size: 0.78rem;
    }

    .compact-table {
        font-size: 0.70rem;
    }

    .compact-table thead th,
    .compact-table td {
        padding: 0.16rem 0.30rem;
    }

    .text-report {
        font-size: 0.68rem;
        padding: 0.4rem;
    }

    .scheduler-header,
    .calendar-header {
        flex-direction: column;
        align-items: stretch;
    }

    .scheduler-form-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .scheduler-title,
    .calendar-title {
        font-size: 0.95rem;
    }

    .scheduler-subtitle,
    .calendar-subtitle {
        font-size: 0.78rem;
    }

    .scheduler-card,
    .scheduler-table-card {
        padding: 8px;
    }

    /* ===== CALENDAR MOBILE OPTIMIZATION ===== */

    .calendar-grid-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, minmax(150px, 1fr));
        min-width: 1050px;
        gap: 6px;
    }

    .calendar-weekday {
        font-size: 0.72rem;
        padding: 6px;
    }

    .calendar-cell {
        min-height: 130px;
        padding: 5px;
        gap: 4px;
    }

    .calendar-day-number {
        font-size: 0.78rem;
    }

    .calendar-day-link {
        font-size: 0.65rem;
    }

    .calendar-day-total {
        font-size: 0.65rem;
        margin-bottom: 3px;
    }

    .calendar-entry {
        font-size: 0.64rem;
        padding: 3px 4px;
        gap: 1px;
    }

    .calendar-entry-line1,
    .calendar-entry-line2 {
        gap: 4px;
    }

    .calendar-entry-badge {
        min-width: 30px;
        padding: 1px 6px;
        font-size: 0.64rem;
    }

    .calendar-entry-density {
        min-width: 36px;
        padding: 1px 6px;
        font-size: 0.62rem;
    }

    .calendar-legend {
        padding: 8px 9px;
        margin-bottom: 10px;
    }

    .calendar-legend-title {
        font-size: 0.78rem;
    }

    .calendar-legend-item {
        font-size: 0.70rem;
    }
}

.calendar-clinic-group-spaced {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 3px solid #dbe7f5;
}

.calendar-clinic-group-header {
    font-size: 0.86rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f5132;
}

.report-row-finished td {
    background: #e9ecef !important;
}

.report-row-arrived td {
    background: #e8f7e8 !important;
}

.calendar-legend {
    margin: 10px 0 14px 0;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.calendar-legend-title {
    font-size: 0.86rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #374151;
}

.calendar-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #4b5563;
}

.calendar-legend-badge,
.calendar-entry-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.12);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1f2937;
}

.calendar-entry-density,
.calendar-legend-density {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
}

.density-heat-green {
    background: #dcfce7;
    color: #166534;
}

.density-heat-yellow {
    background: #fef3c7;
    color: #92400e;
}

.density-heat-red {
    background: #fee2e2;
    color: #991b1b;
}

.density-heat-none {
    background: #f3f4f6;
    color: #6b7280;
}

.calendar-entry-popup {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 14px;
    z-index: 2000;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    padding: 12px 14px;
    font-size: 0.84rem;
    line-height: 1.35;
    color: #1f2937;
}

.calendar-entry-popup-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: #111827;
}

.calendar-entry-popup-row {
    margin-bottom: 4px;
}

.calendar-entry-popup-row:last-child {
    margin-bottom: 0;
}

.popup-types {
    white-space: normal;
    word-break: break-word;
}

@media (min-width: 769px) {
    .calendar-entry-popup {
        display: none !important;
    }
}

.calendar-entry-touch {
    color: inherit;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.calendar-entry-touch:hover,
.calendar-entry-touch:focus {
    color: inherit;
    transform: translateY(-1px);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08);
}

.calendar-entry-popup[hidden] {
    display: none !important;
}

.calendar-entry-popup.visible {
    display: block;
}

.calendar-period-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.calendar-period-label {
    min-width: 160px;
    text-align: center;
}

.calendar-month-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.calendar-month-nav-btn:hover,
.calendar-month-nav-btn:focus {
    background: #f1f3f5;
    color: #212529;
    border-color: #adb5bd;
    text-decoration: none;
}

@media (max-width: 768px) {
    .calendar-period-label {
        min-width: 130px;
        font-size: 0.9rem;
    }

    .calendar-month-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}

.calendar-header .calendar-day-total {
    margin-top: 6px;
    font-size: 0.82rem;
    color: #198754;
    font-weight: 700;
}

#calendar-today {
    scroll-margin-top: 90px;
    scroll-margin-left: 40px;
}

.calendar-entry-popup-actions {
    display: flex;
    justify-content: flex-end;
}

.calendar-entry-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-entry-delete-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.72rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #b02a37;
    transition: background 0.12s ease, transform 0.12s ease;
}

.calendar-entry-delete-btn:hover,
.calendar-entry-delete-btn:focus {
    text-decoration: none;
    color: #842029;
    background: rgba(255, 255, 255, 0.92);
    transform: scale(1.05);
}

@media (hover: hover) and (pointer: fine) {
    .calendar-entry-touch:hover .calendar-entry-delete-btn,
    .calendar-entry-touch:focus-within .calendar-entry-delete-btn {
        display: inline-flex;
    }
}

@media (hover: none), (pointer: coarse) {
    .calendar-entry-delete-btn {
        display: none !important;
    }
}

.calendar-entry-delete-btn.disabled {
    pointer-events: none;
    opacity: 0.4;
    color: #6c757d;
    border-color: rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.5);
}

.popup-delete-link.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.calendar-day-summary-trigger {
    border-radius: 8px;
    padding: 2px 3px;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.calendar-day-summary-trigger:active {
    background: rgba(13, 110, 253, 0.06);
}

.popup-day-details {
    white-space: normal;
    word-break: break-word;
}

.tasks-status-badge {
    font-size: 0.72rem;
}

code {
    white-space: normal;
    word-break: break-all;
}

.task-chat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.task-chat-row {
    display: flex;
}

.task-chat-row-admin {
    justify-content: flex-end;
}

.task-chat-row-submitter {
    justify-content: flex-start;
}

.task-chat-bubble {
    max-width: 85%;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.84rem;
    border: 1px solid #dee2e6;
    background: #ffffff;
}

.task-chat-row-admin .task-chat-bubble {
    background: #e7f1ff;
    border-color: #b6d4fe;
}

.task-chat-row-submitter .task-chat-bubble {
    background: #ffffff;
    border-color: #dee2e6;
}

.task-chat-meta {
    font-size: 0.74rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.collapse-row td {
    background: transparent !important;
}

.compact-table .collapse .task-chat-list {
    margin-top: 8px;
}

.btn-icon-delete {
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Container pentru hover */
.task-card {
    position: relative;
}

/* Buton delete ascuns implicit */
.task-card .delete-action {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* Desktop: apare la hover */
@media (hover: hover) {
    .task-card:hover .delete-action {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Mobil: apare când cardul are clasa .show-actions */
.task-card.show-actions .delete-action {
    opacity: 1;
    pointer-events: auto;
}

.task-card {
    position: relative;
}

.task-card .delete-action {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

@media (hover: hover) {
    .task-card:hover .delete-action {
        opacity: 1;
        pointer-events: auto;
    }
}

.task-action-menu {
    display: none;
    margin-top: 12px;
}

.task-card.show-actions .task-action-menu {
    display: block;
}

.task-action-menu-inner {
    display: grid;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.btn-icon-delete {
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991.98px) {
    .task-card-actions-desktop,
    .task-delete-desktop {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .task-action-menu {
        display: none !important;
    }
}

.btn-icon-copy {
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
    font-size: 0.95rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.btn-icon-copy {
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
    font-size: 0.95rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* ===== TASKS / PORTAL / SUBMITTERS ===== */

.task-card,
.task-portal-card {
    position: relative;
    background: #ffffff;
}

.task-mobile-hint {
    display: none;
}

.task-events-collapse .task-chat-list,
.collapse .task-chat-list {
    margin-top: 0;
}

.task-chat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.task-chat-row {
    display: flex;
}

.task-chat-row-admin {
    justify-content: flex-end;
}

.task-chat-row-submitter {
    justify-content: flex-start;
}

.task-chat-bubble {
    max-width: 88%;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.84rem;
    border: 1px solid #dee2e6;
    background: #ffffff;
    word-break: break-word;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.04);
}

.task-chat-row-admin .task-chat-bubble {
    background: #e7f1ff;
    border-color: #b6d4fe;
}

.task-chat-row-submitter .task-chat-bubble {
    background: #ffffff;
    border-color: #dee2e6;
}

.task-chat-bubble-system {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
}

.task-chat-meta {
    font-size: 0.74rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.task-card .delete-action {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.task-action-menu {
    display: none;
    margin-top: 12px;
}

.task-card.show-actions .task-action-menu {
    display: block;
}

.task-action-menu-inner {
    display: grid;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.btn-icon-delete,
.btn-icon-copy {
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.btn-icon-delete {
    font-size: 1rem;
}

.btn-icon-copy {
    font-size: 0.95rem;
}

.compact-table .collapse .task-chat-list {
    margin-top: 8px;
}

.collapse-row td {
    background: transparent !important;
}

code {
    white-space: normal;
    word-break: break-all;
}

.task-dashboard-card .card-body {
    padding: 0.85rem;
}

.task-dashboard-value {
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.1;
}

.task-dashboard-label {
    font-size: 0.82rem;
    color: #6c757d;
}

.submitter-meta-line {
    font-size: 0.82rem;
    color: #6c757d;
}

.submitter-card textarea,
.task-card textarea,
.task-portal-card textarea {
    resize: vertical;
}

.task-card .form-control-sm,
.task-portal-card .form-control-sm {
    min-height: calc(1.5em + 0.5rem + 2px);
}

@media (hover: hover) {
    .task-card:hover .delete-action {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 991.98px) {
    .task-card-actions-desktop,
    .task-delete-desktop {
        display: none !important;
    }

    .task-mobile-hint {
        display: block;
    }

    .task-chat-bubble {
        max-width: 94%;
    }
}

@media (min-width: 992px) {
    .task-action-menu {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .compact-table {
        font-size: 0.74rem;
    }

    .compact-table thead th {
        padding: 0.28rem 0.38rem;
    }

    .compact-table td {
        padding: 0.2rem 0.38rem;
    }

    .task-chat-list {
        max-height: 220px;
        padding: 8px;
    }

    .task-chat-bubble {
        font-size: 0.8rem;
        padding: 7px 9px;
    }
}

.report-row-total-medic td {
    background: #eef4ff !important;
    font-weight: 600;
}

.report-row-total-general td {
    background: #dbe7f5 !important;
    font-weight: 700;
    border-top: 2px solid #9ec5fe;
}

.day-density-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.day-density-chart-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 10px 10px 8px;
}

.day-density-chart-title {
    font-weight: 600;
    margin-bottom: 1px;
    font-size: 0.95rem;
}

.day-density-chart-subtitle {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.day-density-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
    gap: 6px;
    align-items: end;
    min-height: 140px;
}

.day-density-bar-group {
    display: grid;
    grid-template-rows: 16px 80px 16px;
    align-items: end;
    justify-items: center;
    gap: 3px;
}

.day-density-bar-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: #374151;
    line-height: 1;
}

.day-density-bar-track {
    width: 100%;
    max-width: 24px;
    height: 80px;
    border-radius: 6px;
    background: #eef2f7;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: end;
    justify-content: center;
}

.day-density-bar-fill {
    width: 100%;
    border-radius: 6px 6px 0 0;
    min-height: 6px;
}

.day-density-bar-fill.density-low {
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
}

.day-density-bar-fill.density-medium {
    background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
}

.day-density-bar-fill.density-high {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

.day-density-bar-label {
    font-size: 0.68rem;
    color: #4b5563;
    text-align: center;
    white-space: nowrap;
    line-height: 1;
}

@media (max-width: 767.98px) {
    .day-density-chart-grid {
        grid-template-columns: 1fr;
    }

    .day-density-chart {
        grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
        gap: 4px;
        min-height: 120px;
    }

    .day-density-bar-group {
        grid-template-rows: 14px 64px 14px;
        gap: 2px;
    }

    .day-density-bar-track {
        max-width: 20px;
        height: 64px;
    }

    .day-density-bar-label,
    .day-density-bar-value {
        font-size: 0.62rem;
    }
}

@media (max-width: 767.98px) {
    .day-density-chart-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .day-density-chart-card {
        padding: 8px 8px 6px !important;
        border-radius: 8px !important;
    }

    .day-density-chart-title {
        font-size: 0.88rem !important;
        margin-bottom: 0 !important;
    }

    .day-density-chart-subtitle {
        font-size: 0.72rem !important;
        margin-bottom: 6px !important;
    }

    .day-density-chart {
        grid-template-columns: repeat(auto-fit, minmax(24px, 1fr)) !important;
        gap: 3px !important;
        min-height: 95px !important;
    }

    .day-density-bar-group {
        grid-template-rows: 12px 48px 12px !important;
        gap: 2px !important;
    }

    .day-density-bar-track {
        max-width: 16px !important;
        height: 48px !important;
        border-radius: 4px !important;
    }

    .day-density-bar-fill {
        min-height: 4px !important;
        border-radius: 4px 4px 0 0 !important;
    }

    .day-density-bar-value {
        font-size: 0.58rem !important;
        line-height: 1 !important;
    }

    .day-density-bar-label {
        font-size: 0.56rem !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }
}
