/* ==========================================================================
   Atoms to Application — Sentinel Health Design System board
   All values are the REAL tokens from Colect-sentinel-health:
   src/styles/tokens.css · tailwind.config.cjs · src/components/{Button,Input,ui/Badge}.tsx
   Scoped under .a2a to avoid collisions with host pages.
   ========================================================================== */

.a2a-fit {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.a2a-stage {
  width: 1600px;
  transform-origin: top left;
}

.a2a {
  /* Real Sentinel tokens (tokens.css :root, dark theme) */
  --a2a-bg-canvas: #111827;          /* --color-bg-primary — superfície principal do app */
  --a2a-bg-primary: #111827;         /* --color-bg-primary */
  --a2a-bg-secondary: #1c2634;       /* --color-bg-secondary */
  --a2a-bg-tertiary: #243044;        /* --color-bg-tertiary */
  --a2a-drawer: #131a2b;             /* --color-drawer-bg */
  --a2a-text-primary: #ffffff;       /* --color-text-primary */
  --a2a-text-secondary: #d1d5db;     /* --color-text-secondary */
  --a2a-text-tertiary: #9ca3af;      /* --color-text-tertiary */
  --a2a-text-muted: #7a8190;         /* --color-text-muted */
  --a2a-cyan: #22d3ee;               /* --color-accent-cyan */
  --a2a-primary-blue: #2374e1;       /* --color-primary-blue */
  --a2a-border-light: #4b5563;       /* --color-border-light */
  --a2a-border-dark: #1a1f2e;        /* --color-border-dark */
  --a2a-border-sidebar: #1e293b;     /* --color-border-sidebar */
  --a2a-healthy: #4ade6d;            /* --color-status-healthy-text */
  --a2a-healthy-bright: #22c55e;     /* --color-status-healthy-bright */
  --a2a-healthy-card: #1d3f35;       /* --color-status-healthy-bg-card */
  --a2a-warning: #facc15;            /* --color-status-warning-text */
  --a2a-warning-card: #403c23;       /* --color-status-warning-bg-card */
  --a2a-critical: #b72526;           /* --color-status-critical-bg (brand) */
  --a2a-critical-rendered: #dc5253;  /* bg-status-critical (Tailwind channel 220 82 83) */
  --a2a-critical-card: #331a27;      /* --color-status-critical-bg-card */
  --a2a-info: #3b82f6;               /* --color-status-info-bg / --color-focus-ring */
  --a2a-info-card: #1e2a3d;          /* --color-status-info-bg-card */
  --a2a-sidebar-muted: #64748b;      /* --color-text-sidebar-muted — só sidebar; micro-labels usam text-tertiary (WCAG AA) */
  --a2a-font-heading: 'Poppins', 'system-ui', 'Segoe UI', sans-serif;
  --a2a-font-body: 'Inter', 'system-ui', 'Segoe UI', sans-serif;
  --a2a-font-mono: 'SFMono-Regular', 'Menlo', 'Consolas', monospace;

  box-sizing: border-box;
  background: var(--a2a-bg-canvas);
  color: var(--a2a-text-primary);
  font-family: var(--a2a-font-body);
  padding: 56px 64px 40px;
  border-radius: 12px;
  line-height: 1.45;
}

.a2a *, .a2a *::before, .a2a *::after { box-sizing: border-box; }

/* ---------- header ---------- */

.a2a-eyebrow {
  font-family: var(--a2a-font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--a2a-text-tertiary);
  text-transform: uppercase;
  margin: 0 0 10px;
}

.a2a-title {
  font-family: var(--a2a-font-heading);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--a2a-text-primary);
}

.a2a-subtitle {
  font-size: 15px;
  color: var(--a2a-text-muted);
  margin: 6px 0 0;
}

.a2a-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 44px;
}

.a2a-head-right {
  font-family: var(--a2a-font-mono);
  font-size: 11px;
  color: var(--a2a-text-tertiary);
  text-align: right;
  line-height: 1.7;
}

/* ---------- 3-column grid ---------- */

.a2a-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 430px;
  gap: 44px;
  align-items: start;
}

.a2a-col-label {
  font-family: var(--a2a-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--a2a-text-tertiary);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--a2a-border-sidebar);
}

.a2a-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--a2a-cyan);
  margin: 26px 0 12px;
}

