/* Acciones V1 — lectura */

.actions-shell {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 90px;
}

.actions-mobile-topbar {
    display: none;
}

.actions-loading {
    padding: 18px 0;
    color: #667085;
    text-align: center;
}

.actions-message {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
}

.actions-message:empty,
.actions-message[hidden] {
    display: none;
}

.actions-message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.actions-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.actions-header h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.75rem);
}

.actions-header p:not(.eyebrow) {
    margin: 6px 0 0;
    color: #667085;
}

.actions-business-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 9px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #475467;
    font-size: .88rem;
}

.actions-business-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2fb77e;
}

.actions-group {
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid #e3e8ef;
    border-radius: 18px;
    background: #fff;
}

.actions-group-primary {
    background: #f0fbf6;
    border-color: #cdeedc;
}

.actions-group-inactive {
    background: #fbfcfe;
}

.actions-group-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.actions-group-heading h2 {
    margin: 0;
    font-size: 1.08rem;
}

.actions-group-heading p {
    margin: 4px 0 0;
    color: #667085;
    font-size: .88rem;
}

.actions-count {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eef2f6;
    color: #344054;
    font-weight: 800;
}

.actions-list {
    display: grid;
    gap: 10px;
}

.action-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid #e6eaf0;
    border-radius: 14px;
    background: #fff;
}

.action-card-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f2f4f7;
    color: #344054;
}

.action-card-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-type-whatsapp .action-card-icon {
    background: #dcfce7;
    color: #15803d;
}

.action-type-order .action-card-icon {
    background: #fce7f3;
    color: #be185d;
}

.action-type-phone .action-card-icon {
    background: #dbeafe;
    color: #2563eb;
}

.action-type-email .action-card-icon {
    background: #ffedd5;
    color: #ea580c;
}

.action-type-team .action-card-icon {
    background: #ede9fe;
    color: #7c3aed;
}

.action-type-instagram .action-card-icon {
    background: #fce7f3;
    color: #db2777;
}

.action-type-facebook .action-card-icon,
.action-type-website .action-card-icon {
    background: #e0ecff;
    color: #2563eb;
}

.action-card-copy {
    min-width: 0;
}

.action-card-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.action-card h3 {
    margin: 0;
    color: #101828;
    font-size: .98rem;
}

.action-card p {
    margin: 4px 0 0;
    overflow: hidden;
    color: #667085;
    font-size: .86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
}

.action-badge.primary {
    background: #dcfce7;
    color: #166534;
}

.action-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}

.action-status.active {
    background: #dcfce7;
    color: #166534;
}

.action-status.inactive {
    background: #eef2f6;
    color: #667085;
}

.actions-empty {
    padding: 14px;
    border: 1px dashed #d0d5dd;
    border-radius: 12px;
    color: #667085;
    background: rgba(255,255,255,.7);
}

.actions-readonly-note {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 15px 17px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
}

.actions-readonly-note span {
    color: #475467;
    font-size: .86rem;
}

@media (max-width: 720px) {
    .actions-shell {
        width: min(100% - 24px, 720px);
        padding: 20px 0 96px;
    }

    .actions-mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 28px;
    }

    .actions-mobile-topbar .business-select {
        max-width: 48%;
    }

    .actions-header {
        display: block;
        margin-bottom: 18px;
    }

    .actions-business-pill {
        display: none;
    }

    .actions-group {
        padding: 14px;
        border-radius: 16px;
    }

    .action-card {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 11px;
        padding: 12px;
    }

    .action-card-icon {
        width: 40px;
        height: 40px;
    }

    .action-status {
        grid-column: 2;
        justify-self: start;
        min-width: 0;
        margin-top: 2px;
        padding: 5px 8px;
    }

    .action-card p {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

/* Acciones V2 — activar / desactivar */

.actions-message.success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}

.action-card-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    min-width: 150px;
}

.action-primary-note {
    color: #667085;
    font-size: .72rem;
    font-weight: 700;
}

.action-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}

.action-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    pointer-events: none;
}

.action-toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background .18s ease;
}

.action-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .2);
    transition: transform .18s ease;
}

.action-toggle input:checked + .action-toggle-track {
    background: #2fb77e;
}

