/* ============================================================================
   Medyxia Clinics — tema da aplicação (fiel ao protótipo Medyxia Clinics.dc.html)
   Paleta exata do protótipo:
     petróleo #0C272C · teal #147A80 / #0E5A5F · verde-água #2FA8A4
     fundo app #EEF3F3 · superfície #fff · linhas #E1E8E8 · texto #10262B
     texto suave #6C8286 · muted #8CA0A3 · dourado (notas) #B77E1E
   Tipografia: Albert Sans
============================================================================ */
:root {
  /* Paleta ÚNICA do sistema = teal do protótipo/landing (Medyxia Clinics). */
  --m-ink: #0C272C;
  --m-teal: #147A80;        /* primário (teal) */
  --m-teal-2: #0E5A5F;      /* teal escuro (hover) */
  --m-aqua: #2FA8A4;        /* acento (aqua) */
  --m-bg: #EEF3F3;
  --m-surface: #FFFFFF;
  --m-line: #E1E8E8;
  --m-line-2: #EDF1F1;
  --m-line-3: #F2F5F5;
  --m-soft: #F4F8F8;
  --m-soft-2: #F7FAFA;
  --m-text: #10262B;
  --m-text-2: #2B4247;
  --m-text-soft: #4A6165;
  --m-muted: #6C8286;
  --m-muted-2: #8CA0A3;
  --m-muted-3: #9FB3B5;
  --m-muted-4: #A9BBBD;
  --m-teal-bg: #E3F0EF;     /* fundo teal suave */
  --m-danger: #B04343;
  --m-gold: #B77E1E;
  --m-gold-bg: #FBF9F4;
  --m-gold-line: #EADFC7;
  --m-ok: #2E8A5B;
  --m-sidebar-w: 248px;
  --m-radius: 14px;
  --m-radius-sm: 10px;
  --m-radius-lg: 18px;

  /* Sidebar escura (clínico premium) */
  --m-side-bg: #0C272C;
  --m-side-bg-2: #103F44;
  --m-side-text: #C9DAD9;
  --m-side-muted: #6F9694;
  --m-side-hover: rgba(255,255,255,.06);
  --m-side-active: rgba(47,168,164,.16);

  /* Profundidade — sombras em camadas */
  --m-sh-xs: 0 1px 2px rgba(12,39,44,.06);
  --m-sh-sm: 0 1px 3px rgba(12,39,44,.07), 0 1px 2px rgba(12,39,44,.05);
  --m-sh:    0 4px 14px rgba(12,39,44,.08), 0 1px 3px rgba(12,39,44,.05);
  --m-sh-md: 0 10px 30px rgba(12,39,44,.10), 0 2px 8px rgba(12,39,44,.06);
  --m-sh-lg: 0 24px 60px rgba(12,39,44,.16);
  --m-ring: 0 0 0 3px rgba(20,122,128,.16);

  --m-ease: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Albert Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--m-bg);
  color: var(--m-text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--m-teal); text-decoration: none; }
a:hover { color: var(--m-teal-2); }
h1,h2,h3,h4 { color: var(--m-ink); letter-spacing: -0.01em; margin: 0; }
input::placeholder, textarea::placeholder { color: var(--m-muted-3); }

