/* ==========================================================================
   Shell do app: sidebar + topbar + área de conteúdo
   ========================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--t) var(--ease);
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--side-bg);
  color: var(--side-text);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--side-border);
  z-index: 40;
  overflow: hidden;
}
.sidebar::before { /* grade sutil "tech" */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 45%);
}
.sidebar::after { /* brilho da marca */
  content: ""; position: absolute; width: 320px; height: 320px; left: -120px; bottom: -160px; pointer-events: none;
  background: radial-gradient(circle, rgba(50, 185, 87, 0.16), transparent 65%);
}
.side-brand { position: relative; display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; min-height: 76px; }
.side-brand img { width: 46px; height: auto; flex-shrink: 0; filter: drop-shadow(0 6px 14px rgba(34, 176, 240, 0.25)); }
.side-brand-text { line-height: 1.05; min-width: 0; }
.side-brand-text b { display: block; font-family: var(--font-display); color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.side-brand-text b span { background: linear-gradient(90deg, #3fb5f2, #5fd18a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-brand-text small { display: block; margin-top: 4px; font-size: 10px; letter-spacing: 0.34em; color: #8ea0bf; text-transform: uppercase; font-weight: 600; }

.side-nav { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 12px; }
.side-section { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: #5f7093; font-weight: 700; padding: 16px 12px 8px; white-space: nowrap; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 10px; color: var(--side-text); font-weight: 500; font-size: 14px;
  transition: background var(--t-fast), color var(--t-fast); text-decoration: none !important; white-space: nowrap;
}
.side-link .i { width: 19px; height: 19px; opacity: 0.85; transition: transform var(--t) var(--ease-spring); }
.side-link:hover { background: var(--side-hover); color: #fff; }
.side-link:hover .i { transform: scale(1.08); }
.side-link.active { background: var(--side-active); color: #fff; box-shadow: inset 0 0 0 1px rgba(59, 155, 232, 0.18); }
.side-link.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #22b0f0, #32b957); box-shadow: 0 0 12px rgba(34, 176, 240, 0.8);
}
.side-link.active .i { opacity: 1; color: #5fc2f5; }
.side-count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; background: rgba(255,255,255,0.08); color: #cfdaf0; }
.side-count.alert { background: rgba(239, 68, 68, 0.2); color: #ffb4b4; }

.side-foot { position: relative; padding: 12px; border-top: 1px solid var(--side-border); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; transition: background var(--t-fast); width: 100%; text-align: left; }
.side-user:hover { background: var(--side-hover); }
.side-user-info { min-width: 0; flex: 1; line-height: 1.25; }
.side-user-info b { display: block; color: #fff; font-size: 13px; font-weight: 600; }
.side-user-info small { color: #8ea0bf; font-size: 11.5px; }
.side-foot .side-collapse { position: absolute; right: 12px; top: -46px; }

.app.collapsed .side-brand-text, .app.collapsed .side-section, .app.collapsed .side-link span, .app.collapsed .side-count,
.app.collapsed .side-user-info, .app.collapsed .side-user .i { display: none; }
.app.collapsed .side-brand { justify-content: center; padding: 20px 10px; }
.app.collapsed .side-link { justify-content: center; padding: 11px; }
.app.collapsed .side-nav { padding: 6px 10px; }
.app.collapsed .side-user { justify-content: center; }
.app.collapsed .side-section { height: 14px; padding: 0; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; position: relative; }
.main::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 420px; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 300px at 20% -60px, rgba(31, 120, 209, 0.10), transparent 70%), radial-gradient(700px 260px at 85% -80px, rgba(50, 185, 87, 0.07), transparent 70%);
}
[data-theme="dark"] .main::before {
  background: radial-gradient(900px 320px at 20% -60px, rgba(31, 120, 209, 0.18), transparent 70%), radial-gradient(700px 280px at 85% -80px, rgba(50, 185, 87, 0.08), transparent 70%);
}

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: var(--surface-glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .i { width: 14px; height: 14px; opacity: 0.6; }
.crumbs b { color: var(--text); font-weight: 600; }
.top-search {
  margin-left: auto; display: flex; align-items: center; gap: 10px; width: min(360px, 34vw); height: 38px; padding: 0 10px 0 12px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 13.5px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.top-search:hover { border-color: var(--border-strong); background: var(--surface); }
.top-search kbd, kbd { margin-left: auto; font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); box-shadow: 0 1px 0 var(--border); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .dot { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 10px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); line-height: 1; }
.icon-btn.bell-anim .i { animation: bellShake 900ms var(--ease) 1; transform-origin: 50% 0; }
.mobile-menu { display: none; }

.page { position: relative; z-index: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 28px 28px 64px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.page-head p { color: var(--text-2); margin-top: 6px; font-size: 14px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--gradient-arrow); }

.demo-banner {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 16px; font-size: 12.5px; font-weight: 500;
  background: linear-gradient(90deg, rgba(29,95,191,.12), rgba(0,145,213,.12), rgba(50,185,87,.12)); color: var(--text-2); border-bottom: 1px solid var(--border);
}
.demo-banner b { color: var(--text); }

/* ==========================================================================
   Botões
   ========================================================================== */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  border: 1px solid transparent; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t), transform var(--t-fast);
  overflow: hidden; user-select: none; text-decoration: none !important;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn .i { width: 16px; height: 16px; }
.btn[disabled], .btn.disabled { opacity: 0.55; pointer-events: none; }
.btn-primary { color: #fff; background: var(--gradient-primary); box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 16px -8px rgba(29, 95, 191, 0.7); }
.btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent); transform: translateX(-120%) skewX(-20deg); }
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 10px 24px -8px rgba(29, 95, 191, 0.75); }
.btn-primary:hover::after { animation: shine 900ms var(--ease); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--faint); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: var(--primary-soft-2); }
.btn-danger { background: #dc2626; color: #fff; box-shadow: 0 6px 16px -8px rgba(220, 38, 38, 0.7); }
.btn-danger:hover { background: #c01f1f; }
.btn-danger-ghost { color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-bg); }
.btn-success { background: #16a34a; color: #fff; box-shadow: 0 6px 16px -8px rgba(22, 163, 74, 0.7); }
.btn-success:hover { background: #12883e; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-sm .i { width: 14px; height: 14px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-xs .i { width: 13px; height: 13px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-icon.btn-xs { width: 26px; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.btn.loading { pointer-events: none; }
.btn.loading { color: transparent !important; }
.btn.loading > :not(.spinner) { opacity: 0; }
.btn.loading .spinner { position: absolute; color: #fff; border-color: #fff; border-right-color: transparent; }
.btn-secondary.loading .spinner, .btn-ghost.loading .spinner, .btn-soft.loading .spinner, .btn-danger-ghost.loading .spinner { border-color: var(--primary); border-right-color: transparent; }

/* ==========================================================================
   Formulários
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.label .req { color: var(--red); }
.hint { font-size: 12px; color: var(--muted); }
.error-text { font-size: 12px; color: var(--red); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.input[readonly], .input:disabled { background: var(--surface-2); color: var(--text-2); }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.select { appearance: none; padding-right: 34px; 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='%237d889d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.input-sm, .select.input-sm { height: 34px; font-size: 13px; border-radius: 9px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .prefix, .input-group > .suffix { position: absolute; color: var(--muted); font-size: 13px; font-weight: 600; pointer-events: none; display: flex; align-items: center; }
.input-group > .prefix { left: 12px; }
.input-group > .suffix { right: 12px; }
.input-group > .prefix ~ .input { padding-left: 38px; }
.input-group > .prefix.icon ~ .input { padding-left: 36px; }
.input-group .input:has(~ .suffix) { padding-right: 40px; }
.input-group > .btn { position: absolute; right: 4px; height: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.form-grid > .c-12 { grid-column: span 12; } .form-grid > .c-9 { grid-column: span 9; } .form-grid > .c-8 { grid-column: span 8; }
.form-grid > .c-6 { grid-column: span 6; } .form-grid > .c-4 { grid-column: span 4; } .form-grid > .c-3 { grid-column: span 3; }
.form-grid > .c-5 { grid-column: span 5; } .form-grid > .c-7 { grid-column: span 7; } .form-grid > .c-2 { grid-column: span 2; }
@media (max-width: 720px) { .form-grid > [class*="c-"] { grid-column: span 12; } }
.form-section { font-family: var(--font-display); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; margin-top: 6px; }
.form-section .i { color: var(--primary); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 38px; height: 22px; border-radius: 22px; background: var(--border-strong); position: relative; transition: background var(--t); flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform var(--t) var(--ease-spring); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--ring); }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); font-weight: 600; font-size: 13.5px; transition: all var(--t-fast); height: 100%;
}
.choice > span .i { color: var(--muted); }
.choice:hover > span { border-color: var(--faint); }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--ring); color: var(--text); }
.choice input:checked + span .i { color: var(--primary); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }

.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border); gap: 2px; }
.segmented button, .segmented a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: all var(--t-fast); text-decoration: none !important; white-space: nowrap; }
.segmented button:hover, .segmented a:hover { color: var(--text); }
.segmented .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .i { width: 15px; height: 15px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 30px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: all var(--t-fast); white-space: nowrap;
}
.chip:hover { border-color: var(--faint); color: var(--text); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip .i { width: 14px; height: 14px; }
.chip .count { font-size: 11px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.chip.active .count { background: var(--primary); color: #fff; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.toolbar .search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.toolbar .search .input { padding-left: 36px; height: 38px; }
.toolbar .select { width: auto; min-width: 150px; height: 38px; font-size: 13.5px; }
.toolbar .spacer { flex: 1; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); min-width: 0;
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head h3 { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head h3 .i { color: var(--primary); width: 18px; height: 18px; }
.card-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card-body { padding: 16px 20px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card.hoverable { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t); cursor: pointer; }
.card.hoverable:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card.glow::before { /* borda em gradiente no hover */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0;
  background: var(--gradient-brand); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity var(--t);
}
.card.glow:hover::before { opacity: 1; }
.card-link { font-size: 13px; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }
.card-link .i { width: 15px; height: 15px; transition: transform var(--t-fast); }
.card-link:hover { text-decoration: none; }
.card-link:hover .i { transform: translateX(3px); }

/* Card hero com gradiente da marca */
.card-brand {
  background: radial-gradient(600px 240px at 100% 0%, rgba(50, 185, 87, 0.28), transparent 60%), radial-gradient(500px 260px at 0% 100%, rgba(0, 145, 213, 0.35), transparent 60%), linear-gradient(135deg, #0b1f47, #0f2c59 50%, #123a7a);
  color: #e7efff; border: 1px solid rgba(255,255,255,0.06); overflow: hidden;
}
.card-brand::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(90deg, transparent, #000 70%); }
.card-brand .muted { color: #9fb3d6; }
.card-brand h2, .card-brand h3 { color: #fff; }

/* KPI tile */
.kpi { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.kpi-icon .i { width: 17px; height: 17px; }
.kpi-value { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.delta .i { width: 13px; height: 13px; stroke-width: 2.4; }
.delta.up { color: var(--green); background: var(--green-bg); }
.delta.down { color: var(--red); background: var(--red-bg); }
.delta.flat { color: var(--slate); background: var(--slate-bg); }
.tone-blue { color: var(--blue); background: var(--blue-bg); }
.tone-cyan { color: var(--cyan); background: var(--cyan-bg); }
.tone-green { color: var(--green); background: var(--green-bg); }
.tone-amber { color: var(--amber); background: var(--amber-bg); }
.tone-red { color: var(--red); background: var(--red-bg); }
.tone-violet { color: var(--violet); background: var(--violet-bg); }
.tone-pink { color: var(--pink); background: var(--pink-bg); }
.tone-slate { color: var(--slate); background: var(--slate-bg); }

/* ==========================================================================
   Badges / status
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap; line-height: 1;
}
.badge .i { width: 12px; height: 12px; stroke-width: 2.3; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-blue { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-bd); }
.badge-cyan { color: var(--cyan); background: var(--cyan-bg); border-color: var(--cyan-bd); }
.badge-green { color: var(--green); background: var(--green-bg); border-color: var(--green-bd); }
.badge-amber { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-bd); }
.badge-red { color: var(--red); background: var(--red-bg); border-color: var(--red-bd); }
.badge-violet { color: var(--violet); background: var(--violet-bg); border-color: var(--violet-bd); }
.badge-pink { color: var(--pink); background: var(--pink-bg); border-color: var(--pink-bd); }
.badge-slate { color: var(--slate); background: var(--slate-bg); border-color: var(--slate-bd); }
.badge-solid { color: #fff; background: var(--gradient-primary); border: 0; }
.badge-lg { height: 26px; padding: 0 10px; font-size: 12.5px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--surface-3); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.tag .i { width: 12px; height: 12px; }

.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.prio i { display: inline-block; width: 3px; border-radius: 2px; background: var(--faint); }
.prio i:nth-child(1) { height: 6px; } .prio i:nth-child(2) { height: 9px; } .prio i:nth-child(3) { height: 12px; }
.prio .bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.prio.alta { color: var(--red); } .prio.alta i { background: var(--red); }
.prio.media { color: var(--amber); } .prio.media i:nth-child(-n+2) { background: var(--amber); }
.prio.baixa { color: var(--slate); } .prio.baixa i:nth-child(1) { background: var(--slate); }

/* ==========================================================================
   Avatares
   ========================================================================== */
.avatar {
  --size: 32px; width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0; position: relative;
  display: inline-grid; place-items: center; font-weight: 700; font-size: calc(var(--size) * 0.38); color: #fff; letter-spacing: 0.02em;
  background: var(--av, linear-gradient(135deg, #1d5fbf, #0091d5)); overflow: visible; font-family: var(--font-display);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar.xs { --size: 22px; } .avatar.sm { --size: 26px; } .avatar.md { --size: 36px; } .avatar.lg { --size: 48px; } .avatar.xl { --size: 64px; } .avatar.xxl { --size: 112px; }
.avatar .presence { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 8px; min-height: 8px; border-radius: 50%; background: var(--faint); border: 2px solid var(--surface); }
.avatar .presence.on { background: #22c55e; animation: pulseRing 2s infinite; }
.sidebar .avatar .presence { border-color: #0a1a3c; }
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-stack .more { --size: 26px; background: var(--surface-3); color: var(--text-2); font-size: 10.5px; }

/* ==========================================================================
   Progresso
   ========================================================================== */
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--gradient-arrow); transform-origin: left; animation: growX 900ms var(--ease) both; }
.progress.thin { height: 4px; }
.progress.thick { height: 10px; }
.progress.green > span { background: linear-gradient(90deg, #22a34a, #32b957); }
.progress.amber > span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress.red > span { background: linear-gradient(90deg, #dc2626, #f87171); }
.progress.blue > span { background: linear-gradient(90deg, #1d5fbf, #3b9be8); }
.ring { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-track { stroke: var(--surface-3); }
.ring .ring-val { stroke: url(#gradRing); transition: stroke-dashoffset 900ms var(--ease); }
.ring b { position: absolute; font-family: var(--font-display); font-weight: 600; font-size: 13px; }

/* Stepper de fases */
.phase-bar { display: flex; gap: 4px; }
.phase-bar i { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-3); }
.phase-bar i.on { background: var(--primary); }
.phase-bar i.on:last-of-type { background: var(--cyan-500); }
.phase-bar.done i { background: #22a34a; }
.phase-bar.cancel i { background: var(--red-bd); }

/* ==========================================================================
   Tabelas
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: inherit; }
.table { width: 100%; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 700; color: var(--muted);
  padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .i { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; margin-left: 2px; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table .t-right { text-align: right; }
.table .t-center { text-align: center; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.table-compact td { padding: 10px 14px; }
.card > .table-wrap:first-child .table th:first-child { border-top-left-radius: var(--r-lg); }
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; opacity: 0.55; transition: opacity var(--t-fast); }
tr:hover .row-actions { opacity: 1; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main b { font-weight: 600; display: block; color: var(--text); }
.cell-main small { color: var(--muted); font-size: 12px; display: block; }

/* ==========================================================================
   Abas
   ========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px 13px; font-weight: 600; font-size: 13.5px; color: var(--muted);
  white-space: nowrap; transition: color var(--t-fast); text-decoration: none !important; border-radius: 8px 8px 0 0;
}
.tab .i { width: 16px; height: 16px; }
.tab:hover { color: var(--text); background: var(--surface-3); }
.tab.active { color: var(--text); }
.tab.active .i { color: var(--primary); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gradient-arrow); animation: growX 300ms var(--ease); }
.tab .count { font-size: 11px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-weight: 700; }
.tab.active .count { background: var(--primary-soft-2); color: var(--primary); }

/* ==========================================================================
   Overlays: modal, drawer, dropdown, toast, tooltip
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 10, 24, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fadeIn var(--t) var(--ease);
}
.overlay.closing { animation: fadeIn 180ms var(--ease) reverse forwards; }
.modal {
  position: relative; width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-xl); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: scaleIn 300ms var(--ease-spring); display: flex; flex-direction: column; max-height: calc(100vh - 8vh - 16px);
}
.modal.sm { max-width: 420px; } .modal.md { max-width: 640px; } .modal.lg { max-width: 860px; } .modal.xl { max-width: 1100px; }
.overlay.closing .modal { animation: scaleIn 180ms var(--ease) reverse forwards; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.modal-head .m-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.modal-head h2 { font-size: 18px; font-weight: 600; }
.modal-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.modal-head .close { margin-left: auto; margin-top: -4px; margin-right: -6px; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.modal-foot .left { margin-right: auto; }

.drawer-overlay { align-items: stretch; justify-content: flex-end; padding: 0; }
.drawer {
  width: min(560px, 100vw); height: 100%; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slideInRight 340ms var(--ease);
}
.drawer.wide { width: min(760px, 100vw); }
.overlay.closing .drawer { animation: slideInRight 220ms var(--ease) reverse forwards; }
.drawer .modal-head { padding: 18px 22px; }
.drawer .modal-body { padding: 20px 22px 28px; }

.dropdown {
  position: fixed; z-index: 150; min-width: 200px; max-width: 320px; padding: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); animation: scaleIn 180ms var(--ease); transform-origin: top right;
}
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text); text-align: left; text-decoration: none !important; }
.dd-item .i { width: 16px; height: 16px; color: var(--muted); }
.dd-item:hover { background: var(--surface-3); }
.dd-item.danger { color: var(--red); }
.dd-item.danger .i { color: var(--red); }
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: slideInUp 360ms var(--ease-spring); position: relative; overflow: hidden;
}
.toast.out { animation: slideInUp 220ms var(--ease) reverse forwards; }
.toast .t-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.toast .t-icon .i { width: 17px; height: 17px; }
.toast b { display: block; font-size: 13.5px; font-weight: 600; }
.toast p { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--gradient-arrow); animation: growX linear forwards reverse; transform-origin: left; width: 100%; }

.tooltip {
  position: fixed; z-index: 400; pointer-events: none; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.4;
  background: #0b1730; color: #e8eefc; box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.08);
  opacity: 0; transform: translateY(4px); transition: opacity 120ms, transform 120ms; max-width: 280px;
}
.tooltip.show { opacity: 1; transform: none; }
.tooltip .tt-title { color: #9fb0cc; font-size: 11.5px; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .tt-row b { font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.tooltip .tt-key { display: inline-flex; align-items: center; gap: 6px; color: #b9c6dd; }
.tooltip .tt-key i { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }

/* ==========================================================================
   Empty states / skeleton
   ========================================================================== */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 44px 20px; gap: 10px; }
.empty-art { position: relative; width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; margin-bottom: 6px; background: linear-gradient(135deg, var(--primary-soft), rgba(50, 185, 87, 0.1)); color: var(--primary); }
.empty-art::after { content: ""; position: absolute; inset: -8px; border-radius: 32px; border: 1px dashed var(--border-strong); }
.empty-art .i { width: 34px; height: 34px; stroke-width: 1.6; }
.empty h4 { font-size: 16px; }
.empty p { color: var(--muted); max-width: 380px; font-size: 13.5px; }
.empty.sm { padding: 26px 16px; }
.empty.sm .empty-art { width: 56px; height: 56px; border-radius: 18px; }
.empty.sm .empty-art::after { display: none; }
.empty.sm .empty-art .i { width: 24px; height: 24px; }

.skel { border-radius: 8px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%); background-size: 800px 100%; animation: shimmer 1.3s linear infinite; }

/* ==========================================================================
   Listas
   ========================================================================== */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); transition: background var(--t-fast); min-width: 0; }
.list-item:first-child { border-top: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-2); }
.li-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.li-icon .i { width: 17px; height: 17px; }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-main small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-side { text-align: right; flex-shrink: 0; }
.li-side b { display: block; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.li-side small { display: block; font-size: 11.5px; color: var(--muted); }

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; color: var(--text); min-width: 0; word-break: break-word; }

.stat-inline { display: flex; flex-direction: column; gap: 2px; }
.stat-inline small { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-inline b { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid; font-size: 13.5px; align-items: flex-start; }
.callout .i { margin-top: 1px; }
.callout b { font-weight: 600; }
.callout.info { background: var(--blue-bg); border-color: var(--blue-bd); color: var(--text); }
.callout.info > .i { color: var(--blue); }
.callout.warn { background: var(--amber-bg); border-color: var(--amber-bd); }
.callout.warn > .i { color: var(--amber); }
.callout.danger { background: var(--red-bg); border-color: var(--red-bd); }
.callout.danger > .i { color: var(--red); }
.callout.success { background: var(--green-bg); border-color: var(--green-bd); }
.callout.success > .i { color: var(--green); }

/* ==========================================================================
   Painel de notificações
   ========================================================================== */
.notif-panel {
  position: fixed; top: calc(var(--topbar-h) - 6px); right: 16px; z-index: 120; width: min(420px, calc(100vw - 24px)); max-height: min(620px, calc(100vh - 90px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: scaleIn 220ms var(--ease); transform-origin: top right; overflow: hidden;
}
.notif-head { padding: 16px 18px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notif-head h3 { font-size: 16px; }
.notif-tabs { display: flex; gap: 6px; padding: 0 18px 10px; border-bottom: 1px solid var(--border); }
.notif-list { overflow-y: auto; flex: 1; }
.notif-group { padding: 12px 18px 4px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.notif-item { display: flex; gap: 12px; padding: 12px 18px; cursor: pointer; transition: background var(--t-fast); position: relative; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread::after { content: ""; position: absolute; right: 16px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.notif-item .li-icon { width: 34px; height: 34px; }
.notif-item b { font-size: 13.5px; font-weight: 600; display: block; padding-right: 18px; }
.notif-item p { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.notif-item time { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: block; }
.notif-foot { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; background: var(--surface-2); }

/* ==========================================================================
   Command palette
   ========================================================================== */
.cmdk { max-width: 640px; overflow: hidden; }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cmdk-input .i { color: var(--muted); width: 20px; height: 20px; }
.cmdk-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; }
.cmdk-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.cmdk-group { padding: 10px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.cmdk-item .li-icon { width: 30px; height: 30px; border-radius: 8px; }
.cmdk-item small { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.cmdk-item.sel { background: var(--primary-soft); }
.cmdk-item.sel .arrow { opacity: 1; }
.cmdk-item .arrow { opacity: 0; color: var(--primary); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: var(--surface-2); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ==========================================================================
   Kanban
   ========================================================================== */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; min-height: 200px; max-height: calc(100vh - 250px); transition: background var(--t-fast), border-color var(--t-fast); }
.column.drag-over { background: var(--primary-soft); border-color: var(--primary); border-style: dashed; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.column-head h4 { font-size: 13.5px; font-weight: 600; font-family: var(--font-sans); letter-spacing: 0; }
.column-head .cdot { width: 8px; height: 8px; border-radius: 50%; }
.column-head .count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 0 7px; border-radius: 10px; }
.column-head .btn { margin-left: auto; }
.column-body { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; min-height: 60px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; cursor: grab; box-shadow: var(--shadow-xs);
  transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t-fast), opacity var(--t-fast); position: relative;
}
.kcard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-2px); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: 0.4; transform: rotate(2deg) scale(0.98); }
.kcard.done .kc-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.kc-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.kc-title { font-weight: 600; font-size: 13.5px; line-height: 1.4; }
.kc-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kc-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.kc-foot .due { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }
.kc-foot .due .i { width: 13px; height: 13px; }
.kc-foot .due.late { color: var(--red); }
.kc-foot .due.soon { color: var(--amber); }
.kc-check { display: inline-flex; align-items: center; gap: 4px; }
.kc-check .i { width: 13px; height: 13px; }
.kcard .kc-prog { height: 3px; margin-top: 10px; }
.column-add { margin: 0 10px 10px; justify-content: flex-start; color: var(--muted); }

/* Loader */
.spinner-lg { width: 30px; height: 30px; border: 3px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%; animation: spin 800ms linear infinite; }
.page-loading { display: grid; place-items: center; min-height: 50vh; }

/* ==========================================================================
   Responsivo do shell
   ========================================================================== */
@media (max-width: 1024px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-102%); transition: transform var(--t) var(--ease); box-shadow: var(--shadow-lg); }
  .app.mobile-open .sidebar { transform: none; }
  .app.collapsed .side-brand-text, .app.collapsed .side-section, .app.collapsed .side-link span, .app.collapsed .side-count, .app.collapsed .side-user-info { display: initial; }
  .side-scrim { position: fixed; inset: 0; background: rgba(4, 10, 24, 0.5); z-index: 35; animation: fadeIn var(--t); }
  .mobile-menu { display: grid; }
  .side-collapse { display: none; }
  .topbar { padding: 0 16px; }
  .page { padding: 20px 16px 56px; }
  .top-search { width: 40px; padding: 0; justify-content: center; margin-left: auto; }
  .top-search span, .top-search kbd { display: none; }
}
@media (max-width: 640px) {
  .crumbs > :not(:last-child) { display: none; }
  .page-head h1 { font-size: 22px; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 16px; }
  .modal-foot { padding: 12px 16px; flex-wrap: wrap; }
  .overlay { padding: 12px 8px; }
  .toolbar .search { max-width: none; min-width: 100%; }
  .toolbar .select { flex: 1; }
  .kpi-value { font-size: 22px; }
  .hide-sm { display: none !important; }
}
