/* Portal Statuz Clínica — identidade própria sobre a base do portal.css */
body.clinic-portal {
  --accent: #0f766e;
  --accent-hover: #0b5f58;
  --accent-mid: #14b8a6;
  --bad: #c2410c;
  --good: #047857;
  --paper: #f3f7f6;
  --side-bg: #0b2e2c;
  --side-w: 236px;
}

html[data-theme="dark"] body.clinic-portal {
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --bad: #fb923c;
  --good: #34d399;
  --paper: #0d1514;
  --white: #142120;
  --line: #24403d;
  --side-bg: #07191a;
}

/* Login */
.clinic-portal .login-shell { background: var(--side-bg); }

.clinic-portal .login-visual {
  background:
    radial-gradient(ellipse 70% 55% at 0% 100%, rgba(20, 184, 166, 0.28), transparent 55%),
    linear-gradient(165deg, #0b2e2c 0%, #114541 100%);
}

.login-kicker {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5eead4;
}

.clinic-portal .login-visual p:not(.login-kicker) { color: #a7c4c0; }
.clinic-portal .form-field input:focus { outline-color: rgba(15, 118, 110, 0.35); }

.brand-sub {
  font-style: normal;
  color: var(--accent-mid);
}

.clinic-portal .login-card .brand .brand-sub { color: var(--accent); }

.login-back { margin: 1.2rem 0 0; font-size: 0.86rem; }
.login-back a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Menu lateral */
.clinic-portal .portal-side { background: var(--side-bg); }

.side-clinic {
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.7rem;
  border-radius: 10px;
  background: rgba(94, 234, 212, 0.08);
  font-size: 0.8rem;
  color: rgba(241, 245, 249, 0.55);
}

.side-clinic strong {
  display: block;
  color: #f1f5f9;
  font-weight: 600;
}

.clinic-portal .side-nav a.is-active {
  background: rgba(94, 234, 212, 0.16);
  color: #f1f5f9;
  box-shadow: inset 3px 0 0 #2dd4bf;
}

.portal-frame.is-collapsed .side-clinic { display: none; }

/* Barra superior */
.period-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.period-switch a {
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
}

.period-switch a.is-on { background: var(--accent); color: #fff; }
html[data-theme="dark"] .period-switch a.is-on { color: #06201e; }

.demo-strip {
  margin: 0;
  padding: 0.55rem 1.5rem;
  background: rgba(15, 118, 110, 0.08);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.demo-strip a {
  margin-left: 0.4rem;
  color: var(--accent);
  font-weight: 600;
}

.clinic-body {
  background: var(--paper);
  display: grid;
  gap: 1.1rem;
  align-content: start;
}

/* KPIs */
.c-kpis {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 700px) {
  .c-kpis-4 { grid-template-columns: repeat(4, 1fr); }
  .c-kpis-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1380px) {
  .c-kpis-6 { grid-template-columns: repeat(6, 1fr); }
}

.c-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--white);
}

.c-kpi.is-alert { border-top-color: var(--bad); }

.c-kpi-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
}

.c-kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.c-kpi.is-alert .c-kpi-value { color: var(--bad); }
.c-kpi-sub { font-size: 0.78rem; color: var(--muted); }

.c-delta { font-size: 0.74rem; font-weight: 600; color: var(--muted); }
.c-delta.good { color: var(--good); }
.c-delta.bad { color: var(--bad); }

/* Cartões */
.c-grid { display: grid; gap: 1.1rem; }

@media (min-width: 1040px) {
  .c-grid-2 { grid-template-columns: 1fr 1fr; }
}

.c-card {
  padding: 1.2rem 1.25rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  min-width: 0;
}

.c-card h2 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.c-hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.c-card-ink {
  background: var(--side-bg);
  border-color: transparent;
  color: #e6f2f0;
}

.c-card-ink h2 { color: #fff; margin-bottom: 0.8rem; }

.c-reading {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.c-reading li {
  padding-left: 0.95rem;
  border-left: 3px solid #2dd4bf;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #cfe3e0;
}

.c-more {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

/* Barras */
.c-bars { display: grid; gap: 0.55rem; }

.c-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) 1.6fr auto;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.84rem;
}

.c-bar-label { color: var(--ink); font-weight: 500; }

.c-bar-label em {
  display: block;
  font-style: normal;
  font-size: 0.74rem;
  color: var(--muted);
}

.c-bar-track {
  position: relative;
  height: 12px;
  border-radius: 99px;
  background: var(--paper);
  overflow: hidden;
}

.c-bar {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 99px;
  background: var(--accent);
}

.c-bar-bad { background: var(--bad); }

.c-bar-val {
  min-width: 5.5rem;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.c-bar-val em { font-style: normal; font-weight: 400; color: var(--muted); }

/* Mapa dia × turno */
.c-heat { display: grid; gap: 0.35rem; overflow-x: auto; }

.c-heat-row {
  display: grid;
  grid-template-columns: 50px repeat(6, minmax(38px, 1fr));
  gap: 0.3rem;
  align-items: center;
}

.c-heat-head span {
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
}

.c-heat-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }

.c-heat-cell {
  display: grid;
  place-items: center;
  height: 52px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.c-heat-cell.is-rate {
  background: rgba(194, 65, 12, calc(0.08 + var(--a) * 0.8));
  color: var(--ink);
}

.c-heat-cell.is-occ {
  background: rgba(15, 118, 110, calc(0.06 + var(--a) * 0.8));
  color: var(--ink);
}

.c-heat-cell.is-off {
  background: var(--paper);
  color: var(--muted);
  font-weight: 400;
}

/* Tabelas */
.c-table-wrap { overflow-x: auto; }

.c-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.c-table th {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  white-space: nowrap;
}

.c-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.c-table .sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.c-table .center { text-align: center; }
.c-table .right { text-align: right; }
.c-table .muted { color: var(--muted); }

.c-slot {
  display: inline-block;
  min-width: 3.4rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  background: rgba(15, 118, 110, calc(var(--a) * 0.55));
  font-size: 0.8rem;
  font-weight: 600;
}

.c-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
}

.c-pill.bad { background: rgba(194, 65, 12, 0.14); color: var(--bad); }
.c-pill.ok { background: rgba(4, 120, 87, 0.12); color: var(--good); }

@media (max-width: 640px) {
  .c-bar-row { grid-template-columns: 1fr auto; }
  .c-bar-track { grid-column: 1 / -1; order: 3; }
  .demo-strip { padding: 0.55rem 1rem; }
}