/* ── Marca ─────────────────────────────────────────────────────────────── */
.m-brand { display: flex; align-items: baseline; gap: 3px; }
.m-brand .m { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--m-ink); }
.m-brand .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--m-aqua); display: inline-block; margin-left: 2px; }
.m-brand .c { font-size: 9.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--m-muted-3); margin-left: 4px; }
.m-brand.on-dark .m { color: #fff; }
.m-brand.on-dark .c { color: #7FB4B1; }

/* ── Botões ────────────────────────────────────────────────────────────── */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  transition: background .18s var(--m-ease), box-shadow .18s var(--m-ease),
              transform .12s var(--m-ease), opacity .15s, border-color .18s;
  line-height: 1.1;
}
.m-btn:active { transform: translateY(1px); }
.m-btn:focus-visible { outline: none; box-shadow: var(--m-ring); }
.m-btn-primary {
  background: linear-gradient(180deg, var(--m-teal) 0%, var(--m-teal-2) 100%);
  color: #fff; box-shadow: 0 2px 8px rgba(14,90,95,.28);
}
.m-btn-primary:hover { box-shadow: 0 4px 14px rgba(14,90,95,.34); filter: brightness(1.04); }
.m-btn-ghost { background: #fff; color: var(--m-teal); border-color: #CFE0DF; box-shadow: var(--m-sh-xs); }
.m-btn-ghost:hover { background: var(--m-teal-bg); border-color: var(--m-teal); }
.m-btn-neutral { background: #fff; color: var(--m-text-soft); border-color: #D6E0E1; box-shadow: var(--m-sh-xs); }
.m-btn-neutral:hover { background: var(--m-soft); border-color: #C4D2D3; }
.m-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.m-btn-block { width: 100%; }

/* ── Campos ────────────────────────────────────────────────────────────── */
.m-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.m-field label, .m-label { font-size: 12px; font-weight: 600; color: var(--m-text-soft); }
.m-req { color: #C0705E; }
.m-input, .m-select, .m-textarea {
  font: inherit; font-size: 13.5px; padding: 10px 13px; border-radius: 10px;
  border: 1px solid #D6E0E1; background: #fff; color: var(--m-text); width: 100%;
  transition: border-color .16s var(--m-ease), box-shadow .16s var(--m-ease);
}
.m-textarea { min-height: 74px; resize: vertical; }
.m-input:hover, .m-select:hover, .m-textarea:hover { border-color: #BFD1D2; }
.m-input:focus, .m-select:focus, .m-textarea:focus {
  outline: none; border-color: var(--m-teal); box-shadow: var(--m-ring);
}

/* ── Cartões ───────────────────────────────────────────────────────────── */
.m-card {
  background: var(--m-surface); border: 1px solid var(--m-line);
  border-radius: var(--m-radius); box-shadow: var(--m-sh-sm);
  transition: box-shadow .2s var(--m-ease), transform .2s var(--m-ease), border-color .2s;
}
.m-card-pad { padding: 22px 24px; }
/* cartões clicáveis / interativos ganham elevação no hover */
.m-card-hover:hover, a.m-card:hover, button.m-card:hover {
  box-shadow: var(--m-sh-md); transform: translateY(-2px); border-color: #D3E0E0;
}
.m-section-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--m-muted-2); }
.m-section-title .bi { color: var(--m-teal); margin-right: 5px; }

/* ── Pílulas de status ─────────────────────────────────────────────────── */
.m-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 3px 10px; }
.m-pill::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; opacity: .9; }
.st-agendado    { background: #EAF0F1; color: #4A6165; }
.st-confirmado  { background: #E3F0EF; color: #0E5A5F; }
.st-chegou      { background: #E8EFF9; color: #3D6FB4; }
.st-em_atendimento { background: #E8EFF9; color: #3D6FB4; }
.st-finalizado  { background: #EEF7F1; color: #2E6E4A; }
.st-faltou      { background: #F9E9E9; color: #B04343; }
.st-cancelado   { background: #EFEFEF; color: #8A8A8A; }

.m-alert { border-radius: 10px; padding: 10px 16px; font-size: 12.5px; margin: 8px 0; line-height: 1.5; }
.m-alert-error { background: #F9E9E9; color: #8A2E27; border: 1px solid #E5C2C2; }
.m-alert-info  { background: var(--m-soft); color: #35474A; border: 1px solid var(--m-line); }
.m-alert-lgpd  { background: var(--m-gold-bg); color: #7A6320; border: 1px solid var(--m-gold-line); }

/* ── Layout da app (sidebar teal escuro — clínico premium) ──────────────── */
.m-shell { display: flex; height: 100vh; overflow: hidden; background: var(--m-bg); }
.m-sidebar {
  width: var(--m-sidebar-w); flex: none;
  background: linear-gradient(185deg, var(--m-side-bg) 0%, #0E353A 60%, var(--m-side-bg-2) 100%);
  color: var(--m-side-text);
  display: flex; flex-direction: column; position: relative;
}
/* brilho aqua sutil no topo da sidebar */
.m-sidebar::before {
  content: ""; position: absolute; top: -80px; left: -40px; width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(47,168,164,.18), transparent 70%);
  pointer-events: none;
}
.m-sidebar-brand { padding: 22px 22px 16px; position: relative; z-index: 1; }
.m-sidebar-clinic {
  margin: 0 14px 6px; padding: 11px 14px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 9px; position: relative; z-index: 1;
}
.m-sidebar-clinic .sq { width: 9px; height: 9px; border-radius: 3px; background: var(--m-aqua); flex: none; box-shadow: 0 0 10px rgba(47,168,164,.7); }
.m-sidebar-clinic > div > div:first-child { color: #EAF3F2; }
.m-sidebar-clinic > div > div:last-child { color: var(--m-side-muted) !important; }
.m-nav { flex: 1; overflow: auto; padding: 12px; position: relative; z-index: 1; }
.m-nav::-webkit-scrollbar { width: 6px; }
.m-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; }
.m-nav-group { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--m-side-muted); padding: 0 12px 6px; margin-top: 16px; }
.m-nav-link {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  border: none; cursor: pointer; padding: 10px 12px; border-radius: 11px;
  font-size: 13.5px; font-weight: 600; background: none; color: var(--m-side-text);
  position: relative; margin-bottom: 2px;
  transition: background .16s var(--m-ease), color .16s var(--m-ease);
}
.m-nav-link:hover { background: var(--m-side-hover); color: #fff; }
.m-nav-link.active { background: var(--m-side-active); color: #fff; font-weight: 700; }
.m-nav-link.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--m-aqua); box-shadow: 0 0 8px rgba(47,168,164,.8); }
.m-nav-link.active .m-nav-ico .bi { color: var(--m-aqua); }
.m-nav-ico { width: 20px; text-align: center; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.m-nav-ico .bi { font-size: 15px; line-height: 1; }
.m-sidebar-user {
  padding: 12px 14px; margin: 6px; border-radius: 12px;
  background: rgba(255,255,255,.04); border-top: none;
  display: flex; align-items: center; gap: 10px; position: relative; z-index: 1;
}
.m-sidebar-user > div > div:first-child { color: #EAF3F2 !important; }
.m-sidebar-user > div > div:last-child { color: var(--m-side-muted) !important; }
.m-sidebar-user .m-btn-neutral { background: rgba(255,255,255,.06); color: var(--m-side-text); box-shadow: none; }
.m-sidebar-user .m-btn-neutral:hover { background: rgba(255,255,255,.12); }

.m-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.m-topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 28px;
  background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--m-line); flex: none; box-shadow: var(--m-sh-xs); z-index: 5;
}
.m-topbar .title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.m-topbar .sub { font-size: 12px; color: var(--m-muted); margin-top: 1px; }
.m-bell { position: relative; width: 40px; height: 40px; border: 1px solid var(--m-line); background: #fff; border-radius: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; }
.m-bell:hover { background: var(--m-soft); border-color: #CFE0DF; }
.m-bell .badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--m-danger); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.m-avatar { width: 36px; height: 36px; border-radius: 99px; background: linear-gradient(135deg, var(--m-aqua), var(--m-teal)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; box-shadow: 0 2px 6px rgba(14,90,95,.3); }
.m-content { flex: 1; overflow: auto; padding: 26px 28px; }

/* ── KPIs ──────────────────────────────────────────────────────────────── */
.m-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 24px; }
.m-kpi {
  position: relative; padding: 18px 22px 18px 24px; overflow: hidden;
}
/* faixa de acento teal à esquerda */
.m-kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--m-aqua), var(--m-teal));
}
.m-kpi:hover { box-shadow: var(--m-sh-md); transform: translateY(-2px); }
.m-kpi .label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--m-muted-2); }
.m-kpi .value { font-size: 27px; font-weight: 800; color: var(--m-ink); margin-top: 6px; line-height: 1; letter-spacing: -.02em; }
.m-kpi .hint { font-size: 11.5px; color: var(--m-text-soft); margin-top: 6px; }

/* ── Tabelas / listas ──────────────────────────────────────────────────── */
.m-table-head { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--m-muted-2); padding: 12px 22px; border-bottom: 1px solid var(--m-line-2); background: var(--m-soft-2); border-radius: var(--m-radius) var(--m-radius) 0 0; }
.m-row { align-items: center; font-size: 13px; padding: 14px 22px; border-bottom: 1px solid var(--m-line-3); transition: background .14s var(--m-ease); }
.m-row:last-child { border-bottom: none; }
.m-row:hover { background: var(--m-soft-2); }
.m-ini { width: 32px; height: 32px; border-radius: 99px; background: var(--m-teal-bg); color: var(--m-teal-2); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.m-badge { font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 3px 8px; }

/* ── Agenda ────────────────────────────────────────────────────────────── */
.m-agenda-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.m-slot { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 14px; padding: 13px 18px; border: 1px solid var(--m-line); border-radius: 12px; background: #fff; margin-bottom: 10px; box-shadow: var(--m-sh-xs); transition: box-shadow .18s var(--m-ease), transform .18s var(--m-ease), border-color .18s; }
.m-slot:hover { box-shadow: var(--m-sh); transform: translateY(-1px); border-color: #D3E0E0; }
.m-slot .hora { font-weight: 800; color: var(--m-teal-2); }
.m-slot .who { font-weight: 700; }
.m-slot .sub { font-size: 13px; color: var(--m-muted-2); }

/* ── Sala de espera ────────────────────────────────────────────────────── */
.m-queue { display: flex; flex-direction: column; gap: 10px; }
.m-queue .row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 14px 16px; }
.m-prio { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; }
.prio-urgencia { background: #F9E9E9; color: #B04343; }
.prio-gestante { background: #FDE9F1; color: #A0417A; }
.prio-idoso { background: #EAF0F1; color: #4A6165; }

/* ── PEP: abas ─────────────────────────────────────────────────────────── */
.m-tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.m-tab { border: 1px solid var(--m-line); border-bottom: none; background: var(--m-soft); color: var(--m-muted); border-radius: 10px 10px 0 0; padding: 10px 18px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.m-tab:hover { background: #fff; color: var(--m-text-soft); }
.m-tab.active { background: #fff; color: var(--m-teal-2); position: relative; }
.m-tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--m-aqua), var(--m-teal)); }
.m-tabpanel { background: #fff; border: 1px solid var(--m-line); border-radius: 0 14px 14px 14px; padding: 24px; box-shadow: var(--m-sh-sm); }
.m-vital { flex: 1; background: var(--m-soft-2); border: 1px solid var(--m-line); border-radius: 10px; padding: 10px 14px; }
.m-vital .label { font-size: 11px; color: var(--m-muted-2); }
.m-vital .value { font-size: 18px; font-weight: 800; margin-top: 2px; }
.m-chip { font-size: 12.5px; background: #F0F4F5; border: 1px solid var(--m-line); border-radius: 6px; padding: 5px 10px; }
.m-notas { background: #FBFAF6; border: 1px solid var(--m-gold-line); border-radius: 12px; padding: 16px 18px; }
.m-notas .m-input, .m-notas .m-textarea { border-color: #E3D9C2; }
.m-notas .m-input:focus, .m-notas .m-textarea:focus { border-color: var(--m-gold); }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.m-modal-backdrop { position: fixed; inset: 0; background: rgba(8,29,33,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: m-fade .18s var(--m-ease); }
.m-modal-backdrop > * { animation: m-rise .24s var(--m-ease) both; }

/* ── Login ─────────────────────────────────────────────────────────────── */
.m-auth { display: flex; height: 100vh; }
.m-auth .hero { width: 46%; flex: none; color: #fff; padding: 52px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
  background: linear-gradient(155deg,#0B2529 0%,#103F44 55%,#155A5C 100%); }
.m-auth .hero h1 { color: #fff; font-size: 33px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; max-width: 430px; }
.m-auth .au-bullets { display: flex; flex-direction: column; gap: 13px; margin-top: 28px; }
.m-auth .au-bullets > div { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: #DCEAE9; }
.m-auth .au-check { width: 24px; height: 24px; border-radius: 99px; background: rgba(47,168,164,.22); color: #5FD3CE; display: flex; align-items: center; justify-content: center; flex: none; font-size: 13px; }
.m-auth .au-stats { display: flex; gap: 30px; margin-top: 38px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.14); }
.m-auth .au-stats .n { font-size: 26px; font-weight: 800; }
.m-auth .au-stats .l { font-size: 12px; color: #8FB6B4; margin-top: 2px; }
.m-auth .au-sec { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #6FA09C; }
.m-auth .au-glow { position: absolute; border-radius: 99px; z-index: 0; pointer-events: none; }
.m-auth .au-glow-1 { top: -120px; right: -100px; width: 340px; height: 340px; background: radial-gradient(circle,rgba(47,168,164,.35),transparent 70%); }
.m-auth .au-glow-2 { bottom: -140px; left: -80px; width: 300px; height: 300px; background: radial-gradient(circle,rgba(47,168,164,.18),transparent 70%); }
.m-auth .panel { flex: 1; display: grid; place-items: center; padding: 40px; background: #fff; }
.m-auth .panel .box { width: 100%; max-width: 372px; }
.m-auth .panel h2 { font-size: 24px; margin-bottom: 6px; letter-spacing: -.01em; }
.m-auth .panel .lead { color: var(--m-muted); margin-bottom: 22px; font-size: 13.5px; }
@media (max-width: 860px) { .m-auth .hero { display: none; } }

/* ── Menu responsivo (off-canvas no celular) ─────────────────────────── */
.m-hamburger { display: none; width: 38px; height: 38px; border: 1px solid var(--m-line); background: var(--m-soft); border-radius: 9px; cursor: pointer; align-items: center; justify-content: center; flex: none; }
.m-hamburger .bi { font-size: 20px; }
.m-backdrop { display: none; }
/* Tablet: sidebar um pouco mais estreita, respiro reduzido */
@media (max-width: 1100px) and (min-width: 821px) {
  :root { --m-sidebar-w: 216px; }
  .m-content { padding: 22px 22px; }
}

/* Celular / tablet pequeno: sidebar off-canvas */
@media (max-width: 820px) {
  .m-hamburger { display: inline-flex; }
  .m-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: 264px;
    transform: translateX(-100%); transition: transform .26s var(--m-ease);
    box-shadow: var(--m-sh-lg);
  }
  .m-shell.menu-aberto .m-sidebar { transform: translateX(0); }
  .m-shell.menu-aberto .m-backdrop {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(8,29,33,.5); backdrop-filter: blur(2px);
    animation: m-fade .2s var(--m-ease);
  }
  .m-content { padding: 16px !important; }
  .m-topbar { padding: 12px 16px; }
  .m-topbar .title { font-size: 15.5px; }
  .m-kpis { gap: 12px; }
  .m-tabpanel { padding: 16px; border-radius: 0 12px 12px 12px; }
  .m-card-pad { padding: 16px 18px; }
}

/* Celular pequeno: KPIs em 2 colunas, botões cheios em barras de ação */
@media (max-width: 520px) {
  .m-kpis { grid-template-columns: 1fr 1fr; }
  .m-kpi .value { font-size: 23px; }
}

/* ── Micro-interações / utilidades ─────────────────────────────────────── */
@keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.m-content > * { animation: m-rise .28s var(--m-ease) both; }

/* Scrollbar discreta no conteúdo */
.m-content::-webkit-scrollbar { width: 10px; }
.m-content::-webkit-scrollbar-thumb { background: #CBD9D9; border: 3px solid var(--m-bg); border-radius: 99px; }
.m-content::-webkit-scrollbar-thumb:hover { background: #B4C6C6; }
