.cad-entregaveis {
    overflow: hidden;
    min-width: 0;
    width: 100%;
}

.cad-entregaveis .cad-list-toolbar,
.cad-entregaveis .cad-entregaveis-filters,
.cad-entregaveis .cad-legend,
.cad-entregaveis .cad-form-error {
    flex-shrink: 0;
}

.cad-entregaveis .cad-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.cad-entregaveis .cad-list-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-blue, #1e3a5f);
}

.cad-entregaveis .cad-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cad-entregaveis button.cad-btn-new-project,
.cad-entregaveis button.cad-btn-add,
.cad-entregaveis button.cad-btn-send,
.cad-entregaveis button.cad-btn-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    font-family: inherit;
}

.cad-entregaveis button.cad-btn-new-project {
    background: #fff;
    border: 1px solid #047857;
    color: #065f46;
}

.cad-entregaveis button.cad-btn-new-project:hover {
    background: #ecfdf5;
}

.cad-entregaveis button.cad-btn-add {
    background: #047857;
    border: 1px solid #047857;
    color: #fff;
}

.cad-entregaveis button.cad-btn-add:hover {
    background: #065f46;
}

.cad-entregaveis button.cad-btn-new-project:focus-visible,
.cad-entregaveis button.cad-btn-add:focus-visible {
    outline: 2px solid #047857;
    outline-offset: 2px;
}

.cad-entregaveis .cad-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.cad-entregaveis .impl-status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

.cad-entregaveis .impl-status-backlog { background: #e5e7eb; color: #374151; }
.cad-entregaveis .impl-status-andamento { background: #dcfce7; color: #166534; }
.cad-entregaveis .impl-status-postergado { background: #ffedd5; color: #c2410c; }
.cad-entregaveis .impl-status-atrasado { background: #fee2e2; color: #b91c1c; }
.cad-entregaveis .impl-status-concluido { background: #dbeafe; color: #1d4ed8; }
.cad-entregaveis .impl-status-tbd { background: #fef9c3; color: #a16207; }
.cad-entregaveis .impl-status-cancelado { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }

.cad-entregaveis-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
    overflow: hidden;
}

.cad-entregaveis-scroll {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    container-type: inline-size;
    container-name: cad-list;
}

.cad-entregaveis .cad-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cad-entregaveis .cad-card-skel {
    height: 88px;
    border-radius: 16px;
}

.cad-entregaveis .cad-card {
    padding: 20px 24px;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgb(15 23 42 / 0.08);
    min-width: 0;
    width: 100%;
}

.cad-entregaveis .cad-card-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.cad-entregaveis .cad-card-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    width: 100%;
}

.cad-entregaveis .cad-card-sep {
    display: none;
}

.cad-entregaveis .cad-card-people {
    gap: 16px;
}

.cad-entregaveis .cad-card-meta {
    gap: 12px;
}

.cad-entregaveis .cad-card-actions-section {
    justify-content: center;
}

.cad-entregaveis .cad-card-blank {
    background: #f8fafc;
    border-style: dashed;
}

.cad-entregaveis .cad-card-cancelled {
    opacity: 0.64;
}

.cad-entregaveis .cad-card-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.cad-entregaveis .cad-identity-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.cad-entregaveis .cad-phase-select,
.cad-entregaveis .cad-status-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none'><path d='M5 7.5L10 12.5L15 7.5' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding: 4px 28px 4px 12px;
    border: 0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.cad-entregaveis .cad-phase-select {
    background-color: #e5e7eb;
    color: #374151;
    width: auto;
    max-width: 100%;
}

.cad-entregaveis .cad-card-project,
.cad-entregaveis .cad-card-title-select,
.cad-entregaveis .cad-card-title,
.cad-entregaveis .cad-obs-input,
.cad-entregaveis .cad-date-input,
.cad-entregaveis .cad-days-input {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #111827;
    font-family: inherit;
}

.cad-entregaveis .cad-card-project,
.cad-entregaveis .cad-card-project-name {
    font-size: 12px;
    color: #6b7280;
}

.cad-entregaveis .cad-card-title,
.cad-entregaveis .cad-card-title-select {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    padding: 0;
}

.cad-entregaveis button.cad-card-detail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: #0369a1;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.cad-entregaveis button.cad-card-detail:hover {
    text-decoration: underline;
}

.cad-entregaveis .cad-card-detail:focus-visible,
.cad-entregaveis .cad-person-swap:focus-visible,
.cad-entregaveis .cad-phase-select:focus-visible,
.cad-entregaveis .cad-status-select:focus-visible,
.cad-entregaveis .cad-card-title:focus-visible,
.cad-entregaveis .cad-date-input:focus-visible,
.cad-entregaveis .cad-days-input:focus-visible,
.cad-entregaveis .cad-obs-input:focus-visible,
.cad-entregaveis button.cad-btn-send:focus-visible,
.cad-entregaveis button.cad-btn-del:focus-visible {
    outline: 2px solid #1e3a5f;
    outline-offset: 2px;
}

.cad-entregaveis .cad-card-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.cad-entregaveis .cad-card-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}

.cad-entregaveis .cad-person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 24px;
}

.cad-entregaveis .cad-person-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.cad-entregaveis .cad-area-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #4b5563;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.cad-entregaveis button.cad-person-swap {
    border: 0;
    background: none;
    padding: 0;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.cad-entregaveis button.cad-origin-ext-btn {
    opacity: 1;
    flex-shrink: 0;
    border: 1px solid #7dd3fc;
    background: #f0f9ff;
    padding: 4px 10px;
    border-radius: 8px;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
}

.cad-entregaveis button.cad-origin-ext-btn:hover:not(:disabled) {
    background: #e0f2fe;
}

.cad-entregaveis button.cad-origin-ext-btn:focus-visible {
    outline: 2px solid #0369a1;
    outline-offset: 2px;
}

.cad-entregaveis button.cad-origin-ext-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cad-entregaveis .cad-person-picker input {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 8px;
}

.cad-entregaveis .cad-dates-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.cad-entregaveis .cad-dates-row-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 8px;
    align-items: end;
    width: 100%;
}