.a2a-sub:first-of-type { margin-top: 0; }

/* ---------- foundations: colors ---------- */

.a2a-swatch {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 7px 0;
}

.a2a-dot {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  flex-shrink: 0;
  border: 1px solid rgb(255 255 255 / 0.08);
}

.a2a-dot--ring {
  background: transparent;
  border: 2px solid var(--a2a-border-light);
}

.a2a-dot--ghost {
  background: transparent;
  border: 1px dashed var(--a2a-border-light);
}

.a2a-swatch-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--a2a-text-primary);
}

.a2a-swatch-hex {
  font-family: var(--a2a-font-mono);
  font-size: 11px;
  color: var(--a2a-text-secondary);
}

.a2a-swatch-token {
  font-family: var(--a2a-font-mono);
  font-size: 10px;
  color: var(--a2a-text-tertiary);
}

/* ---------- foundations: typography ---------- */

.a2a-type-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgb(30 41 59 / 0.6);
}

.a2a-type-row:last-child { border-bottom: none; }

.a2a-type-name { color: var(--a2a-text-primary); }

.a2a-type-spec {
  font-family: var(--a2a-font-mono);
  font-size: 10px;
  color: var(--a2a-text-tertiary);
  text-align: right;
  white-space: nowrap;
}

/* ---------- foundations: spacing & radii ---------- */

.a2a-space-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.a2a-space-bar {
  height: 10px;
  border-radius: 2px;
  background: rgb(34 211 238 / 0.25);
  border: 1px solid rgb(34 211 238 / 0.45);
  flex-shrink: 0;
}

.a2a-space-label {
  font-family: var(--a2a-font-mono);
  font-size: 10px;
  color: var(--a2a-text-secondary);
  white-space: nowrap;
}

.a2a-radii {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.a2a-radius-box {
  width: 40px;
  height: 40px;
  background: var(--a2a-bg-tertiary);
  border: 1px solid var(--a2a-border-light);
}

.a2a-radius-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.a2a-radius-label {
  font-family: var(--a2a-font-mono);
  font-size: 9px;
  color: var(--a2a-text-tertiary);
  text-align: center;
  line-height: 1.4;
}

/* ---------- annotated anatomy ---------- */

.a2a-anatomy {
  position: relative;
  border: 1px dashed var(--a2a-border-light);
  border-radius: 12px;
  height: 240px;
  margin-bottom: 40px;
}

.a2a-anatomy-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 48px;
}

.a2a-anatomy-btn .a2a-btn {
  width: 100%;
  height: 100%;
}

.a2a-tag {
  position: absolute;
  z-index: 2;
  font-family: var(--a2a-font-mono);
  font-size: 11px;
  color: var(--a2a-text-tertiary);
  white-space: nowrap;
}

.a2a-tag b { color: var(--a2a-cyan); font-weight: 600; }

.a2a-leader {
  position: absolute;
  z-index: 2;
}

.a2a-leader--h { height: 0; border-top: 1px dashed var(--a2a-border-light); }
.a2a-leader--v { width: 0; border-left: 1px dashed var(--a2a-border-light); }

.a2a-leader-dot {
  position: absolute;
  z-index: 2;
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: var(--a2a-text-tertiary);
}

.a2a-padbox {
  position: absolute;
  inset: 6px 12px;   /* distâncias reais: py-1.5 (6px) · px-3 (12px) */
  border: 1px dashed rgb(255 255 255 / 0.4);
  border-radius: 2px;
  pointer-events: none;
}

/* ---------- real Button recipes (Button.tsx) ---------- */

.a2a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;               /* Tailwind `rounded` */
  font-family: var(--a2a-font-body);
  font-weight: 500;                 /* font-medium */
  font-size: 14px;                  /* text-sm (md) */
  padding: 6px 12px;                /* py-1.5 px-3 */
  border: 1px solid transparent;
  transition: all 200ms ease-in-out;
  cursor: pointer;
  white-space: nowrap;
}

