:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --warning-bg: #fff7ed;
    --warning-border: #fdba74;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.topbar {
    background: #111827;
    color: white;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 22px;
    font-weight: 700;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 18px;
    font-weight: 600;
}

nav a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1300px;
    margin: 28px auto;
    padding: 0 20px;
}

h1 {
    margin-top: 0;
}

.login-card,
.panel,
.card,
.summary {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.login-card {
    max-width: 420px;
    margin: 70px auto;
    padding: 28px;
}

.panel {
    padding: 20px;
    margin-bottom: 22px;
}

label {
    display: block;
    margin: 14px 0 7px;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: white;
}

textarea {
    font-family: Consolas, monospace;
}

.checkbox {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 600;
}

.checkbox input {
    width: auto;
}

button,
.button {
    display: inline-block;
    border: 0;
    background: var(--primary);
    color: white;
    padding: 11px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    margin-top: 12px;
}

button:hover,
.button:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: #374151;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 18px;
    margin: 22px 0;
}

.card {
    padding: 22px;
}

.card-title {
    color: var(--muted);
    font-weight: 700;
}

.card-number {
    font-size: 34px;
    font-weight: 800;
    margin-top: 8px;
}

.actions {
    margin: 20px 0 30px;
}

.table-wrap {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--muted);
}

tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #e5e7eb;
    color: #374151;
}

.badge.searched {
    background: #dcfce7;
    color: #166534;
}