.action-toggle input:checked + .action-toggle-track::after {
    transform: translateX(20px);
}

.action-toggle input:focus-visible + .action-toggle-track {
    outline: 3px solid rgba(47, 183, 126, .25);
    outline-offset: 2px;
}

.action-toggle-text {
    min-width: 76px;
    color: #667085;
    font-size: .78rem;
    font-weight: 800;
}

.action-toggle input:checked ~ .action-toggle-text {
    color: #166534;
}

.action-toggle.is-saving {
    opacity: .65;
    cursor: wait;
}

@media (max-width: 720px) {
    .action-card-controls {
        grid-column: 2;
        justify-self: stretch;
        justify-content: flex-start;
        min-width: 0;
        margin-top: 2px;
    }

    .action-toggle {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Acciones V3 — acción principal */

.action-card-controls {
    flex-wrap: wrap;
}

.action-make-primary {
    appearance: none;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #b8c9ff;
    border-radius: 10px;
    background: #eef3ff;
    color: #2457d6;
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}

.action-make-primary:hover:not(:disabled) {
    background: #e0e9ff;
    border-color: #93adff;
}

.action-make-primary:focus-visible {
    outline: 3px solid rgba(47, 98, 233, .22);
    outline-offset: 2px;
}

.action-make-primary:disabled {
    opacity: .6;
    cursor: wait;
}

@media (max-width: 720px) {
    .action-card-controls {
        align-items: center;
        gap: 8px 10px;
    }

    .action-make-primary {
        min-height: 34px;
        padding: 6px 10px;
    }
}

/* Acciones V4 — editor */

.action-edit-button {
    appearance: none;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    color: #344054;
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
    cursor: pointer;
}

.action-edit-button:hover {
    background: #f8fafc;
}

.action-editor-open {
    overflow: hidden;
}

.action-editor-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, .48);
}

.action-editor-backdrop[hidden] {
    display: none !important;
}

.action-editor {
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.action-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #eef0f3;
}

.action-editor-head h2 {
    margin: 0;
    font-size: 1.35rem;
}

.action-editor-close {
    appearance: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #f2f4f7;
    color: #344054;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.action-editor-form {
    display: grid;
    gap: 18px;
    padding: 20px 22px 22px;
}

.action-editor-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
}

.action-editor-check[hidden] {
    display: none !important;
}

.action-editor-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.action-editor-check span {
    display: grid;
    gap: 3px;
}

.action-editor-check small,
.action-editor-field small {
    color: #667085;
    font-size: .8rem;
}

.action-editor-field {
    display: grid;
    gap: 7px;
}

.action-editor-field[hidden] {
    display: none !important;
}

.action-editor-field label {
    color: #344054;
    font-size: .88rem;
    font-weight: 800;
}

.action-editor-field input,
.action-editor-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d0d5dd;
    border-radius: 11px;
    background: #fff;
    color: #101828;
    font: inherit;
    font-size: .95rem;
    outline: none;
}

.action-editor-field input {
    min-height: 44px;
    padding: 10px 12px;
}

.action-editor-field textarea {
    min-height: 108px;
    padding: 11px 12px;
    resize: vertical;
}

.action-editor-field input:focus,
.action-editor-field textarea:focus {
    border-color: #7aa2ff;
    box-shadow: 0 0 0 3px rgba(47, 98, 233, .12);
}

.action-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.action-editor-button {
    appearance: none;
    min-height: 42px;
    padding: 9px 15px;
    border-radius: 11px;
    font: inherit;
    font-size: .88rem;
    font-weight: 800;
    cursor: pointer;
}

.action-editor-button.secondary {
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #344054;
}

.action-editor-button.primary {
    border: 1px solid #2f62e9;
    background: #2f62e9;
    color: #fff;
}

.action-editor-button:disabled {
    opacity: .65;
    cursor: wait;
}

@media (max-width: 720px) {
    .action-editor-backdrop {
        align-items: end;
        padding: 12px;
    }

    .action-editor {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 20px 20px 14px 14px;
    }

    .action-editor-head {
        padding: 18px 16px 14px;
    }

    .action-editor-form {
        padding: 16px;
    }

    .action-editor-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .action-editor-button {
        width: 100%;
    }
}

