.fluxos-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    height: 100%;
}

.fluxos-page__header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fluxos-page__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--sidebar-bg, #03173d);
}

.fluxos-page__subtitle {
    margin: 0;
    font-size: 0.92rem;
    color: #4a5568;
}

.fluxos-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    min-height: calc(100vh - 160px);
}

.fluxos-panel {
    background: #ffffff;
    border: 1px solid #e0e4ea;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(3, 23, 61, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.fluxos-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #e0e4ea;
}

.fluxos-panel__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.fluxos-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--sidebar-bg, #03173d);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fluxos-panel__body {
    padding: 1rem;
    overflow: auto;
}

.fluxos-panel__body--scroll {
    max-height: calc(100vh - 220px);
}

.fluxos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.fluxos-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.fluxos-btn--primary {
    background: #0066cc;
    color: #ffffff;
}

.fluxos-btn--primary:hover:not(:disabled) {
    background: #0057ad;
}

.fluxos-btn--secondary {
    background: rgba(0, 102, 204, 0.1);
    color: #0066cc;
}

.fluxos-btn--secondary:hover:not(:disabled) {
    background: rgba(0, 102, 204, 0.16);
}

.fluxos-btn--ghost {
    background: transparent;
    color: #4a5568;
    border: 1px solid #e0e4ea;
}

.fluxos-btn--ghost:hover:not(:disabled) {
    background: #f4f6f9;
}

.fluxos-btn--danger {
    background: rgba(179, 33, 33, 0.08);
    color: #b32121;
}

.fluxos-btn--sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
}

.fluxos-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fluxos-list__item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.fluxos-list__item:hover {
    background: #f4f6f9;
}

.fluxos-list__item--active {
    background: rgba(0, 102, 204, 0.08);
    border-color: rgba(0, 102, 204, 0.25);
}

.fluxos-list__icon {
    color: #0066cc;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.fluxos-list__content {
    min-width: 0;
    flex: 1;
}

.fluxos-list__nome {
    display: block;
    font-weight: 600;
    color: var(--sidebar-bg, #03173d);
    font-size: 0.92rem;
}

.fluxos-list__meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #4a5568;
}

.fluxos-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.fluxos-badge--ativo {
    background: rgba(38, 176, 80, 0.12);
    color: #1f8a43;
}

.fluxos-badge--inativo {
    background: rgba(74, 85, 104, 0.12);
    color: #4a5568;
}

.fluxos-form {
    display: grid;
    gap: 0.85rem;
}

.fluxos-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fluxos-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #4a5568;
}

.fluxos-field input,
.fluxos-field textarea,
.fluxos-field select {
    width: 100%;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
    color: var(--sidebar-bg, #03173d);
    background: #ffffff;
    font-family: inherit;
}

.fluxos-field textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.45;
}

.fluxos-field input:focus,
.fluxos-field textarea:focus,
.fluxos-field select:focus {
    outline: 2px solid rgba(0, 102, 204, 0.25);
    border-color: #0066cc;
}

.fluxos-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.fluxos-switch input {
    accent-color: #0066cc;
}

.fluxos-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.fluxos-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #4a5568;
}

.fluxos-empty i {
    font-size: 2rem;
    color: #0066cc;
    margin-bottom: 0.75rem;
}

.fluxos-alert {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
}

.fluxos-alert--error {
    background: rgba(179, 33, 33, 0.08);
    color: #b32121;
    border: 1px solid rgba(179, 33, 33, 0.15);
}

.fluxos-alert--success {
    background: rgba(38, 176, 80, 0.1);
    color: #1f8a43;
    border: 1px solid rgba(38, 176, 80, 0.2);
}

.fluxos-loading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #4a5568;
    font-size: 0.9rem;
    padding: 1rem 0;
}

.fluxos-loading__bar {
    flex: 1;
    max-width: 180px;
    height: 4px;
    border-radius: 999px;
    background: rgba(0, 102, 204, 0.15);
    overflow: hidden;
    position: relative;
}

.fluxos-loading__bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 40%;
    background: #0066cc;
    animation: fluxos-loading 1.2s ease-in-out infinite;
}

@keyframes fluxos-loading {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

.etapas-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.etapa-card {
    border: 1px solid #e0e4ea;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.etapa-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f4f6f9;
    border-bottom: 1px solid #e0e4ea;
    cursor: pointer;
}

.etapa-card__header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.etapa-card__passo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #0066cc;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.fluxos-field__hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #5c6573;
    line-height: 1.35;
}

.etapa-card__toggle {
    color: #0066cc;
    flex-shrink: 0;
}

.etapa-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sidebar-bg, #03173d);
}

.etapa-card__identificador {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.82rem;
    color: #0066cc;
}

.etapa-card__body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.etapa-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.transicoes-section {
    border-top: 1px dashed #e0e4ea;
    padding-top: 0.85rem;
}

.transicoes-section__title {
    margin: 0 0 0.65rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sidebar-bg, #03173d);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.transicoes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.transicoes-table th,
.transicoes-table td {
    padding: 0.55rem 0.45rem;
    border-bottom: 1px solid #e0e4ea;
    text-align: left;
    vertical-align: middle;
}

.transicoes-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4a5568;
}

.transicoes-table tr:last-child td {
    border-bottom: none;
}

.transicoes-table select,
.transicoes-table input {
    width: 100%;
    min-width: 0;
}

.transicoes-table__actions {
    width: 44px;
    text-align: center;
}

@media (max-width: 960px) {
    .fluxos-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .fluxos-panel__body--scroll {
        max-height: 320px;
    }
}
