:root {
  --bg: #f4f2f7;
  --surface: #ffffff;
  --surface-2: #f8f6fb;
  --ink: #16131b;
  --muted: #716d78;
  --line: #e7e2ed;
  --accent: #843cf6;
  --accent-dark: #6421c7;
  --green: #207a52;
  --green-bg: #e8f4ed;
  --amber: #a35b08;
  --amber-bg: #fff2dd;
  --blue: #2d62b0;
  --blue-bg: #eaf1fb;
  --red: #b43b32;
  --red-bg: #fae9e7;
  --purple: #7453a6;
  --purple-bg: #f0eaf9;
  --shadow: 0 10px 35px rgba(28, 29, 27, 0.07);
  --sidebar: 236px;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); }
.hidden { display: none !important; }
body.auth-locked .app-shell { display: none; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; color: #f4effa; background: radial-gradient(circle at 50% 15%,rgba(126,52,232,.24),transparent 34%),linear-gradient(145deg,#050307,#12091b 55%,#07040b); }
.auth-card { position: relative; overflow: hidden; width: min(420px,100%); padding: 34px; border: 1px solid #3e2458; border-radius: 22px; background: rgba(18,12,25,.9); box-shadow: 0 30px 90px rgba(0,0,0,.45),0 0 60px rgba(121,48,225,.12); }
.auth-card::after { content: ""; position: absolute; right: -100px; bottom: -130px; width: 250px; height: 250px; border: 40px solid rgba(132,60,246,.08); border-radius: 50%; pointer-events: none; }
.auth-brand { width: 74px; height: 74px; overflow: hidden; margin-bottom: 24px; border: 1px solid #522b83; border-radius: 18px; box-shadow: 0 0 30px rgba(132,60,246,.25); }
.auth-brand img { width: 100%; height: 100%; object-fit: cover; }
.auth-card h1 { margin: 0; font: 800 28px/1.15 Manrope,sans-serif; letter-spacing: -.04em; }
.auth-card > p { margin: 9px 0 25px; color: #aaa0b4; font-size: 13px; line-height: 1.55; }
.auth-card .form-group { margin-bottom: 14px; }
.auth-card .form-group > span { font-size: 11px; font-weight: 700; color: #cfc4d9; }
.auth-card .form-control { min-height: 46px; color: #f5f1f8; border-color: #372943; background: #130e19; }
.auth-card .form-control:focus { border-color: #8444df; box-shadow: 0 0 0 3px rgba(132,68,223,.13); }
.auth-submit { position: relative; z-index: 1; width: 100%; min-height: 46px; margin-top: 5px; }
.auth-card > small { position: relative; z-index: 1; display: block; margin-top: 18px; color: #746b7c; text-align: center; font-size: 10px; }
.auth-error { min-height: 16px; margin: 2px 0 8px; color: #f19b94; font-size: 11px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  display: flex; flex-direction: column; padding: 22px 14px 16px;
  color: #eeeaf5; background: linear-gradient(180deg,#09070d 0%,#0d0912 58%,#12091c 100%);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 27px; }
.brand-mark { width: 46px; height: 46px; overflow: hidden; flex: 0 0 auto; border: 1px solid #50268a; border-radius: 12px; background: #050307; box-shadow: 0 0 18px rgba(132,60,246,.28); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand strong { display: block; font: 800 16px/1.1 Manrope, sans-serif; letter-spacing: .1em; }
.brand small { display: block; margin-top: 3px; font-size: 8px; letter-spacing: .28em; color: #888b87; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; scrollbar-width: none; }
.nav-section { padding: 15px 12px 6px; color: #686b68; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-item { width: 100%; border: 0; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #a9aba7; background: transparent; cursor: pointer; text-align: left; font-size: 13px; font-weight: 600; transition: .18s ease; }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-item:hover { color: white; background: #1c1425; }
.nav-item.active { color: white; background: linear-gradient(90deg,#2a1741,#1b1424); box-shadow: inset 3px 0 var(--accent), 0 0 18px rgba(132,60,246,.08); }
.nav-item .nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--accent); font-size: 10px; }
.sidebar-footer { margin-top: auto; padding-top: 14px; }
.mode-pill { display: flex; align-items: center; gap: 7px; margin: 0 2px 10px; padding: 10px 11px; border: 1px solid #40245e; border-radius: 10px; color: #dcccf1; background: #1d1228; font-size: 9px; }
.mode-pill i { width: 6px; height: 6px; border-radius: 50%; background: #a972e0; box-shadow: 0 0 0 3px rgba(169,114,224,.12); }
.mode-pill b { margin-left: auto; color: #8a7d92; font-size: 7px; text-transform: uppercase; letter-spacing: .08em; }
.plan-card { padding: 12px; margin: 0 2px 10px; border: 1px solid #303335; border-radius: 12px; background: #202325; }
.plan-icon { color: #ff8a65; margin-bottom: 8px; }
.plan-icon svg { width: 18px; }
.plan-card strong, .plan-card span { display: block; }
.plan-card strong { font-size: 11px; }
.plan-card span { margin-top: 3px; color: #7f837f; font-size: 9px; }
.mini-progress { height: 4px; margin-top: 11px; overflow: hidden; border-radius: 3px; background: #34383a; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.user-card { width: 100%; border: 0; display: flex; align-items: center; gap: 9px; padding: 8px; color: #f1f1ed; background: transparent; cursor: pointer; text-align: left; border-radius: 10px; }
.user-card:hover { background: #222527; }
.avatar { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg,#5d625e,#343735); font: 700 10px Manrope; }
.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 10px; }
.user-card small { margin-top: 2px; color: #777a77; font-size: 8px; }
.user-card .dots { margin-left: auto; color: #646764; font-size: 10px; letter-spacing: .05em; }

.main-wrap { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 30; height: 70px; display: flex; align-items: center; gap: 16px; padding: 0 28px; border-bottom: 1px solid rgba(221,216,229,.85); background: rgba(244,242,247,.9); backdrop-filter: blur(18px); }
.global-search { width: min(410px, 42vw); display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.78); color: #979a95; transition: .2s; }
.global-search:focus-within { border-color: #bab9b3; box-shadow: 0 0 0 3px rgba(24,26,28,.04); }
.global-search svg { width: 16px; }
.global-search input { width: 100%; height: 38px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.global-search input::placeholder { color: #a6a7a2; }
kbd { padding: 3px 6px; border: 1px solid #deddd8; border-radius: 5px; color: #92938f; background: #f7f6f2; font: 9px Manrope; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.sync-status { display: flex; align-items: center; gap: 6px; padding-right: 5px; color: var(--muted); font-size: 10px; }
.sync-status i { width: 6px; height: 6px; border-radius: 50%; background: #45a276; box-shadow: 0 0 0 3px #dcefe4; }
.icon-btn { position: relative; width: 38px; height: 38px; border: 1px solid var(--line); display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.7); cursor: pointer; }
.icon-btn:hover { background: white; box-shadow: 0 4px 14px rgba(20,20,20,.05); }
.icon-btn svg { width: 16px; }
.badge-dot { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border: 1px solid white; border-radius: 50%; background: var(--accent); }
.menu-btn { display: none; }
.primary-btn, .secondary-btn, .ghost-btn, .danger-btn { min-height: 38px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; padding: 0 14px; cursor: pointer; font-weight: 700; font-size: 11px; transition: .18s; }
.primary-btn { color: white; background: var(--ink); box-shadow: 0 5px 14px rgba(20,20,20,.12); }
.primary-btn:hover { transform: translateY(-1px); background: #292c2e; }
.primary-btn.accent { background: linear-gradient(135deg,#8d47f7,#6723cb); box-shadow: 0 6px 18px rgba(113,42,218,.24); }
.primary-btn svg, .secondary-btn svg, .ghost-btn svg { width: 14px; height: 14px; }
.primary-btn .chev { padding-left: 4px; color: #999; }
.secondary-btn { border: 1px solid var(--line); background: white; }
.secondary-btn:hover { border-color: #ceccc5; box-shadow: 0 3px 10px rgba(20,20,20,.04); }
.ghost-btn { background: transparent; color: var(--muted); }
.ghost-btn:hover { background: var(--surface-2); color: var(--ink); }
.danger-btn { color: var(--red); background: var(--red-bg); }
.sm-btn { min-height: 30px; padding: 0 10px; font-size: 10px; }

.content { padding: 27px 28px 45px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-head h1 { margin: 0; font: 800 27px/1.15 Manrope, sans-serif; letter-spacing: -.035em; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.eyebrow { margin-bottom: 7px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }

.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; margin-bottom: 16px; }
.stat-card { position: relative; overflow: hidden; min-height: 136px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 20px rgba(28,29,27,.025); }
.stat-card.dark { border-color: #1e2021; color: white; background: var(--ink); }
.stat-card.dark::after { content: ""; position: absolute; width: 130px; height: 130px; right: -65px; bottom: -72px; border: 25px solid rgba(132,60,246,.24); border-radius: 50%; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 600; }
.dark .stat-label { color: #939694; }
.stat-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.dark .stat-icon { background: #2a2d2f; color: #d2d4d1; }
.stat-icon svg { width: 15px; }
.stat-value { margin-top: 15px; font: 800 22px/1 Manrope; letter-spacing: -.035em; }
.stat-foot { display: flex; align-items: center; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.delta { padding: 3px 5px; border-radius: 5px; font-weight: 700; }
.delta.up { color: var(--green); background: var(--green-bg); }
.delta.down { color: var(--red); background: var(--red-bg); }
.dark .delta.up { color: #d6befc; background: #36224e; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(270px,.75fr); gap: 14px; margin-bottom: 14px; }
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 20px rgba(28,29,27,.025); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 18px 13px; }
.card-head h2, .card-head h3 { margin: 0; font: 700 13px Manrope; letter-spacing: -.02em; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.card-body { padding: 0 18px 18px; }
.link-btn { border: 0; background: transparent; color: var(--accent-dark); font-size: 10px; font-weight: 700; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.segmented { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--surface-2); }
.segmented button { min-width: 45px; height: 25px; padding: 0 8px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; font-weight: 700; }
.segmented button.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(20,20,20,.07); }

.chart-summary { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 4px; }
.chart-summary strong { font: 800 21px Manrope; letter-spacing: -.04em; }
.chart-summary span { color: var(--green); font-size: 9px; font-weight: 700; }
.revenue-chart { width: 100%; height: 178px; overflow: visible; }
.chart-grid line { stroke: #eeece7; stroke-width: 1; }
.chart-area { fill: url(#areaGradient); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: white; stroke: var(--accent); stroke-width: 2; }
.chart-labels { display: flex; justify-content: space-between; margin-top: -5px; color: #969893; font-size: 8px; }

.donut-wrap { display: grid; place-items: center; padding: 5px 0 14px; }
.donut { position: relative; width: 136px; height: 136px; border-radius: 50%; background: conic-gradient(var(--green) 0 45%, var(--blue) 45% 70%, var(--amber) 70% 88%, #deded9 88% 100%); }
.donut::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: white; }
.donut-center { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font: 800 22px Manrope; }
.donut-center span { color: var(--muted); font-size: 8px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.legend-item { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.legend-item i { width: 7px; height: 7px; border-radius: 50%; }
.legend-item strong { margin-left: auto; color: var(--ink); font-size: 10px; }

.split-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.data-table th { height: 37px; padding: 0 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #959792; background: #faf9f6; text-align: left; font-size: 8px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 53px; padding: 0 13px; border-bottom: 1px solid #efeee9; white-space: nowrap; }
.data-table tbody tr { cursor: pointer; transition: .15s; }
.data-table tbody tr:hover { background: #fbfaf7; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.order-id { font-weight: 800; }
.subtext { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.money { font-weight: 700; font-variant-numeric: tabular-nums; }
.customer-cell { display: flex; align-items: center; gap: 8px; }
.mini-avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #555b58; background: #e9ebe6; font-size: 8px; font-weight: 800; }
.product-thumb { width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: #f0eee8; font-size: 16px; }
.status { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 8px; font-weight: 700; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.success { color: var(--green); background: var(--green-bg); }
.status.warning { color: var(--amber); background: var(--amber-bg); }
.status.info { color: var(--blue); background: var(--blue-bg); }
.status.danger { color: var(--red); background: var(--red-bg); }
.status.neutral { color: #656862; background: #eeefeb; }
.status.purple { color: var(--purple); background: var(--purple-bg); }
.row-menu { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; color: #8d8f89; }
.row-menu:hover { background: #eee; color: var(--ink); }

.low-stock-list { display: flex; flex-direction: column; }
.stock-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #efeee9; }
.stock-row:last-child { border: 0; }
.stock-row .product-thumb { width: 36px; height: 36px; }
.stock-row strong { display: block; font-size: 10px; }
.stock-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.stock-count { text-align: right; }
.stock-count strong { color: var(--red); font: 800 13px Manrope; }
.stock-count span { font-size: 7px; }
.progress { width: 100%; height: 5px; overflow: hidden; border-radius: 4px; background: #eeede9; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.filters-bar { display: flex; align-items: center; gap: 8px; padding: 12px; margin-bottom: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.search-field { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; color: var(--muted); }
.search-field svg { width: 14px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 10px; }
.filter-select, .form-control { min-height: 36px; padding: 0 31px 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); background: #fbfaf7; font-size: 10px; }
.filter-select:focus, .form-control:focus { border-color: #a9aaa5; box-shadow: 0 0 0 3px rgba(20,20,20,.04); }
.count-label { margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }

.tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 15px; padding: 4px; width: fit-content; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.6); }
.tab { min-height: 31px; padding: 0 13px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.tab.active { color: white; background: var(--ink); box-shadow: 0 3px 10px rgba(20,20,20,.12); }
.tab .tab-count { margin-left: 5px; opacity: .65; }

.shipment-code { display: flex; align-items: center; gap: 9px; }
.direction-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; }
.direction-icon.in { color: var(--green); background: var(--green-bg); }
.direction-icon.out { color: var(--blue); background: var(--blue-bg); }
.direction-icon svg { width: 14px; }
.tracking { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #555854; font-size: 9px; }

.inventory-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 14px; }
.movement-list { display: flex; flex-direction: column; }
.movement-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.movement-row:last-child { border: 0; }
.movement-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; }
.movement-icon svg { width: 14px; }
.movement-icon.in { color: var(--green); background: var(--green-bg); }
.movement-icon.out { color: var(--red); background: var(--red-bg); }
.movement-icon.adjust { color: var(--purple); background: var(--purple-bg); }
.movement-row strong { display: block; font-size: 9px; }
.movement-row span { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.movement-qty { text-align: right; font-weight: 800; font-size: 11px; }
.movement-qty.in { color: var(--green); }
.movement-qty.out { color: var(--red); }

.product-grid { display: grid; grid-template-columns: repeat(4,minmax(170px,1fr)); gap: 13px; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; transition: .18s; }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-visual { position: relative; height: 138px; display: grid; place-items: center; background: #eeece6; font-size: 54px; }
.product-visual.coral { background: #eee4fb; }
.product-visual.sage { background: #e5ebe4; }
.product-visual.blue { background: #e2e9ef; }
.product-visual.sand { background: #eee8dc; }
.product-visual .fav { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border: 0; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.82); }
.product-visual .fav svg { width: 13px; }
.product-info { padding: 13px; }
.product-info h3 { margin: 0; font: 700 11px Manrope; }
.product-info .sku { margin: 4px 0 11px; color: var(--muted); font-size: 8px; }
.product-metrics { display: flex; align-items: flex-end; justify-content: space-between; }
.product-price strong { display: block; font: 800 13px Manrope; }
.product-price span, .product-stock span { color: var(--muted); font-size: 7px; }
.product-stock { text-align: right; }
.product-stock strong { display: block; font-size: 10px; }

.customer-summary { display: flex; align-items: center; gap: 10px; }
.customer-summary .mini-avatar { width: 34px; height: 34px; }
.loyalty { display: inline-flex; align-items: center; gap: 4px; color: #9a6710; font-size: 8px; font-weight: 700; }
.loyalty svg { width: 11px; fill: #d39b35; stroke: #d39b35; }

.finance-hero { display: grid; grid-template-columns: 1.25fr 1fr 1fr; overflow: hidden; margin-bottom: 14px; border-radius: 15px; color: white; background: var(--ink); }
.finance-main { position: relative; padding: 22px; border-right: 1px solid #313436; }
.finance-main::after { content: ""; position: absolute; right: -35px; bottom: -78px; width: 160px; height: 160px; border: 30px solid rgba(132,60,246,.2); border-radius: 50%; }
.finance-main span, .finance-side span { color: #989b98; font-size: 9px; }
.finance-main strong { display: block; margin-top: 9px; font: 800 27px Manrope; letter-spacing: -.04em; }
.finance-side { display: flex; flex-direction: column; justify-content: center; padding: 22px; border-right: 1px solid #313436; }
.finance-side:last-child { border: 0; }
.finance-side strong { display: block; margin-top: 8px; font: 800 18px Manrope; }
.finance-side small { margin-top: 6px; color: #69c28f; font-size: 8px; }

.bar-chart { display: flex; align-items: end; gap: 9px; height: 175px; padding-top: 15px; }
.bar-group { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 6px; }
.bars { height: 140px; width: 100%; display: flex; align-items: end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.bar { width: min(14px,34%); min-height: 3px; border-radius: 4px 4px 0 0; background: #2d3032; }
.bar.cost { background: #a988d5; }
.bar-group label { color: var(--muted); font-size: 7px; }

.report-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.report-card { padding: 17px; }
.report-card .report-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 10px; color: var(--accent); background: #f0e8fb; }
.report-card .report-icon svg { width: 16px; }
.report-card h3 { margin: 0; font: 700 12px Manrope; }
.report-card p { min-height: 30px; margin: 6px 0 16px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.report-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin-bottom: 18px; }
.report-summary > div { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.report-summary span { display: block; color: var(--muted); font-size: 10px; }
.report-summary strong { display: block; margin-top: 7px; font: 800 17px Manrope; letter-spacing: -.03em; }
.report-table { max-height: 330px; border: 1px solid var(--line); border-radius: 11px; }

.production-board { display: grid; grid-template-columns: repeat(3,minmax(240px,1fr)); gap: 13px; align-items: start; }
.production-column { padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.48); }
.production-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
.production-head h3 { margin: 0; font: 700 11px Manrope; }
.production-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.production-head b { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: white; font-size: 9px; box-shadow: 0 2px 7px rgba(20,20,20,.05); }
.production-cards { display: flex; flex-direction: column; gap: 8px; }
.production-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 3px 12px rgba(20,20,20,.025); cursor: pointer; transition: .18s; }
.production-card:hover { transform: translateY(-1px); border-color: #cccac3; box-shadow: 0 7px 18px rgba(20,20,20,.06); }
.production-card-top, .production-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.production-card-top > strong { font-size: 9px; }
.production-card h4 { margin: 12px 0 4px; font: 700 11px Manrope; }
.production-card p { min-height: 25px; margin: 0 0 10px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.production-card-foot { padding-top: 9px; border-top: 1px solid var(--line); }
.production-card-foot span { font-size: 9px; font-weight: 800; }
.column-empty { padding: 35px 10px; border: 1px dashed #d7d6d0; border-radius: 10px; color: var(--muted); text-align: center; font-size: 9px; }
.production-note { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 15px 17px; }
.production-note > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--accent); background: #f0e8fb; }
.production-note svg { width: 16px; }
.production-note strong { display: block; font-size: 10px; }
.production-note p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.production-note button { margin-left: auto; }

.insights-grid { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); }
.insight { min-height: 112px; display: flex; gap: 10px; padding: 18px; border-right: 1px solid var(--line); }
.insight:last-child { border-right: 0; }
.insight-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; }
.insight-icon svg { width: 14px; }
.insight-icon.up { color: var(--green); background: var(--green-bg); }
.insight-icon.warn { color: var(--amber); background: var(--amber-bg); }
.insight-icon.info { color: var(--blue); background: var(--blue-bg); }
.insight strong { display: block; margin-top: 1px; font-size: 9px; }
.insight p { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }

.settings-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 14px; }
.settings-nav { padding: 7px; height: fit-content; }
.settings-nav button { width: 100%; height: 38px; border: 0; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-size: 10px; font-weight: 600; }
.settings-nav button.active { color: var(--ink); background: var(--surface-2); }
.settings-nav button svg { width: 14px; }
.settings-panel { padding: 21px; }
.settings-panel h2 { margin: 0 0 4px; font: 700 15px Manrope; }
.settings-panel > p { margin: 0 0 22px; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1/-1; }
.form-group label { color: #4d504c; font-size: 9px; font-weight: 700; }
.form-control { width: 100%; min-height: 40px; padding-right: 10px; background: white; }
textarea.form-control { min-height: 85px; padding-top: 10px; resize: vertical; }
.form-hint { color: #93958f; font-size: 8px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--line); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.toggle-row strong { display: block; font-size: 10px; }
.toggle-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.switch { position: relative; width: 38px; height: 21px; flex: 0 0 auto; border: 0; border-radius: 11px; background: #d9d9d4; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: .2s; }
.switch.on { background: var(--ink); }
.switch.on::after { left: 20px; }

.empty-state { padding: 50px 20px; text-align: center; }
.empty-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 15px; color: var(--muted); background: var(--surface-2); }
.empty-icon svg { width: 21px; }
.empty-state h3 { margin: 0; font: 700 12px Manrope; }
.empty-state p { margin: 5px 0 15px; color: var(--muted); font-size: 9px; }

.overlay { position: fixed; inset: 0; z-index: 69; background: rgba(19,20,19,.42); opacity: 0; pointer-events: none; backdrop-filter: blur(2px); transition: .2s; }
.overlay.visible { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 70; top: 0; right: 0; width: min(440px,100vw); height: 100vh; overflow-y: auto; padding: 23px; background: white; box-shadow: -12px 0 40px rgba(20,20,20,.12); transform: translateX(102%); transition: .25s ease; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font: 800 18px Manrope; letter-spacing: -.03em; }
.drawer-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.drawer-section h3 { margin: 0 0 12px; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.detail-item span { display: block; color: var(--muted); font-size: 8px; }
.detail-item strong { display: block; margin-top: 4px; font-size: 10px; }
.timeline { position: relative; padding-left: 21px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 7px; width: 1px; background: #d9dad5; }
.timeline-item { position: relative; padding-bottom: 17px; }
.timeline-item::before { content: ""; position: absolute; left: -20px; top: 4px; width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; background: #b8bbb5; box-shadow: 0 0 0 1px #cfd0cc; }
.timeline-item:first-child::before { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.timeline-item strong { display: block; font-size: 9px; }
.timeline-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.drawer-actions { display: flex; gap: 8px; padding-top: 18px; }
.drawer-actions > * { flex: 1; }

.modal-shell { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(18,20,19,.5); backdrop-filter: blur(3px); animation: fadeIn .17s ease; }
.modal { width: min(560px,100%); max-height: calc(100vh - 36px); overflow-y: auto; border-radius: 16px; background: white; box-shadow: 0 25px 80px rgba(0,0,0,.2); animation: modalIn .22s ease; }
.modal.wide { width: min(760px,100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 21px 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font: 800 17px Manrope; letter-spacing: -.03em; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.close-btn { width: 30px; height: 30px; border: 0; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.close-btn svg { width: 14px; }
.modal-body { padding: 20px 21px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 21px 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.quick-option { display: flex; align-items: center; gap: 11px; min-height: 67px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; text-align: left; }
.quick-option:hover { border-color: #c6c5bf; background: #fbfaf7; }
.quick-option > span:first-child { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--accent); background: #f0e8fb; }

.empty-start { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(260px,1fr) minmax(320px,1.1fr); gap: 28px; padding: 28px; }
.empty-start::after { content: ""; position: absolute; right: -90px; bottom: -130px; width: 280px; height: 280px; border: 42px solid rgba(132,60,246,.07); border-radius: 50%; pointer-events: none; }
.empty-start-copy { display: flex; align-items: flex-start; gap: 16px; }
.empty-start-copy > span { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; color: #eee4ff; background: linear-gradient(135deg,#1c1229,#55208c); box-shadow: 0 8px 22px rgba(88,32,143,.2); }
.empty-start-copy h2 { margin: 0; font: 800 19px Manrope; letter-spacing: -.03em; }
.empty-start-copy p { max-width: 500px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.quick-option svg { width: 16px; }
.quick-option strong, .quick-option small { display: block; }
.quick-option strong { font-size: 10px; }
.quick-option small { margin-top: 3px; color: var(--muted); font-size: 8px; }

.toast-root { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 250px; max-width: 350px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #313436; border-radius: 11px; color: white; background: #202325; box-shadow: 0 12px 35px rgba(0,0,0,.18); animation: toastIn .25s ease; }
.toast > span:first-child { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: #a9e1c0; background: #294436; }
.toast svg { width: 13px; }
.toast strong { display: block; font-size: 9px; }
.toast small { display: block; margin-top: 2px; color: #929692; font-size: 8px; }

.command-palette { position: fixed; z-index: 90; top: 80px; left: 50%; width: min(540px,calc(100vw - 30px)); max-height: 420px; overflow: hidden; border: 1px solid #d8d7d1; border-radius: 14px; background: white; box-shadow: 0 25px 80px rgba(20,20,20,.18); transform: translate(-50%,-10px); opacity: 0; pointer-events: none; transition: .17s; }
.command-palette.open { transform: translate(-50%,0); opacity: 1; pointer-events: auto; }
.command-head { display: flex; align-items: center; gap: 9px; padding: 13px; border-bottom: 1px solid var(--line); color: var(--muted); }
.command-head svg { width: 16px; }
.command-head input { flex: 1; border: 0; outline: 0; font-size: 11px; }
.command-results { max-height: 350px; overflow-y: auto; padding: 6px; }
.command-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; }
.command-item:hover { background: var(--surface-2); }
.command-item > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #eeeee9; }
.command-item svg { width: 14px; }
.command-item strong, .command-item small { display: block; }
.command-item strong { font-size: 9px; }
.command-item small { margin-top: 2px; color: var(--muted); font-size: 8px; }

/* GGB CEO: uma única camada de decisão, sem adicionar menus ao painel */
.ceo-card { position: relative; isolation: isolate; overflow: hidden; margin-bottom: 16px; padding: 22px; border: 1px solid rgba(177,111,255,.3); border-radius: 18px; color: #f8f5ff; background: radial-gradient(circle at 85% -40%,rgba(150,71,255,.42),transparent 42%),linear-gradient(135deg,#09070d 0%,#171020 56%,#0c0911 100%); box-shadow: 0 16px 42px rgba(36,16,55,.15); }
.ceo-glow { position: absolute; z-index: -1; right: -90px; bottom: -150px; width: 340px; height: 340px; border: 54px solid rgba(137,54,242,.08); border-radius: 50%; }
.ceo-header, .ceo-footer, .ceo-brand { display: flex; align-items: center; }
.ceo-header, .ceo-footer { justify-content: space-between; gap: 16px; }
.ceo-brand { gap: 11px; }
.ceo-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(195,151,255,.28); border-radius: 13px; color: #d9b8ff; background: linear-gradient(145deg,rgba(153,68,255,.3),rgba(255,255,255,.04)); box-shadow: inset 0 1px 0 rgba(255,255,255,.16),0 0 26px rgba(137,54,242,.17); }
.ceo-brand .eyebrow { color: #a991bf; }
.ceo-brand h2 { margin: 2px 0 0; font: 800 18px Manrope; letter-spacing: -.03em; }
.ceo-status { display: inline-flex; align-items: center; gap: 7px; color: #bdb1ca; font-size: 10px; }
.ceo-status i { width: 7px; height: 7px; border-radius: 50%; background: #70d59d; box-shadow: 0 0 0 4px rgba(112,213,157,.1); }
.ceo-intro { margin: 24px 0 15px; }
.ceo-intro h3 { margin: 0; font: 700 21px Manrope; letter-spacing: -.03em; }
.ceo-intro p { margin: 5px 0 0; color: #aca2b6; font-size: 12px; line-height: 1.55; }
.ceo-priorities { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.ceo-priority { display: grid; grid-template-columns: 24px 34px 1fr; align-items: start; gap: 9px; min-height: 118px; padding: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.045); backdrop-filter: blur(8px); }
.ceo-priority.warning { border-color: rgba(245,181,72,.21); }
.ceo-priority.danger { border-color: rgba(248,102,102,.23); }
.ceo-priority.success { border-color: rgba(112,213,157,.2); }
.ceo-number { padding-top: 4px; color: #756c7f; font: 700 9px Manrope; }
.ceo-priority-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #d4adff; background: rgba(137,54,242,.15); }
.ceo-priority.warning .ceo-priority-icon, .ceo-priority-icon.warning { color: #f3c970; background: rgba(245,181,72,.12); }
.ceo-priority.danger .ceo-priority-icon, .ceo-priority-icon.danger { color: #ff9999; background: rgba(248,102,102,.12); }
.ceo-priority.success .ceo-priority-icon, .ceo-priority-icon.success { color: #8de0b2; background: rgba(112,213,157,.12); }
.ceo-priority-icon svg { width: 15px; }
.ceo-priority strong { display: block; color: #f7f2fc; font-size: 12px; line-height: 1.4; }
.ceo-priority p { margin: 4px 0 7px; color: #aca2b6; font-size: 11px; line-height: 1.45; }
.ceo-priority small { display: block; color: #7f7589; font-size: 9px; line-height: 1.4; }
.ceo-footer { margin-top: 15px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.ceo-footer > span { display: flex; align-items: center; gap: 7px; color: #8f849a; font-size: 10px; }
.ceo-open { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid rgba(195,151,255,.28); border-radius: 9px; color: #eee3fb; background: rgba(137,54,242,.12); font-size: 11px; font-weight: 700; cursor: pointer; }
.ceo-open:hover { background: rgba(137,54,242,.23); }

.modal.ceo-modal { width: min(980px,100%); }
.ceo-modal .modal-body { display: grid; gap: 16px; background: #faf9fc; }
.ceo-modal-summary { display: grid; grid-template-columns: repeat(4,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.ceo-modal-summary > div { padding: 15px; border-right: 1px solid var(--line); }
.ceo-modal-summary > div:last-child { border-right: 0; }
.ceo-modal-summary span, .ceo-modal-summary strong, .ceo-modal-summary small { display: block; }
.ceo-modal-summary span { color: var(--muted); font-size: 10px; }
.ceo-modal-summary strong { margin-top: 5px; font: 800 17px Manrope; letter-spacing: -.03em; }
.ceo-modal-summary small { margin-top: 4px; color: #8c8e88; font-size: 9px; line-height: 1.4; }
.ceo-modal-section, .ceo-simulator, .ceo-method { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.ceo-modal-section h3, .ceo-simulator h3 { margin: 3px 0 12px; font: 800 14px Manrope; letter-spacing: -.02em; }
.ceo-analysis-list { display: grid; gap: 8px; }
.ceo-analysis-list article { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid #eceae7; border-radius: 12px; }
.ceo-analysis-list strong { display: block; font-size: 12px; }
.ceo-analysis-list p { margin: 3px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.ceo-analysis-list small { color: #94958f; font-size: 9px; }
.ceo-analysis-actions { display: flex; align-items: center; gap: 7px; }
.ceo-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ceo-stock-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ceo-stock-list > div:first-child { border-top: 0; }
.ceo-stock-list span, .ceo-stock-list strong, .ceo-stock-list small { display: block; }
.ceo-stock-list strong { font-size: 11px; }
.ceo-stock-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.ceo-stock-list b { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: #6f30ce; background: #f1e8fc; font-size: 10px; }
.ceo-memory { display: grid; gap: 9px; }
.ceo-memory > div { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--accent); }
.ceo-memory > div:first-child { padding-top: 0; border-top: 0; }
.ceo-memory p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.ceo-memory strong, .ceo-memory small { display: block; }
.ceo-memory strong { margin-bottom: 2px; color: var(--ink); font-size: 11px; }
.ceo-memory small { margin-top: 3px; color: #999b96; font-size: 9px; }
.ceo-empty-copy { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.ceo-opportunity { display: grid; grid-template-columns: 30px 1fr; gap: 9px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--accent); }
.ceo-opportunity:first-of-type { padding-top: 0; border-top: 0; }
.ceo-opportunity p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ceo-opportunity strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 11px; }
.ceo-simulator .form-grid { margin-top: 14px; }
.ceo-simulation-results { display: grid; grid-template-columns: repeat(3,1fr); overflow: hidden; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; }
.ceo-simulation-results > div { padding: 12px; border-right: 1px solid var(--line); }
.ceo-simulation-results > div:last-child { border-right: 0; }
.ceo-simulation-results span, .ceo-simulation-results strong { display: block; }
.ceo-simulation-results span { color: var(--muted); font-size: 9px; }
.ceo-simulation-results strong { margin-top: 4px; font: 800 15px Manrope; }
.ceo-disclaimer { margin: 9px 0 0; color: #92948f; font-size: 8px; }
.ceo-method { display: grid; grid-template-columns: 30px 1fr; gap: 9px; color: var(--accent); background: #f7f2fc; }
.ceo-method p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.ceo-method strong { display: block; margin-bottom: 2px; color: var(--ink); }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .product-grid { grid-template-columns: repeat(3,1fr); }
  .report-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar: 220px; }
  .sidebar { transform: translateX(-102%); transition: .23s; box-shadow: 12px 0 35px rgba(0,0,0,.18); }
  .sidebar.open { z-index: 71; transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .menu-btn { display: grid; }
  .dashboard-grid, .split-grid, .inventory-layout { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2,1fr); }
  .finance-hero { grid-template-columns: 1fr 1fr; }
  .production-board { grid-template-columns: 1fr; }
  .insights-grid { grid-template-columns: 1fr; }
  .insight { border-right: 0; border-bottom: 1px solid var(--line); }
  .insight:last-child { border-bottom: 0; }
  .empty-start { grid-template-columns: 1fr; }
  .ceo-priorities { grid-template-columns: 1fr; }
  .ceo-priority { min-height: auto; }
  .ceo-modal-summary { grid-template-columns: repeat(2,1fr); }
  .ceo-modal-summary > div:nth-child(2) { border-right: 0; }
  .ceo-modal-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ceo-detail-grid { grid-template-columns: 1fr; }
  .finance-main { grid-column: 1/-1; border-right: 0; border-bottom: 1px solid #313436; }
}
@media (max-width: 650px) {
  .topbar { height: 62px; padding: 0 14px; gap: 8px; }
  .content { padding: 20px 14px 35px; }
  .global-search { flex: 1; width: auto; }
  .global-search kbd, .sync-status, .primary-btn .chev { display: none; }
  .top-actions .primary-btn { width: 38px; padding: 0; }
  .top-actions .primary-btn > span:nth-child(2) { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; overflow-x: auto; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 120px; }
  .filters-bar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .count-label { display: none; }
  .product-grid, .report-grid { grid-template-columns: 1fr; }
  .product-visual { height: 170px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav button { width: auto; flex: 0 0 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .finance-hero { grid-template-columns: 1fr; }
  .finance-main { grid-column: auto; }
  .finance-side { border-right: 0; border-bottom: 1px solid #313436; }
  .quick-grid { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: repeat(2,1fr); }
  .empty-start { padding: 20px; }
  .empty-start-copy { flex-direction: column; }
  .ceo-card { padding: 17px; border-radius: 15px; }
  .ceo-header { align-items: flex-start; }
  .ceo-status { padding-top: 3px; font-size: 0; }
  .ceo-intro { margin-top: 19px; }
  .ceo-intro h3 { font-size: 19px; }
  .ceo-priority { grid-template-columns: 22px 32px 1fr; padding: 12px; }
  .ceo-footer { align-items: stretch; flex-direction: column; }
  .ceo-footer > span { line-height: 1.4; }
  .ceo-open { min-height: 44px; justify-content: center; }
  .ceo-analysis-list article { grid-template-columns: 34px 1fr; }
  .ceo-analysis-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; }
  .ceo-analysis-actions .secondary-btn { width: 100%; }
  .ceo-simulation-results { grid-template-columns: 1fr; }
  .ceo-simulation-results > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .ceo-simulation-results > div:last-child { border-bottom: 0; }
}

.nav { min-height: 0; overflow-y: auto; }
.variant-line { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.variant-line span { padding: 4px 7px; border: 1px solid rgba(132,60,246,.18); border-radius: 999px; background: rgba(132,60,246,.08); color: #6f30ce; font-size: 9px; font-weight: 700; }
.variant-row { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.variant-row span { color: var(--muted); font-size: 11px; }
.stacked-actions { flex-wrap: wrap; }
.profile-editor { display: grid; gap: 16px; }
.profile-block { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfafc; }
.profile-block .form-grid { margin-top: 14px; }
.backup-section { margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.backup-section h3 { margin: 0 0 8px; font: 700 12px Manrope; }
.backup-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.backup-row:first-of-type { border-top: 0; }
.backup-row > span { color: var(--accent); }
.backup-row strong, .backup-row small { display: block; }
.backup-row strong { font-size: 11px; }
.backup-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.backup-empty { margin: 14px 0; padding: 14px; border-radius: 12px; background: #f7f4fa; color: var(--muted); font-size: 10px; }
.alert-list { display: grid; gap: 9px; }
.alert-row { width: 100%; display: grid; grid-template-columns: 38px 1fr 20px; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.alert-row strong, .alert-row small { display: block; }
.alert-row strong { font-size: 11px; }
.alert-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.alert-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; }
.alert-icon.warning { color: #8b5d12; background: #fff4d6; }
.alert-icon.danger { color: #a73939; background: #ffe9e9; }
.install-guide { display: grid; gap: 12px; }
.install-guide > div { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 13px; }
.install-guide > div > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: white; font-weight: 800; }
.install-guide p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.install-guide strong { display: block; margin-bottom: 2px; color: var(--ink); }
.attachment-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.attachment-head h3 { margin: 0; }
.attachment-list { margin-top: 10px; }
.attachment-row { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.attachment-row > span { color: var(--accent); }
.attachment-row > button:not(.row-menu) { border: 0; background: transparent; text-align: left; cursor: pointer; }
.attachment-row strong, .attachment-row small { display: block; }
.attachment-row strong { max-width: 220px; overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.upload-zone { display: grid; place-items: center; gap: 8px; padding: 24px; border: 1px dashed rgba(132,60,246,.35); border-radius: 15px; background: rgba(132,60,246,.04); text-align: center; }
.upload-zone > span { color: var(--accent); }
.upload-zone strong { font-size: 13px; }
.upload-zone p { margin: 0 0 8px; color: var(--muted); font-size: 10px; }
.upload-zone .form-control { width: 100%; background: white; }

@media (max-width: 650px) {
  .backup-row { grid-template-columns: 28px 1fr; }
  .backup-row .secondary-btn { grid-column: 1 / -1; width: 100%; }
  .alert-row { grid-template-columns: 38px 1fr; }
  .alert-row > svg { display: none; }
}

/* Camada de legibilidade: tamanhos confortáveis para uso diário */
.brand strong { font-size: 18px; }
.brand small { font-size: 9px; }
.nav-item { min-height: 44px; font-size: 14px; }
.mode-pill { font-size: 11px; }
.user-card strong { font-size: 12px; }
.user-card small { font-size: 10px; }
.global-search input { font-size: 14px; }
.sync-status, .primary-btn, .secondary-btn, .ghost-btn, .danger-btn { font-size: 12px; }
.page-head h1 { font-size: 31px; }
.page-head p { font-size: 14px; }
.eyebrow { font-size: 10px; }
.stat-label { font-size: 12px; }
.stat-value { font-size: 26px; }
.stat-foot { font-size: 11px; }
.card-head h2, .card-head h3 { font-size: 15px; }
.card-head p { font-size: 11px; }
.link-btn, .segmented button { font-size: 11px; }
.data-table { font-size: 12px; }
.data-table th { height: 42px; font-size: 10px; }
.data-table td { height: 59px; }
.subtext { font-size: 10px; }
.status { height: 25px; font-size: 10px; }
.filter-select, .form-control, .search-field input { font-size: 12px; }
.form-group label { font-size: 11px; }
.form-hint { font-size: 10px; }
.tab { font-size: 12px; }
.product-info h3, .production-card h4 { font-size: 13px; }
.product-info .sku, .product-price span, .product-stock span { font-size: 10px; }
.stock-row strong, .movement-row strong { font-size: 12px; }
.stock-row span, .movement-row span { font-size: 10px; }
.detail-item span, .drawer-section h3 { font-size: 10px; }
.detail-item strong { font-size: 12px; }
.settings-panel > p, .settings-nav button { font-size: 12px; }
.toggle-row strong { font-size: 12px; }
.toggle-row span { font-size: 10px; }

/* iPhone e modo aplicativo */
@media (max-width: 650px) {
  body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .topbar { padding-top: max(8px, env(safe-area-inset-top)); height: calc(62px + env(safe-area-inset-top)); }
  .sidebar, .drawer { height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
  .nav { overflow-y: auto; overscroll-behavior: contain; }
  .form-control { min-height: 46px; font-size: 16px !important; }
  textarea.form-control { min-height: 100px; }
  .primary-btn, .secondary-btn, .danger-btn, .icon-btn, .nav-item { min-height: 44px; }
  .modal-foot, .drawer-actions { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