.cad-entregaveis .cad-date-col-due {
    width: 100%;
}

.cad-entregaveis .cad-dates-heading {
    width: 100%;
}

.cad-entregaveis .cad-date-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cad-entregaveis .cad-date-picker {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    border-bottom: 1px solid #e5e7eb;
}

.cad-entregaveis .cad-date-picker .cad-date-input,
.cad-entregaveis .cad-date-picker input[type="date"] {
    flex: 1;
    min-width: 0;
    padding: 4px 28px 4px 0;
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    font-family: inherit;
}

.cad-entregaveis .cad-date-picker input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    width: 24px;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cad-entregaveis .cad-date-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 12px;
    pointer-events: none;
}

.cad-entregaveis .cad-days-input {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cad-entregaveis .cad-days-input {
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

.cad-entregaveis .cad-days-input::-webkit-outer-spin-button,
.cad-entregaveis .cad-days-input::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

.cad-entregaveis .cad-status-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cad-entregaveis .cad-status-select {
    width: 100%;
    min-width: 112px;
    font-size: 12px;
}

.cad-entregaveis .cad-status-effective-hint {
    font-size: 10px;
    font-weight: 600;
    color: #b45309;
    line-height: 1.3;
}

.cad-entregaveis .cad-status-empty {
    color: #9ca3af;
    font-size: 12px;
}

.cad-entregaveis .cad-obs-input {
    font-size: 13px;
    color: #4b5563;
    padding: 4px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cad-entregaveis .cad-card-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.cad-entregaveis button.cad-btn-send,
.cad-entregaveis button.cad-btn-del {
    min-width: 88px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    border: 0;
}

.cad-entregaveis button.cad-btn-send {
    background: #4f46e5;
    color: #fff;
}

.cad-entregaveis button.cad-btn-send:hover:not(:disabled) {
    background: #4338ca;
}

.cad-entregaveis button.cad-btn-send:disabled {
    background: #a5b4fc;
    cursor: not-allowed;
}

.cad-entregaveis button.cad-btn-del {
    background: #fee2e2;
    color: #b91c1c;
}

.cad-entregaveis button.cad-btn-del:hover:not(:disabled) {
    background: #fecaca;
    color: #991b1b;
}

.cad-entregaveis button.cad-btn-del:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cad-entregaveis .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cad-entregaveis .resumo-skel {
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-size: 200% 100%;
    animation: cad-entregaveis-skel 1.2s ease-in-out infinite;
}

@keyframes cad-entregaveis-skel {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@container cad-list (min-width: 960px) {
    .cad-entregaveis .cad-card-body {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
    }

    .cad-entregaveis .cad-card-section {
        flex: 1 1 0;
        width: auto;
        padding: 0 20px;
    }

    .cad-entregaveis .cad-card-section:first-child {
        padding-left: 0;
    }

    .cad-entregaveis .cad-card-context {
        flex: 0.72 1 0;
        min-width: 112px;
    }

    .cad-entregaveis .cad-card-identity {
        flex: 1.1 1 0;
    }

    .cad-entregaveis .cad-card-people {
        flex: 1 1 0;
    }

    .cad-entregaveis .cad-card-dates {
        flex: 1.05 1 0;
    }

    .cad-entregaveis .cad-card-meta {
        flex: 0.9 1 0;
    }

    .cad-entregaveis .cad-card-actions-section {
        flex: 0 0 auto;
        width: auto;
        padding-right: 0;
        padding-left: 20px;
        justify-content: center;
    }

    .cad-entregaveis .cad-card-sep {
        display: block;
        width: 1px;
        flex-shrink: 0;
        align-self: stretch;
        margin: 4px 0;
        background: #e5e7eb;
    }

    .cad-entregaveis .cad-card-actions {
        flex-direction: column;
        flex-wrap: nowrap;
        width: auto;
        min-width: 88px;
    }

    .cad-entregaveis .cad-person-swap {
        opacity: 0;
    }

    .cad-entregaveis .cad-person:hover .cad-person-swap,
    .cad-entregaveis .cad-person:focus-within .cad-person-swap {
        opacity: 1;
    }
}

.dark-theme .cad-entregaveis .cad-list-title {
    color: var(--text-primary, #f8fafc);
}

.dark-theme .cad-entregaveis-panel,
.dark-theme .cad-entregaveis .cad-card,
.dark-theme .cad-entregaveis button.cad-btn-new-project {
    background: var(--bg-card, #1e293b);
    border-color: var(--border-color, #334155);
}

.dark-theme .cad-entregaveis button.cad-btn-new-project {
    color: #6ee7b7;
}

.dark-theme .cad-entregaveis .cad-card-title,
.dark-theme .cad-entregaveis .cad-person-name,
.dark-theme .cad-entregaveis .cad-date-input,
.dark-theme .cad-entregaveis .cad-days-input {
    color: var(--text-primary, #f8fafc);
}

.dark-theme .cad-entregaveis .cad-card-label,
.dark-theme .cad-entregaveis .cad-card-project-name,
.dark-theme .cad-entregaveis .cad-obs-input {
    color: #94a3b8;
}