.badge.skipped {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.messages {
    margin-bottom: 18px;
}

.message {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.filter-form {
    display: grid;
    grid-template-columns: 1fr 220px auto auto;
    gap: 12px;
    align-items: center;
}

.filter-form button,
.filter-form .button {
    margin-top: 0;
}

.summary {
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.error-text {
    color: var(--danger);
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pagination {
    margin: 18px 0;
    display: flex;
    gap: 14px;
    align-items: center;
}

@media (max-width: 800px) {
    .topbar {
        display: block;
    }

    nav {
        margin-top: 12px;
    }

    nav a {
        display: inline-block;
        margin: 0 12px 8px 0;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.page-header h1 {
    margin-bottom: 4px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(17, 24, 39, 0.55);
}

.modal-content {
    background: #ffffff;
    margin: 80px auto;
    padding: 24px;
    border-radius: 16px;
    width: min(680px, calc(100% - 30px));
    box-shadow: 0 20px 45px rgba(0,0,0,0.20);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: #111827;
    color: #ffffff;
    border: 0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 24px;
    line-height: 32px;
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.watch-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.secondary-button {
    background: #374151;
}

.inline-checkbox {
    margin: 12px 0 0;
}

.watch-filter {
    grid-template-columns: 1fr auto auto;
}

.row-actions {
    white-space: nowrap;
}

.row-actions a {
    margin-right: 12px;
}

.link-danger {
    background: none;
    border: 0;
    color: #dc2626;
    padding: 0;
    margin: 0;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.link-danger:hover {
    background: none;
    color: #991b1b;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
}

@media (max-width: 800px) {
    .page-header {
        display: block;
    }

    .watch-filter {
        grid-template-columns: 1fr;
    }

    .watch-actions {
        display: block;
    }

    .watch-actions button,
    .watch-actions .secondary-button {
        display: block;
        width: 100%;
        margin-bottom: 8px;
    }
}

.results-filter-form {
    grid-template-columns: 1fr 220px auto auto;
}

.result-mode-panel {
    margin-bottom: 20px;
}

.results-table th,
.results-table td {
    vertical-align: top;
}

.results-table .title-cell {
    min-width: 330px;
}

.results-table .money-cell {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
}

.results-table .total-cell {
    font-weight: 800;
}

.results-table th:nth-child(4),
.results-table th:nth-child(5),
.results-table th:nth-child(6) {
    text-align: right;
}

@media (max-width: 900px) {
    .results-filter-form {
        grid-template-columns: 1fr;
    }
}

.results-table th.sortable a {
    color: #374151;
    text-decoration: none;
    display: inline-block;
    width: 100%;
}

.results-table th.sortable a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.results-table th.money-header {
    text-align: right;
}

.results-table th.money-header a {
    text-align: right;
}


/* EcomCloud result images */
.results-table .image-cell {
    width: 88px;
    min-width: 88px;
    text-align: center;
    vertical-align: middle;
}

.results-table .image-cell img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    padding: 3px;
    display: block;
}

.results-table .image-placeholder {
    display: inline-flex;
    width: 72px;
    height: 72px;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}




/* EcomCloud cost/msrp fields */
.money-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

.small-note {
    font-size: 13px;
    margin-top: 10px;
}

.cost-cell {
    white-space: nowrap;
    font-weight: 800;
}


/* EcomCloud editable UPC cost/msrp */
.edit-money-cell {
    min-width: 105px;
}

.table-money-input {
    width: 95px;
    max-width: 100%;
    padding: 8px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 800;
    background: #ffffff;
}

.table-money-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.save-link {
    color: #0f766e;
    font-weight: 800;
    margin-right: 12px;
}


/* EcomCloud hide save until edit */
.save-link {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 10px;
    border: 0;
    background: #16a34a;
    color: #ffffff !important;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    margin-right: 10px;
}

tr.is-editing-cost-msrp .save-link {
    display: inline-flex;
}

.save-link:hover {
    background: #15803d;
}

.table-money-input {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.table-money-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}


/* EcomCloud save button open-click fix */
.save-link {
    display: inline-flex !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    min-width: 72px;
    margin-right: 10px;
    transition: opacity 0.12s ease;
}

tr.is-editing-cost-msrp .save-link {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Do NOT show Save just because Open/Delete was clicked */
tr:focus-within .save-link {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

tr.is-editing-cost-msrp:focus-within .save-link {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}


/* EcomCloud clickable UPC */
.upc-result-link {
    color: #0f172a;
    font-weight: 900;
    text-decoration: none;
}

.upc-result-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* === ECOMCLOUD UPC ALERT FLOWS PHASE 1 START === */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.page-header h1 {
    margin-bottom: 6px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.button.small {
    padding: 7px 10px;
    font-size: 13px;
}

.button.danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.alert-flow-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    margin: 0 0 16px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: #f8fafc;
}

.alert-flow-actions strong {
    display: block;
    margin-bottom: 3px;
}

.alert-flow-actions span,
.muted {
    color: #64748b;
}

.alert-flow-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.flow-editor-card {
    display: grid;
    gap: 22px;
}

.flow-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.flow-form-grid label,
.full-label {
    display: grid;
    gap: 7px;
    font-weight: 650;
}

.flow-form-grid input,
.flow-form-grid select,
.full-label textarea {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
}

.flow-section {
    display: grid;
    gap: 12px;
}

.flow-section h2 {
    margin: 0;
    font-size: 18px;
}

.flow-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.check-card {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    background: #fff;
}

.upc-check-list {
    display: grid;
    gap: 8px;
    max-height: 460px;
    overflow: auto;
    padding-right: 4px;
}

.upc-check-row {
    display: grid;
    grid-template-columns: 28px 170px repeat(3, minmax(90px, 1fr));
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    background: #fff;
}

.upc-main {
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.flow-options {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
}

.flow-options label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-actions,
.danger-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.flow-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 15px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: #fff;
}

.stat-card strong {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
}

.stat-card span {
    color: #64748b;
    font-size: 13px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.status-pill.good {
    background: #dcfce7;
    color: #166534;
}

.status-pill.muted-pill {
    background: #e5e7eb;
    color: #374151;
}

.empty-state {
    text-align: center;
    padding: 30px 14px;
}

.danger-zone {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 14px;
    background: #fff7f7;
}

@media (max-width: 900px) {
    .page-header,
    .alert-flow-actions,
    .flow-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .flow-form-grid,
    .check-grid,
    .flow-stats-grid {
        grid-template-columns: 1fr;
    }

    .upc-check-row {
        grid-template-columns: 24px 1fr;
    }

    .upc-check-row span:not(.upc-main) {
        grid-column: 2;
    }
}
/* === ECOMCLOUD UPC ALERT FLOWS PHASE 1 END === */

/* === ALERT FLOW HOURS + MINUTES PATCH START === */
.schedule-interval-grid {
    grid-template-columns: 2fr 1fr 1fr;
}

.small-note {
    margin-top: -10px;
    font-size: 13px;
}

@media (max-width: 900px) {
    .schedule-interval-grid {
        grid-template-columns: 1fr;
    }
}
/* === ALERT FLOW HOURS + MINUTES PATCH END === */


/* === ALERT FLOW DESIGN REFRESH START === */

.flow-page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin: 28px 0 18px;
}

.flow-eyebrow {
    margin: 0 0 7px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.flow-page-hero h1 {
    margin: 0;
    color: #111827;
    font-size: clamp(27px, 3vw, 36px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.flow-title-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.flow-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.flow-page-actions.centered {
    justify-content: center;
}

.flow-page-actions .button,
.flow-card-actions .button,
.flow-toolbar-actions .button,
.flow-save-actions .button {
    min-height: 40px;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
}

.flow-list-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
}

.flow-search-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    font-weight: 650;
    outline: none;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}

.flow-search-input:focus,
.flow-field input:focus,
.flow-field textarea:focus,
.interval-fields input:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, .18);
}

.flow-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    background: #eef4ff;
    color: #334155;
    border: 1px solid #dbe7ff;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.flow-count-pill.light {
    background: #f8fafc;
    border-color: #e5e7eb;
    color: #64748b;
}

.flow-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(315px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.flow-card,
.flow-panel,
.flow-empty-panel {
    background: #ffffff;
    border: 1px solid #e6edf5;
    border-radius: 20px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .06);
}

.flow-card {
    padding: 20px;
}

.flow-card[hidden] {
    display: none;
}

.flow-card-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.flow-card h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.flow-card-meta {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.flow-metrics {
    display: grid;
    grid-template-columns: .75fr .75fr 1.5fr;
    gap: 10px;
    margin: 18px 0 14px;
}

.flow-metric {
    min-width: 0;
    padding: 12px;
    border-radius: 15px;
    background: #f8fafc;
    border: 1px solid #e8eef5;
}

.flow-metric strong {
    display: block;
    overflow: hidden;
    color: #111827;
    font-size: 17px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.flow-metric span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.flow-card-recipients {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 34px;
}

.flow-card-recipients span {
    max-width: 100%;
    overflow: hidden;
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flow-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.flow-empty-panel {
    padding: 46px 24px;
    text-align: center;
}

.flow-empty-panel h2 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 24px;
    letter-spacing: -0.02em;
}

.flow-empty-panel p {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 15px;
}

.flow-modern-form {
    display: grid;
    gap: 16px;
    margin-bottom: 26px;
}

.flow-panel {
    padding: 22px;
}

.flow-panel-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.flow-panel-heading.split {
    justify-content: space-between;
}

.flow-panel-heading.split > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flow-panel-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.flow-step {
    display: inline-flex;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.flow-settings-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(280px, 1fr);
    gap: 16px;
}

.flow-field {
    display: block;
}

.flow-field > span,
.interval-fields label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 850;
}

.flow-field b {
    color: #ef4444;
}

.flow-field input,
.flow-field textarea,
.interval-fields input {
    width: 100%;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
    outline: none;
}

.flow-field input,
.interval-fields input {
    min-height: 46px;
    padding: 10px 13px;
}

.flow-field textarea {
    min-height: 70px;
    padding: 12px 13px;
    resize: vertical;
}

.interval-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.flow-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 10px;
}

.flow-check-card,
.flow-toggle-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid #e3eaf3;
    border-radius: 15px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.flow-check-card:hover,
.flow-toggle-card:hover,
.flow-upc-row:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.flow-check-card input,
.flow-toggle-card input,
.flow-upc-row input {
    width: 16px;
    height: 16px;
    accent-color: #111827;
}

.flow-add-emails {
    margin-top: 16px;
}

.flow-empty-inline {
    padding: 14px 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 15px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
    font-weight: 750;
}

.flow-upc-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.flow-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.flow-upc-list {
    display: grid;
    gap: 8px;
    max-height: 430px;
    overflow: auto;
    padding: 2px;
}

.flow-upc-row {
    display: grid;
    grid-template-columns: 32px minmax(145px, 1.2fr) repeat(3, minmax(105px, .8fr));
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 11px 13px;
    border: 1px solid #e3eaf3;
    border-radius: 15px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}

.flow-upc-row[hidden] {
    display: none;
}

.flow-upc-main {
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: .01em;
}

.flow-upc-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #111827;
}

.flow-upc-cell small {
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.flow-save-bar {
    position: sticky;
    bottom: 14px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e6edf5;
    border-radius: 18px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .12);
    backdrop-filter: blur(10px);
}

.flow-save-bar-text {
    color: #475569;
    font-size: 14px;
    font-weight: 850;
}

.flow-save-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.flow-options-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.flow-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 16px;
}

.stat-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid #e6edf5;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.stat-card strong {
    display: block;
    overflow: hidden;
    color: #111827;
    font-size: 19px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.stat-card span {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.recent-runs-card {
    margin-top: 4px;
}

.flow-table-wrap table th {
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.flow-table-wrap table td {
    font-size: 14px;
}

.status-pill.bad {
    background: #fee2e2;
    color: #991b1b;
}

.flow-danger-zone {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 16px 0 34px;
    padding: 16px;
    border: 1px solid #fee2e2;
    border-radius: 18px;
    background: #fff7f7;
}

@media (max-width: 900px) {
    .flow-page-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .flow-page-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .flow-settings-grid,
    .flow-stats-grid {
        grid-template-columns: 1fr;
    }

    .flow-upc-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .flow-toolbar-actions {
        justify-content: space-between;
    }

    .flow-upc-row {
        grid-template-columns: 28px 1fr;
        gap: 8px 12px;
    }

    .flow-upc-cell {
        grid-column: 2;
    }

    .flow-save-bar {
        align-items: stretch;
        flex-direction: column;
        position: static;
    }

    .flow-save-actions {
        justify-content: stretch;
    }

    .flow-save-actions .button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .flow-page-hero h1 {
        font-size: 28px;
    }

    .flow-card-grid {
        grid-template-columns: 1fr;
    }

    .flow-metrics {
        grid-template-columns: 1fr;
    }

    .interval-fields {
        grid-template-columns: 1fr;
    }

    .flow-panel,
    .flow-card {
        padding: 17px;
        border-radius: 17px;
    }

    .flow-page-actions .button {
        width: 100%;
    }

    .flow-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .flow-danger-zone .button {
        width: 100%;
    }
}

/* === ALERT FLOW DESIGN REFRESH END === */


/* === ALERT FLOW FONT SOFTENING START === */

/* Softer, cleaner typography only for Alert Flow pages */
.flow-page-hero,
.flow-list-toolbar,
.flow-card-grid,
.flow-modern-form,
.flow-panel,
.flow-empty-panel,
.flow-stats-grid,
.flow-danger-zone {
    font-family: "Segoe UI", Roboto, Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Page title: still strong, but not heavy/blocky */
.flow-page-hero h1 {
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Small top label */
.flow-eyebrow {
    font-weight: 650;
    letter-spacing: .075em;
}

/* Section headings */
.flow-panel-heading h2,
.flow-card h2,
.flow-empty-panel h2 {
    font-weight: 650;
    letter-spacing: -0.01em;
}

/* Number boxes */
.flow-step {
    font-weight: 700;
}

/* Field labels */
.flow-field > span,
.interval-fields label,
.flow-upc-cell small,
.stat-card span,
.flow-metric span {
    font-weight: 600;
    letter-spacing: .01em;
}

/* Inputs should feel readable, not bold */
.flow-field input,
.flow-field textarea,
.interval-fields input,
.flow-search-input {
    font-weight: 450;
    letter-spacing: 0;
}

/* Placeholder text softer */
.flow-field input::placeholder,
.flow-field textarea::placeholder,
.flow-search-input::placeholder {
    color: #7b8797;
    font-weight: 450;
}

/* Cards and checkbox text */
.flow-check-card,
.flow-toggle-card,
.flow-upc-row,
.flow-card-meta,
.flow-card-recipients span,
.flow-count-pill,
.flow-save-bar-text {
    font-weight: 550;
}

/* UPC itself can stay a little stronger */
.flow-upc-main {
    font-weight: 650;
    letter-spacing: 0;
}

/* Buttons: readable but less heavy */
.flow-page-actions .button,
.flow-card-actions .button,
.flow-toolbar-actions .button,
.flow-save-actions .button,
.button {
    font-weight: 650;
    letter-spacing: -0.005em;
}

/* Stats numbers */
.stat-card strong,
.flow-metric strong {
    font-weight: 650;
}

/* Email recipient line */
.flow-check-card span,
.flow-toggle-card span {
    font-weight: 550;
}

/* Softer body text color for better reading */
.flow-title-meta,
.flow-card-meta,
.flow-empty-panel p,
.flow-save-bar-text {
    color: #5f6f84;
}

/* Slightly reduce large title size on desktop */
.flow-page-hero h1 {
    font-size: clamp(26px, 2.7vw, 34px);
}

/* Softer input focus */
.flow-search-input:focus,
.flow-field input:focus,
.flow-field textarea:focus,
.interval-fields input:focus {
    border-color: #a8b3c3;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .18);
}

/* === ALERT FLOW FONT SOFTENING END === */


/* === ALERT FLOW UPC SELECT PAGING FINAL START === */

.flow-upc-toolbar.flow-upc-toolbar-select {
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.flow-select-all-box {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    font-weight: 550;
    white-space: nowrap;
    cursor: pointer;
}

.flow-select-all-box:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.flow-select-all-box input {
    width: 16px;
    height: 16px;
    accent-color: #111827;
}

.flow-page-size-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: #64748b;
    font-size: 14px;
    font-weight: 550;
    white-space: nowrap;
}

.flow-page-size-label select {
    min-height: 40px;
    padding: 8px 34px 8px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    font-weight: 500;
    outline: none;
}

.flow-page-size-label select:focus {
    border-color: #a8b3c3;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .18);
}

@media (max-width: 900px) {
    .flow-upc-toolbar.flow-upc-toolbar-select {
        grid-template-columns: 1fr;
    }

    .flow-select-all-box,
    .flow-page-size-label {
        width: 100%;
    }

    .flow-page-size-label select {
        margin-left: auto;
    }
}

/* === ALERT FLOW UPC SELECT PAGING FINAL END === */

