/* Portal UNIFORS · Design system UNIFORS (referência Omenix) */
:root {
  --primary-dark-blue: #17345f;
  --primary-blue: #1366f4;
  --secondary-blue: #397ced;
  --main-text: #69a0f6;
  --small-text: #cfdcec;
  --borders: #e7ebf2;
  --ink: #17345f;
  --ink-muted: #6e85a4;
  --ink-placeholder: #a1b6d5;
  --accent-text: #1366f4;
  --on-accent: #ffffff;
  --bg-page: #fbfbfb;
  --bg-surface: #ffffff;
  --bg-sidebar: #fcfdff;
  --bg-subtle: #edf2f8;
  --bg-blue-soft: #dce8f6;
  --bg-blue-tint: #ebf3ff;
  --border-input: #97c1fd;
  --border-card: #ebf1fd;
  --focus-ring: #1366f4;
  --gradient-violet: #6a2ef2;
  --gradient-blue: #1369fe;
  --deep-blue: #173766;
  --dark-ground: #0b0e15;
  --success: #1ec897;
  --success-text: #0f8a66;
  --success-soft: #e6f9f5;
  --warning: #feb74b;
  --warning-text: #cb7508;
  --warning-soft: #fff7ec;
  --violet: #9654e9;
  --violet-soft: #f4edfd;
  --danger: #fe6f71;
  --danger-text: #d0393c;
  --danger-soft: #ffeced;
  --info-text: #3a81f5;
  --info-soft: #e9f1fe;
  --shadow-card: 0 4px 20px rgba(23, 52, 95, 0.06);
  --shadow-raised: 0 10px 30px rgba(19, 102, 244, 0.25);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--bg-page); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
