.widget-card {
    background: var(--surface-color);
    border: 1px solid var(--surface-border-color);
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    overflow: hidden;
    padding: 0;
}

.widget-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    border-bottom: 0;
}

.widget-title {
    color: var(--header-color);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.widget-header .widget-title {
    font-size: 1.25rem;
    font-weight: 800;
}

.widget-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 0;
}

.widget-table {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
}

.widget-table--empty-state {
    padding-top: 0.85rem;
}

.widget-table-row {
    display: flex;
    align-items: center;
    padding: 0.7rem 0;
    gap: 0.75rem;
    transition: background 0.15s ease;
}

.widget-table-row:hover {
    background: var(--background-subtle-color);
}

.widget-table-row:not(:last-child) {
    border-bottom: 1px solid var(--form-border);
}

.widget-empty-state-row {
    align-items: center;
    margin: auto 0;
    min-height: 6.5rem;
    padding: 1rem;
    background: var(--background-subtle-color);
    border: 1px dashed var(--form-border);
    border-radius: var(--form-border-radius);
}

.widget-empty-state-row:hover {
    background: var(--background-subtle-color);
}

.widget-empty-state-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    background: var(--surface-color);
    border: 1px solid var(--surface-border-color);
    border-radius: 50%;
}

.widget-empty-state-copy {
    min-width: 0;
}

.widget-table-cell {
    display: flex;
    align-items: center;
}

.widget-date {
    width: 52px;
    flex: 0 0 52px;
    justify-content: center;
}

.widget-main {
    flex: 0 0 50%;
    max-width: 50%;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
}

.widget-progress {
    flex: 0 0 35%;
    max-width: 35%;
}

.widget-meta {
    width: 20%;
    flex: 0 0 20%;
    justify-content: flex-end;
    font-size: 0.85rem;
    color: var(--sub-title-color);
}

.widget-primary {
    font-weight: 700;
    color: var(--header-color);
}

.widget-secondary {
    font-size: 0.85rem;
    color: var(--sub-title-color);
}

.date-bubble {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--widget-icon-bg);
    color: var(--widget-icon-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.date-day {
    font-size: 0.9rem;
}

.date-month {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

.date-bubble.today {
    background: var(--primary-color);
    color: var(--surface-color);
}

.date-bubble.overdue {
    background: var(--invalid-background);
    color: var(--invalid-color);
}

.widget-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-link-color);
    text-decoration: none;
    white-space: nowrap;
}

.widget-link:hover {
    color: var(--primary-link-hover);
    text-decoration: none;
}

.widget-progress {
    width: 150px;
    flex: 0 0 150px;
}

.widget-row-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-link-color);
    text-decoration: none;
    white-space: nowrap;
}

.widget-row-link:hover {
    color: var(--primary-link-hover);
    text-decoration: none;
}

.home-widget-grid {
    margin-left: calc(-0.5 * var(--bs-gutter-x));
    margin-right: calc(-0.5 * var(--bs-gutter-x));
}

.body-content > .home-widget-grid {
    margin-left: calc(-0.5 * var(--bs-gutter-x));
    margin-right: calc(-0.5 * var(--bs-gutter-x));
}

.home-widget-empty-state {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.25rem;
    background: var(--background-subtle-color);
    border: 1px dashed var(--form-border);
    border-radius: var(--surface-radius-sm);
}

.home-widget-empty-state__icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    background: var(--surface-color);
    border: 1px solid var(--surface-border-color);
    border-radius: 50%;
}

.home-widget-empty-state__title {
    margin: 0 0 0.25rem;
    color: var(--header-color);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.home-widget-empty-state__copy {
    color: var(--sub-title-color);
    font-size: 0.9rem;
    line-height: 1.4;
}

.widget-table-row--task {
    display: grid;
    grid-template-columns: 52px minmax(11rem, 40%) minmax(118px, 136px) minmax(0, 1fr) max-content;
    gap: 0.6rem;
    align-items: center;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.widget-table-row--task .widget-date,
.widget-table-row--task .widget-main,
.widget-table-row--task .widget-progress,
.widget-table-row--task .widget-meta {
    width: auto;
    max-width: none;
    flex: initial;
}

.widget-table-row--task .widget-main--task {
    min-width: 0;
}

.widget-table-row--task .widget-primary,
.widget-table-row--task .widget-secondary {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.widget-meta--task {
    grid-column: 5;
    justify-content: flex-end;
    justify-self: end;
}

.progress-wrap {
    width: 100%;
}

.progress-with-value {
    --progress-value: 0%;
}

.progress-with-value .progress-bar {
    width: var(--progress-value);
}

.progress-table-min-width {
    min-width: 160px;
}

.progress-label {
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sub-title-color);
}

.task-progress {
    height: 0.55rem;
    background: var(--widget-icon-bg);
    border-radius: 999px;
    overflow: hidden;
}

.task-progress .progress-bar {
    background: var(--primary-color);
    border-radius: 999px;
}

.provider-card-header {
    position: relative;
}

.provider-sales-mapping-header {
    align-items: start;
    display: grid;
    gap: .75rem 1rem;
    grid-template-columns: minmax(8rem, 1fr) auto;
}

.provider-sales-mapping-title {
    min-width: 0;
}

.provider-sales-mapping-controls {
    align-items: flex-start;
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    min-width: 0;
}

.provider-sales-mapping-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
    min-width: 0;
}

.provider-sales-mapping-action {
    white-space: nowrap;
}

.task-widget-panel:not(.d-none) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

@media (max-width: 767.98px) {
    .provider-sales-mapping-header {
        grid-template-columns: 1fr;
    }

    .provider-sales-mapping-controls {
        justify-content: space-between;
        width: 100%;
    }

    .provider-sales-mapping-actions {
        flex: 1 1 auto;
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .provider-sales-mapping-action {
        flex: 1 1 100%;
        white-space: normal;
    }
}

@media (max-width: 991.98px) {
    .home-widget-grid {
        --bs-gutter-x: 0;
    }

    .home-widget-grid > * {
        padding-left: 0;
        padding-right: 0;
    }

    .home-widget-empty-state {
        align-items: flex-start;
        padding: 1rem;
    }

    .widget-table-row--task {
        grid-template-columns: 52px minmax(0, 1fr) max-content;
    }

    .widget-table-row--task .widget-progress {
        grid-column: 2 / -1;
        width: min(100%, 220px);
    }

    .widget-meta--task {
        grid-column: 3;
    }
}
