:root {
    --ink: #14251f;
    --muted: #6d7c76;
    --line: #dde5e1;
    --surface: #ffffff;
    --canvas: #f5f7f6;
    --forest: #103c2d;
    --forest-2: #185440;
    --green: #14b875;
    --green-dark: #07955b;
    --green-soft: #e9f9f1;
    --amber: #e79a21;
    --amber-soft: #fff6e7;
    --red: #d84b4b;
    --red-soft: #fff0f0;
    --shadow: 0 18px 55px rgba(17, 53, 40, .11);
    --radius: 15px;
    --sidebar: 268px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.plain-button { border: 0; padding: 0; color: inherit; background: transparent; text-align: left; }
a { color: inherit; text-decoration: none; }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .9em; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 780; letter-spacing: -.5px; }
.brand-light { color: #fff; }
.brand-mark {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    background: var(--green); color: #fff; font-weight: 850; box-shadow: inset 0 -4px 9px rgba(0,0,0,.08);
}
.eyebrow { display: block; text-transform: uppercase; letter-spacing: 1.7px; font-size: 11px; font-weight: 800; color: rgba(255,255,255,.68); margin-bottom: 10px; }
.eyebrow.green { color: var(--green-dark); }
.muted { color: var(--muted); }

.button {
    border: 0; border-radius: 10px; min-height: 42px; padding: 0 17px;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-weight: 720; font-size: 14px; transition: .18s ease; white-space: nowrap;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button.primary { background: var(--green); color: white; box-shadow: 0 7px 18px rgba(20,184,117,.2); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { color: var(--ink); border: 1px solid var(--line); background: white; }
.button.secondary:hover, .button.ghost:hover { background: #f0f5f2; }
.button.ghost { color: var(--muted); background: transparent; }
.button.wide { width: 100%; }
.button.tall { min-height: 50px; }
.button.loading { color: transparent !important; position: relative; pointer-events: none; }
.button.loading::after {
    content: ""; position: absolute; width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.45);
    border-top-color: white; border-radius: 50%; animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.grow { flex: 1; }
.field label, .field legend { color: #35463f; font-weight: 680; font-size: 13px; }
.field input, .field textarea, .field select {
    width: 100%; border: 1px solid #d6dfda; border-radius: 10px; background: #fff; color: var(--ink);
    outline: none; padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
.field input { min-height: 45px; }
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,184,117,.11); }
.field small { color: #809089; line-height: 1.4; font-size: 11px; }
.optional { font-weight: 500; color: #8a9993; }
.form-stack { display: flex; flex-direction: column; gap: 17px; }
.form-row { display: flex; gap: 13px; align-items: flex-start; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 66px; }
.show-password { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--green-dark); font-size: 11px; font-weight: 750; }
.alert { padding: 11px 13px; border-radius: 9px; font-size: 13px; line-height: 1.45; }
.alert.error { color: #8c2929; border: 1px solid #f1c7c7; background: var(--red-soft); }
.alert.success { color: #176d49; border: 1px solid #bce7d3; background: var(--green-soft); }
.info-note { padding: 13px 15px; border-radius: 10px; color: #476158; background: #f0f6f3; font-size: 12px; line-height: 1.5; }
.danger-note { display: flex; flex-direction: column; gap: 5px; margin: 22px 0; padding: 15px; border-radius: 11px; border: 1px solid #f0cf96; background: var(--amber-soft); color: #714c12; font-size: 13px; line-height: 1.45; }

/* Installation */
.install-body { min-height: 100vh; background: var(--forest); }
.install-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .9fr) minmax(480px, 1.1fr); }
.install-brand {
    min-height: 100vh; padding: 55px clamp(45px, 6vw, 95px); color: #fff;
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(circle at 80% 15%, rgba(31,193,126,.2), transparent 31%),
        linear-gradient(145deg, #0d3226, #143f31);
}
.install-brand h1 { max-width: 620px; font-size: clamp(39px, 4.8vw, 67px); line-height: 1.01; letter-spacing: -3px; margin: 18px 0 24px; }
.install-brand p { max-width: 520px; color: rgba(255,255,255,.68); line-height: 1.7; font-size: 17px; }
.install-trust { display: flex; flex-wrap: wrap; gap: 10px; }
.install-trust span { border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.05); padding: 9px 11px; border-radius: 8px; color: rgba(255,255,255,.75); font-size: 11px; }
.install-card { background: var(--canvas); padding: 60px clamp(45px, 8vw, 130px); display: flex; flex-direction: column; justify-content: center; }
.install-card > * { max-width: 520px; width: 100%; margin-left: auto; margin-right: auto; }
.install-card h2 { margin: 0 0 8px; font-size: 32px; letter-spacing: -1px; }
.install-card .muted { margin: 0 0 25px; line-height: 1.55; }
.status-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 0 25px; border-radius: 18px; font-size: 25px; font-weight: 800; }
.status-icon.success { background: var(--green-soft); color: var(--green-dark); }

/* Authentication */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.02fr) minmax(520px, .98fr); }
.auth-story {
    position: relative; overflow: hidden; padding: 48px clamp(48px, 6vw, 90px) 35px; color: white;
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(circle at 72% 32%, rgba(20,184,117,.28), transparent 29%),
        linear-gradient(148deg, #0d3427 0%, #143f31 65%, #0b2b21 100%);
}
.auth-story::before, .auth-story::after {
    content: ""; position: absolute; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; pointer-events: none;
}
.auth-story::before { width: 540px; height: 540px; right: -180px; top: 100px; }
.auth-story::after { width: 330px; height: 330px; right: -45px; top: 205px; }
.auth-story-copy { position: relative; z-index: 1; margin-top: 9vh; }
.auth-story-copy h1 { margin: 0 0 24px; font-size: clamp(49px, 5.2vw, 78px); line-height: .98; letter-spacing: -4px; max-width: 700px; }
.auth-story-copy h1 span { color: #52d99f; }
.auth-story-copy p { max-width: 580px; color: rgba(255,255,255,.66); line-height: 1.65; font-size: 17px; }
.auth-metric-card { position: relative; z-index: 1; max-width: 580px; padding: 18px 20px; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; background: rgba(255,255,255,.055); backdrop-filter: blur(12px); }
.metric-top { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.68); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.metric-top strong { margin-left: auto; color: #5cdfaa; font-size: 10px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4fe0a2; box-shadow: 0 0 0 5px rgba(79,224,162,.09); }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 17px; }
.metric-grid div { display: flex; flex-direction: column; gap: 4px; }
.metric-grid strong { font-size: 24px; }
.metric-grid span { color: rgba(255,255,255,.5); font-size: 11px; }
.auth-foot { position: absolute; bottom: 18px; right: 25px; color: rgba(255,255,255,.32); font-size: 10px; letter-spacing: 1px; }
.auth-foot span { margin: 0 6px; }
.auth-panel { min-height: 100vh; display: grid; place-items: center; padding: 45px; background: #fbfcfb; }
.auth-box { width: 100%; max-width: 440px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 35px; border: 1px solid var(--line); border-radius: 11px; background: #f1f4f2; }
.auth-tab { border: 0; min-height: 40px; border-radius: 8px; color: var(--muted); background: transparent; font-weight: 700; font-size: 13px; }
.auth-tab.active { color: var(--ink); background: #fff; box-shadow: 0 2px 9px rgba(30,60,48,.09); }
.form-heading { margin-bottom: 7px; }
.form-heading h2 { margin: 0 0 7px; font-size: 30px; letter-spacing: -1.2px; }
.form-heading p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.form-legal { margin: -4px 0 0; color: #8b9792; text-align: center; font-size: 10px; line-height: 1.5; }
.mobile-brand { display: none; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--sidebar); color: white;
    display: flex; flex-direction: column; background: linear-gradient(180deg, #103c2d 0%, #0d3327 100%);
}
.sidebar-head { height: 76px; padding: 0 19px; display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,.075); }
.sidebar-close { display: none; margin-left: auto; color: #fff; }
.sidebar-section { padding: 24px 15px 18px; }
.sidebar-label-row { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
.sidebar-label { text-transform: uppercase; color: rgba(255,255,255,.42); font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.count-pill { min-width: 22px; padding: 2px 6px; text-align: center; border-radius: 9px; color: rgba(255,255,255,.52); background: rgba(255,255,255,.08); font-size: 9px; font-weight: 800; }
.store-list { display: flex; flex-direction: column; gap: 4px; max-height: 255px; overflow-y: auto; }
.store-button { width: 100%; min-height: 47px; padding: 7px 8px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; color: rgba(255,255,255,.65); background: transparent; text-align: left; }
.store-button:hover { color: #fff; background: rgba(255,255,255,.06); }
.store-button.active { color: #fff; background: rgba(255,255,255,.1); }
.store-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border-radius: 8px; color: #d9f4e8; background: rgba(20,184,117,.22); font-size: 12px; font-weight: 800; }
.store-button span { min-width: 0; display: flex; flex-direction: column; }
.store-button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.store-button small { margin-top: 2px; color: rgba(255,255,255,.35); font-size: 9px; }
.store-status { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #4bd39a; }
.store-status.error { background: #f17676; }
.add-store-button { width: 100%; margin-top: 8px; padding: 10px 8px; display: flex; align-items: center; gap: 11px; border: 1px dashed rgba(255,255,255,.16); border-radius: 9px; color: rgba(255,255,255,.7); background: transparent; text-align: left; }
.add-store-button:hover { color: #fff; border-color: rgba(82,217,159,.5); background: rgba(82,217,159,.06); }
.plus-box { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 18px; }
.add-store-button > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.add-store-button strong { font-size: 11px; }
.add-store-button small { color: rgba(255,255,255,.34); font-size: 9px; }
.sidebar-nav { padding: 16px 15px; border-top: 1px solid rgba(255,255,255,.07); display: flex; flex-direction: column; gap: 4px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 11px; border: 0; border-radius: 9px; color: rgba(255,255,255,.53); background: transparent; text-align: left; font-weight: 620; font-size: 12px; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { box-shadow: inset 3px 0 var(--green); }
.nav-icon { width: 20px; text-align: center; color: #62d9a6; font-size: 16px; }
.sidebar-user { margin-top: auto; min-height: 72px; padding: 13px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 10px; color: #fff; background: #217254; font-size: 12px; font-weight: 800; }
.user-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.user-copy small { color: rgba(255,255,255,.34); font-size: 9px; }
.logout-button { margin-left: auto; border: 0; color: rgba(255,255,255,.4); background: transparent; font-size: 17px; }
.logout-button:hover { color: white; }
.sidebar-backdrop { display: none; }
.main-area { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 64px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); }
.menu-button { display: none !important; }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: #93a09b; font-size: 11px; }
.breadcrumb b { color: #c5ceca; }
.breadcrumb strong { color: #53645d; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.connection-badge { display: flex; align-items: center; gap: 7px; color: #668077; font-size: 10px; font-weight: 650; }
.connection-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.top-avatar { width: 31px; height: 31px; border-radius: 9px; }
.view { display: none; padding: 31px; }
.view.active { display: block; }
.page-header { min-height: 81px; margin-bottom: 25px; display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; }
.page-header h1 { margin: 0 0 7px; font-size: 29px; line-height: 1; letter-spacing: -1px; }
.page-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.page-actions { display: flex; gap: 9px; }
.catalog-grid { min-height: calc(100vh - 201px); display: grid; grid-template-columns: 295px minmax(0, 1fr); gap: 17px; }
.category-panel, .products-panel, .surface { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 4px 15px rgba(22,56,43,.025); }
.category-panel { display: flex; flex-direction: column; overflow: hidden; }
.panel-head { min-height: 72px; padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e8edea; }
.panel-head h2, .surface-head h2 { margin: 0 0 4px; font-size: 14px; }
.panel-head p, .surface-head p { margin: 0; color: #8b9893; font-size: 10px; }
.icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #71817a; background: white; }
.search-box { position: relative; margin: 13px 13px 6px; }
.search-box span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #8f9c97; }
.search-box input { width: 100%; height: 37px; padding: 0 10px 0 32px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: #fafbfa; font-size: 11px; }
.search-box input:focus { border-color: var(--green); }
.category-bulk-bar { margin: 4px 12px 6px; padding: 8px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; background: #f8faf9; }
.category-bulk-bar > div { display: flex; flex-direction: column; line-height: 1; }
.category-bulk-bar strong { color: var(--green-dark); font-size: 15px; }
.category-bulk-bar span { margin-top: 3px; color: #8b9893; font-size: 8px; }
.category-bulk-bar .plain-link { justify-self: end; border: 0; color: #6f8179; background: transparent; font-size: 8px; font-weight: 700; }
.category-bulk-bar .button { min-height: 31px; padding: 0 9px; font-size: 9px; }
.category-bulk-bar button:disabled { opacity: .45; cursor: not-allowed; }
.category-tree { flex: 1; min-height: 260px; max-height: calc(100vh - 407px); overflow-y: auto; padding: 8px 9px 15px; }
.category-node { --depth: 0; }
.category-row { min-height: 35px; display: flex; align-items: center; padding-left: calc(var(--depth) * 14px); border-radius: 7px; }
.category-row:hover { background: #f3f7f5; }
.category-row.selected { background: var(--green-soft); }
.category-row.checked-for-ai { box-shadow: inset 3px 0 0 var(--green); background: #f6fbf8; }
.tree-toggle { width: 22px; height: 26px; border: 0; color: #97a39e; background: transparent; font-size: 9px; }
.tree-toggle.blank { visibility: hidden; }
.category-check { width: 20px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; cursor: pointer; }
.category-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--green); }
.category-select { min-width: 0; flex: 1; height: 31px; display: flex; align-items: center; gap: 7px; border: 0; color: #56665f; background: transparent; text-align: left; font-size: 11px; }
.category-select strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 620; }
.folder-icon { position: relative; width: 14px; height: 10px; flex: 0 0 auto; border-radius: 2px; background: #b7c4be; }
.folder-icon::before { content: ""; position: absolute; left: 1px; top: -3px; width: 6px; height: 4px; border-radius: 2px 2px 0 0; background: inherit; }
.category-row.selected .folder-icon { background: var(--green); }
.hidden-badge { margin-left: auto; padding: 2px 5px; border-radius: 5px; color: #98661a; background: var(--amber-soft); font-size: 8px; }
.category-children.collapsed { display: none; }
.tree-legend { min-height: 41px; padding: 0 17px; display: flex; align-items: center; gap: 15px; border-top: 1px solid var(--line); color: #87958f; font-size: 9px; }
.dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; }
.dot.visible { background: var(--green); }
.dot.hidden-cat { background: var(--amber); }
.products-panel { overflow: hidden; }
.panel-empty { height: 100%; min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px; text-align: center; }
.panel-empty.compact { min-height: 230px; }
.panel-empty h2 { margin: 13px 0 7px; font-size: 17px; }
.panel-empty p { max-width: 410px; margin: 0; color: #85928d; font-size: 11px; line-height: 1.55; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--green-dark); background: var(--green-soft); font-size: 20px; }
.empty-icon.large { width: 58px; height: 58px; border-radius: 18px; font-size: 25px; }
.products-head { min-height: 73px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.title-line { display: flex; align-items: center; gap: 8px; }
.products-head h2 { margin: 0 0 4px; font-size: 15px; }
.products-head p { margin: 0; color: #8b9893; font-size: 10px; }
.products-actions { display: flex; gap: 7px; }
.products-actions .button { min-height: 35px; padding: 0 12px; font-size: 10px; }
.status-badge { padding: 3px 7px; border-radius: 6px; font-size: 8px; font-weight: 750; }
.status-badge.active { color: #18764e; background: var(--green-soft); }
.status-badge.hidden-status { color: #98661a; background: var(--amber-soft); }
#productsNotice .alert { margin: 13px 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.table-wrap { overflow-x: auto; }
.product-table { width: 100%; border-collapse: collapse; }
.product-table th { height: 38px; padding: 0 17px; color: #8c9994; background: #fafbfa; border-bottom: 1px solid var(--line); text-align: left; text-transform: uppercase; letter-spacing: .8px; font-size: 8px; font-weight: 800; }
.product-table td { height: 61px; padding: 8px 17px; border-bottom: 1px solid #edf0ee; color: #52625b; font-size: 10px; }
.product-table tr:hover td { background: #fcfdfc; }
.product-cell { display: flex; align-items: center; gap: 11px; min-width: 260px; }
.product-thumb { display: grid; place-items: center; width: 37px; height: 37px; flex: 0 0 auto; overflow: hidden; border-radius: 9px; color: #297354; background: #e7f3ed; font-weight: 800; }
.product-image-frame { position: relative; }
.product-image-frame img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; }
.product-image-frame .thumb-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.product-image-frame .thumb-fallback.visible,
.product-image-frame.image-failed .thumb-fallback { position: static; }
.product-image-frame.image-failed img { display: none; }
.product-cell span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.product-cell strong { max-width: 410px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2f423a; font-size: 11px; font-weight: 680; }
.product-cell small { color: #97a39e; font-size: 9px; }
.active-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 6px; font-size: 8px; font-weight: 700; }
.active-pill.on { color: #18764e; background: var(--green-soft); }
.active-pill.off { color: #8b5e18; background: var(--amber-soft); }
.row-action { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 8px; color: #71817a; background: #fff; font-weight: 800; }
.row-action:hover { color: white; border-color: var(--green); background: var(--green); }
.product-row-actions { display: flex; align-items: center; gap: 5px; }
.row-ai-action { height: 31px; padding: 0 9px; border: 1px solid #b8ddcc; border-radius: 8px; color: #176f4b; background: var(--green-soft); font-size: 9px; font-weight: 800; white-space: nowrap; }
.row-ai-action:hover { color: white; border-color: var(--green); background: var(--green); }
.skeleton-row td { height: 61px; }
.skeleton { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #edf1ef, #f8faf9, #edf1ef); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pagination-bar { min-height: 55px; padding: 9px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pagination-bar p { margin: 0; color: #87958f; font-size: 9px; }
.pagination { display: flex; gap: 4px; }
.page-button { min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; color: #60716a; background: white; font-size: 9px; font-weight: 700; }
.page-button.active { color: white; border-color: var(--green); background: var(--green); }

/* Owner views */
.surface { overflow: hidden; }
.surface-head { min-height: 74px; padding: 18px 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.queue-stats { margin-bottom: 17px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.queue-stats > div { padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; }
.queue-stats span { color: #82908a; font-size: 10px; }
.queue-stats strong { font-size: 22px; letter-spacing: -.7px; }
.queue-row { min-height: 68px; padding: 11px 20px; display: grid; grid-template-columns: minmax(210px, 1.5fr) .8fr .8fr .8fr auto; align-items: center; gap: 15px; border-bottom: 1px solid #edf0ee; }
.queue-product { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.queue-product strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.queue-product small, .queue-cell { color: #84918c; font-size: 9px; }
.job-pill { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 7px; font-size: 8px; font-weight: 750; }
.job-pill.review { color: #825817; background: var(--amber-soft); }
.job-pill.applied { color: #17744c; background: var(--green-soft); }
.job-pill.failed { color: #942e2e; background: var(--red-soft); }
.job-pill.processing, .job-pill.queued, .job-pill.researching, .job-pill.applying { color: #355e85; background: #edf5fc; }
.team-row { min-height: 72px; padding: 11px 20px; display: grid; grid-template-columns: minmax(190px, 1.2fr) 1fr 1fr auto; align-items: center; gap: 20px; border-bottom: 1px solid #edf0ee; }
.team-person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.team-person .avatar { color: #176f4b; background: var(--green-soft); }
.team-person span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.team-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.team-person small, .team-meta { color: #83918b; font-size: 10px; }
.team-stores { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-pill { padding: 4px 7px; border-radius: 6px; color: #49635a; background: #eff4f1; font-size: 8px; }
.team-actions { display: flex; gap: 6px; }
.team-actions button { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; color: #697a73; background: white; font-size: 9px; font-weight: 700; }
.team-actions .danger:hover { color: var(--red); border-color: #efb7b7; }
.activity-surface { padding: 8px 22px; }
.activity-item { min-height: 65px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid #edf0ee; }
.activity-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--green-dark); background: var(--green-soft); font-size: 13px; }
.activity-copy { display: flex; flex-direction: column; gap: 3px; }
.activity-copy strong { font-size: 11px; }
.activity-copy small { color: #87958f; font-size: 9px; }
.activity-time { margin-left: auto; color: #9ba6a1; font-size: 9px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.settings-card { position: relative; padding: 23px; display: flex; flex-direction: column; gap: 17px; }
.settings-card h2 { margin: 0 0 4px; font-size: 17px; }
.settings-card p { margin: 0; color: #71817a; font-size: 11px; line-height: 1.5; }
.settings-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #fff; background: #101010; font-size: 20px; font-weight: 800; }
.settings-icon.clock { color: var(--green-dark); background: var(--green-soft); }
.integration-status { position: absolute; top: 23px; right: 23px; padding: 5px 8px; border-radius: 7px; color: #8b9893; background: #f0f3f1; font-size: 9px; font-weight: 750; }
.integration-status.connected { color: #14734a; background: var(--green-soft); }

/* Modals */
body.modal-open { overflow: hidden; }
.modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,25,18,.62); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(900px, 100%); max-height: calc(100vh - 40px); overflow: hidden; border-radius: 17px; background: white; box-shadow: 0 24px 90px rgba(3,22,15,.3); }
.modal-card.small { width: min(540px, 100%); }
.modal-head { min-height: 79px; padding: 20px 23px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.5px; }
.modal-head .eyebrow { margin-bottom: 5px; }
.modal-close { width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 9px; color: #7e8c86; background: white; font-size: 20px; }
.modal-body { max-height: calc(100vh - 120px); overflow-y: auto; padding: 22px 23px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.modal-intro { margin: 0 0 17px; color: #66776f; font-size: 13px; line-height: 1.55; }
.choice-list { display: flex; flex-direction: column; gap: 7px; }
.choice-list label, .mode-option { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; color: #52635c; font-size: 12px; }
.choice-list input, .mode-option input { accent-color: var(--green); }
.mode-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.mode-option { align-items: flex-start; padding: 13px; cursor: pointer; }
.mode-option:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.mode-option.warning:has(input:checked) { border-color: var(--amber); background: var(--amber-soft); }
.mode-option span { display: flex; flex-direction: column; gap: 3px; }
.mode-option b { color: var(--ink); font-size: 12px; }
.mode-option small { color: #7b8983; line-height: 1.4; font-size: 10px; }
.automation-scope-summary { max-height: 92px; overflow-y: auto; margin: -8px 0 15px; padding: 9px 11px; display: flex; flex-wrap: wrap; gap: 5px; border-radius: 9px; background: #f5f8f6; }
.automation-scope-summary span { padding: 4px 7px; border-radius: 6px; color: #49635a; background: #e8f1ec; font-size: 9px; }
.automation-progress { margin-top: 13px; padding: 11px 12px; border-radius: 9px; color: #1c6d4d; background: var(--green-soft); font-size: 10px; line-height: 1.5; }
.product-card { width: min(980px, 100%); }
.product-modal-head { min-height: 77px; }
.product-heading { display: flex; align-items: center; gap: 12px; }
.product-head-actions { display: flex; align-items: center; gap: 9px; }
.product-head-actions .ai-button { min-height: 36px; padding: 0 14px; font-size: 10px; }
.product-modal-thumb { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 11px; color: #237352; background: var(--green-soft); font-weight: 800; }
.modal-loading { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #7b8983; font-size: 12px; }
.spinner { width: 32px; height: 32px; border: 3px solid #e1e9e5; border-top-color: var(--green); border-radius: 50%; animation: spin .75s linear infinite; }
.product-tabs { height: 50px; padding: 0 23px; display: flex; align-items: flex-end; gap: 25px; border-bottom: 1px solid var(--line); }
.product-tabs button { height: 50px; padding: 0; border: 0; border-bottom: 2px solid transparent; color: #81908a; background: transparent; font-size: 11px; font-weight: 700; }
.product-tabs button.active { color: var(--ink); border-bottom-color: var(--green); }
#jobDot { display: inline-block; width: 6px; height: 6px; margin-left: 3px; border-radius: 50%; background: transparent; }
#jobDot.active { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.product-tab-panel { display: none; }
.product-tab-panel.active { display: block; }
.modal-scroll { max-height: calc(100vh - 245px); overflow-y: auto; padding: 22px 25px; display: flex; flex-direction: column; gap: 17px; }
.sticky-actions { min-height: 69px; margin: 0; padding: 12px 24px; border-top: 1px solid var(--line); background: #fff; }
.counter { align-self: flex-end; margin-top: -1px; }
.counter.good { color: var(--green-dark); }
.counter.warn { color: var(--amber); }
.seo-meter { width: 54px; margin-top: 23px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.seo-meter span { color: #8b9893; font-size: 8px; font-weight: 750; }
.seo-meter b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--green-dark); background: var(--green-soft); font-size: 10px; }
.ai-hero { padding: 19px; display: flex; gap: 15px; border-radius: 13px; color: white; background: linear-gradient(135deg, #133f31, #1b5a43); }
.ai-spark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 13px; color: #123a2c; background: #5ae1a7; font-size: 20px; }
.ai-hero .eyebrow { margin-bottom: 5px; color: #59dda5; }
.ai-hero h3 { margin: 0 0 6px; font-size: 16px; }
.ai-hero p { max-width: 670px; margin: 0; color: rgba(255,255,255,.67); line-height: 1.5; font-size: 11px; }
.job-state { min-height: 255px; border: 1px solid var(--line); border-radius: 13px; }
.job-empty, .job-progress, .job-result { min-height: 255px; padding: 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.job-empty h3, .job-progress h3, .job-result h3 { margin: 11px 0 6px; font-size: 15px; }
.job-empty p, .job-progress p, .job-result p { max-width: 500px; margin: 0 0 16px; color: #7e8c86; font-size: 11px; line-height: 1.5; }
.mode-inline { margin-bottom: 15px; display: flex; gap: 16px; color: #56675f; font-size: 10px; }
.mode-inline input { accent-color: var(--green); }
.ai-button { color: #fff; background: linear-gradient(135deg, #163f32, #1c6b4c); }
.job-steps { width: min(430px, 100%); display: flex; flex-direction: column; gap: 8px; text-align: left; }
.job-step { padding: 10px 12px; display: flex; align-items: center; gap: 10px; border-radius: 8px; color: #86948e; background: #f6f8f7; font-size: 10px; }
.job-step.active { color: #176f4b; background: var(--green-soft); }
.job-step.done::before { content: "✓"; color: var(--green-dark); font-weight: 800; }
.job-step.active::before { content: ""; width: 10px; height: 10px; border: 2px solid #9fe1c4; border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
.job-result { align-items: stretch; text-align: left; }
.result-summary { margin-bottom: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-summary div { padding: 11px; border-radius: 8px; background: #f5f8f6; }
.result-summary span { display: block; color: #89958f; font-size: 8px; text-transform: uppercase; }
.result-summary strong { display: block; margin-top: 4px; font-size: 11px; }
.source-list { margin: 7px 0 14px; padding-left: 18px; color: #61736b; font-size: 10px; line-height: 1.7; }
.source-list a { color: var(--green-dark); text-decoration: underline; }
.result-actions { display: flex; justify-content: flex-end; gap: 7px; }
.job-error { color: #8c2929; background: var(--red-soft); }

.toast-region { position: fixed; z-index: 150; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 9px; }
.toast { min-width: 260px; max-width: 390px; padding: 13px 15px; border-radius: 10px; color: white; background: #173b30; box-shadow: var(--shadow); font-size: 11px; line-height: 1.45; animation: toast-in .2s ease-out; }
.toast.error { background: #8c3030; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
    .auth-layout, .install-shell { grid-template-columns: 1fr; }
    .auth-story, .install-brand { display: none; }
    .mobile-brand { margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
    .install-card, .auth-panel { min-height: 100vh; }
    .catalog-grid { grid-template-columns: 260px minmax(0, 1fr); }
    .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: grid; }
    .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; background: rgba(5,25,18,.5); }
    .sidebar.open + .sidebar-backdrop { display: block; }
    .main-area { margin-left: 0; }
    .menu-button { display: grid !important; margin-right: 12px; }
    .topbar { justify-content: flex-start; padding: 0 18px; }
    .topbar-actions { margin-left: auto; }
    .view { padding: 20px; }
    .catalog-grid { grid-template-columns: 1fr; }
    .category-tree { max-height: 330px; }
    .products-panel { min-height: 480px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .team-row { grid-template-columns: 1fr; gap: 8px; padding: 15px; }
    .queue-stats { grid-template-columns: repeat(2, 1fr); }
    .queue-row { grid-template-columns: 1fr auto; }
    .queue-row .queue-cell { display: none; }
}
@media (max-width: 570px) {
    .auth-panel, .install-card { padding: 28px 20px; }
    .view { padding: 17px 12px; }
    .topbar { height: 58px; }
    .connection-badge { display: none; }
    .page-header { margin-bottom: 18px; }
    .page-actions { flex-direction: column; }
    .page-actions .button { width: 100%; }
    .products-head { align-items: flex-start; flex-direction: column; }
    .products-actions { width: 100%; }
    .products-actions .button { flex: 1; }
    .product-table th:nth-child(3), .product-table td:nth-child(3),
    .product-table th:nth-child(4), .product-table td:nth-child(4) { display: none; }
    .pagination-bar { align-items: flex-start; flex-direction: column; }
    .modal { padding: 0; }
    .modal-card, .modal-card.small { width: 100%; height: 100vh; max-height: none; border-radius: 0; }
    .modal-scroll { max-height: calc(100vh - 245px); }
    .modal-body { max-height: calc(100vh - 80px); }
    .form-row { flex-direction: column; }
    .seo-meter { display: none; }
    .mode-inline { align-items: flex-start; flex-direction: column; }
    .result-summary { grid-template-columns: 1fr; }
    .toast-region { left: 12px; right: 12px; bottom: 12px; }
    .toast { min-width: 0; max-width: none; }
}
