:root,
.ea-light-scheme,
body {
    --color-primary: #000000 !important;
    --color-primary-dark: #333333 !important;
    --bs-primary: #000000 !important;
    --bs-primary-rgb: 0, 0, 0 !important;
}

.ea-dark-scheme {
    --color-primary: #ffffff !important;
    --color-primary-dark: #cccccc !important;
    --bs-primary: #ffffff !important;
    --bs-primary-rgb: 255, 255, 255 !important;
}

.btn-primary {
    background: var(--color-primary) !important;
    background-image: none !important;
    border-color: var(--color-primary) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
    background: var(--color-primary-dark) !important;
    background-image: none !important;
    border-color: var(--color-primary-dark) !important;
    color: #ffffff !important;
}

.ea-dark-scheme .btn-primary {
    color: #000000 !important;
}

.ea-dark-scheme .btn-primary:hover,
.ea-dark-scheme .btn-primary:active,
.ea-dark-scheme .btn-primary:focus {
    color: #000000 !important;
}

.img-logo-dashboard {
    max-width: 115px !important;
}

.ea-dark-scheme .img-logo-dashboard {
    filter: invert(1);
}

.form-fieldset.has-fieldset-error {
    border: unset !important;
    box-shadow: unset !important;
}

.field-collection-delete-button {
    transform: translateY(-3px);
}

.form-collection-item-collapse-marker {
    transform: translateY(-2px);
}

.form-group.field-collection .form-group {
    display: block !important;
}
.form-group.field-collection .form-group label {
    padding: 0 0 8px !important;
    inline-size: 100% !important;
}

/* DOCUMENT_CARD */

#documents_entry,
#documents_file,
.project-file-upload,
.existing-document-wrapper {
    border: 1px solid var(--form-input-border-color);
    background: var(--form-control-bg);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    border-radius: 0.4rem;
    border-style: dashed;
}

#documents_file,
.existing-document-wrapper {
    border: 1px solid var(--link-color);
    border-style: dashed;
}

#documents_entry,
.project-file-upload {
    padding: 2rem 1rem;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, background-color 0.15s;
}

#documents_entry.drag-over,
.upload-document-wrapper.drag-over,
.project-file-upload.drag-over {
    border-color: var(--link-color);
    background-color: color-mix(in srgb, var(--link-color) 8%, var(--form-control-bg));
}

#documents_file,
.existing-document-wrapper {
    padding: 1rem 1rem 2rem 1rem;
}

#documents_entry .icon,
#documents_file .icon,
.project-file-upload .icon,
.existing-document-wrapper .icon {
    width: 4rem;
    height: 4rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f3f3fd;
    font-size: 2rem;
    color: var(--link-color);
}

#documents_entry span,
#documents_file span,
.project-file-upload span,
.existing-document-wrapper span {
    margin-top: 0.25rem;
    font-weight: 400;
    color: #71717a;
    max-width: 100%;
    width: fit-content;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    padding: 0 0.5rem;
}

#documents_entry strong,
#documents_file strong,
.project-file-upload strong,
.existing-document-wrapper strong {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 1rem;
}

#documents_entry small,
#documents_file small,
.project-file-upload small,
.existing-document-wrapper small {
    text-transform: uppercase;
    color: #71717a;
    border: 1px solid #71717a75;
    border-radius: 9999px;
    padding: 0.1rem 0.75rem;
    margin-top: 0.5rem;
}

#documents_file .content,
.existing-document-wrapper .content {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#documents_file .header,
.existing-document-wrapper .header {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}

#documents_file .metadata {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: #71717a;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

#documents_file .metadata-separator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #a1a1aa;
}

.d-none-important {
    display: none !important;
}

/* PROJECT FILE ADD CARD */

.form-group:has(.project-files-collection) .field-collection-add-button {
    display: none !important;
}

/* Reset EasyAdmin accordion wrappers inside the files collection */
.ea-form-collection-items:has(.project-files-collection),
.ea-form-collection-items:has(.project-files-collection) > .accordion,
.ea-form-collection-items:has(.project-files-collection) .form-widget-compound,
.ea-form-collection-items:has(.project-files-collection) [data-empty-collection] {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Make cols stretch to match the tallest card in the row */
.project-files-collection > .col-12 {
    display: flex;
    flex-direction: column;
}

.project-files-collection > .col-12 > *,
.project-files-collection > .col-12 > .project-file-upload,
.project-files-collection > .col-12 > .existing-document-wrapper {
    flex: 1;
}

.project-file-add-card {
    border: 1px dashed var(--form-input-border-color);
    background: var(--form-control-bg);
    width: 100%;
    height: 100%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 0.4rem;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
    padding: 2rem 1rem;
    gap: 0.5rem;
    margin-top: 39px;
}

.project-file-add-card:hover {
    border-color: var(--link-color);
    background: var(--bs-light, #f8f9fa);
}

.project-file-add-card .icon {
    width: 4rem;
    height: 4rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f3f3fd;
    font-size: 2rem;
    color: var(--link-color);
}

.project-file-add-card span {
    margin-top: 0.25rem;
    font-weight: 400;
    color: #71717a;
}

.form-group.has-error .invalid-feedback,
.form-group.has-error ~ .invalid-feedback,
.invalid-feedback.d-block {
    display: block !important;
}

.btn-action-icon {
    border: none;
    background: #fee2e2;
    color: #ef4444;
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    border-radius: 0.25rem;
    cursor: pointer;
}

.btn-clear-file {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

/* HISTORY */

#history {
    position: relative;
    padding: 1rem;
    border: 1px solid var(--form-input-border-color);
    background: var(--form-control-bg);
    max-height: 100%;
    overflow-y: auto;
}

#history .note-item {
    position: relative;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1rem;
    padding-bottom: 2rem;
}

#history .note-date strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
}

#history .note-date span {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: #71717a;
}

#history .note-card-line {
    position: absolute;
    height: 100%;
    width: 1px;
    background: var(--form-input-border-color);
    left: calc(200px + 0.5rem);
    transform: translateX(-50%);
}

#history .note-card-line span {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0.5rem;
    height: 0.5rem;
    background: var(--link-color);
    border-radius: 50%;
    z-index: 2;
}

#history .note-card-content {
    padding-inline: 1rem;
    padding-bottom: 0.5rem;
}

#history .note-field-label {
    font-weight: 500;
}

/* ── Linha com exigência aberta (listagem normal de processos) ── */

tr.has-open-requirements td {
    background-color: oklch(97.3% 0.071 103.193) !important;
}

tr.has-open-requirements:hover td {
    background-color: oklch(94% 0.09 103.193) !important;
}

.ea-dark-scheme tr.has-open-requirements td {
    background-color: oklch(28% 0.07 85) !important;
}

.ea-dark-scheme tr.has-open-requirements:hover td {
    background-color: oklch(33% 0.08 85) !important;
}
