:root { --bg:#050607; --surface:#101114; --surface-2:#18191d; --surface-3:#222328; --border:#292b31; --text:#f5f6f7; --muted:#8f9199; --green:#24c58b; --green-dark:#0e412e; --blue:#159df3; --danger:#ff5d64; --nav-height:88px; }
    html[data-theme="light"] { color-scheme:light; --bg:#f4f6f8; --surface:#ffffff; --surface-2:#eef1f4; --surface-3:#e3e8ed; --border:#d8dee6; --text:#18202a; --muted:#68717c; --green:#0ba875; --green-dark:#d9f7ec; --blue:#087fd0; --danger:#dc3f4d; }
    html[data-theme="light"] body { background:var(--bg); }
    html[data-theme="light"] .product-card,html[data-theme="light"] .metric-card,html[data-theme="light"] .chart-card,html[data-theme="light"] .workspace-card { background:linear-gradient(145deg,#ffffff,#f8fafb); box-shadow:0 10px 30px rgba(31,45,61,.08); }
    html[data-theme="light"] .bottom-nav { border-top-color:#d8dee6; background:rgba(255,255,255,.94); }
    html[data-theme="light"] .modal { background:#ffffff; box-shadow:0 28px 80px rgba(31,45,61,.2); }
    html[data-theme="light"] .status { color:#087d58; background:#e1f8ef; }
    html[data-theme="light"] .chip.active-green { color:#063d2c; }
    html[data-theme="light"] .add-button,html[data-theme="light"] .primary { color:#063d2c; }
    html[data-theme="light"] .nav-item:hover { background:rgba(8,127,208,.07); }
    html[data-theme="light"] .toast { color:#075b42; background:#dff8ed; }
    html[data-theme="light"] .field input,html[data-theme="light"] .field select { background:#f7f9fb; }
    html[data-theme="light"] .product-image { background:#e6ddd2; }
    html[data-theme="light"] .recent-name,html[data-theme="light"] .legend-row,html[data-theme="light"] .bar-label { color:#27313c; }
    html[data-theme="light"] .workspace-card .workspace-value,html[data-theme="light"] .metric-value,html[data-theme="light"] .price,html[data-theme="light"] .recent-price { color:var(--text); }
    * { box-sizing:border-box; }
    html { color-scheme:dark; scroll-behavior:smooth; }
    body { margin:0; min-width:320px; background:var(--bg); color:var(--text); font-family:Inter,-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",sans-serif; -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent; }
    button,input,select { font:inherit; }
    button { cursor:pointer; }
    button:focus-visible { outline:3px solid var(--blue); outline-offset:3px; }
    .app-shell { width:min(100%,760px); min-height:100vh; margin:auto; padding:24px 22px calc(var(--nav-height) + env(safe-area-inset-bottom) + 28px); }
    .page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:30px; }.export-wrap{position:relative}.export-menu{position:absolute;z-index:5;top:calc(100% + 8px);right:0;display:grid;min-width:150px;gap:5px;padding:7px;border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:0 14px 35px rgba(0,0,0,.2)}.export-menu[hidden]{display:none}.export-menu button{min-height:40px;border:0;border-radius:9px;padding:9px 12px;color:var(--text);background:transparent;text-align:left;font-size:13px}.export-menu button:hover{background:var(--surface-2)}.export-menu small{display:block;padding:3px 8px 5px;color:var(--muted);font-size:10px}.export-button{min-height:44px;border:1px solid var(--border);border-radius:14px;padding:10px 12px;color:var(--text);background:var(--surface-2);font-size:12px;font-weight:700;white-space:nowrap}.export-button:hover{background:var(--surface-3)}.header-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end}.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;border:1px solid var(--border);border-radius:14px;padding:10px 12px;color:var(--text);background:var(--surface-2);font-size:12px;font-weight:700;white-space:nowrap;transition:background .2s,transform .12s}.theme-toggle:hover{background:var(--surface-3)}.theme-toggle:active{transform:scale(.97)}.theme-icon{font-size:16px;line-height:1}
    h1 { margin:0 0 7px; font-size:clamp(32px,6vw,43px); line-height:1; letter-spacing:-.8px; }.count { margin:0; color:var(--muted); font-size:19px; }
    .period-filter{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}.period-filter select{min-height:40px;border:1px solid var(--border);border-radius:11px;padding:8px 10px;color:var(--text);background:var(--surface-2);font-size:13px;font-weight:700}.period-filter small{color:var(--muted)}.role-panel{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-8px 0 18px;padding:12px 14px;border:1px solid var(--border);border-radius:15px;background:var(--surface)}.role-panel label{display:grid;gap:3px;color:var(--muted);font-size:11px}.role-panel select{min-height:36px;border:1px solid var(--border);border-radius:9px;padding:6px 10px;color:var(--text);background:var(--surface-2);font-size:14px;font-weight:700}.role-note{color:var(--muted);font-size:11px;text-align:right}.nav-item.locked{color:#565861;opacity:.72}.nav-item.locked::after{content:"🔒";font-size:9px}.permission-locked{opacity:.5;cursor:not-allowed!important}.connection-status{display:flex;align-items:center;gap:8px;margin:-14px 0 22px;color:var(--green);font-size:13px}.connection-status::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor}.connection-status.offline{color:#f2b94b}.connection-status.offline::before{background:currentColor}.add-button { display:inline-flex; align-items:center; justify-content:center; min-height:48px; gap:11px; border:0; border-radius:18px; padding:16px 20px; color:#04291e; background:var(--green); font-size:17px; font-weight:700; transition:transform .2s,filter .2s; }.add-button:hover{filter:brightness(1.08);transform:translateY(-1px)}.plus{font-size:28px;font-weight:300;line-height:15px}
    .filter-group { display:flex; gap:12px; overflow-x:auto; padding:1px 0 4px; margin-bottom:17px; scrollbar-width:none; -webkit-overflow-scrolling:touch; scroll-snap-type:x proximity; overscroll-behavior-x:contain; }.filter-group::-webkit-scrollbar{display:none}.chip{flex:0 0 auto;min-height:44px;border:1px solid transparent;border-radius:999px;padding:11px 21px;color:#d7d8dc;background:var(--surface-2);font-size:16px;scroll-snap-align:start;transition:background .2s,color .2s,transform .12s}.chip:active{transform:scale(.97)}.chip:hover{background:var(--surface-3)}.chip.active-green{color:#031e16;background:var(--green);font-weight:700}.chip.active-blue{color:white;background:var(--blue);font-weight:700}
    .products { display:grid; gap:22px; margin-top:36px; }.empty-state { border:1px dashed var(--border); border-radius:25px; padding:40px 24px; text-align:center; color:var(--muted); }.empty-state strong{display:block;margin-bottom:8px;color:var(--text);font-size:18px}
    .product-card { display:grid; grid-template-columns:148px 1fr; gap:20px; min-height:244px; touch-action:manipulation; padding:22px; border:1px solid var(--border); border-radius:25px; background:linear-gradient(145deg,#111215,#0e0f12); box-shadow:0 10px 30px rgba(0,0,0,.15); animation:rise .35s ease both; }.product-image{width:148px;height:148px;object-fit:cover;border-radius:20px;background:#d6c9b8}.product-info{display:flex;min-width:0;flex-direction:column;padding:4px 0 1px}.product-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.product-name{margin:0;font-size:21px;line-height:1.2;letter-spacing:-.25px}.status{flex:0 0 auto;border:1px solid rgba(36,197,139,.35);border-radius:999px;padding:6px 11px;color:#1dd58f;background:rgba(5,48,33,.55);font-size:13px;white-space:nowrap}.product-meta{margin:6px 0 21px;color:var(--muted);font-size:16px}.price-line{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.product-profit{margin:8px 0 0;color:var(--muted);font-size:12px}.product-profit.positive{color:var(--green)}.price{font-size:24px;font-weight:750;letter-spacing:-.4px}.resale{color:var(--green);font-size:17px}.resale::before{content:"→";margin-right:8px}.card-bottom{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-top:auto}.owner{border-radius:9px;padding:8px 13px;color:#d7d8dc;background:var(--surface-2);font-size:14px}.actions{display:flex;gap:18px}.icon-button{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;color:var(--muted);background:transparent}.icon-button:hover{color:var(--text)}.icon-button.delete{color:var(--danger)}.icon-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}
    .bottom-nav{position:fixed;z-index:10;right:0;bottom:0;left:0;display:flex;justify-content:center;height:calc(var(--nav-height) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);border-top:1px solid #1e2024;background:rgba(14,15,18,.96);backdrop-filter:blur(18px)}.nav-inner{display:grid;grid-template-columns:repeat(7,1fr);width:min(100%,760px);padding:9px 8px 6px}.nav-item{display:flex;min-width:0;min-height:56px;flex-direction:column;align-items:center;justify-content:center;gap:5px;border:0;border-radius:14px;padding:6px 2px;color:#85878e;background:transparent;font-size:11px;transition:color .2s,background .2s,transform .12s}.nav-item:hover{background:rgba(255,255,255,.06)}.nav-item:active{transform:scale(.96)}.nav-item.active{color:var(--green);background:rgba(36,197,139,.08)}.nav-icon{width:26px;height:26px}.nav-icon svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}.nav-item.active .nav-icon svg{stroke-width:2.3}
    .modal-backdrop{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:20px;overscroll-behavior:contain;background:rgba(0,0,0,.7);backdrop-filter:blur(8px)}.modal-backdrop[hidden]{display:none}.modal{width:min(100%,480px);max-height:min(86vh,700px);overflow-y:auto;border:1px solid var(--border);border-radius:25px;padding:24px;padding-bottom:calc(24px + env(safe-area-inset-bottom));background:#111215;box-shadow:0 28px 80px rgba(0,0,0,.55)}.modal-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px}.modal h2{margin:0;font-size:23px}.close{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;color:var(--muted);background:var(--surface-2);font-size:23px}.form-grid{display:grid;gap:14px}.field{display:grid;gap:7px;color:#b8bac1;font-size:13px}.field input,.field select{width:100%;min-height:48px;border:1px solid var(--border);border-radius:12px;padding:12px 13px;font-size:16px;outline:none;color:var(--text);background:var(--surface-2)}.field input:focus,.field select:focus{border-color:var(--green)}.photo-actions{display:flex;gap:10px;flex-wrap:wrap}.photo-actions .secondary{flex:1;min-width:150px}.photo-field input[type=file]{display:none}.field-help{color:var(--muted);font-size:12px;line-height:1.4}.photo-preview{width:100%;max-height:180px;object-fit:cover;border-radius:14px;margin-top:4px;border:1px solid var(--border)}.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}.secondary,.primary{min-height:48px;border:0;border-radius:12px;padding:11px 16px;font-weight:700;touch-action:manipulation}.secondary{color:#dedfe3;background:var(--surface-2)}.primary{color:#05251a;background:var(--green)}
    .toast{position:fixed;z-index:30;right:20px;bottom:calc(var(--nav-height) + 20px);max-width:calc(100% - 40px);border:1px solid rgba(36,197,139,.35);border-radius:12px;padding:12px 15px;color:#dffbef;background:#103b2b;box-shadow:0 8px 30px rgba(0,0,0,.3);transform:translateY(20px);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}.toast.show{transform:translateY(0);opacity:1}
    #dashboard-view[hidden],#stock-view[hidden],#workspace-view[hidden]{display:none}.dashboard-header{margin:0 0 25px}.eyebrow{margin:0 0 7px;color:var(--green);font-size:12px;font-weight:750;letter-spacing:.09em;text-transform:uppercase}.dashboard-subtitle{margin:0;color:var(--muted);font-size:16px}.metric-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:18px}.metric-card{min-height:112px;border:1px solid var(--border);border-radius:20px;padding:17px;background:linear-gradient(145deg,#111215,#0e0f12)}.metric-label{margin:0 0 11px;color:var(--muted);font-size:13px}.metric-value{margin:0;color:var(--text);font-size:25px;letter-spacing:-.5px}.metric-detail{margin:7px 0 0;color:var(--green);font-size:12px}.charts-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:18px}.chart-card{min-width:0;border:1px solid var(--border);border-radius:22px;padding:19px;background:linear-gradient(145deg,#111215,#0e0f12)}.chart-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:18px}.chart-heading h2{margin:0;font-size:18px;letter-spacing:-.2px}.chart-caption{color:var(--muted);font-size:12px;white-space:nowrap}.donut-wrap{display:flex;align-items:center;gap:17px;min-height:170px}.donut-chart{display:grid;place-items:center;flex:0 0 auto;width:132px;height:132px;border-radius:50%;background:conic-gradient(var(--green) 0 100%);position:relative;color:var(--text);font-size:27px;font-weight:750}.donut-chart::after{content:"";position:absolute;width:83px;height:83px;border-radius:50%;background:var(--surface)}.donut-chart span,.donut-chart small{z-index:1}.donut-chart small{margin-top:-43px;color:var(--muted);font-size:10px;font-weight:500}.chart-legend{display:grid;gap:10px;min-width:0}.legend-row{display:flex;align-items:center;gap:8px;color:#d7d8dc;font-size:12px}.legend-dot{width:8px;height:8px;border-radius:50%;flex:0 0 auto}.legend-value{margin-left:auto;color:var(--muted)}.bar-chart{display:grid;gap:14px}.bar-row{display:grid;grid-template-columns:minmax(70px,1fr) 42%;align-items:center;gap:12px}.bar-label{overflow:hidden;color:#d7d8dc;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.bar-track{height:12px;border-radius:99px;background:var(--surface-2);overflow:hidden}.bar-fill{height:100%;min-width:3px;border-radius:inherit;background:linear-gradient(90deg,var(--blue),#6fc7ff)}.bar-amount{grid-column:1/-1;margin-top:-9px;color:var(--muted);font-size:11px;text-align:right}.recent-card{margin-bottom:20px}.compact-action{min-height:40px;padding:8px 12px;font-size:12px}.recent-list{display:grid;gap:9px}.recent-row{display:flex;align-items:center;gap:12px;border-radius:13px;padding:9px;background:var(--surface-2)}.recent-thumb{width:42px;height:42px;object-fit:cover;border-radius:10px;background:#2a2b30}.recent-info{min-width:0}.recent-name{overflow:hidden;color:#e5e6e9;font-size:13px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.recent-meta{margin-top:3px;color:var(--muted);font-size:11px}.recent-price{margin-left:auto;color:var(--text);font-size:13px;white-space:nowrap}.dashboard-empty{color:var(--muted);font-size:13px}@media (max-width:560px){.charts-grid{grid-template-columns:1fr;gap:14px}.donut-wrap{justify-content:center}.metric-card{min-height:104px;padding:15px}.metric-value{font-size:22px}.dashboard-header{margin-bottom:21px}}
    .dashboard-actions{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;justify-content:flex-end}.dashboard-hero{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px;padding:22px;border:1px solid rgba(36,197,139,.3);border-radius:23px;background:linear-gradient(135deg,rgba(36,197,139,.16),rgba(21,157,243,.08));}.dashboard-hero h2{margin:0;font-size:22px;letter-spacing:-.3px}.dashboard-hero p:last-child{margin:8px 0 0;color:var(--muted);font-size:13px}.hero-pulse{display:flex;align-items:center;gap:8px;white-space:nowrap;color:var(--green);font-size:13px}.hero-pulse span{width:10px;height:10px;border-radius:50%;background:var(--green);box-shadow:0 0 0 6px rgba(36,197,139,.12)}.shortcut-panel{margin-bottom:18px;padding:19px;border:1px solid var(--border);border-radius:22px;background:var(--surface)}.shortcut-panel .chart-heading{margin-bottom:13px}.shortcut-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.shortcut-button{min-height:76px;border:1px solid var(--border);border-radius:15px;padding:13px;text-align:left;color:var(--text);background:var(--surface-2);transition:transform .15s,border-color .15s,background .15s}.shortcut-button:hover{transform:translateY(-2px);border-color:var(--green);background:var(--surface-3)}.shortcut-button strong{display:block;font-size:13px}.shortcut-button span{display:block;margin-top:7px;color:var(--muted);font-size:11px}.dashboard-panels{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}.alert-list{display:grid;gap:9px}.alert-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-radius:12px;padding:11px 12px;background:var(--surface-2);font-size:12px}.alert-row strong{color:var(--text)}.alert-row span{color:var(--muted);text-align:right}.alert-row.critical strong{color:#ffb3b6}.alert-row.pending strong{color:#f2b94b}.trend-chart{display:flex;align-items:flex-end;gap:10px;min-height:170px;padding:14px 4px 0;border-bottom:1px solid var(--border)}.trend-column{display:flex;flex:1;height:150px;flex-direction:column;align-items:center;justify-content:flex-end;gap:6px;min-width:0}.trend-bar-wrap{display:flex;width:100%;height:112px;align-items:flex-end;justify-content:center}.trend-bar{width:min(32px,70%);min-height:3px;border-radius:7px 7px 2px 2px;background:linear-gradient(180deg,var(--green),var(--blue))}.trend-label{overflow:hidden;width:100%;color:var(--muted);font-size:10px;text-align:center;text-overflow:ellipsis;white-space:nowrap}.trend-amount{color:var(--text);font-size:10px}.period-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:18px}.period-toolbar .workspace-muted{font-size:12px;text-align:right}@media (max-width:560px){.dashboard-actions{align-items:stretch;justify-content:stretch}.dashboard-actions>*{flex:1}.dashboard-hero{align-items:flex-start;flex-direction:column}.shortcut-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-panels{grid-template-columns:1fr}.period-toolbar{align-items:flex-start;flex-direction:column}.period-toolbar .workspace-muted{text-align:left}}

    .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.smart-filters{display:flex;gap:8px;overflow-x:auto;margin:-2px 0 17px;padding:1px 0 4px;scrollbar-width:none}.smart-filters::-webkit-scrollbar{display:none}.smart-filter{flex:0 0 auto;min-height:38px;border:1px solid var(--border);border-radius:999px;padding:8px 13px;color:var(--muted);background:var(--surface);font-size:12px;font-weight:700}.smart-filter.active{color:#06291e;background:var(--green);border-color:var(--green)}.smart-filter.alert.active{color:#381e00;background:#f2b94b;border-color:#f2b94b}.stock-tools{display:grid;grid-template-columns:1fr 170px;gap:10px;margin:0 0 15px}.stock-tools input,.stock-tools select{width:100%;min-height:46px;border:1px solid var(--border);border-radius:13px;padding:11px 13px;color:var(--text);background:var(--surface-2);font-size:14px}.stock-tools input:focus,.stock-tools select:focus{outline:2px solid var(--blue);outline-offset:1px}.stock-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:18px}.stock-stat{border:1px solid var(--border);border-radius:15px;padding:13px;background:var(--surface)}.stock-stat strong{display:block;font-size:18px}.stock-stat span{display:block;margin-top:5px;color:var(--muted);font-size:11px}.stock-insights{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-4px 0 18px;color:var(--muted);font-size:12px}.calc-layout{display:grid;grid-template-columns:1.15fr .85fr;gap:18px}.calc-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.calc-form-grid label{display:grid;gap:7px;color:var(--muted);font-size:12px}.calc-form-grid input{width:100%;min-height:46px;border:1px solid var(--border);border-radius:11px;padding:10px 12px;color:var(--text);background:var(--surface-2)}.calc-presets{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.calc-preset{min-height:38px;border:1px solid var(--border);border-radius:10px;padding:8px 11px;color:var(--text);background:var(--surface-2);font-size:12px}.calc-preset:hover{border-color:var(--green)}.calc-result-main{border:1px solid rgba(36,197,139,.35);border-radius:18px;padding:18px;background:linear-gradient(145deg,rgba(36,197,139,.13),rgba(21,157,243,.06))}.calc-result-main .workspace-value{font-size:34px;color:var(--green)}.calc-breakdown{display:grid;gap:10px;margin-top:16px}.calc-breakdown-row{display:flex;justify-content:space-between;gap:10px;padding-bottom:9px;border-bottom:1px solid var(--border);color:var(--muted);font-size:13px}.calc-breakdown-row strong{color:var(--text)}.recap-hero{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px;padding:20px;border:1px solid var(--border);border-radius:21px;background:linear-gradient(135deg,rgba(21,157,243,.12),rgba(36,197,139,.1))}.recap-hero h2{margin:0;font-size:22px}.health-score{font-size:28px;font-weight:750;color:var(--green)}.distribution-bar{display:flex;height:12px;overflow:hidden;border-radius:99px;background:var(--surface-2)}.distribution-bar span{height:100%}.recap-actions{display:flex;gap:8px;flex-wrap:wrap}@media (max-width:560px){.stock-tools{grid-template-columns:1fr}.stock-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.stock-insights{align-items:flex-start;flex-direction:column}.calc-layout{grid-template-columns:1fr}.recap-hero{align-items:flex-start;flex-direction:column}}

    .stock-progress{height:5px;margin:10px 0 0;overflow:hidden;border-radius:99px;background:var(--surface-2)}.stock-progress span{display:block;height:100%;border-radius:inherit;background:var(--green);transition:width .25s ease,background .25s ease}.stock-progress span.low{background:#f2b94b}.stock-progress span.empty{background:var(--danger)}@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;transition-duration:.001ms!important}}
    @keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
    @media (max-width:560px){.role-panel{align-items:flex-start}.role-note{max-width:125px}.app-shell{padding-right:16px;padding-left:16px}.header-actions{gap:7px}.export-button{min-width:44px;padding:10px}.export-button{font-size:0}.export-button::after{content:"⇩";font-size:17px}.export-menu{right:-8px}.theme-toggle{min-width:44px;padding:10px}.theme-toggle .theme-label{display:none}.modal-backdrop{align-items:end;padding:12px}.modal{border-radius:24px 24px 18px 18px;max-height:88vh}.page-header{margin-bottom:25px}.add-button{padding:15px 17px}.product-card{grid-template-columns:100px 1fr;gap:15px;min-height:202px;padding:16px;border-radius:21px}.product-image{width:100px;height:100px;border-radius:15px}.product-name{font-size:17px}.product-meta{margin-top:4px;margin-bottom:12px;font-size:14px}.price{font-size:20px}.resale{font-size:14px}.status{padding:5px 8px;font-size:11px}.owner{padding:7px 10px;font-size:12px}.nav-item{min-height:54px;font-size:9px}}
    @media (max-width:390px){.page-header{align-items:center}.page-header h1{font-size:30px}.count{font-size:16px}.add-button{padding:13px 14px;font-size:14px}.plus{font-size:23px}.product-card{grid-template-columns:88px 1fr;gap:12px}.product-image{width:88px;height:88px}.product-top{display:block}.status{display:inline-block;margin-top:7px}}

    /* Refonte mobile : mêmes données, interface pensée au pouce. */
    .more-sheet-backdrop{position:fixed;z-index:45;inset:0;display:grid;align-items:end;background:rgba(0,0,0,.58);backdrop-filter:blur(8px)}.more-sheet-backdrop[hidden]{display:none}.more-sheet{width:100%;max-width:760px;margin:auto;padding:10px 18px calc(22px + env(safe-area-inset-bottom));border:1px solid var(--border);border-radius:26px 26px 0 0;background:var(--surface);box-shadow:0 -20px 56px rgba(0,0,0,.4)}.sheet-handle{width:38px;height:5px;margin:1px auto 18px;border-radius:99px;background:var(--border)}.more-sheet-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.more-sheet-heading h2{margin:0;font-size:23px}.more-sheet-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:18px}.more-nav-action{min-height:102px;border:1px solid var(--border);border-radius:17px;padding:13px 10px;color:var(--text);background:var(--surface-2);text-align:left}.more-nav-action strong{display:block;font-size:14px}.more-nav-action span{display:block;margin-top:7px;color:var(--muted);font-size:11px;line-height:1.25}.more-nav-action:active{transform:scale(.98)}.stock-search-toolbar{display:flex;gap:10px;align-items:stretch;margin-bottom:14px}.stock-search-toolbar>input{flex:1;min-width:0;min-height:48px;border:1px solid var(--border);border-radius:15px;padding:12px 14px;color:var(--text);background:var(--surface-2);font-size:16px}.stock-filter-drawer{position:relative;flex:0 0 auto}.stock-filter-drawer>summary{display:flex;align-items:center;justify-content:center;gap:7px;min-height:48px;border:1px solid var(--border);border-radius:15px;padding:10px 12px;list-style:none;color:var(--text);background:var(--surface-2);font-size:12px;font-weight:750;white-space:nowrap}.stock-filter-drawer>summary::-webkit-details-marker{display:none}.filter-summary-icon{font-size:17px}.active-filter-count{display:none}.filter-drawer-content{display:grid;gap:14px;margin-top:11px;padding:15px;border:1px solid var(--border);border-radius:18px;background:var(--surface)}.mobile-select-label{display:grid;gap:7px;color:var(--muted);font-size:12px;font-weight:700}.mobile-select-label select{min-height:46px;border:1px solid var(--border);border-radius:12px;padding:10px 12px;color:var(--text);background:var(--surface-2);font-size:15px}.filter-section-title{margin:2px 0 -5px;color:var(--muted);font-size:11px;font-weight:750;letter-spacing:.08em;text-transform:uppercase}.clear-stock-filters{width:100%;min-height:46px}.form-section{display:grid;gap:14px;padding:16px;border:1px solid var(--border);border-radius:18px;background:var(--surface)}.form-section-heading h3{margin:0;font-size:17px}.form-section-heading .eyebrow{margin-bottom:4px}.form-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.form-disclosure{border:1px solid var(--border);border-radius:18px;background:var(--surface)}.form-disclosure summary{display:flex;align-items:center;justify-content:space-between;min-height:58px;padding:14px 16px;list-style:none;color:var(--text);font-weight:750}.form-disclosure summary::-webkit-details-marker{display:none}.form-disclosure summary small{color:var(--muted);font-weight:500}.form-disclosure .form-fields{padding:0 16px 16px}.dashboard-metrics-toggle{display:none}.modal-open{overflow:hidden}
    @media (max-width:800px){:root{--nav-height:84px}.app-shell{width:100%;padding:18px 14px calc(var(--nav-height) + env(safe-area-inset-bottom) + 22px)}.page-header{gap:14px;margin-bottom:17px}.stock-title-block .eyebrow{margin-bottom:4px}.page-header h1{font-size:34px}.count{font-size:15px}.stock-page-header{flex-direction:column;align-items:stretch}.stock-page-header .header-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;width:100%}.stock-page-header .add-button{grid-column:1/-1;min-height:52px;border-radius:16px;font-size:16px}.stock-page-header .export-button,.stock-page-header .theme-toggle{width:100%;min-height:46px;border-radius:13px;font-size:12px}.stock-page-header .export-button{font-size:12px}.stock-page-header .export-button::after{content:none!important;display:none!important}.role-panel{margin:0 0 14px;padding:11px 12px}.role-note{max-width:48%;line-height:1.35}.connection-status{margin:-4px 0 12px;font-size:12px}.stock-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}.stock-stat{min-height:76px;padding:12px}.stock-stat strong{font-size:19px}.stock-stat span{font-size:10px}.stock-insights{margin:0 0 12px;font-size:11px}.stock-insights span:last-child{text-align:right}.smart-filters{margin:0;gap:7px;overflow:visible;flex-wrap:wrap}.smart-filter{min-height:44px;padding:10px 12px;font-size:12px}.filter-group{gap:8px;margin:0;overflow:visible;flex-wrap:wrap}.chip{min-height:44px;padding:10px 14px;font-size:13px}.products{gap:12px;margin-top:18px}.product-card{grid-template-columns:94px minmax(0,1fr);gap:12px;min-height:0;padding:12px;border-radius:20px}.product-image{width:94px;height:116px;border-radius:14px}.product-info{padding:1px 0}.product-top{gap:8px}.product-name{font-size:17px;line-height:1.15}.status{padding:5px 7px;font-size:10px}.product-meta{margin:4px 0 8px;font-size:13px}.stock-line{margin:0;font-size:11px}.stock-progress{margin:8px 0}.price{font-size:19px}.resale{font-size:13px}.product-profit{margin:6px 0 0;font-size:11px}.card-bottom{margin-top:10px;align-items:center}.owner{padding:6px 9px;font-size:11px}.actions{gap:2px}.icon-button{width:44px;height:44px;border-radius:12px;background:var(--surface-2)}.icon-button.delete{background:rgba(255,93,100,.10)}.bottom-nav{height:calc(var(--nav-height) + env(safe-area-inset-bottom));border-top:1px solid var(--border);background:rgba(10,11,14,.96);box-shadow:0 -12px 34px rgba(0,0,0,.28)}.nav-inner{display:grid;grid-template-columns:repeat(5,1fr);width:100%;padding:8px 8px calc(6px + env(safe-area-inset-bottom));gap:3px}.nav-item{min-height:61px;gap:4px;border-radius:14px;padding:5px 2px;font-size:10px}.nav-icon{width:24px;height:24px}.modal-backdrop{align-items:end;padding:0}.modal{width:100%;max-height:calc(100dvh - 16px);border-radius:26px 26px 0 0;padding:18px 14px calc(16px + env(safe-area-inset-bottom));background:var(--surface)}.modal-header{position:sticky;top:-18px;z-index:2;margin:-18px -14px 14px;padding:18px 14px 13px;border-bottom:1px solid var(--border);background:var(--surface)}.modal h2{font-size:21px}.form-grid{gap:12px}.form-fields{grid-template-columns:1fr}.field input,.field select{min-height:52px;border-radius:13px;font-size:16px}.photo-actions{display:grid;grid-template-columns:1fr 1fr}.photo-actions .secondary{min-width:0;min-height:50px;padding:10px 7px;font-size:12px}.form-actions{position:sticky;bottom:-16px;z-index:2;display:grid;grid-template-columns:.72fr 1.28fr;margin:16px -14px -16px;padding:12px 14px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--border);background:var(--surface)}.form-actions .primary,.form-actions .secondary{min-height:52px}.dashboard-header{gap:14px}.dashboard-header h1{font-size:34px}.dashboard-subtitle{font-size:14px}.dashboard-actions{width:100%;align-items:center;justify-content:space-between}.dashboard-actions .period-filter{flex:1}.dashboard-actions .period-filter select{width:100%;min-height:46px}.notification-button{min-height:46px;padding:10px 12px;font-size:12px}.dashboard-hero{padding:17px;border-radius:19px}.dashboard-hero h2{font-size:19px}.metric-grid{gap:9px;margin-bottom:10px}.metric-card{min-height:97px;padding:13px;border-radius:16px}.metric-value{font-size:21px}.metric-label{margin-bottom:7px;font-size:11px}.metric-detail{font-size:10px}.dashboard-metrics-toggle{display:block;width:100%;min-height:44px;margin:0 0 16px;border:1px solid var(--border);border-radius:13px;color:var(--text);background:var(--surface)}#dashboard-metrics:not(.expanded) .metric-card:nth-child(n+5){display:none}#dashboard-view{display:flex;flex-direction:column}#dashboard-view>.dashboard-header{order:1}#dashboard-view>.dashboard-hero{order:2}#dashboard-view>#dashboard-metrics{order:3}#dashboard-view>#dashboard-metrics-toggle{order:4}#dashboard-view>.shortcut-panel{order:5}#dashboard-view>.dashboard-panels{order:6}#dashboard-view>.charts-grid{order:7}#dashboard-view>.recent-card{order:8}.shortcut-panel{padding:15px;border-radius:18px}.shortcut-grid{grid-template-columns:1fr 1fr;gap:8px}.shortcut-button{min-height:74px;padding:11px;border-radius:13px}.dashboard-panels,.charts-grid{grid-template-columns:1fr;gap:12px;margin-bottom:12px}.chart-card{padding:15px;border-radius:19px}.chart-heading{margin-bottom:13px}.donut-wrap{min-height:150px}.donut-chart{width:118px;height:118px}.donut-chart::after{width:74px;height:74px}.trend-chart{min-height:148px}.workspace-header{position:sticky;top:0;z-index:4;display:flex;align-items:flex-start;margin:0 -14px 15px;padding:14px 14px 12px;border-bottom:1px solid var(--border);background:rgba(5,6,7,.94);backdrop-filter:blur(16px)}html[data-theme="light"] .workspace-header{background:rgba(244,246,248,.94)}.workspace-header h1{font-size:27px}.workspace-header .secondary{min-height:42px;padding:8px 10px;font-size:11px}.workspace-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.workspace-card{padding:15px;border-radius:18px}.workspace-card h2{font-size:17px}.data-list li{align-items:flex-start;gap:12px;padding:12px 0}.data-list li>div+div{min-width:82px}.calc-layout{grid-template-columns:1fr;gap:12px}.calc-form-grid{grid-template-columns:1fr}.calc-result-main .workspace-value{font-size:31px}.recap-actions{width:100%}.recap-actions .secondary{flex:1;min-height:44px}.calendar-grid{gap:4px}.calendar-day{min-height:38px;padding:6px 2px;font-size:12px}.more-nav-action:focus-visible,.stock-filter-drawer summary:focus-visible,.dashboard-metrics-toggle:focus-visible{outline:3px solid var(--blue);outline-offset:3px}}
    @media (max-width:370px){.nav-item{font-size:9px}.nav-icon{width:22px;height:22px}.stock-page-header .header-actions{gap:7px}.product-card{grid-template-columns:82px minmax(0,1fr)}.product-image{width:82px;height:104px}.product-name{font-size:16px}.status{font-size:9px}.owner{font-size:10px}.metric-value{font-size:19px}.more-sheet-grid{gap:7px}.more-nav-action{min-height:94px;padding:10px 8px}.more-nav-action strong{font-size:12px}.more-nav-action span{font-size:10px}}
