/* OMR Studio — camada fina sobre o Metronic 8 (style.bundle.css vendorizado).
   Shell de administração: MENU HORIZONTAL no topo + barra de ferramentas +
   conteúdo. Theme-aware: tudo em variáveis do Metronic (--bs-*), que têm valores
   claros e escuros sob [data-bs-theme]. */

.omr-body { background: var(--bs-page-bg, #f5f8fa); min-height: 100vh; }
.omr-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Barra superior (menu horizontal) ─────────────────────────────────────── */
.omr-topnav {
  position: sticky; top: 0; z-index: 100; background: var(--bs-body-bg, #fff);
  border-bottom: 1px solid var(--bs-border-color, #eef0f4);
}
.omr-topnav-inner {
  max-width: 1280px; margin: 0 auto; height: 66px; padding: 0 32px;
  display: flex; align-items: center; gap: 24px;
}
.omr-brand { font-size: 21px; font-weight: 800; letter-spacing: -.4px; text-decoration: none; white-space: nowrap; color: var(--bs-gray-900); }
.omr-brand span { color: var(--bs-primary); }

.omr-menu { display: flex; align-items: center; gap: 6px; flex: 1; }
.omr-menu-item {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px; border-radius: 9px;
  color: var(--bs-gray-600); font-weight: 600; font-size: 14px; text-decoration: none; transition: .15s; white-space: nowrap;
}
.omr-menu-item:hover { background: var(--bs-gray-100); color: var(--bs-gray-900); }
.omr-menu-item.active { background: var(--bs-primary); color: #fff; box-shadow: 0 4px 14px -5px rgba(27,132,255,.7); }
.omr-menu-item svg { width: 18px; height: 18px; opacity: .9; flex-shrink: 0; }

.omr-topnav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.omr-theme { color: var(--bs-gray-700); background: var(--bs-gray-100); border: none; }
.omr-theme:hover { color: var(--bs-gray-900); background: var(--bs-gray-200); }
/* claro → mostra lua (clicar p/ escuro); escuro → mostra sol (clicar p/ claro) */
.omr-theme .ic-sun { display: none; }
[data-bs-theme="dark"] .omr-theme .ic-sun { display: inline-flex; }
[data-bs-theme="dark"] .omr-theme .ic-moon { display: none; }

.omr-user { display: flex; align-items: center; gap: 10px; padding-left: 4px; }
.omr-avatar {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; background: var(--bs-primary);
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.omr-user-info { line-height: 1.15; max-width: 170px; }
.omr-user-name { color: var(--bs-gray-900); font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.omr-user-org { color: var(--bs-gray-500); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.omr-navtoggle { display: none !important; color: var(--bs-gray-700); background: var(--bs-gray-100); border: none; }

/* ── Barra de ferramentas ─────────────────────────────────────────────────── */
.omr-toolbar { background: var(--bs-body-bg, #fff); border-bottom: 1px solid var(--bs-border-color, #eef0f4); }
.omr-toolbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.omr-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.omr-page-title { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -.3px; color: var(--bs-gray-900); }
.omr-crumbs { font-size: 12.5px; color: var(--bs-gray-600); margin-bottom: 2px; }
.omr-crumbs a { color: var(--bs-gray-600); text-decoration: none; }
.omr-crumbs a:hover { color: var(--bs-primary); }

.omr-content { flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; padding: 28px 32px 60px; }

/* ── Responsivo: menu vira painel abrível ─────────────────────────────────── */
@media (max-width: 850px) {
  .omr-navtoggle { display: inline-flex !important; order: -1; }
  .omr-menu {
    position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bs-body-bg, #fff); border-bottom: 1px solid var(--bs-border-color, #eef0f4);
    padding: 12px 20px 16px; gap: 4px; display: none; z-index: 99;
  }
  body.omr-menu-open .omr-menu { display: flex; }
  .omr-user-info { display: none; }
  .omr-topnav-inner, .omr-toolbar-inner, .omr-content { padding-left: 18px; padding-right: 18px; }
}

/* Grelha de alternativas (gabarito / revisão) — reaproveita o app.js */
.opts { display: inline-flex; gap: 5px; }
.opt {
  width: 32px; height: 32px; border: 1px solid var(--bs-gray-300); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  font-weight: 700; font-size: 13px; color: var(--bs-gray-600); background: var(--bs-body-bg, #fff); user-select: none;
}
.opt:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.opt.sel { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.opt.correct { background: var(--bs-success); border-color: var(--bs-success); color: #fff; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--bs-gray-200); border-radius: 8px; }
.qrow .qn { width: 30px; font-weight: 700; color: var(--bs-gray-500); font-variant-numeric: tabular-nums; }

/* Barras (histograma / análise) em HTML/CSS puro */
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.bar-row .lbl { width: 96px; color: var(--bs-gray-600); font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; background: var(--bs-gray-100); border-radius: 6px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--bs-primary); border-radius: 6px; min-width: 3px; }
.bar-row .n { width: 34px; text-align: right; font-weight: 600; color: var(--bs-gray-800); }
.dist { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.dist span { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--bs-gray-100); color: var(--bs-gray-600); }
.dist span.hit { background: var(--bs-success-light); color: var(--bs-success); font-weight: 700; }

/* Toast (app.js) */
.toast-omr {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--bs-gray-900); color: #fff; padding: 11px 20px; border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); opacity: 0; transition: .2s; pointer-events: none; z-index: 200;
}
.toast-omr.show { opacity: 1; }

/* ── Autenticação (Fase 5) — card clássico centrado ────────────────────────
   Componentes do Metronic (card, form-control-solid, btn, alert); aqui só o
   enquadramento centrado sobre um fundo suave. */
.omr-auth-body {
  background:
    radial-gradient(1000px 500px at 50% -10%, rgba(27,132,255,.10), transparent 60%),
    var(--bs-page-bg, #f5f8fa);
  min-height: 100vh;
}
.omr-theme-fixed { position: fixed; top: 20px; right: 20px; z-index: 10; }
.omr-auth-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.omr-auth-box { width: 100%; max-width: 440px; }
.omr-auth-logo {
  display: block; text-align: center; font-size: 26px; font-weight: 800; letter-spacing: -.5px;
  color: var(--bs-gray-900); text-decoration: none; margin-bottom: 24px;
}
.omr-auth-logo span { color: var(--bs-primary); }
.omr-auth-card { border: 0; border-radius: 16px; box-shadow: 0 20px 50px -24px rgba(15,18,25,.35); }
.omr-auth-titulo { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 6px; color: var(--bs-gray-900); }
.omr-auth-sub { color: var(--bs-gray-600); font-size: 14.5px; line-height: 1.6; margin: 0 0 26px; }
.omr-auth-form .form-label { font-weight: 600; font-size: 13.5px; }
.omr-auth-rodape { text-align: center; margin-top: 26px; color: var(--bs-gray-500); font-size: 12.5px; }