h1, h2, h3 { margin: 0; color: var(--ink); }
.ic { flex: none; }
.muted { color: var(--ink-muted); }
.small { font-size: 12px; line-height: 16px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { align-self: start; background: var(--bg-sidebar); border-right: 1px solid var(--borders); padding: 20px 16px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand-block { background: var(--dark-ground); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.brand-block img { width: 100%; max-width: 190px; height: auto; display: block; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); padding: 14px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); color: var(--ink-muted); font-size: 15px; font-weight: 500; line-height: 22px; }
.nav a:hover { background: var(--bg-subtle); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--bg-blue-soft); color: var(--accent-text); }
.nav a .count { margin-left: auto; background: var(--primary-blue); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--borders); display: flex; flex-direction: column; gap: 10px; }
.help { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--bg-blue-tint); border-radius: var(--radius-md); font-size: 12px; line-height: 16px; color: var(--ink); }
.help .ic { color: var(--primary-blue); }
.logout-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; color: var(--ink-muted); font: inherit; font-size: 14px; border-radius: var(--radius-md); cursor: pointer; }
.logout-btn:hover { background: var(--danger-soft); color: var(--danger-text); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 20px; padding: 14px 32px; background: var(--bg-surface); border-bottom: 1px solid var(--borders); position: sticky; top: 0; z-index: 20; }
.cobrand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cobrand .client-logo { height: 34px; max-width: 120px; object-fit: contain; }
.cobrand .client-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.cobrand .x { color: var(--ink-muted); font-size: 18px; }
.cobrand .wordmark { font-weight: 800; font-size: 19px; letter-spacing: .02em; color: var(--primary-dark-blue); line-height: 1; }
.cobrand .wordmark small { white-space: nowrap; display: block; font-size: 8px; letter-spacing: .28em; font-weight: 600; color: var(--ink-muted); margin-top: 3px; }
.portal-title { padding-left: 20px; border-left: 1px solid var(--borders); min-width: 0; }
.portal-title b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; }
.portal-title nav { display: flex; gap: 6px; font-size: 13px; color: var(--ink-muted); white-space: nowrap; }
.portal-title nav a { color: var(--ink-muted); }
.portal-title nav span { opacity: .5; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.search { position: relative; }
.search input { width: 240px; padding: 9px 14px 9px 38px; border: 1px solid var(--border-input); border-radius: 999px; font: inherit; color: var(--ink); background: var(--bg-surface); box-shadow: var(--shadow-card); }
.search input::placeholder { color: var(--ink-placeholder); }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); }
.bell { position: relative; color: var(--ink); display: flex; padding: 6px; border-radius: var(--radius-sm); }
.bell:hover { background: var(--bg-subtle); }
.bell .dot { position: absolute; top: 0; right: 0; background: var(--danger-text); color: #fff; font-size: 10px; font-weight: 600; border-radius: 999px; min-width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--bg-surface); }
.me { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.me:hover { text-decoration: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-dark-blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.me b { display: block; font-size: 13px; line-height: 16px; white-space: nowrap; }
.me span { font-size: 12px; color: var(--ink-muted); }
.menu-toggle { display: none; background: none; border: 0; color: var(--ink); padding: 6px; cursor: pointer; }

.content { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--ink-muted); font-size: 14px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Cards ---------- */
.card { background: var(--bg-surface); border: 1px solid var(--border-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 17px; line-height: 24px; font-weight: 600; }
.card-head h2 small { font-weight: 400; font-size: 13px; color: var(--ink-muted); }
.card-head a { font-size: 13px; white-space: nowrap; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 18px 20px 0; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-row-1 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1fr); }
.dash-row-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border-card); background: var(--bg-surface); box-shadow: var(--shadow-card); color: var(--ink); }
.kpi:hover { text-decoration: none; border-color: var(--border-input); }
.kpi .tile { width: 42px; height: 42px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex: none; }
.kpi .label { font-size: 12.5px; line-height: 16px; color: var(--ink-muted); }
.kpi .value { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.01em; margin-top: 2px; }
.kpi .unit { font-size: 12px; color: var(--ink-muted); }
.kpi.blue .tile { background: var(--bg-blue-tint); color: var(--primary-blue); }
.kpi.orange .tile { background: var(--warning-soft); color: var(--warning-text); }
.kpi.violet .tile { background: var(--violet-soft); color: var(--violet); }
.kpi.green .tile { background: var(--success-soft); color: var(--success-text); }
.kpi.red .tile { background: var(--danger-soft); color: var(--danger-text); }
.kpi.red .value { color: var(--danger-text); }
.kpi.hero { background: linear-gradient(135deg, var(--deep-blue), var(--gradient-blue)); border: 0; box-shadow: var(--shadow-raised); color: #fff; }
.kpi.hero .label, .kpi.hero .unit { color: rgba(255,255,255,.82); }
.kpi.hero .tile { background: rgba(255,255,255,.16); color: #fff; }

/* Barras horizontais (principais peças) */
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 12px; font-size: 13px; }
.hbar .track { height: 18px; background: var(--bg-subtle); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--primary-blue); border-radius: 4px; }
.hbar .n { text-align: right; font-weight: 600; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Alertas */
.alerts-card { background: linear-gradient(180deg, var(--danger-soft), var(--bg-surface) 40%); }
.alerts-card .card-head h2 { color: var(--danger-text); }
.alert-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-surface); border: 1px solid var(--border-card); margin-bottom: 8px; color: var(--ink); }
.alert-item:hover { text-decoration: none; border-color: var(--danger); }
.alert-item .ic { color: var(--danger-text); }
.alert-item.warn .ic { color: var(--warning-text); }
.alert-item b { display: block; font-size: 13px; }
.alert-item span { font-size: 12px; color: var(--danger-text); }
.alert-item.warn span { color: var(--warning-text); }
.alert-item .days { margin-left: auto; font-size: 13px; color: var(--danger-text); font-weight: 600; white-space: nowrap; }
.alert-item.warn .days { color: var(--warning-text); }
.empty { color: var(--ink-muted); font-size: 13px; padding: 18px 0; text-align: center; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 500; color: var(--ink-muted); font-size: 12px; padding: 10px 10px; background: var(--bg-subtle); white-space: nowrap; }
.t th:first-child { border-top-left-radius: var(--radius-sm); }
.t th:last-child { border-top-right-radius: var(--radius-sm); }
.t td { padding: 10px 10px; border-bottom: 1px solid var(--borders); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #fafcff; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.t .c { text-align: center; }
.t a.rowlink { color: var(--ink); font-weight: 500; }
.thumb { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg-subtle); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-muted); vertical-align: middle; }
.prod { display: flex; align-items: center; gap: 10px; }
.prod small { display: block; color: var(--ink-muted); font-size: 11.5px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.badge.info { background: var(--info-soft); color: var(--info-text); }
.badge.warning { background: var(--warning-soft); color: var(--warning-text); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.success { background: var(--success-soft); color: var(--success-text); }
.badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.badge.neutral { background: var(--bg-subtle); color: var(--ink-muted); }
.days-badge { display: inline-block; min-width: 72px; text-align: center; padding: 4px 10px; border-radius: var(--radius-sm); font-weight: 600; font-size: 12px; }
.days-badge.ok { background: var(--success-soft); color: var(--success-text); }
.days-badge.mid { background: var(--warning-soft); color: var(--warning-text); }
.days-badge.low { background: var(--danger-soft); color: var(--danger-text); }
.days-badge.na { background: var(--bg-subtle); color: var(--ink-muted); font-weight: 500; }

/* ---------- Timeline ---------- */
.timeline { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; position: relative; padding-top: 6px; }
.step { text-align: center; position: relative; padding: 0 4px; }
.step::before { content: ""; position: absolute; top: 18px; left: -50%; width: 100%; height: 2px; background: var(--small-text); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before { background: var(--success); }
.step .dot { width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; background: var(--bg-subtle); color: var(--ink-muted); border: 2px solid var(--bg-surface); box-shadow: 0 0 0 1px var(--small-text); }
.step.done .dot { background: var(--success); color: #fff; box-shadow: none; }
.step.current .dot { background: var(--primary-blue); color: #fff; box-shadow: 0 0 0 4px var(--bg-blue-soft); }
.step b { display: block; font-size: 12.5px; line-height: 16px; font-weight: 500; }
.step.current b { color: var(--primary-blue); font-weight: 600; }
.step span { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

/* ---------- Formulários ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-muted); }
.input, select.input, textarea.input { width: 100%; padding: 10px 16px; border: 1px solid var(--border-input); border-radius: 999px; font: inherit; color: var(--ink); background: var(--bg-surface); }
textarea.input { border-radius: var(--radius-md); min-height: 90px; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e85a4' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.input::placeholder { color: var(--ink-placeholder); }
.input:disabled { background: var(--bg-subtle); color: var(--ink-muted); }
.input.sm { padding: 7px 12px; font-size: 13px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary-blue); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--borders); border-radius: var(--radius-md); max-height: 260px; overflow-y: auto; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 170px; }
.pill-filter { display: inline-flex; align-items: center; border: 1px solid var(--borders); border-radius: var(--radius-md); background: var(--bg-surface); overflow: hidden; }
.pill-filter span { padding: 8px 12px; font-size: 13px; color: var(--ink); border-right: 1px solid var(--borders); background: var(--bg-surface); }
.pill-filter select { border: 0; padding: 8px 34px 8px 12px; font: inherit; font-size: 13px; color: var(--ink); appearance: none; background: var(--bg-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236e85a4' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; min-width: 150px; cursor: pointer; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-md); border: 1px solid transparent; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; line-height: 18px; }
.btn.primary { background: var(--primary-blue); color: var(--on-accent); }
.btn.primary:hover { box-shadow: var(--shadow-raised); }
.btn.soft { background: var(--info-soft); color: var(--info-text); }
.btn.soft:hover { background: var(--bg-blue-soft); }
.btn.outline { background: var(--bg-surface); border-color: var(--border-card); color: var(--ink); box-shadow: var(--shadow-card); }
.btn.outline:hover { border-color: var(--border-input); }
.btn.success { background: var(--success-text); color: #fff; }
.btn.danger { background: var(--danger-soft); color: var(--danger-text); }
.btn.danger:hover { background: #ffdfe0; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.inline { display: inline; }
.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Flash ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.flash.success { background: var(--success-soft); color: var(--success-text); }
.flash.error { background: var(--danger-soft); color: var(--danger-text); }
.flash.warning { background: var(--warning-soft); color: #8a4b00; }
.flash.info { background: var(--info-soft); color: var(--info-text); }

/* ---------- Itens de pedido (form) ---------- */
.items-table .input { border-radius: var(--radius-md); }
.items-table td { padding: 8px 6px; }
.avail { font-size: 12px; white-space: nowrap; }
.avail.short { color: var(--danger-text); font-weight: 600; }
.dropzone { border: 1.5px dashed var(--border-input); border-radius: var(--radius-lg); padding: 18px; display: flex; gap: 14px; align-items: center; background: var(--bg-blue-tint); }
.dropzone .ic { color: var(--primary-blue); }

/* ---------- Detalhe ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kv div span { display: block; font-size: 12px; color: var(--ink-muted); }
.kv div b { font-size: 14px; font-weight: 600; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--borders); font-size: 13px; }
.events li:last-child { border-bottom: 0; }
.events .when { color: var(--ink-muted); white-space: nowrap; width: 128px; flex: none; }
.rep-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--warning-soft); color: #6b3d00; }
.rep-box .ic { color: var(--warning-text); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--dark-ground); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(19,105,254,.55), transparent 70%); }
.auth-side img { width: 260px; max-width: 100%; }
.auth-side h2 { color: #fff; font-size: 32px; line-height: 38px; letter-spacing: -.02em; max-width: 420px; }
.auth-side p { color: #b9c6da; max-width: 420px; }
.auth-side ul { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 10px; color: #cfdcec; }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-side li .ic { color: var(--main-text); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg-page); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; line-height: 36px; letter-spacing: -.02em; font-weight: 600; }
.auth-card .lead { color: var(--ink-muted); margin: 6px 0 24px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.code-input { letter-spacing: .4em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.qr { background: #fff; padding: 10px; border-radius: var(--radius-md); border: 1px solid var(--borders); width: 240px; }
.secret { font-family: ui-monospace, Menlo, monospace; background: var(--bg-subtle); padding: 6px 10px; border-radius: var(--radius-sm); word-break: break-all; font-size: 13px; }
.temp-pass { font-family: ui-monospace, Menlo, monospace; font-size: 18px; background: var(--dark-ground); color: #fff; padding: 12px 16px; border-radius: var(--radius-md); letter-spacing: .04em; }

/* ---------- Erro ---------- */
.error-page { max-width: 520px; margin: 60px auto; text-align: center; }
.error-page .code { font-size: 64px; font-weight: 700; color: var(--bg-blue-soft); line-height: 1; }

/* ---------- Responsivo ---------- */
@media (max-width: 1500px) { .portal-title nav { display: none; } }
@media (max-width: 1400px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .dash-row-1 { grid-template-columns: 1fr 1fr; } .dash-row-1 > :first-child { grid-column: 1 / -1; } .dash-row-2 { grid-template-columns: 1fr; } .portal-title nav { display: none; } }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-card); }
  body.nav-open .sidebar { transform: none; }
  .menu-toggle { display: flex; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .portal-title, .search, .me div, .cobrand .x, .cobrand .x ~ .wordmark { display: none; }
  .cobrand .client-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
  .top-actions { gap: 8px; }
  .top-actions .pill-filter select { min-width: 110px; }
  .dropzone { flex-wrap: wrap; }
  .items-table { min-width: 560px; }
  .content { padding: 20px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-row-1, .g-2, .g-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .timeline { grid-auto-flow: row; grid-auto-columns: auto; gap: 12px; }
  .step { display: flex; gap: 12px; align-items: center; text-align: left; }
  .step::before { display: none; }
  .step .dot { margin: 0; }
  .hbar { grid-template-columns: 110px 1fr 40px; }
}
