@import url('./base.css');

/* Identity — app-specific styles (somente variáveis do base.css) */
[hidden] { display: none !important; }
.hint { font-size: .78rem; color: var(--muted); font-weight: 400; line-height: 1.4; }
.hint.ok { color: var(--accent); }
.hint.bad { color: var(--red); }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
code { font-size: .82rem; }
a { color: var(--blue); }
textarea.input { resize: vertical; font-family: inherit; line-height: 1.4; width: 100%; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }

/* ── telas de login e conta ─────────────────────────────────────────── */
body.auth { overflow: auto; height: auto; min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-box { width: 400px; max-width: 100%; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.auth-brand img { width: 28px; height: 28px; }
.auth-title { font-size: 1.25rem; font-weight: 700; }
.auth-sub { font-size: 1rem; font-weight: 700; margin-top: 10px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .input { width: 100%; }
.auth-form .btn-primary { width: 100%; justify-content: center; }
.auth-foot { text-align: center; margin-top: 4px; }
.input-code { letter-spacing: .25em; font-size: 1.1rem; text-align: center; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: .85rem; line-height: 1.4; border: 1px solid; }
.alert-error { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); background: color-mix(in srgb, var(--red) 10%, transparent); }
.alert-warn { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 45%, transparent); background: color-mix(in srgb, var(--yellow) 10%, transparent); }
.alert-ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .75rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.providers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-provider { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text); text-decoration: none; font-size: .85rem; }
.btn-provider:hover { border-color: var(--muted); }
.btn-provider img { width: 16px; height: 16px; }
.btn-provider .badge { font-size: .62rem; padding: 1px 6px; }
.tbd { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.steps { padding-left: 18px; font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.qr { display: flex; justify-content: center; }
.qr img { border-radius: 8px; background: var(--surface); }
.secret { word-break: break-all; color: var(--text); }
.codes { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.codes code { display: block; padding: 6px 8px; background: var(--surface2); border-radius: 6px; text-align: center; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .88rem; }
.facts dt { color: var(--muted); }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }
a.btn-primary, a.btn-primary-sm, a.btn-sm { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* ── console de admin ───────────────────────────────────────────────── */
body:not(.can-write) .write-only { display: none !important; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 4px; }
.sidebar-nav { flex: 1; }
.sidebar-user { border-top: 1px solid var(--border); padding: 12px 8px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .8rem; color: var(--muted); }
#me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.view { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 1240px; margin: 0 auto; min-width: 0; }
.ribbon { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ribbon-sep { width: 1px; height: 22px; background: var(--border); }
.input-search { width: 220px; max-width: 100%; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters .input { flex: 1 1 180px; min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 6px 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); cursor: pointer; }
.form-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.form-group .input { width: 100%; }
.inline-add { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.inline-add .input { flex: 1 1 160px; min-width: 0; }
.input-num { flex: 0 0 90px !important; }
.item-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface2); border-radius: 8px; font-size: .85rem; flex-wrap: wrap; }
.item > span:not(.badge), .item > strong { flex: 1 1 auto; min-width: 0; }
.role-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.role-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .88rem; }
.role-head strong { flex: 1 1 auto; }
.secret-box { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 10px; background: var(--surface2); border-radius: 8px; }
.secret-box code { flex: 1; word-break: break-all; color: var(--text); }
.related-tabs { padding: 0 20px; }
.tabulator .tabulator-cell.mono { font-size: .8rem; }

/* ── tela de acesso embutida no app (iframe) ─────────────────────────── */
body.embed { overflow: auto; height: auto; min-height: 100vh; }
.embed-main { display: flex; flex-direction: column; gap: 10px; padding: 16px; max-width: 1240px; margin: 0 auto; min-width: 0; }
.embed-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.embed-title { font-size: 1.15rem; font-weight: 700; }
.embed-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; min-width: 0; }
.embed-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.embed-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.embed-note { width: 420px; max-width: 100%; padding: 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.embed-main .related-tabs { padding: 0; }
.role-head .check { margin-left: auto; }

@media (max-width: 820px) {
  .layout { flex-direction: column; height: auto; }
  body.admin { overflow: auto; height: auto; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; }
  .sidebar-logo { border: 0; margin: 0; padding: 6px 10px; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 100%; }
  .sidebar-nav .nav-divider { display: none; }
  .sidebar-user { border: 0; padding: 4px 8px; }
  .main { overflow: visible; }
  .providers { grid-template-columns: 1fr; }
}
