/* =========================================================
   PASCOM+ — WORKFLOWS
   Avisos e Escalas
   ========================================================= */

.notice-workflow-container,
.scale-workflow-container {
    max-width: 1120px;
}

.notice-page-heading,
.scale-page-heading {
    max-width: 820px;
}

.form-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.form-section-heading h2 {
    margin: 0 0 5px;
    font-size: 15px;
    font-weight: 600;
}

.form-section-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.6;
}

/* =========================================================
   NOVO AVISO
   ========================================================= */

.notice-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(270px, .75fr);
    gap: 16px;
    align-items: start;
}

.notice-create-form {
    min-width: 0;
    padding: 24px;
}

.notice-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.notice-title-field,
.notice-message-field {
    grid-column: 1 / -1;
}

.notice-message-field textarea {
    min-height: 175px;
}

.notice-publish-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid #eadde0;
    border-radius: 11px;
    background: var(--primary-soft-2);
}

.notice-publish-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 8px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
}

.notice-publish-callout strong,
.notice-publish-callout span {
    display: block;
}

.notice-publish-callout strong {
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 600;
}

.notice-publish-callout span {
    color: var(--text-secondary);
    font-size: 9px;
    line-height: 1.6;
}

.notice-help-card {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.notice-help-card h2 {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
}

.notice-priority-guide {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.notice-priority-guide > div {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.notice-priority-guide strong,
.notice-priority-guide small {
    display: block;
}

.notice-priority-guide strong {
    margin-bottom: 2px;
    font-size: 10px;
}

.notice-priority-guide small {
    color: var(--text-muted);
    font-size: 8px;
    line-height: 1.55;
}

.priority-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-top: 4px;
    border-radius: 50%;
}

.priority-dot-normal { background: var(--info); }
.priority-dot-important { background: var(--secondary); }
.priority-dot-urgent { background: var(--danger); }

.notice-help-note {
    margin-top: 17px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 8px;
    line-height: 1.6;
}

/* =========================================================
   STEPPER DAS ESCALAS
   ========================================================= */

.workflow-steps {
    display: grid;
    grid-template-columns: auto minmax(35px, 1fr) auto minmax(35px, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-muted);
}

.workflow-step > span {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: #ffffff;
    font-size: 9px;
    font-weight: 600;
}

.workflow-step strong,
.workflow-step small {
    display: block;
}

.workflow-step strong {
    color: inherit;
    font-size: 9px;
    font-weight: 600;
}

.workflow-step small { font-size: 7px; }

.workflow-step.active { color: var(--primary); }

.workflow-step.active > span {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.workflow-step.completed { color: var(--success); }

.workflow-step.completed > span {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
}

.workflow-step-line {
    height: 1px;
    background: var(--border);
}

.workflow-step-line.completed { background: #bcd8cc; }

/* =========================================================
   NOVA ESCALA
   ========================================================= */

.scale-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, .75fr);
    gap: 16px;
    align-items: start;
}

.scale-create-form {
    min-width: 0;
    padding: 24px;
}

.scale-preview-card {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    min-height: 350px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.scale-preview-empty {
    min-height: 308px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.scale-preview-empty-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 11px;
    padding: 11px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}

.scale-preview-empty strong { font-size: 11px; }

.scale-preview-empty p {
    max-width: 230px;
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.6;
}

.scale-preview-content h2 {
    margin: 0 0 15px;
    font-size: 15px;
    line-height: 1.35;
}

.scale-preview-list {
    display: flex;
    flex-direction: column;
}

.scale-preview-list > div {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.scale-preview-list > div:last-child { border-bottom: 0; }

.scale-preview-list span {
    color: var(--text-muted);
    font-size: 8px;
}

.scale-preview-list strong {
    color: var(--text-primary);
    font-size: 9px;
    font-weight: 600;
    text-align: right;
}

.scale-availability-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 14px;
}

.scale-availability-summary > div {
    padding: 10px 8px;
    border-radius: 10px;
    background: #faf8f9;
    text-align: center;
}

.scale-availability-summary span,
.scale-availability-summary small { display: block; }

.scale-availability-summary span {
    color: var(--primary);
    font-size: 17px;
    font-weight: 600;
}

.scale-availability-summary small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 7px;
    line-height: 1.4;
}

.scale-preview-note {
    margin-top: 12px;
    padding: 10px 11px;
    border-radius: 9px;
    background: var(--primary-soft-2);
    color: var(--text-secondary);
    font-size: 8px;
    line-height: 1.55;
}

.scale-next-step-callout {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid #eadde0;
    border-radius: 11px;
    background: var(--primary-soft-2);
}

.scale-next-step-icon {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-size: 9px;
    font-weight: 600;
}

.scale-next-step-callout strong,
.scale-next-step-callout span { display: block; }

.scale-next-step-callout strong {
    margin-bottom: 3px;
    font-size: 10px;
}

.scale-next-step-callout span {
    color: var(--text-secondary);
    font-size: 8px;
    line-height: 1.6;
}

.scale-functions-reference {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.scale-function-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.scale-function-chip {
    min-height: 29px;
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid #eadde0;
    border-radius: 999px;
    background: var(--primary-soft-2);
    color: var(--primary);
    font-size: 8px;
    font-weight: 600;
}

/* =========================================================
   MONTAGEM DA EQUIPE
   ========================================================= */

.scale-editor-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.scale-editor-summary > div {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.scale-editor-summary span,
.scale-editor-summary strong { display: block; }

.scale-editor-summary span {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 7px;
    text-transform: uppercase;
}

.scale-editor-summary strong {
    overflow: hidden;
    font-size: 9px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scale-editor-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.scale-editor-metrics article {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 11px 13px;
    border-radius: 10px;
    background: var(--primary-soft-2);
}

.scale-editor-metrics span {
    color: var(--primary);
    font-size: 18px;
    font-weight: 600;
}

.scale-editor-metrics small {
    color: var(--text-secondary);
    font-size: 8px;
}

.scale-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr);
    gap: 16px;
    align-items: start;
}

.scale-team-builder {
    min-width: 0;
    padding: 22px;
}

.scale-member-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.scale-member-grid {
    max-height: 470px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding-right: 3px;
}

.scale-member-option {
    position: relative;
    min-height: 94px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #ffffff;
    cursor: pointer;
}

.scale-member-option:hover { border-color: #d8c8cc; }

.scale-member-option:has(input:checked) {
    border-color: rgba(122, 31, 43, .38);
    background: var(--primary-soft-2);
}

.scale-member-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.scale-member-radio {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 1px solid #cfc5c8;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: inset 0 0 0 4px #ffffff;
}

.scale-member-option input:checked + .scale-member-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.scale-member-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.scale-member-name-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.scale-member-name-row strong { font-size: 10px; }

.scale-member-content > small {
    color: var(--text-muted);
    font-size: 8px;
}

.scale-member-badge {
    padding: 3px 6px;
    border-radius: 999px;
    background: var(--success-soft);
    color: var(--success) !important;
    font-size: 7px !important;
}

.scale-member-preferences {
    color: var(--primary);
    font-size: 8px;
    font-weight: 500;
}

.scale-member-observation {
    margin-top: 2px;
    padding-top: 5px;
    border-top: 1px dashed var(--border);
    color: var(--text-secondary);
    font-size: 8px;
}

.scale-member-config {
    display: grid;
    grid-template-columns: minmax(170px, .7fr) minmax(210px, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.scale-assigned-panel {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.scale-assigned-list {
    display: flex;
    flex-direction: column;
}

.scale-assigned-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.scale-assigned-item:last-child { border-bottom: 0; }

.scale-assigned-item strong,
.scale-assigned-item span { display: block; }

.scale-assigned-item strong { font-size: 10px; }

.scale-assigned-item span {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 8px;
}

.scale-assigned-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 9px;
}

.scale-data-details {
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.scale-data-details > summary {
    padding: 14px 17px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.scale-general-form {
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
}

.scale-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

@media (max-width: 1100px) {
    .notice-create-layout,
    .scale-create-layout,
    .scale-editor-layout {
        grid-template-columns: 1fr;
    }

    .notice-help-card,
    .scale-preview-card,
    .scale-assigned-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .notice-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scale-editor-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scale-member-grid { grid-template-columns: 1fr; }

    .scale-member-config {
        grid-template-columns: 1fr 1fr;
    }

    .scale-member-config .btn { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
    .workflow-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .workflow-step-line { display: none; }
    .workflow-step small { display: none; }

    .notice-form-grid,
    .scale-editor-summary,
    .scale-editor-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .notice-create-form,
    .notice-help-card,
    .scale-create-form,
    .scale-preview-card,
    .scale-functions-reference,
    .scale-team-builder,
    .scale-assigned-panel {
        padding: 15px;
    }

    .scale-member-config { grid-template-columns: 1fr; }
    .scale-member-config .btn { grid-column: auto; }
    .scale-availability-summary { grid-template-columns: 1fr; }
    .scale-preview-list > div { grid-template-columns: 1fr; }
    .scale-preview-list strong { text-align: left; }

    .scale-assigned-item,
    .scale-editor-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .scale-editor-footer .btn { width: 100%; }
}
