/**
 * BridgeWorks — Area aziende · Strumenti (panoramica e sotto-sezioni)
 */

.co-tools-page .co-tools {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.co-tools__tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.co-tools__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.co-tools__tab-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--co-pd2-ink-soft, #334155);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.co-tools__tab-link:hover {
    background: rgba(15, 23, 42, 0.04);
    color: var(--co-pd2-ink, #0f172a);
}

.co-tools__tab-link.is-active {
    background: var(--co-pd2-accent, #363d4b);
    border-color: var(--co-pd2-accent, #363d4b);
    color: #ffffff;
}

.co-tools__tab-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.co-tools__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.co-tools-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.co-tools-card:hover {
    border-color: rgba(52, 59, 74, 0.28);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.co-tools-card:focus-visible {
    outline: 2px solid var(--co-pd2-accent, #363d4b);
    outline-offset: 2px;
}

.co-tools-card__illus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 120px;
    margin-bottom: 16px;
}

.co-tools-card__illus svg {
    width: 100%;
    max-width: 140px;
    height: auto;
}

.co-tools-card__title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--co-pd2-ink, #0f172a);
}

.co-tools-card__title svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--co-pd2-ink-muted, #64748b);
}

.co-tools-card__desc {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--co-pd2-ink-muted, #64748b);
}

.co-tools-placeholder {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    max-width: 42rem;
    padding: 28px;
    border-radius: 12px;
    border: 1px dashed rgba(15, 23, 42, 0.14);
    background: rgba(15, 23, 42, 0.02);
}

.co-tools-placeholder__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(52, 59, 74, 0.1);
    color: var(--co-pd2-ink-soft, #334155);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.co-tools-placeholder__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--co-pd2-ink, #0f172a);
}

.co-tools-placeholder__desc {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--co-pd2-ink-muted, #64748b);
}

@media (max-width: 1200px) {
    .co-tools__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .co-tools__grid {
        grid-template-columns: 1fr;
    }

    .co-tools__tab-link {
        padding: 7px 12px;
        font-size: 0.8125rem;
    }
}

/* ——— Automazioni ——— */

.co-auto {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.co-auto__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.co-auto__title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--co-pd2-ink, #0f172a);
}

.co-auto__filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    background: #ffffff;
    color: var(--co-pd2-ink-soft, #334155);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.co-auto__filter-btn svg {
    width: 16px;
    height: 16px;
}

.co-auto__filter-chevron {
    transition: transform 0.15s ease;
}

.co-auto__filter-btn[aria-expanded="true"] .co-auto__filter-chevron {
    transform: rotate(180deg);
}

.co-auto__filters {
    padding: 12px 0 4px;
}

.co-auto__search input {
    width: min(100%, 360px);
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    font-size: 0.875rem;
}

.co-auto__table-wrap {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.co-auto__table {
    width: 100%;
    border-collapse: collapse;
}

.co-auto__table thead th {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--co-pd2-ink-muted, #64748b);
}

.co-auto__table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 0.875rem;
    color: var(--co-pd2-ink-soft, #334155);
    vertical-align: middle;
}

.co-auto__empty-row td {
    padding: 0;
    border-bottom: none;
}

.co-auto__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 220px;
    padding: 32px 20px;
    text-align: center;
}

.co-auto__empty-illus svg {
    width: 120px;
    height: auto;
}

.co-auto__empty-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--co-pd2-ink, #0f172a);
}

.co-auto__empty-desc {
    margin: 0;
    max-width: 28rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--co-pd2-ink-muted, #64748b);
}

.co-auto__status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.co-auto__status--active {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.co-auto__status--paused {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.co-auto__status--draft {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.co-auto__pager {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding: 12px 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.co-auto__pager-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2563eb;
}

.co-auto__pager-link.is-disabled {
    color: #93c5fd;
    pointer-events: none;
}

.co-auto__predefined {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
}

.co-auto__predefined-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--co-pd2-ink, #0f172a);
}

.co-auto__predefined-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.co-auto-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: #ffffff;
}

.co-auto-card__badge {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 12px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.35;
}

.co-auto-card__badge--pro {
    background: #dbeafe;
    color: #1d4ed8;
}

.co-auto-card__badge--all {
    background: #f1f5f9;
    color: #475569;
}

.co-auto-card__title {
    margin: 0 0 14px;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--co-pd2-ink, #0f172a);
}

.co-auto-card__flow {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1 1 auto;
    margin-bottom: 16px;
}

.co-auto-card__step {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.co-auto-card__step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #f8fafc;
    color: var(--co-pd2-ink-soft, #334155);
}

.co-auto-card__step-icon svg {
    width: 16px;
    height: 16px;
}

.co-auto-card__step p {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--co-pd2-ink-muted, #64748b);
}

.co-auto-card__connector {
    width: 2px;
    height: 18px;
    margin: 4px 0 4px 13px;
    background: #cbd5e1;
}

.co-auto-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.co-auto-card__configured,
.co-auto-card__locked {
    font-size: 0.75rem;
    color: var(--co-pd2-ink-muted, #64748b);
}

.co-auto-card__configure {
    margin-left: auto;
    padding: 8px 14px;
    border: 1px solid #2563eb;
    border-radius: 8px;
    background: #ffffff;
    color: #2563eb;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.co-auto-card__configure:hover:not(:disabled) {
    background: #eff6ff;
}

.co-auto-card__configure:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.co-auto-modal {
    width: min(100% - 32px, 520px);
    padding: 0;
    border: none;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.co-auto-modal::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.co-auto-modal__form {
    display: flex;
    flex-direction: column;
}

.co-auto-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.co-auto-modal__head h3 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
}

.co-auto-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--co-pd2-ink-muted, #64748b);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.co-auto-modal__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
}

.co-auto-modal__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--co-pd2-ink-soft, #334155);
}

.co-auto-modal__field input,
.co-auto-modal__field select,
.co-auto-modal__field textarea {
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
}

.co-auto-modal__note {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--co-pd2-ink-muted, #64748b);
}

.co-auto-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1200px) {
    .co-auto__predefined-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .co-auto__predefined-grid {
        grid-template-columns: 1fr;
    }

    .co-auto__table thead {
        display: none;
    }

    .co-auto__table tbody tr:not(.co-auto__empty-row) {
        display: grid;
        gap: 6px;
        padding: 14px 16px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }

    .co-auto__table tbody tr:not(.co-auto__empty-row) td {
        padding: 0;
        border: none;
    }
}

/* Centro attività */
.co-activity {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    background: #ffffff;
}

.co-activity__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.co-activity__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--co-pd2-ink, #0f172a);
}

