.wiggy-ent-active .content > :not(.wiggy-ent-root) {
    display: none !important;
}

.wiggy-ent-root {
    --ent-navy: #10203e;
    --ent-text: #15223d;
    --ent-muted: #64718a;
    --ent-line: #dce3ed;
    --ent-bg: #f5f7fb;
    --ent-card: #fff;
    --ent-pink: #e41465;
    --ent-pink-soft: #fff0f6;
    --ent-green: #078b63;
    --ent-green-soft: #e8f7f1;
    --ent-amber: #b96c05;
    --ent-amber-soft: #fff4dc;
    --ent-red: #d73950;
    --ent-red-soft: #fff0f2;
    min-height: calc(100vh - 72px);
    padding: 28px 32px 72px;
    color: var(--ent-text);
    font-family: inherit;
}

.wiggy-ent-root *,
.wiggy-ent-root *::before,
.wiggy-ent-root *::after {
    box-sizing: border-box;
}

.wiggy-ent-root button,
.wiggy-ent-root input,
.wiggy-ent-root select,
.wiggy-ent-root textarea {
    font: inherit;
}

.wiggy-ent-page {
    width: min(100%, 1540px);
    margin: 0 auto;
}

.wiggy-ent-header,
.wiggy-ent-card-head,
.wiggy-ent-toolbar,
.wiggy-ent-actions,
.wiggy-ent-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.wiggy-ent-header {
    align-items: flex-end;
    margin-bottom: 22px;
}

.wiggy-ent-kicker {
    margin: 0 0 7px;
    color: #64718a;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.wiggy-ent-title {
    margin: 0;
    color: #071a3b;
    font-size: clamp(29px, 3vw, 40px);
    font-weight: 650;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.wiggy-ent-subtitle {
    margin: 8px 0 0;
    color: var(--ent-muted);
    font-size: 15px;
    line-height: 1.5;
}

.wiggy-ent-actions,
.wiggy-ent-inline {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.wiggy-ent-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 18px;
    padding: 5px;
    overflow-x: auto;
    border-radius: 14px;
    background: #e9eef6;
    scrollbar-width: thin;
}

.wiggy-ent-tab {
    min-height: 43px;
    padding: 9px 15px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #243552;
    cursor: pointer;
    font-weight: 750;
    white-space: nowrap;
}

.wiggy-ent-tab.active {
    background: #fff;
    color: var(--ent-pink);
    box-shadow: 0 3px 10px rgb(31 48 78 / 8%);
}

.wiggy-ent-btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 15px;
    border: 1px solid #d3ddea;
    border-radius: 11px;
    background: #fff;
    color: #263752;
    cursor: pointer;
    font-weight: 750;
    line-height: 1;
    transition: .18s ease;
}

.wiggy-ent-btn:hover {
    border-color: #aebdd2;
    box-shadow: 0 6px 18px rgb(25 40 68 / 9%);
    transform: translateY(-1px);
}

.wiggy-ent-btn.primary {
    border-color: var(--ent-pink);
    background: var(--ent-pink);
    color: #fff;
    box-shadow: 0 9px 22px rgb(228 20 101 / 20%);
}

.wiggy-ent-btn.danger {
    border-color: #efbec7;
    color: var(--ent-red);
}

.wiggy-ent-btn.small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
}

.wiggy-ent-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.wiggy-ent-grid {
    display: grid;
    gap: 15px;
}

.wiggy-ent-grid.metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 16px;
}

.wiggy-ent-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wiggy-ent-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wiggy-ent-card,
.wiggy-ent-metric {
    overflow: hidden;
    border: 1px solid var(--ent-line);
    border-radius: 16px;
    background: var(--ent-card);
    box-shadow: 0 3px 12px rgb(25 40 68 / 3%);
}

.wiggy-ent-card {
    margin-bottom: 16px;
}

.wiggy-ent-card-head {
    min-height: 72px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--ent-line);
}

.wiggy-ent-card-head h2,
.wiggy-ent-card-head h3 {
    margin: 0;
    color: #10203c;
    font-size: 17px;
}

.wiggy-ent-card-head p {
    margin: 5px 0 0;
    color: var(--ent-muted);
    font-size: 13px;
}

.wiggy-ent-card-body {
    padding: 18px 20px;
}

.wiggy-ent-metric {
    min-height: 125px;
    padding: 20px;
}

.wiggy-ent-metric span {
    display: block;
    color: var(--ent-muted);
    font-size: 12px;
}

.wiggy-ent-metric strong {
    display: block;
    margin: 9px 0 7px;
    color: #081b3c;
    font-size: clamp(23px, 2.3vw, 31px);
    line-height: 1;
}

.wiggy-ent-metric.good strong { color: var(--ent-green); }
.wiggy-ent-metric.bad strong { color: var(--ent-red); }
.wiggy-ent-metric.warn strong { color: var(--ent-amber); }

.wiggy-ent-toolbar {
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ent-line);
}

.wiggy-ent-field {
    display: grid;
    gap: 6px;
}

.wiggy-ent-field.grow {
    flex: 1 1 260px;
}

.wiggy-ent-field label {
    color: #40506a;
    font-size: 12px;
    font-weight: 750;
}

.wiggy-ent-input,
.wiggy-ent-select,
.wiggy-ent-textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d3ddea;
    border-radius: 10px;
    outline: 0;
    background: #fff;
    color: #172642;
    font-size: 14px;
}

.wiggy-ent-textarea {
    min-height: 88px;
    resize: vertical;
}

