:root {
  color-scheme: light;
  --ink:#171719;
  --quiet:#595961;
  --red:#cb142d;
  --accent:#e6203b;
  --line:#e8e7eb;
  --surface:#fff;
  --canvas:#f5f5f7;
  font: 16px/1.45 "Inter","Segoe UI",system-ui,sans-serif;
  color:var(--ink);
  background:#eae9ed;
  -webkit-tap-highlight-color:transparent;
}
* {box-sizing:border-box}
body {margin:0}
a {color:inherit;text-decoration:none}
button,input,select,textarea {font:inherit}
button {cursor:pointer}
button:disabled {opacity:.55;cursor:wait}
:focus-visible {outline:3px solid #a10e24;outline-offset:3px}
h1,h2,h3,p,ul {margin:0}
ul {list-style:none;padding:0}
svg {flex-shrink:0;vertical-align:middle}
[hidden] {display:none!important}
.app {position:relative;max-width:520px;min-height:100dvh;margin:auto;background:var(--canvas)}
.topbar {height:71px;padding:0 20px;display:flex;align-items:center;justify-content:space-between;background:#111113;color:white}
.brand,.login-brand {display:inline-flex;gap:10px;align-items:center}
.brand-mark {position:relative;display:flex;align-items:center;justify-content:center;gap:3px;width:39px;height:39px;border-radius:11px;background:#de1633;overflow:hidden;box-shadow:inset 0 1px 0 #ffffff42}
.brand-mark i {display:block;width:4px;height:21px;border-radius:2px;background:white;transform:skewX(-27deg)}
.brand-mark i:nth-child(2) {height:16px;align-self:center}
.brand-mark i:nth-child(3) {height:11px}
.brand-text {display:block;font-size:25px;line-height:.83;font-weight:850;letter-spacing:-1.45px}
.brand-text>span {color:#ff435b}
.brand-text small {display:block;margin-top:6px;color:#d7d6dc;font-size:9px;font-weight:750;letter-spacing:1.65px}
.avatar {display:grid;place-items:center;width:41px;height:41px;border-radius:50%;color:#fff;background:#29292e;border:1px solid #48484d;font-size:.85rem;font-weight:800;flex-shrink:0}
.main {padding:17px 18px calc(90px + env(safe-area-inset-bottom))}
.hero {position:relative;isolation:isolate;padding:18px 18px 21px;overflow:hidden;min-height:149px;border-radius:18px;color:white;background:linear-gradient(112deg,#b80923 0%,#d71430 68%,#bb1027 100%);box-shadow:0 8px 18px #a1102321}
.hero-date {display:inline-flex;align-items:center;gap:6px;font-size:.79rem;font-weight:650;background:#7e061b5e;border:1px solid #ffffff38;border-radius:7px;padding:3px 8px}
.hero-date svg {width:14px;height:14px}
.hero h1 {font-size:clamp(1.5rem,6.1vw,1.92rem);line-height:1.12;letter-spacing:-.9px;margin:14px 0 5px;overflow-wrap:anywhere}
.hero p {font-size:.89rem;color:#fff4f6;font-weight:540}
.hero-orbit {position:absolute;right:-53px;top:-56px;z-index:-1;width:178px;height:245px;transform:rotate(33deg);display:flex;align-items:center;gap:11px;opacity:.32}
.hero-orbit i {flex:0 0 27px;height:100%;border:1px solid #fff7fa;background:#fb7f9235;border-radius:26px}
.hero-orbit i:nth-child(2) {height:86%}
.hero-orbit i:nth-child(3) {height:72%}
.section {margin-top:21px}
.section-heading {display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 10px}
.section-heading h2 {font-size:1.12rem;letter-spacing:-.35px}
.section-heading a,.text-button {color:#b51028;font-size:.86rem;font-weight:750}
.section-heading a {display:flex;align-items:center;min-height:38px}
.tile-grid {display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tile {display:block;min-width:0;min-height:109px;padding:11px 12px;background:var(--surface);border:1px solid var(--line);border-radius:13px;box-shadow:0 2px 4px #17171906;transition:background .15s,border-color .15s}
.tile:active {background:#fff0f3;border-color:#f7a2b1}
.tile-top {display:flex;align-items:center;justify-content:space-between;margin-bottom:7px}
.tile-icon,.movement-icon,.login-icon {display:grid;place-items:center;border-radius:10px;color:var(--red);background:#fde9ed;width:38px;height:38px;flex-shrink:0}
.tile-icon svg,.movement-icon svg {width:21px;height:21px}
.tile-next {width:17px;height:17px;color:#6a6971}
.tile h3 {font-size:1rem;line-height:1.25;letter-spacing:-.27px}
.tile small {font-size:.81rem;color:var(--quiet)}
.movements,.stock-list {border:1px solid var(--line);border-radius:13px;background:white;overflow:hidden}
.movement,.stock-item {display:flex;align-items:center;gap:10px;padding:10px 11px}
.movement+.movement,.stock-item+.stock-item {border-top:1px solid var(--line)}
.movement-icon {width:33px;height:33px}
.movement-icon svg {width:17px;height:17px}
.movement-icon.in {color:#232327;background:#eeeef1}
.movement-text {min-width:0;flex:1}
.movement strong,.movement small {display:block}
.movement-text strong {font-size:.87rem}
.movement small {font-size:.75rem;color:var(--quiet);overflow-wrap:anywhere}
.movement-value {text-align:right}
.movement-value strong {font-size:.85rem;white-space:nowrap}
.bottom-nav {position:fixed;z-index:2;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,520px);padding:5px 5px max(5px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,minmax(0,1fr));border-top:1px solid #e1e0e5;background:#fff;box-shadow:0 -4px 15px #1717190a}
.bottom-nav a {display:grid;justify-items:center;align-content:center;gap:3px;min-width:0;min-height:55px;color:#595962;font-size:.73rem;font-weight:650;text-align:center}
.bottom-nav a svg {width:21px;height:21px}
.bottom-nav a.selected {color:#b51028;font-weight:800}
.bottom-nav a.selected svg {box-sizing:content-box;border-radius:8px;background:#fde8ec;padding:4px 10px;margin-top:-4px;margin-bottom:-4px}
.back {display:inline-flex;gap:3px;align-items:center;min-height:44px;margin:-5px 0 3px;color:var(--quiet);font-size:.88rem;font-weight:700}
.back svg {width:18px;height:18px}
.page-heading {display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:16px}
.page-heading h1 {font-size:1.7rem;line-height:1.15;letter-spacing:-.8px}
.page-heading p {margin-top:5px;font-size:.91rem;color:var(--quiet)}
.primary,.secondary,.account-link {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:46px;padding:9px 14px;border:1px solid transparent;border-radius:10px;font-weight:740}
.primary {color:white;background:#bd112a}
.primary:active {background:#9f1025}
.secondary {background:white;color:var(--ink);border-color:#dedde3}
.icon-button {width:46px;height:46px;padding:0;flex-shrink:0}
.icon-button svg {width:21px;height:21px}
button.small {font-size:.86rem;min-height:44px}
.search {background:#fff;border:1px solid var(--line);border-radius:10px;display:flex;align-items:center;padding-left:11px;gap:6px;color:var(--quiet)}
.search svg {width:20px;height:20px}
.search input {min-width:0;width:100%;border:0;padding:10px 8px;min-height:46px;background:none;color:var(--ink)}
.tabs {display:flex;gap:5px;margin:10px 0;overflow:auto}
.tabs button {min-height:44px;padding:6px 10px;flex:none;border:1px solid var(--line);border-radius:9px;background:white;color:var(--quiet);font-size:.82rem;font-weight:700}
.tabs button[aria-pressed="true"] {color:#a60e25;background:#fde8ec;border-color:#f8c7d0}
.records {display:grid;gap:9px}
.record {padding:13px;border:1px solid var(--line);border-radius:12px;background:white;overflow-wrap:anywhere}
.record-top {display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.record h2 {font-size:1rem;line-height:1.3;margin-top:2px}
.quiet {font-size:.82rem;color:var(--quiet)}
.badge {padding:4px 7px;border-radius:6px;font-size:.73rem;font-weight:800;white-space:nowrap}
.badge.done {background:#eaf0ed;color:#305a42}
.badge.partial {background:#fde8ec;color:#a60e25}
.badge.pending {background:#eeedf1;color:#494850}
.record-product,.record-note {margin:7px 0;font-size:.89rem;color:var(--quiet)}
.record-note {white-space:pre-wrap}
.record-detail {display:flex;gap:5px 15px;flex-wrap:wrap;font-size:.82rem;color:var(--quiet)}
.record-detail strong {color:var(--ink)}
.record-action {display:flex;justify-content:flex-end;margin-top:6px}
.text-button {border:0;background:transparent;padding:6px;min-height:44px}
progress {display:block;width:100%;height:7px;border:0;border-radius:9px;margin:8px 0;overflow:hidden;background:#eeedf1;accent-color:var(--red)}
progress::-webkit-progress-bar {background:#eeedf1}
progress::-webkit-progress-value {background:var(--red)}
progress::-moz-progress-bar {background:var(--red)}
.empty,.loading {padding:18px;border:1px solid var(--line);border-radius:11px;background:#fff;color:var(--quiet);font-size:.9rem}
.empty.compact {padding:11px}
.stock-item {min-height:65px;padding:10px 13px}
.stock-item small {display:block;color:var(--quiet);font-size:.83rem}
.stock-amount {margin-left:auto;text-align:right}
.stock-amount b {font-size:1.22rem;line-height:1}
.date-strip {display:flex;align-items:center;gap:7px;border-radius:9px;padding:9px 11px;background:#edecef;color:#4c4b54;font-size:.88rem;font-weight:700}
.date-strip svg {width:17px;height:17px}
.production-form {display:grid;gap:10px;margin-top:10px}
.production-item {justify-content:space-between;gap:7px}
.stepper {display:grid;grid-template-columns:44px minmax(47px,1fr) 44px;align-items:center;gap:3px;width:min(100%,175px)}
.stepper button,.stepper input {min-height:44px;width:100%;border:1px solid #dedde3;border-radius:8px;text-align:center;background:#faf9fb;color:var(--ink);padding:0}
.stepper button {color:#ac1027;background:#fff0f2;border-color:#fad4db}
.stepper button svg {width:17px;height:17px}
.stepper input {appearance:textfield;-moz-appearance:textfield;touch-action:pan-y}
.stepper input::-webkit-inner-spin-button,.stepper input::-webkit-outer-spin-button {appearance:none}
.account-card,.user-record {display:flex;align-items:center;gap:11px}
.account-card p,.user-record p,.user-record small {color:var(--quiet);font-size:.85rem}
.account-card .big {width:51px;height:51px;background:#fde8ec;color:var(--red);border-color:#fad4db}
.account-link {display:flex;justify-content:flex-start;width:100%;margin-top:9px;background:white;color:var(--ink);border-color:var(--line);text-align:left}
.account-link .end {margin-left:auto}
.account-link svg {width:19px;height:19px}
.user-info {flex:1;min-width:0}
dialog {width:min(calc(100% - 22px),485px);max-height:calc(100dvh - 24px);margin:auto auto max(11px,env(safe-area-inset-bottom));padding:16px;border:0;border-radius:15px;background:#fff;color:var(--ink);box-shadow:0 12px 45px #0005}
dialog::backdrop {background:#11111783}
dialog form,.login-panel form {display:grid;gap:10px}
.dialog-heading {display:flex;align-items:center;justify-content:space-between;gap:8px}
.dialog-heading h2 {font-size:1.25rem}
.dialog-heading .icon-button {width:44px;height:44px}
dialog p,.login-panel p {color:var(--quiet);font-size:.89rem}
dialog label,.login-panel label,.field {display:grid;gap:4px;color:var(--ink);font-size:.9rem;font-weight:720}
label small {color:var(--quiet);font-weight:500}
label input:not([type=checkbox],[type=search]),label select,label textarea {
  width:100%;min-height:44px;padding:8px 10px;border:1px solid #dedde3;border-radius:8px;background:#faf9fb;color:var(--ink);font-size:1rem
}
label textarea {resize:vertical}
label.checkbox {display:flex;align-items:center;gap:9px;min-height:44px}
.checkbox input {width:20px;height:20px;accent-color:#bd112a}
p.error {padding:8px 10px;color:#a80e24;background:#fde9ed;border-radius:8px;font-size:.87rem}
.login-screen {min-height:100dvh;display:flex;flex-direction:column;justify-content:center;padding:28px 19px;background:radial-gradient(ellipse at 100% 0%,#361319,#111113 57%);color:white}
.login-brand {align-self:flex-start;margin:0 0 24px 4px}
.login-panel {background:#fff;color:var(--ink);border-radius:16px;padding:19px;box-shadow:0 12px 35px #0004}
.login-icon {margin-bottom:11px}
.login-panel h1 {font-size:1.6rem;letter-spacing:-.65px}
.login-panel form {margin-top:17px}
.login-foot {margin:17px 0 0 4px;color:#eee9eb;font-size:.86rem}
.notice {position:fixed;z-index:4;left:50%;bottom:calc(75px + env(safe-area-inset-bottom));transform:translateX(-50%);width:min(calc(100% - 32px),470px);border:1px solid #45454d;border-radius:10px;padding:10px 12px;color:#fff;background:#222227;font-size:.9rem;box-shadow:0 5px 18px #0003}
@media (max-width:350px) {
  .main {padding-left:10px;padding-right:10px}
  .topbar {padding-inline:12px}
  .tile {padding-inline:8px}
  .tile h3 {font-size:.93rem}
  .bottom-nav a {font-size:.67rem}
}
@media (min-height:820px) {
  .hero {min-height:163px;padding-top:20px}
  .tile {min-height:118px}
  .section {margin-top:24px}
}
@media (prefers-reduced-motion:reduce) { * {transition:none!important} }