.a2a-btn--primary {
  background: var(--a2a-primary-blue);
  color: #fff;
  border-color: var(--a2a-primary-blue);
}
.a2a-btn--primary:hover { background: rgb(35 116 225 / 0.9); }
.a2a-btn--primary.is-hover { background: rgb(255 255 255 / 0.10); border-color: var(--a2a-primary-blue); color: #fff; }

.a2a-btn--secondary {
  background: rgb(34 211 238 / 0.10);
  color: var(--a2a-cyan);
  border-color: rgb(34 211 238 / 0.30);
}
.a2a-btn--secondary:hover { background: rgb(34 211 238 / 0.20); }
.a2a-btn--secondary.is-hover { background: rgb(255 255 255 / 0.10); border-color: var(--a2a-cyan); }

.a2a-btn--outline {
  background: var(--a2a-bg-primary);
  color: #fff;
  border-color: var(--a2a-border-light);
}
.a2a-btn--outline:hover { background: var(--a2a-bg-secondary); }
.a2a-btn--outline.is-hover { background: rgb(255 255 255 / 0.10); }

.a2a-btn--danger {
  background: var(--a2a-critical-rendered);   /* bg-status-critical → rgb(220 82 83) */
  color: #fff;
  border-color: var(--a2a-critical-rendered);
}
.a2a-btn--danger:hover { background: rgb(220 82 83 / 0.9); }
.a2a-btn--danger.is-hover { background: rgb(255 255 255 / 0.10); border-color: #b72526; color: #fff; }

.a2a-btn--ghost {
  background: transparent;
  color: var(--a2a-text-secondary);
  border-color: transparent;
}
.a2a-btn--ghost:hover { background: rgb(28 38 52 / 0.5); color: #fff; }
.a2a-btn--ghost.is-hover { background: rgb(255 255 255 / 0.10); border-color: transparent; }

.a2a-btn.is-disabled, .a2a-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.a2a-btn--sm { padding: 4px 8px; font-size: 12px; }   /* px-2 py-1 text-xs */
.a2a-btn--lg { padding: 8px 16px; font-size: 16px; }  /* px-4 py-2 text-base */

.a2a-btn--focus { box-shadow: 0 0 0 2px var(--a2a-primary-blue); }

.a2a-btn--xl {
  font-size: 17px;
  padding: 12px 28px;
  border-radius: 5px;
}

/* ---------- component matrix ---------- */

.a2a-matrix {
  display: grid;
  grid-template-columns: 150px repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--a2a-border-sidebar);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 34px;
}

.a2a-matrix > div {
  padding: 13px 16px;
  border-bottom: 1px solid var(--a2a-border-sidebar);
  display: flex;
  align-items: center;
}

.a2a-matrix > div:nth-last-child(-n+4) { border-bottom: none; }

.a2a-matrix-head {
  font-family: var(--a2a-font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--a2a-text-tertiary);
  justify-content: center;
}

.a2a-matrix-head:first-child { justify-content: flex-start; }

.a2a-matrix-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--a2a-text-primary);
  flex-direction: column;
  align-items: flex-start !important;
  gap: 2px;
}

.a2a-matrix-name span {
  font-family: var(--a2a-font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--a2a-text-tertiary);
}

.a2a-matrix-cell { justify-content: center; }

.a2a-matrix-cell--hover { flex-direction: column; gap: 5px; }

.a2a-cell-note {
  font-family: var(--a2a-font-mono);
  font-size: 9px;
  color: var(--a2a-text-tertiary);
}

.a2a-sizes {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: -14px 0 34px;
  padding: 0 4px;
}

.a2a-sizes-label {
  font-family: var(--a2a-font-mono);
  font-size: 10px;
  color: var(--a2a-text-tertiary);
  margin-right: 4px;
}

/* ---------- real Input recipes (Input.tsx) ---------- */

.a2a-field { margin-bottom: 16px; }

.a2a-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--a2a-text-secondary);
  margin-bottom: 6px;
}

.a2a-input {
  display: block;
  width: 100%;
  background: var(--a2a-bg-primary);
  border: 1px solid var(--a2a-border-light);
  border-radius: 8px;               /* --radius-input */
  color: var(--a2a-text-primary);
  font-family: var(--a2a-font-body);
  font-size: 14px;                  /* text-sm */
  padding: 10px 12px;               /* py-2.5 px-3 */
  transition: all 200ms ease-in-out;
}

.a2a-input::placeholder { color: var(--a2a-text-muted); }

.a2a-input--focus, .a2a-input:focus {
  border-color: var(--a2a-cyan);
  outline: 2px solid var(--a2a-cyan);
  outline-offset: 1px;
}

