/* Telas do portal: login, empresas, DREs de uma empresa, equipe e conta. Cores de tokens.css. */

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.auth-brand {
  position: relative; overflow: hidden; background: var(--brand-gradient); color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px;
}
.auth-brand .logo { height: 46px; width: auto; align-self: flex-start; }
.auth-brand .pitch { position: relative; z-index: 1; max-width: 460px; }
.auth-brand h1 { font-family: var(--font-display); font-size: 40px; line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 14px; }
.auth-brand h1 em { font-style: normal; color: var(--brand-green); }
.auth-brand p { margin: 0; color: rgba(255, 255, 255, 0.74); font-size: var(--fs-lg); line-height: 1.5; }
.auth-brand .mark { position: absolute; right: -90px; bottom: -70px; width: 460px; opacity: 0.09; pointer-events: none; }
.auth-brand .foot { position: relative; z-index: 1; font-size: var(--fs-sm); color: rgba(255, 255, 255, 0.55); display: flex; gap: 18px; flex-wrap: wrap; }
.auth-brand .foot span { display: inline-flex; gap: 6px; align-items: center; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; position: relative; }
.auth-panel .theme-btn { position: absolute; top: 18px; right: 18px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h2 { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--brand-ink); }
.auth-card .lead { margin: -10px 0 0; color: var(--text-2); }

/* ---------- Formulários ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.field .hint { font-size: var(--fs-xs); color: var(--text-3); }
.field .input, .field .select, .field textarea { height: 40px; font-size: var(--fs-md); padding: 0 12px; border-radius: 9px; width: 100%; }
.field textarea { height: auto; min-height: 80px; padding: 10px 12px; border: 1px solid var(--border-strong); background: var(--surface); resize: vertical; font: inherit; }
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.form .btn.lg, .btn.lg { height: 42px; font-size: var(--fs-md); justify-content: center; padding: 0 18px; border-radius: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--bad-weak); color: var(--bad-text); font-size: var(--fs-sm); }
.form-error svg.i { margin-top: 2px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Portal (cabeçalho azul + conteúdo) ---------- */
.portal { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.portal-top { background: var(--sidebar-bg); color: #fff; }
.portal-top .bar { max-width: 1240px; margin: 0 auto; padding: 0 28px; height: 64px; display: flex; align-items: center; gap: 28px; }
.portal-top .logo { height: 30px; width: auto; display: block; }
.portal-nav { display: flex; gap: 4px; height: 100%; }
.portal-nav a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--sidebar-ink-2); font-weight: 500; }
.portal-nav a:hover { color: #fff; }
.portal-nav a.on { color: #fff; }
.portal-nav a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand-green); }
.portal-top .right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.portal-top .btn.ghost { color: var(--sidebar-ink-2); }
.portal-top .btn.ghost:hover { background: var(--sidebar-hover); color: #fff; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; color: #fff; border: 1px solid var(--sidebar-line); font-size: var(--fs-sm); font-weight: 500; }
.user-chip:hover { background: var(--sidebar-hover); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-green); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; flex: none; }
.portal-main { max-width: 1240px; width: 100%; margin: 0 auto; padding: 28px 28px 72px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--brand-ink); line-height: 1.15; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head .crumb { font-size: var(--fs-sm); color: var(--text-3); display: inline-flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.page-head .crumb a { color: var(--text-2); }
.page-head .crumb a:hover { color: var(--accent); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input { height: 36px; min-width: 260px; font-size: var(--fs-base); }

/* Empresas */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.company-card {
  text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-lg); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm); transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur);
}
.company-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow); transform: translateY(-1px); }
.company-card .head { display: flex; gap: 12px; align-items: center; }
.company-card .ini { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-weak); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-md); flex: none; }
.company-card h3 { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-card .sub { font-size: var(--fs-sm); color: var(--text-3); }
.company-card .figs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.company-card .figs > div { background: var(--surface-2); padding: 8px 10px; }
.company-card .figs .l { font-size: var(--fs-xs); color: var(--text-3); }
.company-card .figs .v { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.company-card .figs .v.neg { color: var(--bad-text); }
.company-card .figs .v.pos { color: var(--good-text); }
.company-card .foot { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); color: var(--text-3); gap: 8px; }

/* DREs de uma empresa */
.company-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.report-list { display: flex; flex-direction: column; }
.report-row { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.report-row:last-child { border-bottom: 0; }
.report-row:hover { background: var(--surface-hover); }
.report-row .file-ic { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-green-weak); color: var(--brand-green-2); font-weight: 700; font-size: 11px; flex: none; }
.report-row .main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.report-row .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-row .fmeta { font-size: var(--fs-sm); color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.report-row .nums { display: flex; gap: 18px; font-variant-numeric: tabular-nums; text-align: right; }
.report-row .nums .l { font-size: var(--fs-xs); color: var(--text-3); }
.report-row .nums .v { font-weight: 650; }
.report-row .nums .v.neg { color: var(--bad-text); }
.report-row .row-actions { display: flex; gap: 4px; }
.side-stack { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.mini-drop { border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); padding: 22px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; cursor: pointer; transition: border-color var(--dur), background var(--dur); }
.mini-drop:hover, .mini-drop.drag { border-color: var(--brand-green); background: color-mix(in srgb, var(--brand-green) 5%, var(--surface)); }
.mini-drop .dz-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-green-weak); color: var(--brand-green-2); }
.mini-drop .dz-icon svg.i { width: 22px; height: 22px; }
.mini-drop h3 { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; }
.mini-drop p { margin: 0; color: var(--text-3); font-size: var(--fs-sm); }
.mini-drop input { display: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--fs-sm); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

/* Equipe */
.role-pill { font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-2); }
.role-pill.admin { background: var(--accent-weak); color: var(--accent); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: var(--overlay); z-index: 70; display: grid; place-items: center; padding: 20px; animation: fade var(--dur) var(--ease); }
.modal { width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); animation: fadeup var(--dur) var(--ease); }
.modal-h { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-h h3 { margin: 0; font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; }
.modal-h p { margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-sm); }
.modal-b { padding: 18px 22px 22px; }

/* Carregando */
.center-load { min-height: 60vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--accent-weak); border-top-color: var(--brand-green); animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .spinner { width: 14px; height: 14px; border-width: 2px; }

@media (max-width: 1000px) {
  .company-layout { grid-template-columns: 1fr; }
  .side-stack { position: static; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 24px; min-height: 0; gap: 28px; }
  .auth-brand h1 { font-size: 28px; }
  .auth-brand .mark { width: 260px; right: -60px; bottom: -50px; }
  .portal-top .bar { padding: 0 16px; gap: 14px; }
  .portal-top .logo { height: 24px; }
  .portal-main { padding: 20px 16px 56px; }
  .user-chip .nm { display: none; }
  .report-row { flex-wrap: wrap; }
  .report-row .nums { width: 100%; justify-content: flex-start; padding-left: 52px; }
  .form-row { grid-template-columns: 1fr; }
  .toolbar .input { min-width: 0; flex: 1; }
}
@media (max-width: 560px) {
  .portal-nav a span { display: none; }
}