/* Acciones V5 — Añadir acción */

.actions-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.actions-add-button {
    appearance: none;
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid #2f62e9;
    border-radius: 11px;
    background: #2f62e9;
    color: #fff;
    font: inherit;
    font-size: .88rem;
    font-weight: 800;
    cursor: pointer;
}

.actions-add-button:hover {
    background: #2855ca;
    border-color: #2855ca;
}

.actions-add-button:focus-visible {
    outline: 3px solid rgba(47, 98, 233, .22);
    outline-offset: 2px;
}

.action-editor-field select {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 11px;
    background: #fff;
    color: #101828;
    font: inherit;
    font-size: .95rem;
}

.action-editor-field select:focus {
    border-color: #7aa2ff;
    box-shadow: 0 0 0 3px rgba(47, 98, 233, .12);
    outline: none;
}

@media (max-width: 720px) {
    .actions-header-actions {
        justify-content: flex-start;
        margin-top: 14px;
    }

    .actions-add-button {
        width: 100%;
    }
}

/* =========================================================
   ACCIONES V2 VISUAL
   Solo presentación. No modifica lógica ni comportamiento.
   ========================================================= */

.actions-page {
    max-width: 1210px;
    margin: 0 auto;
    padding-top: 12px;
    padding-bottom: 72px;
}

.actions-header {
    margin-bottom: 28px;
}

.actions-header-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
}

.actions-header h1 {
    margin-bottom: 4px;
    letter-spacing: -0.035em;
}

.actions-header p {
    margin-top: 0;
    color: #667085;
}

.actions-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.actions-business-pill {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.actions-add-button {
    min-height: 44px;
    padding: 0 17px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(47, 98, 233, .16);
}

.actions-group {
    margin-top: 24px;
    border: 1px solid #e4e7ec;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
    overflow: hidden;
}

.actions-group--primary {
    border-color: #c8ebd8;
    background: linear-gradient(180deg, #f1fbf6 0%, #f8fdfb 100%);
}

.actions-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 20px 14px;
}

.actions-group-head h2 {
    margin: 0 0 4px;
    font-size: 1.02rem;
    letter-spacing: -0.015em;
}

.actions-group-head p {
    margin: 0;
    color: #667085;
    font-size: .9rem;
    line-height: 1.4;
}

.actions-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-weight: 800;
    font-size: .88rem;
}

.actions-group--primary .actions-count {
    background: #e8f7ef;
    color: #166534;
}

.actions-list {
    display: grid;
    gap: 10px;
    padding: 0 20px 20px;
}

.action-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    min-height: 76px;
    padding: 14px 16px;
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.action-card:hover {
    border-color: #d0d5dd;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .045);
}

.actions-group--primary .action-card {
    border-color: #d8eee1;
    background: rgba(255, 255, 255, .96);
}

.action-card-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.action-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 13px;
}

.action-card-copy {
    min-width: 0;
}

.action-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.action-card-title {
    margin: 0;
    color: #101828;
    font-size: .98rem;
    font-weight: 800;
    line-height: 1.25;
}

.action-card-description {
    margin: 4px 0 0;
    color: #667085;
    font-size: .875rem;
    line-height: 1.35;
    max-width: 600px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
}

.action-badge--primary {
    background: #dcfae6;
    color: #067647;
}

.action-card-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}

.action-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    justify-content: flex-end;
    color: #344054;
    font-size: .82rem;
    font-weight: 700;
}

.action-state.is-active {
    color: #067647;
}

.action-toggle {
    flex: 0 0 auto;
}

.action-toggle-ui {
    width: 42px;
    height: 24px;
    border-radius: 999px;
}

.action-toggle-ui::after {
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
}

.action-toggle input:checked + .action-toggle-ui::after {
    transform: translateX(18px);
}

.action-button {
    min-height: 38px;
    padding: 0 13px;
    border-radius: 10px;
    font-size: .81rem;
    font-weight: 800;
    white-space: nowrap;
}

.action-button--primary {
    border-color: #bfd1ff;
    background: #f4f7ff;
    color: #2457d6;
}

.action-button--primary:hover {
    background: #eaf0ff;
    border-color: #9eb8ff;
}

