/* Forms Command Center */
.subin-forms-command-center {
    --subin-cc-card: #fff;
    --subin-cc-ink: #13213a;
    --subin-cc-muted: #63708a;
    --subin-cc-line: #dbe4f0;
    --subin-cc-blue: #315be8;
    --subin-cc-blue-soft: #edf2ff;
    --subin-cc-green: #168352;
    --subin-cc-green-soft: #eaf8f1;
    --subin-cc-amber: #a86207;
    --subin-cc-amber-soft: #fff6df;
    --subin-cc-red: #be3444;
    --subin-cc-red-soft: #fff0f2;
}

.subin-forms-command-center .subin-admin-hero { margin-bottom: 18px; }

.subin-portfolio-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #f1d18a;
    border-radius: 12px;
    background: var(--subin-cc-amber-soft);
    color: #603b08;
}

.subin-portfolio-alert--critical { border-color: #f0b8c0; background: var(--subin-cc-red-soft); color: #7e2632; }
.subin-portfolio-alert > .dashicons { flex: 0 0 auto; width: 28px; height: 28px; font-size: 28px; }
.subin-portfolio-alert__content { display: grid; flex: 1 1 auto; gap: 2px; }
.subin-portfolio-alert__content strong { font-size: 14px; }
.subin-portfolio-alert__content span { color: #705426; }
.subin-portfolio-alert--critical .subin-portfolio-alert__content span { color: #96515a; }
.subin-portfolio-alert .subin-inline-link { color: inherit; font-weight: 700; white-space: nowrap; }

.subin-portfolio-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.subin-portfolio-kpi {
    display: flex;
    min-width: 0;
    min-height: 94px;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--subin-cc-line);
    border-radius: 13px;
    background: var(--subin-cc-card);
    color: var(--subin-cc-ink);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(24, 42, 78, .045);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

a.subin-portfolio-kpi:hover,
a.subin-portfolio-kpi:focus { border-color: #aabcf5; color: var(--subin-cc-ink); box-shadow: 0 12px 30px rgba(35, 65, 130, .1); transform: translateY(-1px); }

.subin-portfolio-kpi__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--subin-cc-blue-soft);
    color: var(--subin-cc-blue);
    font-size: 18px;
}

.subin-portfolio-kpi--attention .subin-portfolio-kpi__icon,
.subin-portfolio-kpi--failed .subin-portfolio-kpi__icon { background: var(--subin-cc-red-soft); color: var(--subin-cc-red); }
.subin-portfolio-kpi--leads .subin-portfolio-kpi__icon,
.subin-portfolio-kpi--conversion .subin-portfolio-kpi__icon { background: var(--subin-cc-green-soft); color: var(--subin-cc-green); }
.subin-portfolio-kpi__body { display: grid; min-width: 0; gap: 2px; }
.subin-portfolio-kpi__body strong { color: var(--subin-cc-ink); font-size: 23px; line-height: 1; }
.subin-portfolio-kpi__body > span { overflow: hidden; color: #34415a; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.subin-portfolio-kpi__body small { overflow: hidden; color: var(--subin-cc-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.subin-portfolio-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 2px; border-bottom: 1px solid var(--subin-cc-line); }
.subin-portfolio-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 11px 13px 12px; color: #526078; font-weight: 700; text-decoration: none; white-space: nowrap; }
.subin-portfolio-tab span { min-width: 18px; padding: 1px 6px; border-radius: 999px; background: #edf1f7; color: #5b667a; font-size: 11px; text-align: center; }
.subin-portfolio-tab::after { content: ""; position: absolute; right: 10px; bottom: -1px; left: 10px; height: 3px; border-radius: 99px 99px 0 0; background: transparent; }
.subin-portfolio-tab:hover,
.subin-portfolio-tab:focus,
.subin-portfolio-tab.is-active { color: var(--subin-cc-blue); }
.subin-portfolio-tab.is-active::after { background: var(--subin-cc-blue); }
.subin-portfolio-tab.is-active span { background: var(--subin-cc-blue-soft); color: var(--subin-cc-blue); }

.subin-portfolio-toolbar { position: relative; display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.subin-portfolio-filters { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; }
.subin-portfolio-filters input,
.subin-portfolio-filters select,
.subin-organize-menu input,
.subin-forms-bulk select { min-height: 38px; border-color: #cbd7e7; border-radius: 8px; color: #26334b; }
.subin-portfolio-search { position: relative; flex: 1 1 260px; min-width: 210px; }
.subin-portfolio-search .dashicons { position: absolute; z-index: 1; top: 9px; left: 10px; color: #7b879d; }
.subin-portfolio-search input { width: 100%; padding-left: 35px; }
.subin-portfolio-toolbar__meta { color: var(--subin-cc-muted); white-space: nowrap; }

.subin-organize-menu,
.subin-row-menu { position: relative; flex: 0 0 auto; }
.subin-organize-menu > summary,
.subin-row-menu > summary { display: inline-flex !important; align-items: center; justify-content: center; gap: 5px; list-style: none; cursor: pointer; }
.subin-organize-menu > summary .dashicons,
.subin-icon-button .dashicons { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 16px; width: 16px; height: 16px; margin: 0; font-size: 16px; line-height: 1; vertical-align: middle; }
.subin-organize-menu > summary .dashicons::before,
.subin-icon-button .dashicons::before { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; line-height: 1; }
.subin-icon-button .dashicons-ellipsis::before { transform: translateY(-1px); }
.subin-organize-menu > summary::-webkit-details-marker,
.subin-row-menu > summary::-webkit-details-marker { display: none; }
.subin-organize-menu__popover,
.subin-row-menu__popover { position: absolute; z-index: 40; top: calc(100% + 7px); right: 0; width: 290px; padding: 14px; border: 1px solid var(--subin-cc-line); border-radius: 11px; background: #fff; box-shadow: 0 18px 50px rgba(22, 38, 70, .18); }
.subin-organize-menu__popover { display: grid; gap: 12px; }
.subin-organize-menu__popover form,
.subin-organize-menu__popover label { display: grid; gap: 5px; }
.subin-organize-menu__popover label > span { display: grid; grid-template-columns: 1fr auto; gap: 6px; }

.subin-forms-bulk { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 8px; padding: 7px 10px; border: 1px solid var(--subin-cc-line); border-radius: 10px; background: #fff; }
.subin-forms-bulk__count { color: var(--subin-cc-muted); font-size: 12px; font-weight: 700; }

.subin-forms-table-wrap { overflow: visible; border: 1px solid var(--subin-cc-line); border-radius: 13px; background: #fff; box-shadow: 0 10px 30px rgba(24, 42, 78, .045); }
.subin-forms-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.subin-forms-table th { padding: 11px 10px; border-bottom: 1px solid var(--subin-cc-line); background: #f8fafd; color: #6a758a; font-size: 11px; font-weight: 800; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
.subin-forms-table th:nth-child(1) { width: 30px; }
.subin-forms-table th:nth-child(2) { width: 24%; }
.subin-forms-table th:nth-child(3) { width: 12%; }
.subin-forms-table th:nth-child(4) { width: 10%; }
.subin-forms-table th:nth-child(5) { width: 12%; }
.subin-forms-table th:nth-child(6) { width: 14%; }
.subin-forms-table th:nth-child(7) { width: 9%; }
.subin-forms-table th:nth-child(8) { width: 150px; }
.subin-form-portfolio-row > td { padding: 15px 10px; border-bottom: 1px solid #e8edf4; color: var(--subin-cc-ink); vertical-align: middle; }
.subin-form-portfolio-row:hover > td { background: #fbfcff; }
.subin-form-portfolio-row--critical > td:first-child { box-shadow: inset 3px 0 var(--subin-cc-red); }
.subin-form-portfolio-row--attention > td:first-child { box-shadow: inset 3px 0 #db8a19; }
.subin-forms-table__check { text-align: center !important; }

.subin-form-cell__title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.subin-form-cell__title > a,
.subin-form-cell__title > .subin-form-name { overflow: hidden; color: var(--subin-cc-ink); font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.subin-form-cell__meta,
.subin-form-tags { display: flex; align-items: center; gap: 6px; margin-top: 5px; overflow: hidden; color: var(--subin-cc-muted); font-size: 11px; white-space: nowrap; }
.subin-form-cell__meta > span:not(:last-child)::after { content: "·"; margin-left: 6px; color: #b3bdca; }
.subin-form-cell__meta .subin-folder-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 99px; background: #f1f4fa; }
.subin-folder-chip .dashicons { width: 12px; height: 12px; font-size: 12px; }
.subin-auto-reply-chip { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 18px; padding: 1px 7px; border-radius: 99px; background: #eef1f5; color: #687386; font-size: 10px; font-weight: 800; line-height: 1.4; text-decoration: none; }
.subin-auto-reply-chip:hover,
.subin-auto-reply-chip:focus { color: #324057; text-decoration: underline; }
.subin-auto-reply-chip--active { background: var(--subin-cc-green-soft); color: var(--subin-cc-green); }
.subin-auto-reply-chip--attention { background: #fff2da; color: #995b00; }
.subin-auto-reply-chip--draft { background: var(--subin-cc-blue-soft); color: #4b64ad; }
.subin-form-tags span { padding: 2px 6px; border-radius: 99px; background: var(--subin-cc-blue-soft); color: #4b64ad; font-weight: 700; }
.subin-form-status { flex: 0 0 auto; padding: 2px 7px; border-radius: 99px; background: #eef1f5; color: #687386; font-size: 10px; font-weight: 800; }
.subin-form-status--active { background: var(--subin-cc-green-soft); color: var(--subin-cc-green); }
.subin-form-status--trash { background: var(--subin-cc-red-soft); color: var(--subin-cc-red); }
.subin-draft-dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px #fff3d7; }

.subin-metric-primary,
.subin-metric-link strong,
.subin-delivery-state strong { display: block; color: var(--subin-cc-ink); font-size: 14px; font-weight: 800; }
.subin-metric-secondary,
.subin-metric-link span,
.subin-delivery-state span,
.subin-updated-cell small,
.subin-updated-cell > span,
.subin-forms-table td > small { display: block; margin-top: 2px; color: var(--subin-cc-muted); font-size: 10px; line-height: 1.3; }
.subin-metric-link,
.subin-delivery-state { display: block; color: inherit; text-decoration: none; }
.subin-metric-link:hover strong,
.subin-delivery-state:hover strong { color: var(--subin-cc-blue); }
.subin-delivery-state--failed strong { color: var(--subin-cc-red); }
.subin-delivery-state--healthy strong { color: var(--subin-cc-green); }
.subin-delivery-state--empty strong { color: #758196; }

.subin-health-link { display: inline-flex; border-radius: 999px; text-decoration: none; }
.subin-health-link:focus { outline: 2px solid var(--subin-cc-blue); outline-offset: 2px; }
.subin-health-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 99px; background: var(--subin-cc-green-soft); color: var(--subin-cc-green); font-size: 11px; font-weight: 800; }
.subin-health-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.subin-health-pill b { min-width: 15px; padding: 0 4px; border-radius: 99px; background: rgba(0, 0, 0, .08); text-align: center; }
.subin-health-pill--attention { background: var(--subin-cc-amber-soft); color: var(--subin-cc-amber); }
.subin-health-pill--critical { background: var(--subin-cc-red-soft); color: var(--subin-cc-red); }
.subin-health-primary { display: block; overflow: hidden; max-width: 170px; margin-top: 4px; color: var(--subin-cc-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.subin-row-actions { text-align: right; white-space: nowrap; }
.subin-row-actions__group { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; min-width: max-content; vertical-align: middle; }
.subin-row-actions__group > * { flex: 0 0 auto; }
.subin-row-primary-action { display: inline-flex; margin: 0; }
.subin-row-actions .subin-btn,
.subin-icon-button { box-sizing: border-box; min-height: 34px; height: 34px; margin: 0; }
.subin-icon-button { display: inline-flex !important; align-items: center; justify-content: center; min-width: 34px !important; width: 34px; padding: 0 !important; border-radius: 8px !important; line-height: 1 !important; }
.subin-icon-button .dashicons { width: 16px; height: 16px; font-size: 16px; line-height: 1; transition: transform .15s ease; }
[data-subin-toggle-details][aria-expanded="true"] .dashicons { transform: rotate(180deg); }
.subin-row-menu__popover { width: 210px; padding: 7px; text-align: left; }
.subin-row-menu__popover a,
.subin-row-menu__popover button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 9px; border: 0; border-radius: 6px; background: transparent; color: #2d3950; font-size: 12px; text-align: left; text-decoration: none; cursor: pointer; }
.subin-row-menu__popover a:hover,
.subin-row-menu__popover button:hover { background: #f2f5fa; }
.subin-row-menu__popover .dashicons { width: 16px; height: 16px; color: #65738a; font-size: 16px; }
.subin-row-menu__popover form.is-danger button,
.subin-row-menu__popover form.is-danger .dashicons { color: var(--subin-cc-red); }

.subin-form-details-row > td { padding: 0 !important; border-bottom: 1px solid var(--subin-cc-line); background: #f7f9fd; }
.subin-form-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px 16px 16px 50px; }
.subin-form-detail-panel { min-width: 0; padding: 14px; border: 1px solid #dfe7f1; border-radius: 10px; background: #fff; }
.subin-form-detail-panel__heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.subin-form-detail-panel__heading h3 { margin: 0; color: var(--subin-cc-ink); font-size: 13px; }
.subin-form-detail-panel__heading > span,
.subin-form-detail-panel__heading > a { color: var(--subin-cc-muted); font-size: 10px; font-weight: 600; }
.subin-funnel { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 7px; }
.subin-funnel > div { display: grid; gap: 2px; min-width: 0; padding: 10px 8px; border-radius: 8px; background: #f5f7fc; text-align: center; }
.subin-funnel > div strong { color: var(--subin-cc-ink); font-size: 16px; }
.subin-funnel > div span,
.subin-funnel > i { color: var(--subin-cc-muted); font-size: 10px; font-style: normal; }
.subin-funnel-rates { display: flex; gap: 16px; margin-top: 10px; color: var(--subin-cc-muted); font-size: 10px; }
.subin-funnel-rates span { display: flex; gap: 4px; }
.subin-funnel-rates strong { color: var(--subin-cc-blue); }

.subin-operation-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; }
.subin-operation-stats > div { display: grid; gap: 4px; padding: 10px; border-radius: 8px; background: #f7f9fc; }
.subin-operation-stats dt { color: var(--subin-cc-muted); font-size: 10px; }
.subin-operation-stats dd { margin: 0; color: var(--subin-cc-ink); font-size: 16px; font-weight: 800; }
.subin-all-clear { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; background: var(--subin-cc-green-soft); color: var(--subin-cc-green); }
.subin-all-clear > .dashicons { width: 25px; height: 25px; font-size: 25px; }
.subin-all-clear > div { display: grid; }
.subin-all-clear span:last-child { font-size: 11px; }

.subin-issue-list,
.subin-location-list { display: grid; gap: 8px; margin: 0; }
.subin-issue-list__item,
.subin-location-list li { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 9px; border-radius: 8px; background: #f8f9fc; }
.subin-issue-list__item > .dashicons { color: var(--subin-cc-amber); }
.subin-issue-list__item--critical > .dashicons { color: var(--subin-cc-red); }
.subin-issue-list__item > div,
.subin-location-list li > div { display: grid; flex: 1 1 auto; min-width: 0; gap: 2px; }
.subin-issue-list__item strong { color: var(--subin-cc-ink); font-size: 11px; }
.subin-issue-list__item span,
.subin-location-list small { color: var(--subin-cc-muted); font-size: 10px; }
.subin-issue-list__item a,
.subin-location-list a { font-size: 10px; font-weight: 700; }

.subin-shortcode-compact { display: flex; align-items: center; gap: 7px; }
.subin-shortcode-compact code { overflow: hidden; flex: 1 1 auto; padding: 8px 9px; border: 1px solid #dce4ef; border-radius: 7px; background: #f7f9fc; color: #33415a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.subin-orphaned-message { display: flex; align-items: center; gap: 6px; margin: 11px 0 0; color: var(--subin-cc-muted); font-size: 11px; }
.subin-location-list { margin-top: 10px; }
.subin-location-list li { align-items: center; }

.subin-diagnostic-guide { display: flex; align-items: stretch; justify-content: center; gap: 12px; margin-top: 18px; padding: 14px; border: 1px solid var(--subin-cc-line); border-radius: 12px; background: #fff; }
.subin-diagnostic-guide > div,
.subin-diagnostic-guide > a { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; min-width: 210px; padding: 6px 12px; color: var(--subin-cc-ink); text-decoration: none; }
.subin-diagnostic-guide .dashicons { grid-row: 1 / span 2; color: var(--subin-cc-blue); }
.subin-diagnostic-guide small { color: var(--subin-cc-muted); }
.subin-diagnostic-guide > i { align-self: center; color: #a6b0c1; font-style: normal; }
.subin-empty-state-action { margin-top: -18px; text-align: center; }

@media (max-width: 1600px) {
    .subin-portfolio-kpis { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
    .subin-portfolio-filters { flex-wrap: wrap; }
    .subin-portfolio-search { flex-basis: 300px; }
    .subin-forms-table-wrap { overflow: visible; }
    .subin-forms-table { min-width: 1050px; }
}

@media (max-width: 1100px) {
    .subin-forms-table { min-width: 0; }
    .subin-forms-table th:nth-child(7),
    .subin-form-portfolio-row > td:nth-child(7) { display: none; }
    .subin-portfolio-toolbar { flex-wrap: wrap; }
    .subin-portfolio-filters { flex-basis: 100%; }
    .subin-form-details-grid { grid-template-columns: 1fr; padding-left: 16px; }
    .subin-diagnostic-guide { overflow-x: auto; justify-content: flex-start; }
}

@media (max-width: 782px) {
    .subin-forms-table th:nth-child(3),
    .subin-form-portfolio-row > td:nth-child(3),
    .subin-forms-table th:nth-child(5),
    .subin-form-portfolio-row > td:nth-child(5) { display: none; }
    .subin-portfolio-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .subin-portfolio-alert { align-items: flex-start; flex-wrap: wrap; }
    .subin-portfolio-filters > * { flex: 1 1 calc(50% - 8px); max-width: none; }
    .subin-portfolio-search { flex-basis: 100%; }
    .subin-forms-bulk { flex-wrap: wrap; }
    .subin-funnel { grid-template-columns: repeat(4, 1fr); }
    .subin-funnel > i { display: none; }
    .subin-operation-stats { grid-template-columns: repeat(2, 1fr); }
}
