:root {
  --ink: #182019;
  --muted: #758078;
  --paper: #f3f5ef;
  --card: #ffffff;
  --line: #e4e8df;
  --green: #2f7d52;
  --green-dark: #174f34;
  --green-soft: #e5f2e8;
  --lime: #b8dc7a;
  --lime-soft: #eff7df;
  --amber: #e29a32;
  --amber-soft: #fff3dd;
  --red: #c65c4b;
  --red-soft: #fbe9e5;
  --blue: #527aa1;
  --shadow: 0 10px 35px rgba(35, 52, 38, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 240px;
  flex-direction: column;
  padding: 28px 20px 22px;
  color: #eef6ed;
  background: #121811;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 3px; color: #93a092; font-size: 10px; font-weight: 550; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { position: relative; display: flex; width: 34px; height: 34px; align-items: flex-end; justify-content: center; gap: 3px; border-radius: 10px; background: var(--lime); overflow: hidden; }
.brand-mark i { display: block; width: 5px; border-radius: 5px 5px 0 0; background: #152016; transform: rotate(22deg); }
.brand-mark i:nth-child(1) { height: 12px; }
.brand-mark i:nth-child(2) { height: 22px; }
.brand-mark i:nth-child(3) { height: 16px; }
.main-nav { display: grid; gap: 8px; margin-top: 50px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 13px; padding: 12px 13px; color: #98a397; border: 0; border-radius: 12px; background: transparent; text-align: left; font-size: 14px; transition: .18s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.05); }
.nav-item.active { color: #182019; background: var(--lime); font-weight: 700; }
.nav-icon { display: grid; width: 24px; height: 24px; place-items: center; font-size: 20px; }
.side-foot { margin-top: auto; }
.storage-note { display: flex; gap: 9px; padding: 13px 5px; border-top: 1px solid #2c342b; }
.storage-note strong, .storage-note small { display: block; }
.storage-note strong { color: #d6dfd5; font-size: 11px; }
.storage-note small { margin-top: 3px; color: #778376; font-size: 10px; }
.status-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(184,220,122,.12); }
.side-foot .text-button { padding-left: 5px; color: #93a092; font-size: 11px; }

.main-content { min-height: 100vh; margin-left: 240px; padding: 30px 38px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar h1 { margin: 3px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -.035em; }
.eyebrow { margin: 0; color: #8a948c; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.top-actions, .action-row { display: flex; align-items: center; gap: 10px; }
.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 720; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--green-dark); box-shadow: 0 8px 18px rgba(23,79,52,.16); }
.button.primary:hover { background: #0d4129; }
.button.secondary { color: var(--ink); border-color: var(--line); background: white; }
.button.compact { min-height: 34px; padding: 0 12px; color: #674713; background: white; border-color: #f0cf93; font-size: 11px; }
.icon-button { width: 43px; height: 43px; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 18px; }
.text-button { padding: 0; color: var(--green); border: 0; background: transparent; font-size: 12px; font-weight: 700; }

.filter-bar { display: flex; align-items: flex-end; gap: 12px; margin: 27px 0 22px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.62); }
.filter-heading { display: flex; min-height: 40px; align-items: center; gap: 8px; padding: 0 5px 0 1px; font-size: 12px; }
.filter-icon { color: var(--green); font-size: 18px; transform: rotate(90deg); }
.filter-bar label, .custom-dates label { display: grid; gap: 5px; min-width: 150px; }
.filter-bar label span, .custom-dates label span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
select, input { width: 100%; min-height: 39px; padding: 0 11px; color: var(--ink); border: 1px solid #dfe4dc; border-radius: 9px; outline: none; background: white; font-size: 12px; }
select:focus, input:focus { border-color: #78a98c; box-shadow: 0 0 0 3px rgba(47,125,82,.09); }
.custom-dates { display: flex; gap: 8px; }
.custom-dates label { min-width: 130px; }
.clear-filter { min-height: 39px; padding: 0 8px; color: var(--red); border: 0; background: transparent; font-size: 11px; font-weight: 700; }

.view { display: none; animation: fade-in .24s ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } }
.summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.summary-card { position: relative; min-height: 128px; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.summary-card.accent { color: white; border-color: var(--green-dark); background: var(--green-dark); }
.summary-card::after { position: absolute; right: -12px; bottom: -32px; width: 78px; height: 78px; border: 18px solid rgba(184,220,122,.08); border-radius: 50%; content: ""; }
.summary-card .kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.summary-card.accent .kpi-label { color: #b9cabd; }
.summary-card .kpi-icon { display: grid; width: 25px; height: 25px; place-items: center; color: var(--green); border-radius: 8px; background: var(--green-soft); font-size: 12px; }
.summary-card.accent .kpi-icon { color: #172316; background: var(--lime); }
.summary-card .kpi-value { position: relative; z-index: 1; margin-top: 19px; font-size: clamp(17px, 1.8vw, 25px); font-weight: 780; letter-spacing: -.04em; white-space: nowrap; }
.summary-card .kpi-value small { margin-left: 3px; color: var(--muted); font-size: 9px; letter-spacing: .05em; }
.summary-card.accent .kpi-value small { color: #b8c7bb; }
.summary-card .kpi-meta { position: relative; z-index: 1; margin-top: 7px; color: #929a94; font-size: 9px; }
.positive { color: var(--green) !important; }

.stock-alert { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 15px; color: #6a4b18; border: 1px solid #f1d59f; border-radius: 13px; background: var(--amber-soft); }
.stock-alert .alert-icon { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; color: white; border-radius: 50%; background: var(--amber); font-weight: 800; }
.stock-alert div { flex: 1; }
.stock-alert strong { font-size: 12px; }
.stock-alert p { margin: 2px 0 0; color: #8c692f; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 14px; margin-top: 14px; }
.panel { border: 1px solid var(--line); border-radius: 17px; background: var(--card); box-shadow: var(--shadow); }
.performance-panel, .delivery-panel { min-height: 335px; padding: 21px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel h2, .section-intro h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; }
.legend-revenue { background: var(--green-dark); }
.legend-profit { background: var(--lime); }
.chart { display: flex; height: 210px; align-items: flex-end; gap: clamp(9px, 3vw, 25px); margin-top: 18px; padding: 8px 6px 25px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent 44px, #eef0eb 45px); }
.bar-group { position: relative; display: flex; height: 100%; flex: 1; align-items: flex-end; justify-content: center; gap: 4px; }
.bar { min-width: 8px; max-width: 22px; flex: 1; border-radius: 5px 5px 2px 2px; transition: height .3s; }
.bar.revenue { background: var(--green-dark); }
.bar.profit { background: var(--lime); }
.bar-group small { position: absolute; bottom: -20px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.bar-tip { position: absolute; bottom: calc(var(--height) + 5px); left: 50%; z-index: 5; display: none; padding: 5px 7px; color: white; border-radius: 6px; background: #111; font-size: 8px; white-space: nowrap; transform: translateX(-50%); }
.bar-group:hover .bar-tip { display: block; }
.formula-note { margin: 12px 0 0; color: #929a94; font-size: 9px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; margin-top: 30px; }
.donut { display: grid; width: 118px; height: 118px; flex: 0 0 auto; place-content: center; border-radius: 50%; background: conic-gradient(var(--green-dark) 0 50%, var(--lime) 50% 100%); text-align: center; box-shadow: inset 0 0 0 25px white; }
.donut span { font-size: 22px; font-weight: 800; line-height: 1; }
.donut small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.donut-legend { display: grid; gap: 13px; }
.donut-row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; font-size: 9px; }
.donut-row i { width: 8px; height: 8px; border-radius: 3px; }
.donut-row strong { font-size: 11px; }
.delivery-costs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 27px; }
.delivery-cost { padding: 10px; border-radius: 10px; background: #f5f7f3; }
.delivery-cost small, .delivery-cost strong { display: block; }
.delivery-cost small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.delivery-cost strong { margin-top: 4px; font-size: 12px; }

.recent-panel { margin-top: 14px; padding: 20px 20px 8px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 12px 10px; color: #939b94; border-bottom: 1px solid var(--line); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 12px; color: #4c564e; border-bottom: 1px solid #eef0eb; font-size: 10px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbf8; }
.product-cell { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.product-avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--green-soft); font-size: 11px; font-weight: 800; }
.product-cell small { display: block; margin-top: 2px; color: #969e98; font-size: 8px; font-weight: 500; }
.badge { display: inline-flex; min-height: 22px; align-items: center; padding: 0 8px; border-radius: 999px; font-size: 8px; font-weight: 750; }
.badge.normal, .badge.paid, .badge.client { color: #266244; background: var(--green-soft); }
.badge.exceptional, .badge.partial { color: #8a621e; background: var(--amber-soft); }
.badge.company, .badge.pending, .badge.credit, .badge.low { color: #9d4438; background: var(--red-soft); }
.badge.none { color: #667069; background: #edf0ec; }
.profit-cell { color: var(--green); font-weight: 750; }
.loss-cell { color: var(--red); font-weight: 750; }
.empty-state { padding: 45px 20px; color: var(--muted); text-align: center; font-size: 12px; }

.section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin: 11px 0 20px; padding: 24px 26px; color: white; border-radius: 18px; background: var(--green-dark); box-shadow: var(--shadow); }
.section-intro .eyebrow { color: #adc3b3; }
.section-intro h2 { margin-top: 6px; font-size: 27px; }
.section-intro p:last-child { max-width: 610px; margin: 7px 0 0; color: #b8c8bd; font-size: 11px; line-height: 1.5; }
.section-intro .button.secondary { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: white; }
.section-intro .button.primary { color: #182019; background: var(--lime); box-shadow: none; }
.segment-control { display: inline-flex; gap: 5px; margin-bottom: 13px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.segment { min-height: 35px; padding: 0 15px; color: var(--muted); border: 0; border-radius: 8px; background: transparent; font-size: 11px; font-weight: 650; }
.segment.active { color: white; background: var(--green-dark); }
.segment span { margin-left: 5px; opacity: .7; font-size: 8px; }
.activity-table-panel { padding: 7px 12px; }
.inventory-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 13px; }
.inventory-stat { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.inventory-stat small { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.inventory-stat strong { display: block; margin-top: 7px; font-size: 20px; }
.inventory-panel { padding: 20px 12px 8px; }
.inventory-panel .panel-head { padding: 0 8px 12px; }
.search-box { position: relative; width: min(270px, 45vw); }
.search-box span { position: absolute; left: 11px; top: 7px; color: var(--muted); font-size: 20px; }
.search-box input { padding-left: 34px; }
.stock-number { font-size: 13px; font-weight: 800; }
.stock-bar { width: 76px; height: 5px; margin-top: 5px; overflow: hidden; border-radius: 99px; background: #e9ece7; }
.stock-bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.stock-bar.low i { background: var(--red); }
.row-action { width: 28px; height: 28px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; background: white; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: none; background: rgba(9,15,10,.58); backdrop-filter: blur(4px); }
.modal-backdrop.visible { display: block; }
.modal { position: fixed; inset: 50% auto auto 50%; z-index: 60; width: min(590px, calc(100vw - 28px)); max-height: calc(100vh - 30px); margin: 0; padding: 0; overflow: auto; color: var(--ink); border: 0; border-radius: 20px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.22); transform: translate(-50%, -50%); }
.modal::backdrop { display: none; }
.modal form { padding: 25px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 21px; }
.modal-head h2 { margin: 5px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.modal-close { width: 34px; height: 34px; color: var(--muted); border: 0; border-radius: 50%; background: #f1f3ef; font-size: 23px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: grid; gap: 6px; }
.form-grid label > span { color: #5f6a62; font-size: 10px; font-weight: 700; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid select { min-height: 43px; }
.money-input { position: relative; }
.money-input input { padding-right: 45px; }
.money-input b { position: absolute; top: 14px; right: 11px; color: #9aa19b; font-size: 9px; }
.profit-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; padding: 12px; border-radius: 12px; background: var(--green-soft); }
.preview-item small, .preview-item strong { display: block; }
.preview-item small { color: #6b7f70; font-size: 8px; text-transform: uppercase; }
.preview-item strong { margin-top: 4px; color: var(--green-dark); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-help { margin: 13px 0 0; color: var(--muted); font-size: 10px; }
.toast { position: fixed; right: 28px; bottom: 28px; z-index: 100; max-width: 330px; padding: 13px 17px; color: white; border-radius: 12px; background: #182019; box-shadow: 0 15px 45px rgba(0,0,0,.18); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(15px); transition: .25s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #873f35; }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button.mini { min-height: 29px; padding: 0 10px; color: var(--green-dark); border: 1px solid #b9d6c2; background: var(--green-soft); font-size: 9px; box-shadow: none; }
.user-pill { display: flex; max-width: 220px; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.user-avatar { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; color: white; border-radius: 9px; background: var(--green-dark); font-size: 10px; font-weight: 800; }
.user-pill strong, .user-pill small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill strong { font-size: 10px; }
.user-pill small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.quality-alert { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; padding: 12px 15px; color: #375372; border: 1px solid #c9d9e8; border-radius: 13px; background: #edf5fb; }
.quality-icon { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; color: white; border-radius: 50%; background: var(--blue); font-family: Georgia, serif; font-weight: 700; }
.quality-alert strong { font-size: 11px; }
.quality-alert p { margin: 3px 0 0; color: #62788d; font-size: 9px; line-height: 1.45; }
.movements-panel { margin-top: 14px; padding: 20px; }
.movement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 17px; }
.movement-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fafbf8; }
.movement-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.movement-top strong, .movement-number { display: block; }
.movement-number { margin-bottom: 4px; color: var(--green-dark); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.movement-top strong { font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.movement-progress { height: 5px; margin: 15px 0; overflow: hidden; border-radius: 99px; background: #e7ebe4; }
.movement-progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.movement-figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.movement-figures small, .movement-figures strong { display: block; }
.movement-figures small { color: var(--muted); font-size: 7px; letter-spacing: .06em; text-transform: uppercase; }
.movement-figures strong { margin-top: 3px; font-size: 9px; }
.contributors { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.contributors span { padding: 5px 8px; color: #58635b; border-radius: 7px; background: white; font-size: 8px; }
.contributors b { color: var(--ink); }
.standalone-label { display: grid; gap: 7px; }
.standalone-label > span { color: #5f6a62; font-size: 10px; font-weight: 700; }
.payment-context { margin: 0 0 18px; padding: 12px; color: #5e6c61; border-radius: 10px; background: var(--green-soft); font-size: 10px; line-height: 1.7; }
.payment-context strong { color: var(--green-dark); }
.small-modal { width: min(460px, calc(100vw - 28px)); }
.export-help { margin: -7px 0 17px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.export-option { display: grid; min-height: 154px; align-content: center; justify-items: start; gap: 6px; padding: 18px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; background: #fafbf8; text-align: left; transition: .18s ease; }
.export-option:hover { border-color: #9bc2a8; background: var(--green-soft); transform: translateY(-2px); }
.export-option strong { font-size: 13px; }
.export-option small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.export-format { display: grid; width: 38px; height: 38px; margin-bottom: 5px; place-items: center; color: white; border-radius: 10px; background: #bb5546; font-size: 10px; font-weight: 850; letter-spacing: .05em; }
.export-format.word { background: #3b6ca8; font-size: 15px; }
.export-report { margin: 0; color: #182019; background: white; font-family: Arial, Helvetica, sans-serif; font-size: 9px; }
.export-report header { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 3px solid #174f34; }
.export-report h1 { margin: 0; color: #174f34; font-size: 25px; letter-spacing: -.5px; }
.export-report h1 span { display: block; margin-top: 3px; color: #758078; font-size: 9px; font-weight: normal; letter-spacing: 1.2px; text-transform: uppercase; }
.export-report .meta { margin: 7px 0 0; color: #667069; line-height: 1.5; }
.export-report h2 { margin: 19px 0 7px; color: #174f34; font: 700 13px Arial, Helvetica, sans-serif; }
.export-report table { width: 100%; border-collapse: collapse; page-break-inside: auto; }
.export-report tr { page-break-inside: avoid; }
.export-report th { padding: 6px 5px; color: white; background: #174f34; font-size: 7px; text-align: left; text-transform: uppercase; }
.export-report td { padding: 6px 5px; border-bottom: 1px solid #dfe5dc; font-size: 9px; vertical-align: top; white-space: normal; }
.export-report tbody tr:nth-child(even) { background: #f4f7f2; }
.export-report .summary td { width: 25%; padding: 10px; border: 3px solid white; background: #e8f1e9; }
.export-report .summary small { display: block; color: #6d776f; font-size: 7px; text-transform: uppercase; }
.export-report .summary strong { display: block; margin-top: 4px; color: #174f34; font-size: 14px; }
.export-report .empty { padding: 14px; color: #758078; text-align: center; }
.export-report footer { margin-top: 18px; padding-top: 8px; color: #7f8881; border-top: 1px solid #dfe5dc; font-size: 8px; }
.loading-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--green-dark); background: rgba(243,245,239,.96); text-align: center; }
.loading-screen strong { font-size: 13px; }
.loading-screen p { max-width: 360px; margin: 0; color: var(--muted); font-size: 11px; }
.loader { width: 34px; height: 34px; border: 3px solid #dce7dd; border-top-color: var(--green-dark); border-radius: 50%; animation: spin .8s linear infinite; }
.error-mark { display: grid; width: 38px; height: 38px; place-items: center; color: white; border-radius: 50%; background: var(--red); font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-card:nth-child(4), .summary-card:nth-child(5) { grid-column: span 1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .delivery-panel { min-height: auto; }
  .delivery-panel .donut-wrap { justify-content: center; }
  .filter-bar { flex-wrap: wrap; }
}

@media (max-width: 1020px) {
  .movement-grid { grid-template-columns: 1fr; }
  .inventory-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  body { padding-bottom: 74px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 22px 18px 35px; }
  .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 35; display: grid; grid-template-columns: repeat(5, 1fr); height: 68px; padding: 8px 8px 5px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 -8px 30px rgba(26,43,30,.08); backdrop-filter: blur(12px); }
  .mobile-nav-item { display: grid; place-content: center; gap: 2px; color: #8a938c; border: 0; background: transparent; font-size: 8px; text-align: center; }
  .mobile-nav-item span { font-size: 18px; line-height: 1; }
  .mobile-nav-item.active { color: var(--green-dark); font-weight: 800; }
  .mobile-sale { align-self: center; justify-self: center; width: 45px; height: 45px; color: white; border: 0; border-radius: 50%; background: var(--green-dark); box-shadow: 0 8px 18px rgba(23,79,52,.24); font-size: 22px; }
  .topbar { align-items: flex-start; }
  .hide-mobile, .top-actions .icon-button, .user-pill { display: none; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
  .filter-heading { grid-column: 1 / -1; min-height: auto; }
  .filter-bar label { min-width: 0; }
  .filter-bar label:nth-of-type(3) { grid-column: 1 / -1; }
  .custom-dates { grid-column: 1 / -1; }
  .custom-dates label { flex: 1; min-width: 0; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card { min-height: 112px; padding: 15px; }
  .summary-card:first-child { grid-column: 1 / -1; }
  .summary-card .kpi-value { margin-top: 14px; font-size: 20px; }
  .section-intro { align-items: flex-start; flex-direction: column; padding: 21px; }
  .section-intro .action-row { width: 100%; }
  .section-intro .button { flex: 1; }
  .inventory-stats { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .main-content { padding: 18px 12px 25px; }
  .topbar h1 { font-size: 29px; }
  .button { min-height: 40px; padding: 0 13px; }
  .summary-grid { gap: 8px; }
  .summary-card { border-radius: 14px; }
  .summary-card .kpi-label { font-size: 8px; }
  .summary-card .kpi-value { font-size: 17px; }
  .stock-alert { align-items: flex-start; }
  .stock-alert .button { display: none; }
  .performance-panel, .delivery-panel { padding: 17px 13px; }
  .panel-head { align-items: flex-start; }
  .legend { flex-direction: column; gap: 5px; }
  .chart { gap: 7px; }
  .donut-wrap { gap: 15px; }
  .donut { width: 105px; height: 105px; box-shadow: inset 0 0 0 22px white; }
  .recent-panel { padding-right: 10px; padding-left: 10px; }
  .segment-control { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .segment { padding: 0 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .modal form { padding: 20px 17px; }
  .profit-preview { grid-template-columns: 1fr; }
  .export-options { grid-template-columns: 1fr; }
  .export-option { min-height: 112px; }
  .movement-figures { grid-template-columns: 1fr 1fr; }
  .search-box { width: 100%; }
  .inventory-panel .panel-head { align-items: stretch; flex-direction: column; }
  th, td { padding-right: 9px; padding-left: 9px; }
  .toast { right: 12px; bottom: 82px; left: 12px; }
}

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .export-report { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
