:root {
  --green: #76b82a;
  --green-dark: #568d16;
  --green-soft: #edf6e4;
  --ink: #172019;
  --muted: #6f7a71;
  --bg: #f2f5f1;
  --card: #fff;
  --line: #e1e7df;
  --danger: #c43d3d;
  --orange: #d78016;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Poppins, Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); }
button, input, textarea, select { font: inherit; }
.hidden { display: none !important; }
button { border: 0; border-radius: 10px; padding: 10px 14px; background: var(--green); color: #fff; font-size: 13px; font-weight: 750; cursor: pointer; transition: .18s; }
button:hover { background: var(--green-dark); transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.muted, .hint, .field-hint { color: var(--muted); }
.hint, .field-hint { font-size: 12px; }
.eyebrow { font-weight: 800; color: var(--green-dark); letter-spacing: .12em; font-size: 12px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 65% 20%, #dff1c8, transparent 35%), #edf2eb; }
.login-card { width: min(440px, 92vw); background: #fff; padding: 40px; border-radius: 26px; box-shadow: 0 22px 80px #38502624; }
.login-card img { width: 220px; max-height: 90px; object-fit: contain; margin-bottom: 24px; }
.login-card h1 { margin: 8px 0; }
.login-card p { color: var(--muted); margin: 0 0 26px; }
.login-card small { display: block; margin-top: 14px; }
.error { color: var(--danger); margin-top: 12px; }

.app { --sidebar-width: 218px; min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); transition: grid-template-columns .22s ease; }
.app.sidebar-collapsed { --sidebar-width: 76px; }
aside { position: sticky; z-index: 30; top: 0; height: 100vh; padding: 14px 12px 12px; background: #152119; display: flex; flex-direction: column; box-shadow: 8px 0 30px rgba(23,32,25,.08); }
.sidebar-brand { position: relative; min-height: 58px; display: flex; align-items: center; padding: 0 8px 10px; border-bottom: 1px solid #2c3930; }
.sidebar-brand img { width: 145px; height: 46px; object-fit: contain; object-position: left center; filter: brightness(0) invert(1); }
.sidebar-mark { display: none; width: 40px; height: 40px; border-radius: 13px; align-items: center; justify-content: center; color: #142018; background: var(--green); font-size: 21px; font-weight: 900; }
.sidebar-toggle { position: absolute; z-index: 2; right: -25px; top: 10px; width: 28px; height: 34px; display: grid; place-items: center; padding: 0; color: #dce6de; background: #243229; border: 1px solid #425147; border-radius: 0 10px 10px 0; font-size: 23px; line-height: 1; box-shadow: 7px 3px 16px rgba(10,17,12,.16); }
.sidebar-toggle:hover { transform: none; background: #304137; }
nav { display: grid; gap: 3px; margin-top: 11px; overflow-y: auto; scrollbar-width: thin; }
.nav-section { margin: 11px 10px 3px; color: #748178; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav, .ghost { min-width: 0; min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 7px 10px; background: transparent; border-radius: 10px; text-align: left; color: #b9c5bb; white-space: nowrap; }
.nav:hover, .ghost:hover { transform: none; background: #223027; color: #fff; }
.nav.active { background: #2a3b2f; color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.nav-icon { flex: 0 0 25px; width: 25px; height: 25px; display: grid; place-items: center; font-size: 17px; line-height: 1; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ghost { width: 100%; margin-top: auto; border: 1px solid #35453a; }
.app.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
.app.sidebar-collapsed .sidebar-brand img, .app.sidebar-collapsed .nav-label, .app.sidebar-collapsed .nav-section { display: none; }
.app.sidebar-collapsed .sidebar-mark { display: flex; }
.app.sidebar-collapsed .nav, .app.sidebar-collapsed .ghost { width: 48px; min-height: 44px; justify-content: center; padding-inline: 0; margin-inline: auto; }
.app.sidebar-collapsed .nav.active { box-shadow: inset 0 -3px 0 var(--green); }
.app.sidebar-collapsed .sidebar-toggle { transform: rotate(180deg); }
.app.sidebar-collapsed nav { gap: 5px; margin-top: 14px; }
.sidebar-backdrop { display: none; }

main { width: 100%; max-width: 1680px; padding: 20px clamp(20px, 3vw, 44px) 50px; min-width: 0; }
header { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.topbar-heading { display: flex; align-items: center; gap: 11px; }
.mobile-menu-toggle { display: none; width: 40px; height: 40px; padding: 0; background: #1f2c23; font-size: 19px; }
header small { font-weight: 800; color: var(--green-dark); letter-spacing: .11em; font-size: 10px; }
h1 { margin: 2px 0 0; font-size: clamp(24px, 2.3vw, 30px); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin: 0 0 14px; font-size: 19px; line-height: 1.3; }
h3 { font-size: 15px; }
.status { background: #fff; border: 1px solid var(--line); padding: 9px 14px; border-radius: 99px; font-size: 13px; }
.status i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status.ok i { background: var(--green); }
.status.bad i { background: var(--orange); }
.status.neutral i { background: #aab2aa; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.metric, .card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 18px; box-shadow: 0 5px 18px rgba(23,32,25,.025); }
.metric b { display: block; font-size: 27px; margin-top: 4px; }
.metric span { color: var(--muted); }
.welcome { min-height: 220px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(120deg, #fff, #e9f5dc); }
.welcome h2 { font-size: 28px; margin: 8px 0; }
.welcome p { max-width: 650px; color: var(--muted); line-height: 1.6; }
.lizard { font-size: 82px; padding: 16px; }

label { display: grid; gap: 6px; font-weight: 650; font-size: 12.5px; margin: 11px 0; }
input, textarea, select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; padding: 9px 11px; color: var(--ink); outline: none; font-size: 13px; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px #76b82a22; }
textarea { min-height: 92px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 18px; height: 18px; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.icon-button { width: 48px; padding: 0; font-size: 20px; }
.button-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.secondary { background: #eef3eb; color: var(--green-dark); }
.secondary:hover { background: #e0eadb; }
.danger { background: #fdeaea !important; color: var(--danger) !important; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.badge, .secure-chip { display: inline-block; border-radius: 99px; background: var(--green-soft); color: var(--green-dark); padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-error { background: #fdeaea; color: var(--danger); }
.notification-buttons { justify-content: flex-start; }

.integration-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, .6fr); gap: 14px; align-items: start; }
.integration-form > .muted { line-height: 1.65; margin: -6px 0 20px; }
.integration-side { display: grid; gap: 14px; }
details { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 16px; }
summary { font-weight: 750; cursor: pointer; }
.connection-card { text-align: center; }
.connection-card.is-ok { border-color: #afd780; background: linear-gradient(145deg, #fff, #f1f8e9); }
.connection-card.is-bad { border-color: #efb4b4; background: linear-gradient(145deg, #fff, #fff5f5); }
.connection-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; color: #fff; background: #aab2aa; font-size: 30px; font-weight: 850; }
.is-ok .connection-icon { background: var(--green); }
.is-bad .connection-icon { background: var(--danger); }
.connection-card h2 { margin-bottom: 8px; }
.mini-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.mini-metrics div { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.mini-metrics b, .mini-metrics span { display: block; }
.mini-metrics b { font-size: 24px; }
.mini-metrics span { color: var(--muted); font-size: 12px; }
.permission-list { display: grid; gap: 9px; }
.permission { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 9px; padding: 10px; border-radius: 12px; background: #f7f9f6; }
.permission > span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #fff; font-weight: 800; }
.permission-ok > span { background: var(--green); }
.permission-bad > span { background: var(--danger); }
.permission b, .permission small { display: block; }
.permission small { color: var(--muted); margin-top: 2px; }
.danger-zone { border-style: dashed; }
.compact { align-items: center; }
.compact h3 { margin: 0 0 4px; }
.compact p { margin: 0; }
.small-button { padding: 8px 12px; font-size: 12px; }
.category-audience-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.category-audience-visible { margin: 22px 0 4px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #f7faf5; }
.category-audience-visible .eyebrow { display: block; margin-bottom: 5px; }
.category-audience-list { display: grid; gap: 7px; max-height: 360px; overflow: auto; margin-top: 10px; padding-right: 4px; }
.category-audience-row { grid-template-columns: minmax(0, 1fr) 170px; align-items: center; gap: 12px; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfb; }
.category-audience-name { display: grid; min-width: 0; }
.category-audience-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-audience-name small { color: var(--muted); font-weight: 500; margin-top: 2px; }
.category-depth-1 { padding-left: 18px; }
.category-depth-2 { padding-left: 36px; }
.category-depth-3 { padding-left: 54px; }
.category-depth-4 { padding-left: 72px; }
.category-depth-5 { padding-left: 90px; }
.category-depth-6 { padding-left: 108px; }
.category-depth-7 { padding-left: 126px; }
.category-depth-8 { padding-left: 144px; }
.category-audience-row select { padding: 9px; }

.grid-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 14px; margin-bottom: 14px; }
.phone { background: #dfe9da; border-radius: 24px; padding: 40px; display: grid; place-items: center; }
.phone-screen { width: 260px; min-height: 180px; background: #1c251e; color: #fff; border: 9px solid #0b0e0c; border-radius: 28px; padding: 22px; box-shadow: 0 22px 40px #18221835; }
.phone-screen small { color: #a9b5aa; }
.phone-screen h3 { margin: 22px 0 8px; }
.phone-screen p { color: #d8dfd8; line-height: 1.5; }
.list { display: grid; gap: 12px; margin-top: 18px; }
.notice { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.notice h3 { margin: 8px 0 5px; }
.notice p, .notice small { margin: 0; color: var(--muted); }
.notice-actions { display: flex; align-items: center; gap: 8px; }
.notice-actions button { padding: 8px 11px; font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-section-card { margin-top: 14px; }
.audience-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.feeder-editor h2 { margin-top: 5px; }
.feeder-editor h3, #brands h3 { margin: 22px 0 10px; }
.rule-list { display: grid; gap: 14px; margin-top: 18px; }
.shipping-rule { border: 1px solid var(--line); border-radius: 17px; padding: 18px; background: #f9fbf8; }
.shipping-rule-head { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 10px; align-items: end; }
.shipping-rule-head label { margin: 0; }
.shipping-rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.weekday-list, .carrier-checks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.weekday-chip, .carrier-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 11px; }
.weekday-chip input, .carrier-chip input { width: 15px; height: 15px; margin: 0; }
.carrier-section { grid-column: 1 / -1; }
.brand-admin-list { display: grid; gap: 8px; }
.showcase-category-list { display: grid; gap: 12px; }
.showcase-category-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fbfcfb; }
.showcase-category-head { display: flex; align-items: center; gap: 10px; }
.showcase-category-head > div:first-child { min-width: 0; flex: 1; }
.showcase-category-head b, .showcase-category-head small { display: block; }
.showcase-category-head small { color: var(--muted); margin-top: 3px; }
.showcase-category-products { display: grid; gap: 7px; margin-top: 10px; }
.showcase-product-search { margin-top: 12px; }
.showcase-product-results { display: grid; gap: 7px; margin-top: 7px; }
.brand-audience-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.brand-audience-picks label { margin: 0; font-size: 11px; }
.html-editor { min-height: 240px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; }
.brand-admin-row { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfb; }
.brand-admin-logo { width: 66px; height: 48px; object-fit: contain; padding: 5px; border-radius: 9px; background: #fff; border: 1px solid var(--line); }
.brand-admin-copy { min-width: 0; }
.brand-admin-copy b, .brand-admin-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-admin-copy small { color: var(--muted); margin-top: 3px; }
.brand-admin-actions { display: flex; gap: 6px; }
.brand-admin-actions button { padding: 8px 10px; font-size: 12px; }
.brand-admin-row.showcase-category-result { grid-template-columns: minmax(0, 1fr) auto; }
.showcase-category-result .brand-admin-copy b,
.showcase-category-result .brand-admin-copy small { overflow: visible; text-overflow: clip; white-space: normal; }
.showcase-category-result .brand-admin-copy b { line-height: 1.3; }
.showcase-category-result .brand-admin-actions { grid-column: auto; }
.support-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.support-editor textarea { min-height: 150px; resize: vertical; }
.support-editor h2 { margin-bottom: 3px; }
code { padding: 2px 5px; border-radius: 5px; background: #e8eee5; color: var(--green-dark); }
.weekly-hits-card { margin-top: 20px; }
.weekly-hits-card h2 { margin: 4px 0 6px; }
.weekly-hits-card h3 { margin: 22px 0 10px; }
.weekly-hits-card .muted { margin: 0; line-height: 1.55; }
.weekly-hit-results, .weekly-hit-selected { display: grid; gap: 8px; }
.weekly-hit-results { max-height: 260px; overflow: auto; }
.weekly-hit-row { min-width: 0; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfb; }
.weekly-hit-row img, .weekly-hit-image { width: 54px; height: 54px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.weekly-hit-image { display: grid; place-items: center; color: var(--muted); }
.weekly-hit-copy { min-width: 0; }
.weekly-hit-copy b, .weekly-hit-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weekly-hit-copy small { margin-top: 3px; color: var(--muted); }
.weekly-hit-actions { display: flex; align-items: center; gap: 6px; }
.weekly-hit-actions button { min-width: 38px; padding: 8px 10px; font-size: 12px; }
.weekly-hit-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.savebar { position: sticky; bottom: 20px; margin-top: 20px; background: #172019; color: #fff; border-radius: 16px; padding: 14px 18px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; box-shadow: 0 12px 35px #17201944; }
.savebar span { margin-right: auto; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 48px)); background: #172019; color: #fff; padding: 14px 18px; border-radius: 12px; opacity: 0; transform: translateY(15px); transition: .2s; pointer-events: none; box-shadow: 0 14px 40px #17201955; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1050px) {
  .integration-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app, .app.sidebar-collapsed { display: block; }
  aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(236px, calc(100vw - 52px));
    height: 100dvh;
    padding: 14px 12px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 20px 0 60px rgba(10,17,12,.35);
  }
  .app.sidebar-open aside { transform: translateX(0); }
  .sidebar-brand { justify-content: flex-start !important; padding-inline: 8px !important; }
  .sidebar-brand img { display: block !important; }
  .sidebar-mark, .sidebar-toggle { display: none !important; }
  .app.sidebar-collapsed .nav-label, .app.sidebar-collapsed .nav-section { display: initial; }
  .app.sidebar-collapsed .nav-section { display: block; }
  .app.sidebar-collapsed nav { gap: 3px; margin-top: 11px; }
  .app.sidebar-collapsed .nav, .app.sidebar-collapsed .ghost { width: 100%; min-height: 42px; justify-content: flex-start; padding: 7px 10px; margin-inline: 0; }
  .app.sidebar-collapsed .nav.active { box-shadow: inset 3px 0 0 var(--green); }
  .sidebar-backdrop {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    padding: 0;
    border-radius: 0;
    background: rgba(10,16,12,.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .sidebar-backdrop:hover { transform: none; background: rgba(10,16,12,.48); }
  .app.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .mobile-menu-toggle { display: grid; place-items: center; flex: 0 0 40px; }
  main { max-width: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .grid-two, .settings-grid, .audience-editor-grid, .support-editor-grid { grid-template-columns: 1fr; }
  .lizard { display: none; }
}

@media (max-width: 620px) {
  main { padding: 12px 12px 80px; }
  header { position: sticky; z-index: 20; top: 0; min-height: 64px; align-items: center; margin: 0 -12px 12px; padding: 9px 12px; background: rgba(242,245,241,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
  h1 { font-size: 23px; }
  .status { display: none; }
  .metrics, .form-row { grid-template-columns: 1fr; }
  .metrics { gap: 8px; }
  .metric, .card { padding: 14px; border-radius: 13px; }
  .metric { display: flex; align-items: center; justify-content: space-between; }
  .metric b { margin: 0; font-size: 23px; }
  .welcome { min-height: 0; }
  .welcome h2 { font-size: 23px; }
  .phone { padding: 20px; }
  .notice { grid-template-columns: 1fr; }
  .savebar { bottom: 10px; flex-wrap: wrap; padding: 11px 12px; border-radius: 13px; }
  .savebar span { width: 100%; }
  .button-row { display: grid; }
  .section-head { flex-direction: column; }
  .category-audience-row { grid-template-columns: 1fr; }
  .weekly-hit-row { grid-template-columns: 46px minmax(0, 1fr); }
  .weekly-hit-row img, .weekly-hit-image { width: 46px; height: 46px; }
  .weekly-hit-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .shipping-rule-head, .shipping-rule-grid { grid-template-columns: 1fr; }
  .carrier-section { grid-column: auto; }
  .brand-admin-row { grid-template-columns: 52px minmax(0, 1fr); }
  .brand-admin-logo { width: 52px; height: 42px; }
  .brand-admin-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Panel 2.0 */
:root {
  --green: #6fb52b;
  --green-dark: #426f18;
  --green-soft: #edf7e5;
  --ink: #18201a;
  --muted: #6d776f;
  --bg: #f5f7f4;
  --card: #ffffff;
  --line: #dde4dc;
  --danger: #bd3939;
  --orange: #cf7a14;
}

body { background: var(--bg); font-size: 14px; }
button { min-height: 42px; border-radius: 11px; padding: 10px 16px; box-shadow: none; }
button:hover { transform: none; }
.login-shell { background: radial-gradient(circle at 22% 18%, rgba(126,194,62,.18), transparent 31%), linear-gradient(145deg, #eef3eb, #f8faf7); }
.login-card { padding: 42px; border: 1px solid rgba(111,181,43,.18); border-radius: 22px; box-shadow: 0 28px 80px rgba(24,35,27,.12); }
.login-card img { width: 200px; }

.app { --sidebar-width: 264px; }
.app.sidebar-collapsed { --sidebar-width: 78px; }
aside {
  padding: 18px 14px 14px;
  background: #111a14;
  box-shadow: 10px 0 36px rgba(16, 26, 19, .08);
}
.sidebar-brand { min-height: 68px; padding: 0 9px 15px; }
.brand-lockup { min-width: 0; display: flex; flex-direction: column; gap: 0; }
.brand-lockup img { width: 148px; height: 39px; }
.brand-lockup > span { margin-top: -2px; color: #7f8c83; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-toggle { right: -24px; top: 18px; height: 32px; background: #1d2a21; }
nav { gap: 2px; margin-top: 8px; padding-right: 2px; }
.nav-section { margin: 16px 11px 5px; color: #647168; font-size: 8px; letter-spacing: .16em; }
.nav, .ghost { min-height: 39px; gap: 10px; border-radius: 10px; padding: 7px 10px; color: #aebbb1; font-size: 12px; font-weight: 650; }
.nav-icon { flex-basis: 28px; width: 28px; height: 28px; border-radius: 8px; color: #91a096; background: rgba(255,255,255,.035); font-size: 15px; }
.nav:hover, .ghost:hover { background: rgba(255,255,255,.06); }
.nav.active { color: #fff; background: rgba(111,181,43,.16); box-shadow: none; }
.nav.active .nav-icon { color: #162012; background: #83c842; }
.ghost { border-color: #2b382f; }
.app.sidebar-collapsed .brand-lockup { display: none; }
.app.sidebar-collapsed .nav.active { box-shadow: none; }

main { max-width: none; padding: 0 clamp(22px, 3vw, 48px) 60px; }
.topbar {
  position: sticky;
  z-index: 18;
  top: 0;
  min-height: 104px;
  margin: 0 -8px 24px;
  padding: 20px 8px 16px;
  background: rgba(245, 247, 244, .92);
  border-bottom: 1px solid rgba(221, 228, 220, .8);
  backdrop-filter: blur(18px);
}
.topbar-heading { align-items: flex-start; }
.page-breadcrumb { color: #849087; font-size: 10px; font-weight: 750; letter-spacing: .04em; }
.page-description { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
h1 { margin-top: 3px; font-size: clamp(25px, 2vw, 32px); letter-spacing: -.04em; }
h2 { margin-bottom: 16px; font-size: 19px; letter-spacing: -.02em; }
.status { padding: 9px 13px; background: rgba(255,255,255,.82); box-shadow: 0 4px 16px rgba(24,32,26,.04); }

.view { width: 100%; max-width: 1380px; margin: 0 auto; }
.subview { animation: subview-in .18s ease both; }
@keyframes subview-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.metrics { gap: 14px; margin-bottom: 18px; }
.metric {
  min-height: 116px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
}
.metric span { font-size: 12px; font-weight: 650; }
.metric b { margin-top: 13px; font-size: 31px; letter-spacing: -.04em; }
.welcome {
  min-height: 270px;
  padding: 36px;
  border: 0;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 20%, rgba(140, 207, 74, .28), transparent 29%),
    linear-gradient(125deg, #16231a 0%, #233c29 68%, #2e4c31 100%);
  box-shadow: 0 18px 40px rgba(22,35,26,.13);
}
.welcome .eyebrow { color: #aada78; }
.welcome h2 { max-width: 720px; margin: 9px 0 12px; color: #fff; font-size: clamp(25px, 3vw, 38px); line-height: 1.18; }
.welcome p { max-width: 720px; margin-bottom: 20px; color: #bdc9c0; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.welcome-actions .secondary { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: #fff; }
.welcome-mark { flex: 0 0 146px; height: 146px; display: grid; place-items: center; align-content: center; border: 1px solid rgba(255,255,255,.13); border-radius: 38px; background: rgba(255,255,255,.06); transform: rotate(5deg); }
.welcome-mark span { color: #94d456; font-size: 48px; font-weight: 900; letter-spacing: -.08em; }
.welcome-mark small { color: #afbbb2; font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.quick-card {
  min-height: 132px;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px 12px;
  padding: 19px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.quick-card:hover { color: var(--ink); background: #fbfdf9; border-color: #b8d59e; }
.quick-card > span { grid-row: 1 / 3; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--green-dark); background: var(--green-soft); font-size: 20px; }
.quick-card b { font-size: 13px; }
.quick-card small { color: var(--muted); font-size: 10px; font-weight: 500; }

.card {
  padding: 24px;
  border-radius: 16px;
  box-shadow: none;
}
.page-card { max-width: 1120px; }
.narrow-card { max-width: 760px; }
.page-intro-card { padding-bottom: 20px; background: #f9fbf8; }
.page-intro-card h2 { margin: 5px 0 8px; }
.page-intro-card p { max-width: 840px; margin: 0; line-height: 1.6; }
.eyebrow { font-size: 9px; letter-spacing: .15em; }
.muted { line-height: 1.6; }
.info-card { background: #f8fbf6; }
.info-link-list { display: grid; justify-items: start; gap: 4px; margin-top: 18px; }
.text-link { min-height: 32px; padding: 4px 0; color: var(--green-dark); background: transparent; }
.text-link:hover { color: #284d0e; background: transparent; }

label { margin: 14px 0; font-size: 12px; }
input, textarea, select { min-height: 46px; padding: 11px 13px; border-radius: 10px; background: #fcfdfc; }
textarea { min-height: 112px; }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 3px rgba(111,181,43,.12); }
.check { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafcf9; }
.check input { flex: 0 0 18px; min-height: 18px; padding: 0; }
.toolbar-search { max-width: 560px; margin: 22px 0 12px; }
.category-audience-list { max-height: 570px; }
.category-audience-row { padding: 11px 12px; background: #fff; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 18px; }
.diagnostic-grid .permission { min-height: 74px; }
.permission.ok > span { background: var(--green); }
.permission.bad > span { background: var(--danger); }
.variable-hint { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding: 10px 12px; border-radius: 10px; color: var(--muted); background: #f3f6f1; font-size: 11px; }
.no-top { margin-top: 0; }
.collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.collection-grid .weekly-hits-card { margin-top: 0; }

.shipping-rule { padding: 20px; border-radius: 14px; background: #fbfcfa; }
.weekly-hit-row, .brand-admin-row, .showcase-category-card { background: #fff; }
.phone { min-height: 420px; padding: 34px; background: linear-gradient(145deg, #e7eee3, #dce9d5); border: 1px solid #d3dfce; border-radius: 20px; }
.phone-screen { width: 278px; min-height: 210px; border-width: 7px; border-radius: 31px; box-shadow: 0 24px 55px rgba(18,31,21,.2); }
.notice { padding: 18px; background: #fff; }
.support-editor-grid { grid-template-columns: 240px minmax(0, 1fr); max-width: 1180px; align-items: start; }
.support-page-tabs { position: sticky; top: 126px; display: grid; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.support-page-tab { min-height: 54px; display: grid; justify-items: start; align-content: center; gap: 1px; padding: 9px 11px; color: var(--ink); text-align: left; background: transparent; }
.support-page-tab:hover { color: var(--ink); background: #f4f7f2; }
.support-page-tab.active { color: var(--green-dark); background: var(--green-soft); }
.support-page-tab span { font-size: 12px; }
.support-page-tab small { color: var(--muted); font-size: 9px; font-weight: 500; }
.support-editor-stage { min-width: 0; }
.support-editor { padding: 26px; }
.support-editor textarea { min-height: 280px; }
.html-editor { min-height: 340px !important; }

.savebar {
  bottom: 16px;
  min-height: 68px;
  margin-top: 24px;
  padding: 12px 14px 12px 20px;
  color: var(--muted);
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 42px rgba(24,32,26,.13);
  backdrop-filter: blur(16px);
}
.savebar button { min-width: 150px; }
.savebar .secondary { min-width: 0; }

@media (max-width: 1180px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .collection-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  aside { width: min(278px, calc(100vw - 40px)); }
  .brand-lockup { display: flex !important; }
  .brand-lockup img { display: block !important; }
  .topbar { min-height: 92px; }
  .welcome-mark { display: none; }
  .diagnostic-grid { grid-template-columns: 1fr; }
  .support-editor-grid { grid-template-columns: 1fr; }
  .support-page-tabs { position: static; display: flex; overflow-x: auto; padding: 6px; }
  .support-page-tab { flex: 0 0 auto; min-width: 138px; }
}

@media (max-width: 620px) {
  main { padding: 0 12px 90px; }
  .topbar { min-height: 80px; margin: 0 -12px 14px; padding: 11px 12px; }
  .page-breadcrumb, .page-description { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 94px; display: block; padding: 16px; }
  .metric b { margin-top: 9px; font-size: 25px; }
  .welcome { min-height: 0; padding: 24px 20px; border-radius: 17px; }
  .welcome h2 { font-size: 24px; }
  .welcome-actions { display: grid; }
  .quick-grid { grid-template-columns: 1fr; gap: 9px; }
  .quick-card { min-height: 92px; }
  .card { padding: 17px; }
  .savebar { bottom: 8px; display: grid; grid-template-columns: 1fr; padding: 10px; }
  .savebar span { display: none; }
  .savebar button { width: 100%; }
}

/* Logowanie, użytkownicy i analityka — Panel 2.1 */
.login-shell {
  min-height: 100vh;
  grid-template-columns: minmax(360px, .9fr) minmax(480px, 1.1fr);
  place-items: stretch;
  padding: 0;
  background: #f5f7f4;
}
.login-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vw, 120px);
  color: #fff;
  background:
    radial-gradient(circle at 15% 14%, rgba(144, 211, 79, .27), transparent 27%),
    radial-gradient(circle at 90% 84%, rgba(111, 181, 43, .19), transparent 30%),
    linear-gradient(145deg, #0f1712, #1b2d20 64%, #28422c);
}
.login-hero::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -160px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgba(255,255,255,.025), 0 0 0 108px rgba(255,255,255,.018);
}
.login-hero-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 38px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 23px;
  color: #9bd75f;
  background: rgba(255,255,255,.055);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -.08em;
}
.login-hero .eyebrow { color: #9bd75f; }
.login-hero h2 { max-width: 560px; margin: 14px 0 18px; color: #fff; font-size: clamp(34px, 4vw, 58px); line-height: 1.08; letter-spacing: -.055em; }
.login-hero > p { max-width: 520px; color: #b6c3b9; font-size: 15px; line-height: 1.75; }
.login-benefits { display: grid; gap: 13px; margin-top: 44px; color: #dce6de; font-size: 13px; }
.login-benefits span { display: flex; align-items: center; gap: 11px; }
.login-benefits i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #182719; background: #88ca48; font-style: normal; font-weight: 900; }
.login-panel { display: grid; place-items: center; padding: 36px; }
.login-card {
  width: min(480px, 100%);
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(24,35,27,.1);
}
.login-card img { width: 190px; margin-bottom: 31px; }
.login-card h1 { margin: 8px 0 9px; font-size: 34px; }
.login-card p { margin-bottom: 28px; line-height: 1.6; }
.login-password { display: grid; grid-template-columns: 1fr 48px; gap: 7px; }
.password-toggle { min-height: 46px; padding: 0; color: var(--green-dark); background: #eef3eb; }
.login-submit { width: 100%; min-height: 51px; margin-top: 13px; font-size: 13px; }
.login-caps { margin: -4px 0 8px; color: #9b6113; font-size: 11px; font-weight: 750; }
.login-card .error:not(:empty) { padding: 11px 12px; border: 1px solid #f0c2c2; border-radius: 10px; background: #fff5f5; }

.topbar-actions { display: flex; align-items: center; gap: 9px; }
.user-chip {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 5px;
  color: var(--ink);
  background: rgba(255,255,255,.85);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.user-chip:hover { color: var(--ink); background: #fff; border-color: #cbd9c7; }
.user-avatar, .user-list-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #193018;
  background: #91d052;
  font-weight: 850;
}
.user-chip-copy { display: grid; gap: 1px; text-align: left; }
.user-chip-copy b { max-width: 140px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.user-chip-copy small { color: var(--muted); font-size: 9px; }

.analytics-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.analytics-toolbar h2 { margin: 5px 0 7px; font-size: 25px; }
.analytics-toolbar p { margin: 0; }
.analytics-toolbar label { min-width: 190px; margin: 0; }
.analytics-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.analytics-metric { min-height: 125px; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.analytics-metric span, .analytics-metric small { display: block; color: var(--muted); font-size: 10px; }
.analytics-metric b { display: block; margin: 12px 0 7px; font-size: 29px; letter-spacing: -.04em; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.analytics-wide { grid-column: 1 / -1; }
.analytics-loading { grid-column: 1 / -1; color: var(--muted); }
.analytics-chart { min-height: 230px; display: flex; align-items: flex-end; gap: 5px; overflow-x: auto; padding: 24px 4px 4px; border-top: 1px solid #eef1ed; }
.analytics-day { flex: 1 0 22px; min-width: 22px; display: grid; align-items: end; gap: 7px; }
.analytics-bars { height: 170px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.analytics-bars i { width: 7px; min-height: 3px; display: block; border-radius: 5px 5px 2px 2px; }
.analytics-installations { background: #78bb35; }
.analytics-sessions { background: #263a2b; }
.analytics-day small { color: #8b958d; font-size: 8px; text-align: center; transform: rotate(-45deg); }
.analytics-bars .level-0 { height: 2%; opacity: .25; }
.analytics-bars .level-1 { height: 10%; }
.analytics-bars .level-2 { height: 20%; }
.analytics-bars .level-3 { height: 30%; }
.analytics-bars .level-4 { height: 40%; }
.analytics-bars .level-5 { height: 50%; }
.analytics-bars .level-6 { height: 60%; }
.analytics-bars .level-7 { height: 70%; }
.analytics-bars .level-8 { height: 80%; }
.analytics-bars .level-9 { height: 90%; }
.analytics-bars .level-10 { height: 100%; }
.analytics-funnel { display: grid; gap: 18px; }
.analytics-funnel > div > span { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 11px; }
.analytics-funnel em { color: var(--muted); font-style: normal; font-weight: 750; }
.analytics-funnel > div > i { height: 10px; display: block; overflow: hidden; border-radius: 99px; background: #edf1eb; }
.analytics-funnel u { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #6fb52b, #9ad65d); text-decoration: none; }
.analytics-funnel .level-0 { width: 0; }
.analytics-funnel .level-1 { width: 10%; }
.analytics-funnel .level-2 { width: 20%; }
.analytics-funnel .level-3 { width: 30%; }
.analytics-funnel .level-4 { width: 40%; }
.analytics-funnel .level-5 { width: 50%; }
.analytics-funnel .level-6 { width: 60%; }
.analytics-funnel .level-7 { width: 70%; }
.analytics-funnel .level-8 { width: 80%; }
.analytics-funnel .level-9 { width: 90%; }
.analytics-funnel .level-10 { width: 100%; }
.analytics-ranking { display: grid; gap: 8px; }
.analytics-ranking > div { min-height: 54px; display: grid; grid-template-columns: 29px 1fr; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; background: #f8faf7; }
.analytics-ranking > div > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 850; }
.analytics-ranking p { min-width: 0; margin: 0; }
.analytics-ranking b, .analytics-ranking small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-ranking b { font-size: 11px; }
.analytics-ranking small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.password-change-notice { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 17px 19px; border: 1px solid #efc98c; border-radius: 14px; color: #6f4810; background: #fff9ee; }
.password-change-notice b { white-space: nowrap; }
.profile-grid { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(400px, 1.25fr); gap: 16px; align-items: start; max-width: 1050px; }
.profile-card { text-align: center; }
.profile-avatar { width: 92px; height: 92px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 29px; color: #1a3019; background: linear-gradient(145deg, #a7de70, #79bc37); font-size: 34px; font-weight: 900; }
.profile-card h2 { margin: 6px 0 3px; font-size: 24px; }
.role-pill { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 99px; color: var(--green-dark); background: var(--green-soft); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.profile-permissions { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 22px; }
.profile-permissions span { padding: 5px 8px; border-radius: 7px; color: var(--muted); background: #f1f4ef; font-size: 9px; }
.password-rules { padding: 10px 12px; border-radius: 9px; color: var(--muted); background: #f5f7f4; font-size: 10px; line-height: 1.5; }
.users-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .65fr); gap: 16px; align-items: start; }
.create-user-card { position: sticky; top: 126px; }
.role-description { margin: -5px 0 14px; padding: 10px 11px; border-radius: 9px; color: var(--muted); background: #f5f7f4; font-size: 10px; line-height: 1.5; }
.user-list { display: grid; gap: 12px; margin-top: 12px; }
.user-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.user-card.is-disabled { opacity: .62; }
.user-card-head { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-bottom: 13px; }
.user-list-avatar { width: 42px; height: 42px; border-radius: 12px; }
.user-card-head h3, .user-card-head p { margin: 0; }
.user-card-head h3 { font-size: 14px; }
.user-card-head h3 em { margin-left: 5px; padding: 3px 6px; border-radius: 6px; color: var(--green-dark); background: var(--green-soft); font-size: 8px; font-style: normal; text-transform: uppercase; }
.user-card-head p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.user-last-login { color: var(--muted); font-size: 10px; }
.user-password-reset { background: #f8faf7; }
.user-password-reset form { padding-top: 6px; }
.access-readonly { position: relative; }
.access-readonly::before { content: "Tryb tylko do odczytu"; display: inline-block; margin-bottom: 10px; padding: 6px 9px; border-radius: 8px; color: #6e5714; background: #fff7dc; font-size: 10px; font-weight: 750; }

@media (max-width: 1100px) {
  .login-shell { grid-template-columns: minmax(300px, .75fr) minmax(440px, 1.25fr); }
  .login-hero { padding: 54px; }
  .login-hero h2 { font-size: 39px; }
  .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .users-layout { grid-template-columns: 1fr; }
  .create-user-card { position: static; }
}

@media (max-width: 760px) {
  .login-shell { display: block; padding: 16px; background: linear-gradient(145deg, #122017, #243a29); }
  .login-hero { display: none; }
  .login-panel { min-height: calc(100vh - 32px); padding: 0; }
  .login-card { padding: 28px 22px; }
  .login-card h1 { font-size: 28px; }
  .topbar-actions .status { display: none; }
  .user-chip-copy { display: none; }
  .user-chip { padding-right: 5px; }
  .analytics-toolbar { align-items: stretch; flex-direction: column; }
  .analytics-toolbar label { min-width: 0; }
  .analytics-grid, .profile-grid { grid-template-columns: 1fr; }
  .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-metric { min-height: 106px; padding: 14px; }
  .analytics-metric b { font-size: 24px; }
  .analytics-wide { grid-column: auto; }
  .password-change-notice { align-items: flex-start; flex-direction: column; }
  .user-card { padding: 15px; }
  .user-card-head { grid-template-columns: 42px minmax(0, 1fr); }
  .user-card-head .role-pill { grid-column: 1 / -1; justify-self: start; }
}