.a2a-input--error {
  border-color: var(--a2a-critical-rendered);
  outline: 2px solid var(--a2a-critical-rendered);
  outline-offset: 1px;
}

.a2a-hint {
  font-size: 12px;
  color: var(--a2a-text-muted);
  margin-top: 6px;
}

.a2a-hint--error { color: var(--a2a-critical-rendered); }

.a2a-spec-line {
  font-family: var(--a2a-font-mono);
  font-size: 10px;
  color: var(--a2a-text-tertiary);
  margin: 2px 0 0;
  line-height: 1.8;
}

/* ---------- real Badge recipes (ui/Badge.tsx) ---------- */

.a2a-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 34px;
}

.a2a-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;                  /* text-body-3-semibold */
  font-weight: 600;
  padding: 4px 12px;                /* py-xs px-3 */
  border-radius: 9999px;
  border: 0.5px solid transparent;
}

.a2a-badge--healthy { background: var(--a2a-healthy-card); color: var(--a2a-healthy-bright); border-color: var(--a2a-healthy-bright); }
.a2a-badge--warning { background: var(--a2a-warning-card); color: var(--a2a-warning); border-color: var(--a2a-warning); }
.a2a-badge--critical { background: var(--a2a-critical-card); color: var(--a2a-critical); border-color: var(--a2a-critical); }
.a2a-badge--info { background: var(--a2a-info-card); color: var(--a2a-info); border-color: var(--a2a-info); }
.a2a-badge--offline { background: var(--a2a-bg-tertiary); color: var(--a2a-text-muted); border-color: var(--a2a-border-light); }
.a2a-badge--default { background: var(--a2a-bg-tertiary); color: var(--a2a-text-muted); border-color: var(--a2a-border-light); }

.a2a-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: currentColor;
}

/* ---------- real Card recipe (components.css .card) ---------- */

.a2a-card {
  background: var(--a2a-bg-secondary);
  border-radius: 10px;              /* --radius-md */
  padding: 16px;                    /* --spacing-lg */
  transition: all 200ms ease;
}

.a2a-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.a2a-card-title {
  font-size: 16px;                  /* --font-heading-2 */
  font-weight: 500;
  color: var(--a2a-text-primary);
}

.a2a-card-value {
  font-size: 32px;                  /* --font-display-1 */
  font-weight: 700;
  color: var(--a2a-text-primary);
  line-height: 1.1;
}

.a2a-card-desc {
  font-size: 12px;                  /* --font-subtitle-2 */
  color: var(--a2a-text-muted);
  margin-top: 4px;
}

/* ---------- practical application ---------- */

.a2a-app-frame {
  border: 1px solid var(--a2a-border-sidebar);
  border-radius: 10px;
  overflow: hidden;
  background: var(--a2a-bg-primary);
  margin-bottom: 18px;
}

.a2a-app-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--a2a-bg-secondary);
  border-bottom: 1px solid var(--a2a-border-sidebar);
}

.a2a-app-dot {
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background: var(--a2a-border-light);
}

.a2a-app-url {
  font-family: var(--a2a-font-mono);
  font-size: 10px;
  color: var(--a2a-text-tertiary);
  margin-left: 8px;
  background: var(--a2a-bg-primary);
  border: 1px solid var(--a2a-border-sidebar);
  border-radius: 5px;
  padding: 2px 10px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a2a-app-frame img {
  display: block;
  width: 100%;
  height: 215px;
  object-fit: cover;
  object-position: top left;
}

.a2a-app-cap {
  font-size: 11px;
  color: var(--a2a-text-muted);
  line-height: 1.6;
  margin: -10px 0 18px;
}

.a2a-app-cap code {
  font-family: var(--a2a-font-mono);
  font-size: 10px;
  color: var(--a2a-cyan);
  background: rgb(34 211 238 / 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- footer ---------- */

.a2a-foot {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--a2a-border-sidebar);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--a2a-font-mono);
  font-size: 10.5px;
  color: var(--a2a-text-tertiary);
}

.a2a-foot b { color: var(--a2a-text-secondary); font-weight: 600; }

/* ---------- fallback / embed ---------- */

.a2a-fallback {
  font-size: 14px;
  padding: 24px;
  border: 1px dashed var(--a2a-border-light, #4b5563);
  border-radius: 10px;
  color: inherit;
}