.co-activity__lead {
    margin: 6px 0 0;
    font-size: 0.875rem;
    color: var(--co-pd2-ink-soft, #334155);
    max-width: 52ch;
}

.co-activity__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.co-activity__stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 0.8125rem;
    color: var(--co-pd2-ink-soft, #334155);
}

.co-activity__stat--urgent {
    background: #fffbeb;
    border-color: rgba(245, 158, 11, 0.35);
    color: #92400e;
}

.co-activity__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.co-activity__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

.co-activity__item--accent {
    border-color: rgba(42, 92, 71, 0.22);
    background: rgba(42, 92, 71, 0.04);
}

.co-activity__item--warning {
    border-color: rgba(245, 158, 11, 0.35);
    background: #fffbeb;
}

.co-activity__item--info {
    border-color: rgba(37, 99, 235, 0.2);
    background: #eff6ff;
}

.co-activity__item--success {
    border-color: rgba(4, 120, 87, 0.2);
    background: #ecfdf5;
}

.co-activity__item-title {
    margin: 0 0 4px;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--co-pd2-ink, #0f172a);
}

.co-activity__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--co-pd2-accent, #363d4b);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    vertical-align: middle;
}

.co-activity__item-desc {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--co-pd2-ink-soft, #334155);
}

.co-activity__cta {
    flex-shrink: 0;
}

.co-activity__empty {
    margin-top: 0;
}