.action-button--edit {
    border-color: #d0d5dd;
    background: #fff;
    color: #344054;
}

.action-button--edit:hover {
    background: #f9fafb;
    border-color: #b9c0c9;
}

.action-principal-label {
    color: #667085;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

.actions-empty {
    margin: 0 20px 20px;
    padding: 20px;
    border: 1px dashed #d0d5dd;
    border-radius: 14px;
    background: #fafafa;
    color: #667085;
    text-align: center;
}

/* Modal visual polish */
.action-editor {
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .22);
}

.action-editor-head {
    padding-bottom: 16px;
    border-bottom: 1px solid #eaecf0;
}

.action-editor-form {
    gap: 18px;
}

.action-editor-field input,
.action-editor-field textarea,
.action-editor-field select {
    border-radius: 12px;
}

.action-editor-actions {
    padding-top: 4px;
}

/* Tablet */
@media (max-width: 1080px) {
    .actions-header-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .actions-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .action-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .action-card-controls {
        justify-content: flex-start;
        padding-left: 62px;
    }

    .action-state {
        min-width: auto;
        justify-content: flex-start;
    }
}

/* Mobile */
@media (max-width: 720px) {
    .actions-page {
        padding-top: 4px;
        padding-bottom: 92px;
    }

    .actions-header {
        margin-bottom: 20px;
    }

    .actions-header-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .actions-business-pill,
    .actions-add-button {
        width: 100%;
        justify-content: center;
    }

    .actions-group {
        margin-top: 18px;
        border-radius: 16px;
    }

    .actions-group-head {
        padding: 18px 16px 12px;
    }

    .actions-list {
        gap: 9px;
        padding: 0 12px 14px;
    }

    .action-card {
        min-height: 0;
        padding: 13px;
        border-radius: 14px;
        gap: 12px;
    }

    .action-card-main {
        align-items: flex-start;
        gap: 11px;
    }

    .action-card-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .action-card-title {
        font-size: .94rem;
    }

    .action-card-description {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .action-card-controls {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding-left: 53px;
    }

    .action-state {
        min-width: 0;
        justify-content: flex-start;
    }

    .action-button {
        min-height: 36px;
        padding: 0 10px;
        font-size: .78rem;
    }

    .action-principal-label {
        font-size: .76rem;
    }
}

@media (max-width: 520px) {
    .action-card-controls {
        grid-template-columns: 1fr 1fr;
        padding-left: 0;
    }

    .action-state {
        grid-column: 1 / -1;
        padding-top: 2px;
    }

    .action-button {
        width: 100%;
        justify-content: center;
    }

    .action-principal-label {
        grid-column: 1 / 2;
        align-self: center;
    }
}

/* =========================================================
   ACCIONES V2.1 — corrección de composición real
   Render real: icono | copy | controles
   ========================================================= */

.action-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.action-card-icon {
    grid-column: 1;
    justify-self: start;
}

.action-card-copy {
    grid-column: 2;
    min-width: 0;
    justify-self: stretch;
}

.action-card-controls {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: nowrap;
    min-width: max-content;
    padding-left: 0;
}

.action-card-title-row {
    justify-content: flex-start;
}

.action-card-description {
    max-width: 100%;
    text-align: left;
}

.action-toggle {
    width: auto;
}

.action-toggle-text {
    min-width: auto;
}

@media (max-width: 1080px) {
    .action-card {
        grid-template-columns: 48px minmax(0, 1fr);
        align-items: center;
    }

    .action-card-icon {
        grid-column: 1;
        grid-row: 1;
    }

    .action-card-copy {
        grid-column: 2;
        grid-row: 1;
    }

    .action-card-controls {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-start;
        min-width: 0;
        padding-left: 0;
        margin-top: 2px;
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .action-card {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 11px;
    }

    .action-card-icon {
        width: 42px;
        height: 42px;
    }

    .action-card-copy {
        min-width: 0;
    }

    .action-card-controls {
        grid-column: 2;
        display: flex;
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: wrap;
        padding-left: 0;
    }

    .action-toggle {
        width: auto;
    }
}

@media (max-width: 520px) {
    .action-card-controls {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        padding-left: 53px;
    }

    .action-toggle {
        grid-column: 1 / 2;
    }

    .action-make-primary {
        grid-column: 2 / 3;
        justify-self: start;
        width: auto;
    }

    .action-edit-button {
        grid-column: 3 / 4;
        width: auto;
    }

    .action-primary-note {
        grid-column: auto;
    }
}

/* =========================================================
   ACCIONES V2.2 — móvil compacto, inspirado en wireframe
   Mantiene toda la lógica existente.
   ========================================================= */

@media (max-width: 720px) {
    .actions-mobile-topbar {
        margin-bottom: 26px;
    }

    .actions-mobile-topbar .brand {
        gap: 10px;
        font-size: 1.02rem;
    }

    .actions-mobile-topbar .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .actions-mobile-topbar .business-select.compact {
        max-width: 46%;
        min-height: 42px;
        border-radius: 12px;
        font-size: .92rem;
    }

    .actions-header {
        margin-bottom: 18px;
    }

    .actions-header h1 {
        font-size: clamp(2rem, 9vw, 2.55rem);
        line-height: 1.02;
    }

    .actions-header > div:first-child > p:last-child {
        max-width: 28rem;
        margin-top: 8px;
        font-size: .98rem;
        line-height: 1.45;
    }

    .actions-header-actions {
        margin-top: 16px;
    }

    .actions-business-pill {
        display: none;
    }

    .actions-add-button {
        width: 100%;
        min-height: 50px;
        border-radius: 13px;
        font-size: .95rem;
        box-shadow: 0 8px 18px rgba(47, 98, 233, .18);
    }

    .actions-group {
        margin-top: 18px;
        border-radius: 17px;
    }

    .actions-group-heading,
    .actions-group-head {
        padding: 17px 16px 12px;
    }

    .actions-group-heading h2,
    .actions-group-head h2 {
        font-size: 1rem;
        line-height: 1.25;
    }

    .actions-group-heading p,
    .actions-group-head p {
        margin-top: 4px;
        font-size: .82rem;
        line-height: 1.35;
    }

    .actions-count {
        min-width: 32px;
        height: 32px;
        font-size: .82rem;
    }

    .actions-list {
        gap: 8px;
        padding: 0 12px 14px;
    }

    .action-card {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        grid-template-rows: auto;
        align-items: center;
        gap: 10px;
        min-height: 72px;
        padding: 11px 12px;
        border-radius: 13px;
    }

    .action-card-icon {
        grid-column: 1;
        grid-row: 1;
        width: 42px;
        height: 42px;
        border-radius: 11px;
    }

    .action-card-copy {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .action-card-title-row {
        gap: 6px;
    }

    .action-card-title {
        font-size: .91rem;
        line-height: 1.18;
    }

    .action-card-description {
        margin-top: 3px;
        font-size: .78rem;
        line-height: 1.28;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .action-badge {
        min-height: 21px;
        padding: 0 7px;
        font-size: .66rem;
    }

    .action-card-controls {
        grid-column: 3;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        min-width: auto;
        margin: 0;
        padding: 0;
        flex-wrap: nowrap;
    }

    .action-state {
        display: flex;
        min-width: auto;
        gap: 5px;
    }

    .action-state > span:last-child {
        display: none;
    }

    .action-toggle-ui {
        width: 38px;
        height: 22px;
    }

    .action-toggle-ui::after {
        width: 16px;
        height: 16px;
        top: 3px;
        left: 3px;
    }

    .action-toggle input:checked + .action-toggle-ui::after {
        transform: translateX(16px);
    }

    .action-button {
        min-height: 34px;
        padding: 0 9px;
        border-radius: 9px;
        font-size: .72rem;
    }

    .action-button--primary {
        max-width: 82px;
        line-height: 1.08;
        white-space: normal;
        text-align: center;
    }

    .action-button--edit {
        max-width: 58px;
    }

    .action-principal-label {
        font-size: .7rem;
    }

    .actions-empty {
        margin: 0 12px 14px;
        padding: 20px 14px;
        border-radius: 13px;
        font-size: .9rem;
        line-height: 1.35;
    }

    .actions-readonly-note {
        margin-top: 18px;
        padding: 16px;
        border-radius: 15px;
    }
}

@media (max-width: 560px) {
    .action-card {
        grid-template-columns: 42px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
    }

    .action-card-controls {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-start;
        margin-top: 4px;
    }

    .action-button--primary {
        max-width: 92px;
    }

    .action-button--edit {
        max-width: none;
    }
}

/* =========================================================
   ACCIONES V2.3 — pulido móvil final
   Solo compacta tarjetas y controles en móvil.
   ========================================================= */

@media (max-width: 560px) {
    .actions-list {
        gap: 7px;
        padding-bottom: 12px;
    }

    .action-card {
        grid-template-columns: 40px minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 8px 10px;
        min-height: 0;
        padding: 10px 11px;
        border-radius: 12px;
    }

    .action-card-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .action-card-title {
        font-size: .89rem;
        line-height: 1.12;
    }

    .action-card-description {
        margin-top: 2px;
        font-size: .75rem;
        line-height: 1.22;
    }

    .action-card-controls {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        margin-top: 1px;
        padding-left: 0;
        flex-wrap: nowrap;
    }

    .action-state {
        gap: 4px;
        min-width: 0;
    }

    .action-toggle-ui {
        width: 34px;
        height: 20px;
    }

    .action-toggle-ui::after {
        width: 14px;
        height: 14px;
        top: 3px;
        left: 3px;
    }

    .action-toggle input:checked + .action-toggle-ui::after {
        transform: translateX(14px);
    }

    .action-button {
        min-height: 31px;
        padding: 0 8px;
        border-radius: 8px;
        font-size: .69rem;
    }

    .action-button--primary {
        max-width: 76px;
        line-height: 1.05;
        padding-left: 7px;
        padding-right: 7px;
    }

    .action-button--edit {
        max-width: 52px;
    }

    .action-principal-label {
        font-size: .68rem;
        line-height: 1;
    }

    .actions-group-heading,
    .actions-group-head {
        padding: 15px 14px 10px;
    }

    .actions-group-heading h2,
    .actions-group-head h2 {
        font-size: .96rem;
    }

    .actions-group-heading p,
    .actions-group-head p {
        font-size: .79rem;
    }

    .actions-count {
        min-width: 30px;
        height: 30px;
        font-size: .78rem;
    }

    .actions-empty {
        padding: 17px 12px;
        font-size: .86rem;
    }
}

@media (max-width: 420px) {
    .action-card {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 7px 9px;
        padding: 9px 10px;
    }

    .action-card-icon {
        width: 38px;
        height: 38px;
    }

    .action-card-title {
        font-size: .86rem;
    }

    .action-card-description {
        font-size: .73rem;
    }

    .action-card-controls {
        gap: 5px;
    }

    .action-button {
        min-height: 30px;
        padding: 0 7px;
        font-size: .67rem;
    }

    .action-button--primary {
        max-width: 72px;
    }
}

/* ACCIONES V2.4 — desplazar controles móviles ligeramente a la derecha */
@media (max-width: 560px) {
    .action-card-controls {
        transform: translateX(24px);
    }
}

@media (max-width: 420px) {
    .action-card-controls {
        transform: translateX(18px);
    }
}

/* ACCIONES V2.5 — corrección: controles más centrados en móvil */
@media (max-width: 560px) {
    .action-card-controls {
        transform: translateX(-10px);
    }
}

@media (max-width: 420px) {
    .action-card-controls {
        transform: translateX(-6px);
    }
}

/* =========================================================
   SIDEBAR MICROFERTAS — identidad visual estable
   Bloque local a esta pantalla. No modifica el CSS global.
   ========================================================= */

.sidebar {
    color: #fff;
    border-right-color: transparent;
    background: #111a2e;
}

.sidebar .brand {
    color: #fff;
}

.sidebar .brand-mark {
    color: #111a2e;
    background: #fff;
}

.sidebar .nav-item {
    color: #b9c1d1;
    text-decoration: none;
}

.sidebar .nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.sidebar .nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, .11);
}

.sidebar .small-label,
.sidebar .sidebar-user,
.sidebar .logout-button {
    color: #aeb8ca;
}

.sidebar .business-select {
    color: #fff;
    border-color: rgba(255, 255, 255, .14);
    background: #18243d;
}

