/* AgenteX 0.71 — operational clarity, restrained surfaces, touch and keyboard. */
:root {
  --background: #f4f6f8; --foreground: #17232f; --card: #fff;
  --muted-foreground: #5b6978; --border: #dde4ea; --input: #b8c5cf;
  --primary: #137b68; --ring: #137b68; --sidebar: #f9fafb;
  --sidebar-border: #dde4ea; --sidebar-accent: #eaf0f3;
  --sidebar-primary: #137b68; --sidebar-foreground: #52616e;
  --sidebar-accent-foreground: #17232f; --radius-lg: 14px;
  --shadow-soft: 0 3px 15px #14283906;
}
html[data-theme="dark"] {
  --background: #0f151c; --foreground: #e7eef4; --card: #171f29;
  --popover: #171f29; --muted-foreground: #a2afbd; --border: #2a3643;
  --input: #465566; --primary: #6ed3b6; --primary-foreground: #0c3027;
  --ring: #6ed3b6; --sidebar: #121a23; --sidebar-border: #25313f;
  --sidebar-accent: #1d2936; --sidebar-foreground: #a2afbd;
  --sidebar-accent-foreground: #e7eef4; --sidebar-primary: #6ed3b6;
  --shadow-soft: 0 3px 15px #0000000c;
}
body { -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
.shell { height: 100dvh; }
.brand { min-height: 82px; padding: 20px 18px; }
.brand__name { font-size: 16px; letter-spacing: -.025em; }
.brand__sub { margin-top: 4px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { padding: 6px 12px; }
.nav__group { font-size: 10px; letter-spacing: .12em; padding-top: 20px; }
.nav__item { height: 39px; border-radius: 9px; margin: 2px 0; font-size: 13px; }
.nav__item.is-active { background: color-mix(in srgb, var(--primary) 11%, transparent); font-weight: 650; }
.nav__item.is-active::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-left: auto; }
.topbar { background: var(--background); backdrop-filter: none; }
.crumbs { font-size: 12px; }
.content { padding: 28px clamp(18px, 3vw, 42px) 40px; }
.page-title { font-size: clamp(22px, 2.3vw, 28px); letter-spacing: -.035em; line-height: 1.18; }
.page-sub { line-height: 1.6; margin-top: 8px; max-width: 76ch; }
.page-head { margin-bottom: 24px; }
.card { box-shadow: var(--shadow-soft); }
.kpi-grid { gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-grid .card { padding: 20px 18px; }
.kpi__label { font-size: 11.5px; line-height: 1.5; align-items: flex-start; }
.kpi__label svg { flex: none; margin-top: 1px; }
.kpi__value { font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-size: clamp(23px, 2.5vw, 34px); line-height: 1.25; margin-top: 14px; letter-spacing: -.045em; overflow-wrap: anywhere; }
.kpi__hint { line-height: 1.5; margin-top: 8px; }
.panel-title { font-size: 14px; letter-spacing: -.01em; }
.panel-head { gap: 10px; }
.list__row { padding: 13px 2px; }
.list__row > div { flex: 1; }
.list__msg { max-width: min(28vw, 320px); }
.btn { border-radius: 8px; transition: background .14s, border-color .14s, box-shadow .14s; }
.btn--primary { box-shadow: 0 2px 3px #0000000a; }
.btn[disabled] { cursor: not-allowed; }
.input { border-radius: 8px; min-width: 0; }
textarea.input { line-height: 1.65; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 3px;
}
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.table th { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.table td { line-height: 1.55; }
.table tbody tr:hover { background: var(--surface-2); }
.seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.seg__btn { flex: none; white-space: nowrap; }
.grid-2, .grid-3, .agents, .camps, .kbase, .mem__grid, .tr__grid { min-width: 0; }
.agents > *, .camps > *, .grid-2 > *, .kbase > * { min-width: 0; }
.readiness { margin: 0 0 22px; padding: 18px 20px; }
.readiness__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.readiness__head h2 { margin: 0; font-size: 13px; font-weight: 650; }
.readiness__version { font-size: 11px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.readiness__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.readiness__item { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; color: inherit; }
.readiness__item:hover { background: var(--surface-2); border-color: var(--input); }
.readiness__dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--muted-foreground); }
.readiness__dot.is-ready { background: var(--primary); }
.readiness__dot.is-attention { background: var(--warning); }
.readiness__label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); display: block; }
.readiness__value { display: block; margin-top: 4px; font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.appfoot { font-size: 10px; gap: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.release-version { margin-left: auto; color: var(--muted-foreground); }
.menu-scrim { display: none; }
.modal__panel { border-radius: 16px; }
.modal__head { padding-top: 20px; }
.modal__body { padding-bottom: 22px; }
.toast { max-width: min(460px, calc(100vw - 32px)); overflow-wrap: anywhere; }
@media (min-width: 981px) and (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .readiness__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { width: min(300px, 85vw); z-index: 41; box-shadow: 18px 0 50px #00000033; }
  .nav__item { min-height: 44px; }
  .menu-scrim.is-open { display: block; position: fixed; inset: 0; z-index: 40; border: 0; background: #00000066; backdrop-filter: blur(2px); }
  .content { padding: 22px 18px 32px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readiness__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conv { height: calc(100dvh - 130px); }
}
@media (max-width: 640px) {
  .topbar { min-height: 60px; padding: 0 12px; }
  .content { padding: 20px 14px 30px; }
  .kpi-grid .card { padding: 16px 14px; }
  .kpi__value { font-size: 25px; }
  .kpi__hint { font-size: 10.5px; }
  .kpi-grid .card:last-child { grid-column: 1 / -1; }
  .readiness { padding: 16px 14px; }
  .readiness__item { padding: 10px 8px; align-items: flex-start; }
  .readiness__dot { margin-top: 3px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
  .canais-grid, .grid-cards { grid-template-columns: minmax(0, 1fr); }
  .list__msg { max-width: 42vw; }
  .list__row { gap: 8px; }
  .alert { flex-wrap: wrap; }
  .alert .btn { margin-left: 32px; }
  .content .btn:not(.btn--xs), .modal .btn, .topbar .btn { min-height: 44px; height: auto; }
  .topbar .btn--icon { width: 40px; min-height: 44px; }
  .input, select, textarea { font-size: 16px; }
  .modal { padding: 10px; }
  .modal__panel { max-height: calc(100dvh - 20px); }
  .modal__foot { flex-wrap: wrap; }
  .modal__foot .btn { flex: 1; }
  .conv__composer textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .content > .page-head { animation: premium-enter .18s ease-out; }
  @keyframes premium-enter { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

body.modal-open{overflow:hidden}