.wiggy-ent-input:focus,
.wiggy-ent-select:focus,
.wiggy-ent-textarea:focus {
    border-color: #eb7da9;
    box-shadow: 0 0 0 3px rgb(228 20 101 / 10%);
}

.wiggy-ent-table-wrap {
    width: 100%;
    overflow: auto;
}

.wiggy-ent-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

.wiggy-ent-table th {
    padding: 12px 15px;
    border-bottom: 1px solid var(--ent-line);
    background: #f8f9fc;
    color: #62708a;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .055em;
    text-align: left;
    text-transform: uppercase;
}

.wiggy-ent-table td {
    padding: 13px 15px;
    border-bottom: 1px solid #e7ebf2;
    color: #34425d;
    font-size: 13px;
    vertical-align: middle;
}

.wiggy-ent-table tr:last-child td {
    border-bottom: 0;
}

.wiggy-ent-table strong {
    color: #10203c;
}

.wiggy-ent-badge {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #edf2f8;
    color: #52627c;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.wiggy-ent-badge.good { background: var(--ent-green-soft); color: var(--ent-green); }
.wiggy-ent-badge.warn { background: var(--ent-amber-soft); color: var(--ent-amber); }
.wiggy-ent-badge.bad { background: var(--ent-red-soft); color: var(--ent-red); }
.wiggy-ent-badge.info { background: #edf3fb; color: #3b639a; }

.wiggy-ent-connector,
.wiggy-ent-rule,
.wiggy-ent-insight {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--ent-line);
    border-radius: 14px;
    background: #fff;
}

.wiggy-ent-connector h3,
.wiggy-ent-rule h3,
.wiggy-ent-insight h3 {
    margin: 0;
    color: #10203c;
    font-size: 16px;
}

.wiggy-ent-connector p,
.wiggy-ent-rule p,
.wiggy-ent-insight p {
    margin: 0;
    color: var(--ent-muted);
    font-size: 13px;
    line-height: 1.5;
}

.wiggy-ent-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wiggy-ent-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--ent-line);
    border-radius: 9px;
    background: #fafbfe;
    color: #33425d;
    font-size: 12px;
    font-weight: 700;
}

.wiggy-ent-check input {
    accent-color: var(--ent-pink);
}

.wiggy-ent-empty,
.wiggy-ent-loading {
    display: grid;
    min-height: 220px;
    place-items: center;
    padding: 30px;
    color: var(--ent-muted);
    text-align: center;
}

.wiggy-ent-spinner {
    width: 30px;
    height: 30px;
    margin: 0 auto 12px;
    border: 3px solid #f3c1d5;
    border-top-color: var(--ent-pink);
    border-radius: 50%;
    animation: wiggy-ent-spin .7s linear infinite;
}

@keyframes wiggy-ent-spin {
    to { transform: rotate(360deg); }
}

.wiggy-ent-modal-layer {
    position: fixed;
    z-index: 10040;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgb(10 20 40 / 62%);
    backdrop-filter: blur(3px);
}

.wiggy-ent-modal {
    width: min(720px, 100%);
    max-height: min(860px, calc(100vh - 36px));
    overflow: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 70px rgb(4 15 35 / 30%);
}

.wiggy-ent-modal-head,
.wiggy-ent-modal-foot {
    position: sticky;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 17px 20px;
    background: #fff;
}

.wiggy-ent-modal-head {
    top: 0;
    border-bottom: 1px solid var(--ent-line);
}

.wiggy-ent-modal-head h2 {
    margin: 0;
    color: #10203c;
    font-size: 20px;
}

.wiggy-ent-modal-foot {
    bottom: 0;
    justify-content: flex-end;
    border-top: 1px solid var(--ent-line);
}

.wiggy-ent-modal-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 20px;
}

.wiggy-ent-modal-body .full {
    grid-column: 1 / -1;
}

.wiggy-ent-toast {
    position: fixed;
    z-index: 10100;
    right: 24px;
    bottom: 24px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 14px 17px;
    border-radius: 12px;
    background: #10203e;
    color: #fff;
    box-shadow: 0 12px 36px rgb(5 17 38 / 28%);
    font-size: 14px;
    font-weight: 700;
}

.wiggy-ent-toast.good { background: #087b59; }
.wiggy-ent-toast.bad { background: #b92e44; }

.wiggy-ent-product {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wiggy-ent-product img {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    object-fit: cover;
    background: #edf1f6;
}

.wiggy-ent-note {
    color: var(--ent-muted);
    font-size: 12px;
}

@media (max-width: 1180px) {
    .wiggy-ent-grid.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wiggy-ent-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .wiggy-ent-root {
        padding: 20px 14px 105px;
    }

    .wiggy-ent-header {
        align-items: stretch;
        flex-direction: column;
    }

    .wiggy-ent-actions .wiggy-ent-btn {
        flex: 1 1 auto;
    }

    .wiggy-ent-grid.metrics,
    .wiggy-ent-grid.two,
    .wiggy-ent-grid.three {
        grid-template-columns: 1fr;
    }

    .wiggy-ent-tabs {
        margin-inline: -2px;
    }

    .wiggy-ent-card-head,
    .wiggy-ent-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .wiggy-ent-modal-layer {
        align-items: end;
        padding: 0;
    }

    .wiggy-ent-modal {
        max-height: 93vh;
        border-radius: 18px 18px 0 0;
    }

    .wiggy-ent-modal-body {
        grid-template-columns: 1fr;
    }

    .wiggy-ent-modal-body .full {
        grid-column: auto;
    }
}
