:root {
    --bg: #f4f7f5;
    --surface: #ffffff;
    --surface-soft: #f8faf9;
    --surface-dark: #0d1712;
    --text: #152019;
    --muted: #67736d;
    --muted-2: #8a958f;
    --line: #dfe7e2;
    --line-strong: #cfdad4;
    --primary: #117a55;
    --primary-strong: #0a6042;
    --primary-soft: #e8f5ef;
    --excel: #176b45;
    --danger: #b42318;
    --danger-soft: #fff1f0;
    --warning: #b54708;
    --warning-soft: #fff8eb;
    --shadow-sm: 0 1px 2px rgba(16, 38, 28, .05), 0 8px 24px rgba(16, 38, 28, .05);
    --shadow-md: 0 18px 50px rgba(16, 38, 28, .10);
    --shadow-lg: 0 30px 90px rgba(5, 25, 16, .20);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 5% 0%, rgba(17, 122, 85, .055), transparent 26rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { display: block; }
.hidden { display: none !important; }

/* Login */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
    padding: 24px;
    background: linear-gradient(145deg, #07110c 0%, #10231a 58%, #0d1913 100%);
}
.login-glow { position: absolute; border-radius: 999px; filter: blur(10px); opacity: .6; pointer-events: none; }
.login-glow-one { width: 440px; height: 440px; top: -190px; right: -120px; background: radial-gradient(circle, rgba(47, 184, 126, .28), transparent 70%); }
.login-glow-two { width: 380px; height: 380px; bottom: -190px; left: -130px; background: radial-gradient(circle, rgba(89, 141, 255, .16), transparent 70%); }
.login-card {
    width: min(460px, 100%);
    position: relative;
    z-index: 1;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 26px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand h1 { margin: 3px 0 0; font-size: 1.35rem; line-height: 1.2; letter-spacing: -.025em; }
.eyebrow { display: block; color: var(--primary); font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.brand-symbol {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    border-radius: 16px;
    background: linear-gradient(145deg, #1a9a6d, #0a6243);
    box-shadow: 0 12px 28px rgba(17, 122, 85, .28), inset 0 1px rgba(255,255,255,.28);
}
.brand-symbol svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand-symbol.small { width: 38px; height: 38px; border-radius: 12px; box-shadow: 0 8px 18px rgba(17, 122, 85, .2); }
.brand-symbol.small svg { width: 21px; }
.login-copy { margin: 22px 0 26px; color: var(--muted); line-height: 1.55; }
.login-footer { margin: 22px 0 0; color: var(--muted-2); font-size: .8rem; text-align: center; }
.login-footer strong { color: var(--muted); }
.alert { padding: 12px 14px; margin: 0 0 18px; border-radius: 11px; font-size: .9rem; }
.alert.error { color: var(--danger); background: var(--danger-soft); border: 1px solid #ffd3cf; }

/* Inputs and buttons */
.field-label, .form-group label, .discount-copy label {
    display: block;
    margin: 0 0 8px;
    font-size: .84rem;
    font-weight: 750;
    color: #253129;
}
input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input[type="text"], input[type="password"], select { height: 46px; padding: 0 13px; }
textarea { min-height: 130px; padding: 13px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: #3aa77e; box-shadow: 0 0 0 4px rgba(17, 122, 85, .11); }
input::placeholder, textarea::placeholder { color: #a0aaa5; }
.input-with-icon { position: relative; }
.input-with-icon svg { width: 18px; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); fill: none; stroke: #7f8b84; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.input-with-icon input { padding-left: 42px; }
.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 760;
    font-size: .88rem;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { color: #fff; background: linear-gradient(145deg, #16885f, #0d6b49); box-shadow: 0 9px 20px rgba(17, 122, 85, .18); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 26px rgba(17, 122, 85, .25); }
.btn-secondary { color: #126546; background: var(--primary-soft); border-color: #cde9dc; }
.btn-soft { color: #435048; background: #f1f4f2; border-color: #e1e7e3; }
.btn-danger-ghost { color: var(--danger); background: #fff; border-color: #f0c7c3; }
.btn-excel { color: #fff; background: linear-gradient(145deg, #1d7b50, #125f3e); box-shadow: 0 10px 24px rgba(23, 107, 69, .2); }
.btn-block { width: 100%; margin-top: 18px; min-height: 48px; }

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 64px;
    color: #fff;
    background: rgba(10, 22, 16, .96);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 30px rgba(7, 20, 13, .13);
}
.header-inner { width: min(1560px, calc(100% - 32px)); height: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.compact-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-copy { min-width: 0; }
.brand-copy h1 { margin: 0; font-size: 1rem; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
.brand-copy span { display: block; margin-top: 3px; color: #9fb1a7; font-size: .7rem; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-action {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #dbe5df;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 11px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}
.icon-action:hover { background: rgba(255,255,255,.13); transform: translateY(-1px); }
.icon-action svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.connection-badge {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    color: #c5d2cb;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 720;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7d8c84; box-shadow: 0 0 0 4px rgba(125,140,132,.12); }
.connection-badge.connected .status-dot { background: #43cf8d; box-shadow: 0 0 0 4px rgba(67,207,141,.12); }
.connection-badge.failed .status-dot { background: #ff746c; box-shadow: 0 0 0 4px rgba(255,116,108,.12); }
.connection-badge.testing .status-dot { background: #f5c04a; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* Workspace */
.workspace { width: min(1560px, calc(100% - 32px)); margin: 22px auto 34px; display: grid; gap: 18px; }
.panel { background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-heading, .results-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.input-panel, .results-panel { padding: 22px; }
.heading-group, .summary-title { display: flex; align-items: center; gap: 13px; }
.heading-group h2, .summary-title h2, .results-top h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.012em; }
.heading-group p, .summary-title p, .results-top p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.step-chip {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid #d3ebdf;
    border-radius: 12px;
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .04em;
}

/* Collapsible columns */
.accordion-panel { overflow: hidden; }
.accordion-panel > summary {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.accordion-panel > summary::-webkit-details-marker { display: none; }
.accordion-panel[open] > summary { border-bottom: 1px solid var(--line); }
.summary-right { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.summary-hint { font-size: .78rem; }
.chevron { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-soft); border: 1px solid var(--line); transition: transform .2s ease; }
.chevron svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.accordion-panel[open] .chevron { transform: rotate(180deg); }
.accordion-content { padding: 18px 20px 20px; }
.template-bar { display: flex; align-items: flex-end; gap: 10px; padding: 14px; margin-bottom: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; }
.template-field { min-width: 180px; }
.template-field.grow { flex: 1 1 240px; }
.mini-label { display: block; margin: 0 0 6px; color: var(--muted); font-size: .72rem; font-weight: 740; }
.template-button { height: 46px; }
.column-builder { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 9px; }
.column-item {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease, transform .15s ease;
}
.column-item:has(input:checked) { border-color: #b9ddcc; background: #fbfefc; }
.column-item.dragging { opacity: .45; transform: scale(.98); }
.column-item.drag-over { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(17,122,85,.1); }
.drag-handle { width: 24px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; color: #a3ada8; cursor: grab; }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 17px; fill: currentColor; }
.switch-row { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: .84rem; font-weight: 700; }
.switch-row > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.custom-checkbox { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto; color: transparent; background: #fff; border: 1.5px solid #bdc9c2; border-radius: 6px; transition: all .16s ease; }
.custom-checkbox svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.switch-row input:checked + .custom-checkbox { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 5px 12px rgba(17,122,85,.18); }
.order-actions { display: flex; gap: 3px; }
.micro-btn { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; color: #66736c; background: #f7f9f8; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.micro-btn:hover { color: var(--primary); border-color: #bddbce; background: var(--primary-soft); }
.micro-btn svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Product input */
.discount-bar {
    display: grid;
    grid-template-columns: auto minmax(210px, 1fr) 130px auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin: 18px 0;
    background: linear-gradient(100deg, #f3faf7, #f9fbfa);
    border: 1px solid #d7ebe1;
    border-radius: 16px;
}
.discount-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #1b9569, #0d6a49); border-radius: 12px; font-size: 1.05rem; font-weight: 850; box-shadow: 0 8px 18px rgba(17,122,85,.17); }
.discount-copy label { margin-bottom: 3px; }
.discount-copy span { color: var(--muted); font-size: .75rem; }
.percentage-input { position: relative; }
.percentage-input input { padding-right: 34px; text-align: right; font-weight: 800; }
.percentage-input span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .82rem; font-weight: 750; }
.entry-grid { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(420px, 1.18fr); gap: 14px; }
.entry-card { padding: 16px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 16px; }
.entry-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.entry-card-head h3 { margin: 0; font-size: .91rem; }
.entry-card-head p { margin: 3px 0 0; color: var(--muted); font-size: .72rem; }
.entry-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--primary); background: #fff; border: 1px solid #dbe8e1; border-radius: 10px; }
.entry-icon svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.single-input-row { display: flex; gap: 9px; }
.single-input-row input { min-width: 0; }
.bulk-entry-card textarea { min-height: 132px; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; }
.bulk-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.bulk-footer span { color: var(--muted); font-size: .75rem; }
.progress-area { margin-top: 16px; padding: 12px 14px; background: #f7faf8; border: 1px solid var(--line); border-radius: 13px; }
.progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: .75rem; }
.progress-meta strong { color: var(--primary); }
.progress-track { height: 8px; overflow: hidden; background: #e2ebe6; border-radius: 999px; }
.progress-track > div { width: 0; height: 100%; background: linear-gradient(90deg, #1ca572, #0d7250); border-radius: inherit; transition: width .2s ease; }

/* Results */
.results-top { margin-bottom: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; }
.stat-card { min-height: 76px; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.stat-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; }
.stat-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stat-card span:not(.stat-icon) { display: block; color: var(--muted); font-size: .72rem; font-weight: 650; }
.stat-card strong { display: block; margin-top: 2px; font-size: 1.45rem; line-height: 1; letter-spacing: -.03em; }
.stat-total .stat-icon { color: #3f5d4e; background: #e9efec; }
.stat-found { border-color: #d5ebdf; background: #f6fcf9; }
.stat-found .stat-icon { color: var(--primary); background: var(--primary-soft); }
.stat-found strong { color: var(--primary-strong); }
.stat-missing { border-color: #f0ddd9; background: #fffafa; }
.stat-missing .stat-icon { color: var(--danger); background: var(--danger-soft); }
.stat-missing strong { color: var(--danger); }
.table-shell { position: relative; min-height: 190px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.empty-state { min-height: 230px; display: grid; place-items: center; align-content: center; text-align: center; padding: 28px; }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; color: #7c8b83; background: #f1f5f3; border-radius: 16px; }
.empty-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h3 { margin: 13px 0 5px; font-size: .95rem; }
.empty-state p { margin: 0; color: var(--muted); font-size: .78rem; }
.table-wrap { max-height: 64vh; overflow: auto; }
table { width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0; }
th, td { border-bottom: 1px solid var(--line); border-right: 1px solid #edf1ef; text-align: left; vertical-align: top; }
th:last-child, td:last-child { border-right: 0; }
th {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px 11px;
    color: #f2f7f4;
    background: #10241a;
    font-size: .72rem;
    font-weight: 780;
    letter-spacing: .02em;
    white-space: nowrap;
    box-shadow: inset 0 -1px rgba(255,255,255,.04);
}
td { padding: 7px; background: #fff; font-size: .8rem; }
tbody tr:nth-child(even):not(.row-missing) td { background: #fbfcfb; }
tbody tr:hover td { background: #f5faf7; }
tbody tr.row-missing td { background: #fff8f7; }
tbody tr:last-child td { border-bottom: 0; }
.row-number-head, .row-number { width: 48px; min-width: 48px; text-align: center; }
.row-number { padding-top: 18px; color: #8a958f; font-size: .72rem; font-weight: 730; }
.row-action-head, .row-action { width: 48px; min-width: 48px; text-align: center; }
td input, td textarea { min-width: 125px; min-height: 36px; height: 36px; padding: 7px 8px; color: #29342e; background: transparent; border-color: transparent; border-radius: 8px; font-size: .78rem; }
td textarea { min-width: 210px; height: 54px; min-height: 54px; resize: vertical; line-height: 1.35; }
td input:focus, td textarea:focus { background: #fff; border-color: #55ae89; box-shadow: 0 0 0 3px rgba(17,122,85,.1); }
td[data-field="sku"] input, td[data-field="barcode"] input { min-width: 112px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
td[data-field="handle"] input { min-width: 145px; }
td[data-field="vendor"] input, td[data-field="product_type"] input { min-width: 140px; }
td[data-field="product_id"] input, td[data-field="variant_id"] input { min-width: 250px; font-size: .72rem; color: #66736c; }
td[data-field="discount"] input { min-width: 88px; max-width: 105px; text-align: center; font-weight: 800; color: var(--primary-strong); background: #f2faf6; border-color: #d7ebe1; }
.lookup-badge { display: inline-flex; align-items: center; gap: 6px; min-width: 86px; margin: 7px 3px; padding: 6px 9px; border-radius: 999px; font-size: .7rem; font-weight: 780; }
.lookup-badge.found { color: #0c6c49; background: #e8f6ef; }
.lookup-badge.missing { color: var(--danger); background: var(--danger-soft); }
.lookup-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.remove-row { width: 30px; height: 30px; display: grid; place-items: center; margin: 4px auto 0; color: #a74b43; background: #fff4f3; border: 1px solid #f2d5d2; border-radius: 9px; cursor: pointer; transition: color .15s ease, background .15s ease; }
.remove-row:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.remove-row svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(4, 14, 9, .68); backdrop-filter: blur(8px); }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 22px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 23px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 4px 0 0; font-size: 1.18rem; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; color: #64716a; background: #f4f6f5; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.modal-close svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.settings-form { padding: 20px 23px 23px; }
.form-group { margin-bottom: 16px; }
.form-group.compact-group { max-width: 220px; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: .7rem; }
.connection-result { margin: 4px 0 16px; padding: 11px 12px; border-radius: 11px; font-size: .77rem; line-height: 1.4; }
.connection-result.success { color: #0c6948; background: #ebf8f1; border: 1px solid #cdebdc; }
.connection-result.error { color: var(--danger); background: var(--danger-soft); border: 1px solid #f2d2cf; }
.connection-result.testing { color: var(--warning); background: var(--warning-soft); border: 1px solid #f1e0ba; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* Footer and toast */
.app-footer { padding: 0 20px 24px; color: #87928c; font-size: .72rem; text-align: center; }
.app-footer strong { color: #64716a; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 120; max-width: min(430px, calc(100% - 36px)); padding: 13px 15px; color: #fff; background: #14251c; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; box-shadow: var(--shadow-md); font-size: .82rem; line-height: 1.45; }
.toast.error { background: #8f251d; }

@media (max-width: 980px) {
    .entry-grid { grid-template-columns: 1fr; }
    .discount-bar { grid-template-columns: auto 1fr 120px; }
    .discount-bar .btn { grid-column: 2 / -1; justify-self: start; }
    .template-bar { flex-wrap: wrap; }
    .template-button { flex: 1 1 140px; }
}

@media (max-width: 720px) {
    .header-inner, .workspace { width: min(100% - 20px, 1560px); }
    .brand-copy span, .connection-text { display: none; }
    .connection-badge { width: 34px; justify-content: center; padding: 0; }
    .input-panel, .results-panel { padding: 16px; }
    .panel-heading, .results-top { align-items: flex-start; }
    .panel-heading { flex-direction: column; }
    .panel-heading > .btn { align-self: flex-end; margin-top: -45px; }
    .results-top { flex-direction: column; }
    .results-top .btn-excel { width: 100%; }
    .summary-hint { display: none; }
    .accordion-panel > summary { padding: 14px 15px; }
    .accordion-content { padding: 14px 15px 16px; }
    .template-bar { padding: 11px; }
    .template-field.grow { flex-basis: 100%; }
    .column-builder { grid-template-columns: 1fr; }
    .discount-bar { grid-template-columns: auto 1fr; }
    .percentage-input { grid-column: 1 / 2; }
    .discount-bar .btn { grid-column: 2 / 3; align-self: stretch; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 66px; }
    .single-input-row { flex-direction: column; }
    .single-input-row .btn { width: 100%; }
    .bulk-footer { align-items: flex-end; }
    .bulk-footer .btn { min-width: 150px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
}

@media (max-width: 460px) {
    .login-card { padding: 26px 22px; border-radius: 22px; }
    .brand-copy h1 { font-size: .88rem; }
    .panel-heading > .btn { align-self: stretch; margin-top: 0; }
    .discount-bar { grid-template-columns: auto 1fr; gap: 10px; }
    .percentage-input, .discount-bar .btn { grid-column: 1 / -1; }
    .discount-bar .btn { width: 100%; }
    .bulk-footer { flex-direction: column; align-items: stretch; }
    .bulk-footer .btn { width: 100%; }
    .heading-group p, .summary-title p, .results-top p { max-width: 230px; }
}

/* =========================================================
   Enterprise v3 foundation — bounded data grid, smart controls and polish
   ========================================================= */
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body {
    background:
        radial-gradient(circle at 8% -8%, rgba(21, 143, 98, .10), transparent 30rem),
        radial-gradient(circle at 95% 12%, rgba(38, 96, 75, .07), transparent 34rem),
        linear-gradient(180deg, #f5f8f6 0%, #eef3f0 100%);
}
.app-header {
    height: 60px;
    background: linear-gradient(100deg, rgba(8, 20, 14, .985), rgba(13, 37, 26, .97));
    box-shadow: 0 10px 34px rgba(7, 25, 15, .16);
}
.header-inner,
.workspace {
    width: min(1440px, calc(100% - 28px));
    max-width: 100%;
    min-width: 0;
}
.workspace { margin-top: 18px; gap: 16px; }
.panel,
.input-panel,
.results-panel,
.accordion-panel,
.table-shell,
.table-wrap,
.entry-grid,
.entry-card,
.smart-controls,
.smart-control { min-width: 0; max-width: 100%; }
.panel {
    position: relative;
    border-color: rgba(201, 216, 208, .88);
    background: linear-gradient(180deg, rgba(255,255,255,.995), rgba(252,254,253,.98));
    box-shadow: 0 2px 4px rgba(16, 38, 28, .035), 0 18px 48px rgba(16, 38, 28, .055);
}
.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px rgba(255,255,255,.9);
}
.input-panel,
.results-panel { padding: 20px; }
.step-chip {
    background: linear-gradient(145deg, #effaf5, #dff2e9);
    box-shadow: inset 0 1px #fff, 0 7px 16px rgba(17,122,85,.08);
}
.btn { box-shadow: inset 0 1px rgba(255,255,255,.28); }
.btn-control {
    color: #174c37;
    background: linear-gradient(180deg, #ffffff, #edf5f1);
    border-color: #cfe1d7;
    box-shadow: inset 0 1px #fff, 0 7px 16px rgba(31, 78, 56, .08);
}
.btn-control:hover:not(:disabled) {
    color: #0d6847;
    border-color: #9fcdb8;
    background: linear-gradient(180deg, #ffffff, #e7f5ee);
}
.button-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: buttonSpin .7s linear infinite;
}
@keyframes buttonSpin { to { transform: rotate(360deg); } }

/* Smart control deck */
.smart-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 13px;
    margin: 17px 0;
}
.smart-control {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 48px minmax(170px, 1fr) minmax(230px, auto);
    align-items: center;
    gap: 13px;
    min-height: 92px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid #d7e5dd;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(243,249,246,.97));
    box-shadow:
        inset 0 1px rgba(255,255,255,.98),
        inset 0 -1px rgba(190,210,199,.28),
        0 10px 28px rgba(20, 62, 42, .07);
}
.smart-control::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 210px;
    height: 210px;
    right: -110px;
    top: -140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30, 157, 106, .12), transparent 68%);
}
.duplicate-control-card::before { background: radial-gradient(circle, rgba(63, 103, 175, .10), transparent 68%); }
.control-orb {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 15px;
    box-shadow: inset 0 1px rgba(255,255,255,.35), 0 11px 22px rgba(15, 91, 60, .19);
}
.discount-orb { background: linear-gradient(145deg, #21a878, #0c704d); }
.discount-orb span { font-size: 1.08rem; font-weight: 900; }
.duplicate-orb { background: linear-gradient(145deg, #4979a9, #294f75); box-shadow: inset 0 1px rgba(255,255,255,.32), 0 11px 22px rgba(41,79,117,.18); }
.duplicate-orb svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.control-copy { min-width: 0; }
.control-kicker {
    display: block;
    margin-bottom: 3px;
    color: #15805a;
    font-size: .63rem;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.duplicate-control-card .control-kicker { color: #416a91; }
.control-copy label {
    display: block;
    margin: 0;
    color: #1a2a21;
    font-size: .9rem;
    font-weight: 820;
    letter-spacing: -.01em;
}
.control-copy p {
    margin: 5px 0 0;
    color: #6b7871;
    font-size: .72rem;
    line-height: 1.35;
}
.control-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    min-width: 0;
}
.premium-input { width: 100px; flex: 0 0 100px; }
.premium-input input {
    height: 44px;
    padding: 0 32px 0 12px;
    color: #0b6746;
    border-color: #b9d8ca;
    background: linear-gradient(180deg, #fff, #f3faf6);
    box-shadow: inset 0 2px 5px rgba(19, 80, 51, .055), 0 5px 14px rgba(20, 72, 47, .05);
    font-size: 1rem;
    text-align: center;
}
.duplicate-actions {
    min-width: 225px;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
}
.duplicate-actions select {
    height: 44px;
    padding: 0 36px 0 12px;
    color: #27465f;
    border-color: #c9d9e6;
    background-color: #fff;
    font-size: .8rem;
    font-weight: 760;
}
.control-note {
    color: #7b8981;
    font-size: .64rem;
    line-height: 1.25;
    text-align: right;
}

/* Elevated entry cards */
.entry-card {
    background: linear-gradient(145deg, #fafcfb, #f3f7f5);
    box-shadow: inset 0 1px #fff, 0 9px 22px rgba(20, 55, 38, .045);
}
.entry-icon { box-shadow: inset 0 1px #fff, 0 7px 14px rgba(26, 78, 53, .055); }
.bulk-metrics { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.duplicate-detected {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0 8px;
    color: #9b5c0b;
    background: #fff6e6;
    border: 1px solid #f0d9aa;
    border-radius: 999px;
    font-size: .67rem !important;
    font-weight: 760;
}

/* More prominent result counters */
.stats-grid { gap: 12px; }
.stat-card {
    min-height: 80px;
    position: relative;
    overflow: hidden;
    border-radius: 17px;
    box-shadow: inset 0 1px #fff, 0 8px 20px rgba(22, 58, 40, .045);
}
.stat-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    right: -38px;
    top: -50px;
    border-radius: 50%;
    background: rgba(72, 125, 96, .055);
}
.stat-card strong { font-size: 1.62rem; }
.stat-found { background: linear-gradient(145deg, #f9fdfa, #eff9f4); }
.stat-missing { background: linear-gradient(145deg, #fffdfd, #fff4f2); }

/* Root-level table containment: wide tables scroll inside the panel only */
.results-panel { overflow: hidden; }
.table-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    isolation: isolate;
    border-color: #d8e2dc;
    box-shadow: inset 0 1px #fff, 0 10px 30px rgba(17, 48, 32, .055);
}
.table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: min(62vh, 720px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: #fff;
    outline: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: #94b4a4 #edf3f0;
    scrollbar-width: thin;
}
.table-wrap:focus-visible { box-shadow: inset 0 0 0 3px rgba(17,122,85,.12); }
.table-wrap::-webkit-scrollbar { width: 12px; height: 12px; }
.table-wrap::-webkit-scrollbar-track { background: #edf3f0; }
.table-wrap::-webkit-scrollbar-thumb { background: #9bb7a9; border: 3px solid #edf3f0; border-radius: 999px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: #6f9b84; }
#resultTable {
    width: var(--table-content-width, 1000px);
    min-width: 100%;
    max-width: none;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}
#resultTable th,
#resultTable td {
    width: auto;
    max-width: none;
    overflow: hidden;
}
#resultTable th {
    height: 44px;
    padding: 0 11px;
    vertical-align: middle;
    color: #f4faf6;
    background: linear-gradient(180deg, #173428, #10251b);
    border-right-color: rgba(255,255,255,.07);
    box-shadow: inset 0 1px rgba(255,255,255,.045), inset 0 -1px rgba(0,0,0,.18);
}
#resultTable td { padding: 7px; }
#resultTable td input,
#resultTable td textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    border: 1px solid transparent;
}
#resultTable td textarea { min-width: 0 !important; }
#resultTable td[data-field="product_id"] input,
#resultTable td[data-field="variant_id"] input { min-width: 0 !important; }
.row-number-head,
.row-number {
    position: sticky;
    left: 0;
}
.row-number-head { z-index: 13 !important; background: linear-gradient(180deg, #153026, #0d2118) !important; }
.row-number {
    z-index: 5;
    background: #f4f7f5 !important;
    box-shadow: 1px 0 #e2e9e5;
}
.sticky-data-head {
    position: sticky;
    left: 52px;
    z-index: 12 !important;
    box-shadow: 8px 0 16px -13px rgba(3, 20, 11, .9), inset 0 -1px rgba(0,0,0,.18) !important;
}
.sticky-data-cell {
    position: sticky;
    left: 52px;
    z-index: 4;
    background: #fff !important;
    box-shadow: 8px 0 16px -13px rgba(12, 38, 23, .42);
}
tbody tr:nth-child(even):not(.row-missing) .sticky-data-cell { background: #fbfcfb !important; }
tbody tr:hover .sticky-data-cell { background: #f5faf7 !important; }
tbody tr.row-missing .sticky-data-cell { background: #fff8f7 !important; }
.row-action-head,
.row-action {
    position: sticky;
    right: 0;
}
.row-action-head { z-index: 13 !important; background: linear-gradient(180deg, #153026, #0d2118) !important; }
.row-action {
    z-index: 5;
    background: #fff !important;
    box-shadow: -8px 0 16px -13px rgba(12, 38, 23, .42);
}
tbody tr:nth-child(even):not(.row-missing) .row-action { background: #fbfcfb !important; }
tbody tr:hover .row-action { background: #f5faf7 !important; }
tbody tr.row-missing .row-action { background: #fff8f7 !important; }
#resultTable td[data-field="discount"] input {
    min-width: 0;
    max-width: 100%;
    background: linear-gradient(180deg, #f5fcf8, #eaf7f0);
    box-shadow: inset 0 1px #fff;
}
.lookup-badge { min-width: 0; width: calc(100% - 6px); justify-content: center; }

@media (max-width: 1180px) {
    .smart-controls { grid-template-columns: 1fr; }
    .smart-control { grid-template-columns: 48px minmax(170px, 1fr) minmax(260px, auto); }
}

@media (max-width: 760px) {
    .header-inner, .workspace { width: min(100% - 18px, 1440px); }
    .smart-control {
        grid-template-columns: 44px minmax(0, 1fr);
        padding: 13px;
    }
    .control-orb { width: 44px; height: 44px; border-radius: 14px; }
    .control-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
        padding-top: 2px;
    }
    .discount-actions .premium-input { flex: 1 1 110px; width: auto; }
    .discount-actions .btn { flex: 1 1 160px; }
    .duplicate-actions { min-width: 0; }
    .control-note { text-align: left; }
    .table-wrap { max-height: 66vh; }
}

@media (max-width: 480px) {
    .input-panel, .results-panel { padding: 14px; }
    .smart-controls { margin: 14px 0; gap: 10px; }
    .discount-actions { flex-direction: column; align-items: stretch; }
    .discount-actions .premium-input { width: 100%; flex-basis: auto; }
    .discount-actions .btn { width: 100%; }
    .bulk-metrics { align-items: flex-start; flex-direction: column; gap: 5px; }
}

/* ========================================================================== 
   Enterprise v3 — premium spatial UI + high-volume sync experience
   ========================================================================== */
:root {
    --v3-ink: #0b1711;
    --v3-emerald: #0c7a50;
    --v3-mint: #49c793;
    --v3-blue: #4f7ef7;
    --v3-shadow: 0 26px 70px rgba(12, 40, 27, .10), 0 5px 18px rgba(12, 40, 27, .06);
}

body {
    background:
        radial-gradient(circle at 4% 4%, rgba(47, 190, 132, .13), transparent 24rem),
        radial-gradient(circle at 96% 10%, rgba(78, 126, 247, .09), transparent 30rem),
        linear-gradient(180deg, #f7faf8 0%, #edf3ef 54%, #f7faf8 100%);
}

.app-header {
    height: 66px;
    background: linear-gradient(110deg, rgba(5, 18, 12, .985), rgba(11, 43, 28, .97) 58%, rgba(17, 35, 30, .97));
    border-bottom-color: rgba(255,255,255,.1);
    box-shadow: 0 14px 42px rgba(5, 24, 14, .2);
}

.enterprise-pill {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    color: #dffbef;
    border: 1px solid rgba(112, 233, 177, .22);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(49, 166, 115, .22), rgba(24, 104, 72, .18));
    box-shadow: inset 0 1px rgba(255,255,255,.08);
    font-size: .66rem;
    font-weight: 820;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.workspace {
    width: min(1500px, calc(100% - 30px));
    gap: 18px;
    margin-top: 20px;
}

.panel {
    border: 1px solid rgba(190, 210, 199, .82);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.995), rgba(249,252,250,.98));
    box-shadow: var(--v3-shadow), inset 0 1px rgba(255,255,255,.95);
}

.panel::before {
    content: "";
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 36%;
    border-radius: 23px 23px 50% 50%;
    background: linear-gradient(180deg, rgba(255,255,255,.44), transparent);
    pointer-events: none;
}

.panel-heading, .results-top, .accordion-content, .stats-grid, .entry-grid, .smart-controls, .table-shell {
    position: relative;
    z-index: 1;
}

.step-chip {
    min-width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #c9e3d6;
    border-radius: 14px;
    color: #0b6c48;
    background: linear-gradient(145deg, #fbfffd, #e2f4eb);
    box-shadow: 0 9px 20px rgba(18, 111, 74, .10), inset 0 1px #fff;
    font-weight: 850;
}

.entry-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #d4e2da;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff 0%, #f4faf7 100%);
    box-shadow: 0 16px 38px rgba(15, 56, 37, .075), inset 0 1px #fff;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.entry-card::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    right: -95px;
    top: -115px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 188, 129, .12), transparent 70%);
    pointer-events: none;
}
.entry-card:hover {
    transform: translateY(-2px);
    border-color: #c1daca;
    box-shadow: 0 22px 48px rgba(15, 56, 37, .105), inset 0 1px #fff;
}

.smart-control {
    border-radius: 21px;
    box-shadow: 0 18px 42px rgba(16, 62, 41, .075), inset 0 1px rgba(255,255,255,.98), inset 0 -1px rgba(176,203,188,.25);
}
.control-orb, .entry-icon, .brand-symbol {
    transform: translateZ(0);
    box-shadow: 0 14px 30px rgba(13, 102, 67, .19), inset 0 1px rgba(255,255,255,.35), inset 0 -2px rgba(0,0,0,.08);
}

.btn {
    border-radius: 12px;
    box-shadow: 0 7px 16px rgba(22, 65, 45, .08), inset 0 1px rgba(255,255,255,.35);
}
.btn-primary {
    background: linear-gradient(160deg, #22a774 0%, #0e7651 56%, #075a3d 100%);
    box-shadow: 0 12px 26px rgba(10, 111, 73, .20), inset 0 1px rgba(255,255,255,.3), inset 0 -2px rgba(0,0,0,.08);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 16px 34px rgba(10,111,73,.27), inset 0 1px rgba(255,255,255,.3); }
.btn-excel { background: linear-gradient(160deg, #21885a, #0d6240 65%, #084d33); }

input[type="text"], input[type="password"], textarea, select {
    border-color: #cbdad2;
    box-shadow: inset 0 2px 5px rgba(27, 57, 42, .035), 0 1px rgba(255,255,255,.9);
}
input:focus, textarea:focus, select:focus {
    border-color: #42aa80;
    box-shadow: 0 0 0 4px rgba(17, 122, 85, .10), 0 9px 22px rgba(18, 87, 60, .07);
}

.stats-grid { gap: 12px; }
.stat-card {
    border: 1px solid #d9e5de;
    border-radius: 16px;
    background: linear-gradient(150deg, #fff, #f5faf7);
    box-shadow: 0 11px 26px rgba(20, 63, 44, .06), inset 0 1px #fff;
}

.table-shell {
    overflow: hidden;
    border: 1px solid #d4e1da;
    border-radius: 18px;
    background: #fff;
    box-shadow: inset 0 1px #fff, 0 12px 34px rgba(18, 55, 39, .055);
}
.table-wrap { border-radius: 17px 17px 0 0; }
thead th {
    background: linear-gradient(180deg, #17392b, #10281e);
    box-shadow: inset 0 1px rgba(255,255,255,.06), inset 0 -1px rgba(0,0,0,.16);
}
tbody tr:nth-child(even) td { background-color: rgba(244, 249, 246, .62); }
tbody tr:hover td { background-color: #f0f8f4; }

/* Animated Shopify sync stage */
.progress-enterprise {
    --progress: 0;
    position: relative;
    margin-top: 18px;
    padding: 16px 18px;
    overflow: hidden;
    border: 1px solid rgba(110, 177, 143, .34);
    border-radius: 19px;
    background:
        radial-gradient(circle at 92% 0%, rgba(86, 137, 247, .12), transparent 16rem),
        linear-gradient(145deg, #f7fffb, #eef8f3);
    box-shadow: 0 16px 38px rgba(21, 78, 51, .075), inset 0 1px #fff;
}
.progress-enterprise::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(20, 111, 74, .07) .7px, transparent .7px);
    background-size: 11px 11px;
    mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
    pointer-events: none;
}
.progress-stage { position: relative; z-index: 1; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: center; }
.progress-content { min-width: 0; }
.progress-enterprise .progress-meta { margin: 0 0 10px; align-items: flex-end; }
.progress-enterprise .progress-meta > div:first-child { min-width: 0; display: grid; gap: 3px; }
.progress-enterprise .progress-meta strong { color: #123629; font-size: .82rem; }
.progress-enterprise #progressSubtext { color: #71827a; font-size: .69rem; line-height: 1.35; }
.progress-number { min-width: 75px; text-align: right; }
.progress-number strong { display: block; color: #08704a !important; font-size: 1rem !important; }
.progress-number span { color: #7a8981; font-size: .65rem; }
.progress-enterprise .progress-track {
    position: relative;
    height: 12px;
    overflow: hidden;
    border: 1px solid #d4e5dc;
    background: linear-gradient(180deg, #e1ebe6, #edf4f0);
    box-shadow: inset 0 2px 5px rgba(23, 63, 44, .08), 0 1px #fff;
}
.progress-enterprise .progress-track > #progressBar {
    position: relative;
    z-index: 1;
    background: linear-gradient(90deg, #2ec48c, #0b8056 60%, #54a5ff);
    box-shadow: 0 0 18px rgba(35, 186, 126, .34), inset 0 1px rgba(255,255,255,.42);
    transition: width .35s cubic-bezier(.2,.8,.2,1);
}
.progress-sheen {
    position: absolute;
    z-index: 2;
    top: 1px;
    bottom: 1px;
    width: 76px;
    left: -80px;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
    animation: progressSheen 1.4s linear infinite;
    pointer-events: none;
}
@keyframes progressSheen { to { left: calc(100% + 80px); } }

.sync-mascot {
    position: relative;
    width: 52px;
    height: 48px;
    margin: 4px auto 10px;
    border-radius: 15px 15px 17px 17px;
    background: linear-gradient(145deg, #31bf86, #08724d);
    border: 1px solid rgba(5, 86, 56, .32);
    box-shadow: 0 13px 24px rgba(16, 113, 73, .20), inset 0 1px rgba(255,255,255,.42), inset 0 -3px rgba(0,0,0,.08);
    animation: mascotBob .7s ease-in-out infinite alternate;
}
.mascot-handle {
    position: absolute;
    width: 22px;
    height: 12px;
    left: 14px;
    top: -9px;
    border: 4px solid #149565;
    border-bottom: 0;
    border-radius: 13px 13px 0 0;
}
.mascot-face { position: absolute; inset: 0; }
.mascot-face i { position: absolute; top: 18px; width: 5px; height: 6px; border-radius: 50%; background: #eafff5; box-shadow: 0 1px rgba(0,0,0,.12); }
.mascot-face i:first-child { left: 13px; }
.mascot-face i:nth-child(2) { right: 13px; }
.mascot-face b { position: absolute; left: 20px; top: 30px; width: 12px; height: 5px; border-bottom: 2px solid rgba(240,255,248,.9); border-radius: 0 0 12px 12px; }
.mascot-leg { position: absolute; bottom: -8px; width: 4px; height: 9px; border-radius: 4px; background: #0c6848; transform-origin: top; }
.leg-a { left: 14px; animation: legRun .34s ease-in-out infinite alternate; }
.leg-b { right: 14px; animation: legRun .34s ease-in-out infinite alternate-reverse; }
@keyframes mascotBob { to { transform: translateY(-3px) rotate(-1deg); } }
@keyframes legRun { from { transform: rotate(24deg); } to { transform: rotate(-24deg); } }

/* Pagination: render only a controlled window of a very large sheet */
.table-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 54px;
    padding: 9px 14px;
    color: #66766e;
    border-top: 1px solid #dbe6e0;
    background: linear-gradient(180deg, #fbfdfc, #f3f8f5);
    font-size: .75rem;
}
.table-pager strong, .table-pager b { color: #1a3528; }
.pager-actions { display: flex; align-items: center; gap: 9px; }
.pager-actions > span { min-width: 78px; text-align: center; color: #4c5e55; font-weight: 720; }
.pager-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #155f42;
    border: 1px solid #cddfd5;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff, #edf6f1);
    box-shadow: 0 6px 14px rgba(20, 70, 47, .07), inset 0 1px #fff;
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}
.pager-btn:disabled { opacity: .38; cursor: not-allowed; }
.pager-btn:not(:disabled):hover { transform: translateY(-1px); border-color: #9ecdb8; }

.security-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    padding: 6px 9px;
    color: #176143;
    border: 1px solid #cde6d9;
    border-radius: 9px;
    background: #edf9f3;
    font-size: .68rem;
    font-weight: 700;
}
.security-hint::before { content: "✓"; width: 16px; height: 16px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: #18845b; font-size: .62rem; }
.security-hint.warning { color: #8a4c05; border-color: #f0d4a7; background: #fff9ee; }
.security-hint.warning::before { content: "!"; background: #b86d10; }

.enterprise-login {
    border-color: rgba(255,255,255,.25);
    background: linear-gradient(150deg, rgba(255,255,255,.985), rgba(242,249,245,.96));
    box-shadow: 0 42px 110px rgba(2, 15, 8, .38), inset 0 1px rgba(255,255,255,.95);
}

@media (max-width: 820px) {
    .enterprise-pill { display: none; }
    .progress-stage { grid-template-columns: 48px minmax(0, 1fr); gap: 11px; }
    .sync-mascot { transform: scale(.82); transform-origin: center; }
    .progress-enterprise .progress-meta { align-items: flex-start; }
    .progress-enterprise #progressSubtext { max-width: 92%; }
}

@media (max-width: 560px) {
    .workspace { width: min(100% - 16px, 1500px); margin-top: 10px; gap: 11px; }
    .panel { border-radius: 18px; }
    .input-panel, .results-panel { padding: 14px; }
    .app-header { height: 60px; }
    .brand-copy span { display: none; }
    .connection-badge { padding: 0 8px; }
    .connection-text { display: none; }
    .progress-enterprise { padding: 13px; }
    .progress-stage { grid-template-columns: 1fr; }
    .sync-mascot { display: none; }
    .progress-enterprise .progress-meta { gap: 8px; }
    .progress-enterprise #progressSubtext { display: none; }
    .table-pager { padding: 8px 10px; }
    .table-pager > div:first-child span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
.settings-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: #6c7c74; font-size: .68rem; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.settings-divider::before, .settings-divider::after { content: ""; height: 1px; flex: 1; background: #e0e8e4; }
.password-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-group label small { color: #819087; font-size: .72em; font-weight: 650; }
@media (max-width: 560px) { .password-grid { grid-template-columns: 1fr; } }
.security-banner {
    position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 14px; border: 1px solid #efd49e; border-radius: 16px;
    color: #714508; background: linear-gradient(145deg, #fffaf0, #fff4dc);
    box-shadow: 0 10px 26px rgba(114, 78, 15, .07), inset 0 1px #fff;
}
.security-banner > div { display: grid; gap: 3px; }
.security-banner strong { font-size: .78rem; }
.security-banner span { font-size: .71rem; color: #88652d; line-height: 1.4; }
.security-banner.danger { color: #8c271f; border-color: #efc0bb; background: linear-gradient(145deg, #fff7f6, #ffedeb); }
.security-banner.danger span { color: #9b4b44; }
@media (max-width: 640px) { .security-banner { align-items: flex-start; flex-direction: column; } .security-banner .btn { width: 100%; } }
.logout-form { margin: 0; padding: 0; }
.logout-form .icon-action { appearance: none; }

/* v3.0.2 access recovery */
.alert.success { color: #0c6948; background: #ebf8f1; border: 1px solid #cdebdc; }
.login-link {
    display: block;
    width: fit-content;
    margin: 14px auto 0;
    color: #176b4c;
    font-size: .78rem;
    font-weight: 760;
    text-decoration: none;
}
.login-link:hover { text-decoration: underline; }
.recovery-card { width: min(680px, 100%); padding: 30px; }
.recovery-card .login-copy { margin-bottom: 18px; }
.recovery-section {
    padding: 16px;
    border: 1px solid #dce7e1;
    border-radius: 16px;
    background: linear-gradient(145deg, #fff, #f6faf8);
    box-shadow: inset 0 1px #fff, 0 8px 24px rgba(20, 59, 40, .045);
}
.recovery-section + .recovery-section { margin-top: 12px; }
.recovery-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.recovery-section-head strong { font-size: .9rem; }
.recovery-section-head span {
    padding: 5px 8px;
    color: #27684f;
    background: #edf8f3;
    border: 1px solid #d2eadd;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 750;
}
.recovery-divider { display: flex; align-items: center; gap: 10px; margin: 11px 0; color: #8a958f; font-size: .68rem; text-transform: uppercase; }
.recovery-divider::before, .recovery-divider::after { content: ""; height: 1px; flex: 1; background: #dfe7e2; }
.recovery-help { margin: 0 0 12px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.recovery-password-grid { margin-top: 12px; }
.recovery-instructions {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 10px 0;
}
.recovery-step {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #1b9468, #0b6848);
    border-radius: 9px;
    font-size: .72rem;
    font-weight: 850;
}
.recovery-instructions strong { display: block; margin: 2px 0 6px; font-size: .76rem; }
.recovery-instructions code,
.recovery-key-panel code {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 9px 10px;
    color: #17392a;
    background: #eef6f2;
    border: 1px solid #d8e8df;
    border-radius: 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .72rem;
    user-select: all;
}
.btn-small { min-height: 34px; padding: 0 11px; font-size: .72rem; }
.btn-ghost { color: #68756e; background: #fff; border-color: #dce4df; }
.recovery-settings-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #d8e6df;
    border-radius: 14px;
    background: linear-gradient(145deg, #fbfdfc, #f3f8f5);
}
.recovery-settings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recovery-settings-head > div:first-child { display: grid; gap: 4px; }
.recovery-settings-head strong { font-size: .82rem; }
.recovery-settings-head span { color: var(--muted); font-size: .69rem; }
.recovery-settings-actions { display: flex; align-items: center; gap: 7px; }
.recovery-key-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #cbe5d8;
    border-radius: 12px;
    background: #eef9f3;
}
.recovery-key-panel > span { display: block; margin-bottom: 8px; color: #166244; font-size: .72rem; font-weight: 760; }
.recovery-key-panel code { margin-bottom: 9px; background: #fff; }
.security-banner.success { color: #135f43; border-color: #cce7d9; background: linear-gradient(145deg, #f3fcf7, #eaf8f0); }
.security-banner.success span { color: #39735c; }

@media (max-width: 620px) {
    .login-page { padding: 12px; align-items: start; }
    .login-card, .recovery-card { margin: 18px 0; padding: 22px; border-radius: 22px; }
    .recovery-section-head, .recovery-settings-head { align-items: flex-start; flex-direction: column; }
    .recovery-settings-actions { width: 100%; }
    .recovery-settings-actions .btn { flex: 1 1 auto; }
}

/* ========================================================================== 
   Enterprise v3.1 — compact dashboard rebuild
   ========================================================================== */
:root {
    --v31-navy: #0b1720;
    --v31-slate: #16232d;
    --v31-blue: #3977f6;
    --v31-purple: #7b61e8;
    --v31-amber: #e79a36;
    --v31-teal: #0f9f8f;
    --v31-green: #0b8c5f;
    --v31-card-shadow: 0 18px 48px rgba(22, 46, 35, .08), 0 2px 8px rgba(22, 46, 35, .045);
}

body {
    background:
        radial-gradient(circle at 0% 0%, rgba(57,119,246,.07), transparent 29rem),
        radial-gradient(circle at 100% 8%, rgba(123,97,232,.06), transparent 28rem),
        radial-gradient(circle at 45% 55%, rgba(15,159,143,.045), transparent 35rem),
        linear-gradient(180deg, #f7faf9 0%, #eef4f1 46%, #f7faf9 100%);
}

.app-header {
    height: 62px;
    background:
        radial-gradient(circle at 20% -120%, rgba(72, 190, 139, .28), transparent 28rem),
        linear-gradient(112deg, #08140f 0%, #0b2419 58%, #0c1a20 100%);
    box-shadow: 0 12px 34px rgba(5,20,13,.18);
}
.header-inner { width: min(1520px, calc(100% - 28px)); }
.brand-symbol.small { width: 36px; height: 36px; border-radius: 11px; }
.brand-copy h1 { font-size: .96rem; }
.enterprise-pill { background: linear-gradient(180deg, rgba(71,191,138,.25), rgba(16,112,75,.18)); }

.workspace {
    width: min(1520px, calc(100% - 28px));
    margin: 14px auto 28px;
    gap: 14px;
}
.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(330px, .72fr);
    gap: 14px;
    align-items: start;
}
.workspace-sidebar { min-width: 0; display: grid; gap: 14px; align-content: start; }
.panel { position: relative; border-radius: 20px; box-shadow: var(--v31-card-shadow), inset 0 1px rgba(255,255,255,.9); }
.panel::before { opacity: .55; }
.v31-main-card { overflow: hidden; padding: 17px; }
.results-panel { padding: 17px; }
.compact-heading { min-height: 46px; }
.heading-group { gap: 11px; }
.heading-group h2, .summary-title h2, .results-top h2 { font-size: 1rem; }
.heading-group p, .summary-title p, .results-top p { margin-top: 3px; font-size: .76rem; }
.section-kicker {
    display: block;
    margin-bottom: 2px;
    color: #789087;
    font-size: .59rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.feature-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    border-radius: 13px;
    box-shadow: 0 10px 22px rgba(30,59,45,.16), inset 0 1px rgba(255,255,255,.45), inset 0 -2px rgba(0,0,0,.11);
}
.feature-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feature-icon.mini { width: 36px; height: 36px; border-radius: 11px; }
.feature-icon.mini svg { width: 18px; height: 18px; }
.feature-icon-blue { background: linear-gradient(150deg, #5f98ff, #316de5 58%, #2357c7); }
.feature-icon-purple { background: linear-gradient(150deg, #9b82f3, #7459d9 58%, #5942bd); }
.feature-icon-amber { background: linear-gradient(150deg, #f4b75e, #dc8b26 60%, #b96b13); }
.feature-icon-green { background: linear-gradient(150deg, #31b985, #0f8d61 60%, #08704d); }
.capacity-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 0 10px;
    color: #31584a;
    border: 1px solid #d3e5dc;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff, #f1f7f4);
    box-shadow: inset 0 1px #fff;
    font-size: .66rem;
    font-weight: 730;
}
.capacity-pill b { color: #0b7651; font-size: .74rem; }

/* Fast single-entry strip */
.scan-strip {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 36px minmax(110px, auto) minmax(180px, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px;
    border: 1px solid #d8e4de;
    border-radius: 15px;
    background: linear-gradient(145deg, #fbfdfc, #f3f8f5);
    box-shadow: inset 0 1px #fff;
}
.scan-strip-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #3977f6;
    border: 1px solid #d9e5ff;
    border-radius: 10px;
    background: #edf3ff;
}
.scan-strip-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.scan-copy { display: grid; min-width: 0; }
.scan-copy strong { font-size: .78rem; }
.scan-copy span { color: var(--muted); font-size: .63rem; white-space: nowrap; }
.scan-strip input { height: 40px; }
.btn-icon-text svg, .fetch-btn svg, .reset-workspace svg, .workbench-note svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-icon-text { min-height: 40px; }

/* Bulk workbench uses the main visual area instead of multiple tall cards */
.bulk-workbench {
    position: relative;
    z-index: 1;
    margin-top: 11px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid #d7e2dc;
    border-radius: 17px;
    background:
        radial-gradient(circle at 100% 0%, rgba(57,119,246,.065), transparent 16rem),
        linear-gradient(145deg, #ffffff, #f6faf8);
    box-shadow: inset 0 1px #fff, 0 10px 28px rgba(22,63,44,.045);
}
.bulk-workbench::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    right: -90px;
    bottom: -100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123,97,232,.07), transparent 70%);
    pointer-events: none;
}
.bulk-workbench-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.bulk-workbench h3 { margin: 0; font-size: .9rem; }
.bulk-workbench p { margin: 3px 0 0; color: var(--muted); font-size: .7rem; }
.bulk-workbench textarea {
    position: relative;
    z-index: 1;
    min-height: 198px;
    max-height: 460px;
    border-color: #cbd9d2;
    border-radius: 13px;
    background:
        linear-gradient(90deg, rgba(57,119,246,.035) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(rgba(57,119,246,.035) 1px, transparent 1px) 0 0 / 24px 24px,
        #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .81rem;
    line-height: 1.55;
}
.bulk-metrics-top { display: flex; align-items: center; gap: 7px; }
.bulk-metrics-top span {
    padding: 5px 8px;
    color: #496158;
    border: 1px solid #dde7e2;
    border-radius: 999px;
    background: rgba(255,255,255,.76);
    font-size: .64rem;
    font-weight: 720;
}
.bulk-metrics-top .duplicate-detected { color: #9a5b08; border-color: #efd9b7; background: #fff8ed; }
.v31-bulk-footer { position: relative; z-index: 1; margin-top: 9px; }
.workbench-note { display: inline-flex; align-items: center; gap: 7px; color: #6b7a72; font-size: .66rem; font-weight: 650; }
.workbench-note svg { width: 16px; height: 16px; color: #0f8d61; }
.fetch-btn { min-width: 150px; }

/* Compact right-side control rail */
.quick-panel { padding: 15px; overflow: hidden; }
.quick-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.quick-panel-head h2 { margin: 0; font-size: .92rem; }
.quick-control {
    position: relative;
    z-index: 1;
    padding: 11px;
    border: 1px solid #dce5e1;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff, #f6f9f8);
    box-shadow: inset 0 1px #fff;
}
.quick-control + .quick-control { margin-top: 9px; }
.quick-control-title { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.quick-control-title > div { display: grid; min-width: 0; }
.quick-control-title label { margin: 0; color: #25342c; font-size: .75rem; font-weight: 800; }
.quick-control-title span:not(.mini-orb) { margin-top: 1px; color: #7d8b84; font-size: .61rem; }
.mini-orb {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 900;
    box-shadow: 0 8px 16px rgba(25,58,42,.12), inset 0 1px rgba(255,255,255,.35);
}
.mini-orb svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mini-orb-amber { background: linear-gradient(145deg, #efb453, #d78320); }
.mini-orb-teal { background: linear-gradient(145deg, #37b9aa, #0f8c7d); }
.quick-control-actions { display: grid; grid-template-columns: minmax(90px, .75fr) minmax(95px, 1fr); gap: 7px; }
.compact-percentage input { height: 39px; }
.btn-square-wide { min-height: 39px; padding: 0 10px; font-size: .72rem; }
.quick-duplicate select { height: 39px; font-size: .74rem; }
.quick-duplicate .control-note { display: block; margin-top: 6px; color: #7c8982; font-size: .6rem; text-align: left; }
.reset-workspace {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 9px;
    padding: 8px 10px;
    color: #a0352d;
    border: 1px solid #efcfcb;
    border-radius: 13px;
    background: linear-gradient(145deg, #fff, #fff7f6);
    cursor: pointer;
    text-align: left;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.reset-workspace:hover { transform: translateY(-1px); border-color: #e9bbb5; box-shadow: 0 8px 18px rgba(154,55,46,.07); }
.reset-workspace svg { width: 18px; height: 18px; flex: 0 0 auto; }
.reset-workspace span { display: grid; gap: 1px; }
.reset-workspace strong { font-size: .7rem; }
.reset-workspace small { color: #a87974; font-size: .59rem; }

/* Columns/templates become a compact, collapsible side tool */
.columns-panel { overflow: hidden; }
.columns-panel > summary { min-height: 68px; padding: 12px 14px; gap: 10px; }
.columns-panel .summary-title { gap: 10px; }
.columns-panel .summary-title h2 { font-size: .84rem; }
.columns-panel .summary-title p { margin-top: 2px; font-size: .64rem; }
.columns-panel .summary-right, .columns-panel .summary-hint { display: none; }
.columns-panel .chevron { width: 30px; height: 30px; border-radius: 9px; }
.columns-panel .accordion-content { max-height: 620px; overflow: auto; padding: 11px 12px 13px; scrollbar-width: thin; }
.columns-panel .template-bar { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 10px; margin-bottom: 9px; }
.columns-panel .template-field { min-width: 0; }
.columns-panel .template-field input,
.columns-panel .template-field select { height: 39px; font-size: .72rem; }
.template-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.columns-panel .template-button { width: 100%; height: 36px; min-height: 36px; font-size: .69rem; }
.columns-panel .column-builder { grid-template-columns: 1fr; gap: 6px; }
.columns-panel .column-item { min-height: 43px; padding: 6px 7px; border-radius: 10px; }
.columns-panel .switch-row { font-size: .72rem; }
.columns-panel .drag-handle { width: 20px; }
.columns-panel .micro-btn { width: 25px; height: 25px; border-radius: 7px; }
.columns-panel .custom-checkbox { width: 17px; height: 17px; }

/* More useful results density */
.results-top { margin-bottom: 11px; }
.results-panel .feature-icon { width: 39px; height: 39px; }
.stats-grid { gap: 8px; margin-bottom: 10px; }
.stat-card { min-height: 60px; padding: 9px 11px; border-radius: 13px; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; }
.stat-icon svg { width: 17px; }
.stat-card span:not(.stat-icon) { font-size: .63rem; }
.stat-card strong { margin-top: 1px; font-size: 1.16rem; }
.btn-excel { min-height: 39px; font-size: .77rem; }
.empty-state { min-height: 170px; padding: 20px; }
.empty-icon { width: 45px; height: 45px; border-radius: 14px; }

/* Progress turns into a small animated sync console */
.progress-enterprise {
    position: relative;
    z-index: 1;
    margin-top: 11px;
    padding: 12px 13px;
    overflow: hidden;
    border-color: rgba(61, 117, 91, .34);
    background:
        radial-gradient(circle at 86% 0%, rgba(57,119,246,.16), transparent 14rem),
        linear-gradient(135deg, #0c2118, #102b22 58%, #11232c);
    box-shadow: 0 15px 34px rgba(7,37,24,.17), inset 0 1px rgba(255,255,255,.06);
}
.progress-enterprise::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 0 42%, rgba(255,255,255,.04) 49%, transparent 56%);
    animation: syncPanelSweep 2.4s linear infinite;
    pointer-events: none;
}
@keyframes syncPanelSweep { from { transform: translateX(-70%); } to { transform: translateX(80%); } }
.progress-enterprise .progress-stage { position: relative; z-index: 1; }
.progress-enterprise .progress-meta strong { color: #e9fff5; }
.progress-enterprise .progress-meta span { color: #9db9ad; }
.progress-enterprise .progress-number strong { color: #75e6b2; }
.progress-enterprise .progress-track { height: 9px; background: rgba(255,255,255,.09); box-shadow: inset 0 2px 4px rgba(0,0,0,.2); }
.progress-enterprise .progress-track > div { background: linear-gradient(90deg, #2fb57f, #55d7a1 54%, #6d9cff); box-shadow: 0 0 16px rgba(85,215,161,.45); }
.sync-mascot { box-shadow: 0 12px 24px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.4), inset 0 -3px rgba(0,0,0,.1); }
.scan-beam {
    position: absolute;
    left: 6px;
    right: 6px;
    height: 2px;
    top: 13px;
    border-radius: 99px;
    background: #8cf4c5;
    box-shadow: 0 0 9px #65dfaa;
    animation: scanBeam 1s ease-in-out infinite alternate;
}
@keyframes scanBeam { to { transform: translateY(22px); opacity: .45; } }
.sync-dots { display: flex; align-items: center; gap: 5px; margin-top: 7px; }
.sync-dots i { width: 4px; height: 4px; border-radius: 50%; background: #5dd4a0; opacity: .25; animation: syncDot 1.15s ease-in-out infinite; }
.sync-dots i:nth-child(2){ animation-delay:.12s}.sync-dots i:nth-child(3){ animation-delay:.24s}.sync-dots i:nth-child(4){ animation-delay:.36s}.sync-dots i:nth-child(5){ animation-delay:.48s}
@keyframes syncDot { 50% { opacity: 1; transform: translateY(-2px); box-shadow: 0 0 8px rgba(93,212,160,.7); } }

/* Settings: denser and more polished */
.modal-backdrop { backdrop-filter: blur(9px); background: rgba(5,17,12,.56); }
.modal-card {
    width: min(720px, calc(100% - 24px));
    max-height: min(88vh, 780px);
    overflow: auto;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 22px;
    background: linear-gradient(145deg, #fff, #f6faf8);
    box-shadow: 0 34px 90px rgba(2,16,9,.27), inset 0 1px #fff;
}
.modal-head { padding: 18px 18px 13px; background: linear-gradient(145deg, #f9fcfa, #eef7f2); }
.modal-head h2 { font-size: 1.02rem; }
.modal-head p { margin-top: 4px; font-size: .7rem; }
.settings-form { padding: 14px 18px 18px; }
.form-group { margin-bottom: 10px; }
.form-group label { margin-bottom: 5px; font-size: .74rem; }
.modal-card input[type="text"], .modal-card input[type="password"], .modal-card select { height: 40px; }
.recovery-settings-box { margin-top: 10px; padding: 11px; }
.modal-actions { margin-top: 12px; }

/* Sharper component depth without oversized whitespace */
.btn { min-height: 39px; border-radius: 10px; font-size: .8rem; }
.btn-primary { box-shadow: 0 9px 18px rgba(10,111,73,.18), inset 0 1px rgba(255,255,255,.34), inset 0 -2px rgba(0,0,0,.07); }
input[type="text"], input[type="password"], select { height: 42px; border-radius: 10px; }
textarea { border-radius: 11px; }
.app-footer { margin-top: 0; padding: 0 12px 18px; }

@media (max-width: 1120px) {
    .workspace-grid { grid-template-columns: minmax(0, 1fr); }
    .workspace-sidebar { grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr); }
    .columns-panel .column-builder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .columns-panel .template-bar { grid-template-columns: 1fr 1fr; }
    .columns-panel .template-actions-row { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .header-inner, .workspace { width: min(100% - 18px, 1520px); }
    .workspace { margin-top: 9px; gap: 10px; }
    .workspace-grid, .workspace-sidebar { grid-template-columns: 1fr; gap: 10px; }
    .v31-main-card, .results-panel, .quick-panel { padding: 13px; }
    .scan-strip { grid-template-columns: 34px minmax(0, 1fr) auto; }
    .scan-copy { display: none; }
    .scan-strip input { grid-column: 2 / 3; }
    .bulk-workbench-head { align-items: flex-start; flex-direction: column; gap: 7px; }
    .bulk-workbench textarea { min-height: 170px; }
    .columns-panel .column-builder { grid-template-columns: 1fr; }
    .columns-panel .template-bar { grid-template-columns: 1fr; }
    .columns-panel .template-actions-row { grid-column: auto; }
    .workbench-note { display: none; }
    .v31-bulk-footer { justify-content: flex-end; }
    .results-top { align-items: stretch; flex-direction: column; }
    .results-top .btn-excel { width: 100%; }
}

@media (max-width: 500px) {
    .capacity-pill { display: none; }
    .compact-heading .heading-group p { max-width: 250px; }
    .scan-strip { grid-template-columns: 32px minmax(0, 1fr); }
    .scan-strip .btn { grid-column: 1 / -1; width: 100%; }
    .bulk-workbench { padding: 11px; }
    .bulk-metrics-top { align-items: flex-start; flex-direction: column; gap: 4px; }
    .v31-bulk-footer { align-items: stretch; flex-direction: column; }
    .fetch-btn { width: 100%; }
    .quick-control-actions { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr 1fr; }
    .stat-card { min-width: 0; gap: 6px; padding: 8px; }
    .stat-icon { width: 29px; height: 29px; }
    .stat-card span:not(.stat-icon) { display: none; }
    .stat-card strong { font-size: 1rem; }
}
