/* ============================================================
   Tools — shell (login, sidebar, topbar, componentes base)
   ============================================================ */

/* ── Botões ─────────────────────────────────────────────── */
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:hover { box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn--gold:hover { background: #8f7a57; }
.btn--navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.btn--sm { padding: 7px 12px; font-size: 12px; }

.icon-btn {
  background: transparent; border: 0; color: inherit;
  width: 34px; height: 34px; border-radius: 8px;
  font-size: 16px; display: grid; place-items: center;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }

/* ── Campos ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.field input, .field select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}
.field input:focus, .field select:focus { border-color: var(--gold); outline: none; }

/* ── Login (identidade ConVert) ─────────────────────────── */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(165deg, #1c2332 0%, var(--navy) 50%, #313c5e 100%);
  padding: 32px 16px;
}
.login__card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(5,12,30,.45);
  padding: 34px 30px 24px;
}

/* logo */
.login__logo { display: flex; align-items: center; justify-content: center; }
.login__logoimg { width: 232px; max-width: 78%; height: auto; display: block; }
.login__rule { height: 2px; background: var(--gold); border-radius: 2px; margin: 22px 0 24px; }

/* campos */
.login__form { display: flex; flex-direction: column; }
.lf { display: flex; flex-direction: column; margin-bottom: 18px; }
.lf__label { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: #2b3240; text-transform: uppercase; margin-bottom: 7px; }
.lf__input {
  width: 100%; box-sizing: border-box;
  background: #eef0f8; border: 1.5px solid #e0e3ee; border-radius: 11px;
  padding: 13px 14px; font-size: 15px; color: var(--text);
}
.lf__input:focus { outline: none; border-color: var(--navy); }
.lf__wrap { position: relative; }
.lf__wrap .lf__input { padding-right: 44px; }
.lf__eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--gold);
  font-size: 18px; line-height: 1; padding: 4px; opacity: .85;
}
.lf__eye--on { opacity: 1; }

/* botões */
.login__entrar {
  width: 100%; margin-top: 6px;
  background: var(--navy); color: #fff; border: 0; border-radius: 11px;
  padding: 15px; font-size: 14px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; transition: background .15s;
}
.login__entrar:hover { background: var(--navy-soft); }
.login__entrar:disabled { opacity: .7; }
.login__cadastro {
  width: 100%; margin-top: 12px;
  background: var(--surface); color: var(--gold);
  border: 1.5px solid var(--gold); border-radius: 11px;
  padding: 13px; font-size: 14px; font-weight: 700; transition: background .15s;
}
.login__cadastro:hover { background: #fbf8f2; }

/* aviso + consentimento + rodapé */
.login__hint { text-align: center; font-size: 12px; color: #9b855f; margin: 18px 0; font-weight: 500; }
.login__consent {
  display: flex; gap: 9px; align-items: flex-start; cursor: pointer;
  background: #fbfbfe; border: 1px solid #e6e8f1; border-radius: 11px; padding: 12px 13px;
}
.login__consent input { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--gold); flex-shrink: 0; }
.login__consent span { font-size: 11.5px; line-height: 1.5; color: var(--text-soft); }
.login__consent b { color: var(--navy); }
.login__footer { text-align: center; color: #9aa1ad; font-size: 10.5px; margin-top: 18px; }

/* ── Shell / layout ─────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #e8ebf2;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  flex-shrink: 0;
  transition: width .22s ease;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 9px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: transparent; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; cursor: pointer; text-align: left;
}
.sidebar__brand:hover { background: rgba(255,255,255,.04); }
.sidebar__logoimg { height: 30px; width: auto; display: block; }
.sidebar__sys {
  font-size: 10px; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 2px;
}

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav__group { margin-bottom: 18px; }
.nav__label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--gold-soft);
  padding: 4px 10px 8px;
}
.nav__item {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 0; color: #cdd4e1;
  padding: 9px 11px; border-radius: 9px;
  font-size: 13px; font-weight: 500;
  transition: background .14s, color .14s;
}
.nav__item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav__item--active { background: rgba(168,144,104,.2); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav__ico { font-size: 15px; width: 18px; text-align: center; }
.nav__empty { color: rgba(255,255,255,.5); font-size: 12px; padding: 12px; }

.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: #2a2113;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 11px; color: var(--gold-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 5;
}
.topbar__menu { display: grid; color: var(--navy); }
.topbar__title { font-weight: 700; font-size: 15px; color: var(--navy); }

.view { flex: 1; padding: 26px; overflow-y: auto; }

.placeholder { display: grid; place-items: center; height: 60vh; color: var(--text-faint); text-align: center; }
.placeholder__big { font-size: 40px; font-weight: 800; color: var(--navy); opacity: .12; }

/* ── Toasts ─────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; right: 18px; bottom: 18px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  background: var(--navy);
}
.toast--show { opacity: 1; transform: translateY(0); }
.toast--erro { background: #b3261e; }
.toast--ok { background: #2e7d32; }
.toast--info { background: var(--navy); }

/* ── Sidebar recolhível (desktop) ───────────────────────── */
@media (min-width: 821px) {
  .sidebar { overflow: hidden; }
  .shell--collapsed .sidebar { width: 0; border-right: 0; }
}

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0;
    transform: translateX(-100%); transition: transform .22s;
    box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  .sidebar--open { transform: translateX(0); }
  .topbar__menu { display: grid; }
}

/* ── Componentes compartilhados (tabela, badge, pill) ───── */
.tbl-wrap { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); overflow:auto; }
table.cz-tbl { width:100%; border-collapse:collapse; font-size:12.5px; }
.cz-tbl th { background:var(--navy); color:#fff; text-align:left; padding:10px 12px; font-weight:600; white-space:nowrap; }
.cz-tbl td { padding:9px 12px; border-bottom:1px solid var(--line); color:var(--text); }
.cz-tbl tr:nth-child(even) td { background:var(--surface-alt); }
.badge { display:inline-block; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:700; }
.badge.ok{ background:var(--ok-bg); color:var(--ok-fg); }
.badge.nao{ background:var(--err-bg); color:var(--err-fg); }
.badge.cancelada{ background:var(--canc-bg); color:var(--canc-fg); }
.badge.entrada{ background:var(--ent-bg); color:var(--ent-fg); }
.badge.div-valor,.badge.div-status{ background:var(--div-bg); color:var(--div-fg); }
.pill { display:inline-block; background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:5px 12px; font-size:12px; font-weight:600; color:var(--text-soft); }

/* ── Administração de usuários ──────────────────────────── */
.adm { max-width:980px; margin:0 auto; }
.adm__head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.adm__title { font-size:20px; font-weight:700; color:var(--navy); }
.adm__desc { color:var(--text-soft); font-size:13px; margin-top:4px; }
.adm__acoes { display:flex; gap:6px; white-space:nowrap; }
.adm__card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:20px; margin-bottom:18px; box-shadow:var(--shadow-soft); }
.adm__card-t { font-weight:700; color:var(--navy); margin-bottom:14px; font-size:15px; }
.adm__grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; }
.adm__setores { margin-top:16px; }
.adm__checks { display:flex; flex-wrap:wrap; gap:14px; margin-top:8px; }
.check { display:flex; align-items:center; gap:7px; font-size:13px; color:var(--text); cursor:pointer; }
.check input { width:16px; height:16px; accent-color:var(--gold); }
.check--admin { font-weight:600; color:var(--navy); border-left:1px solid var(--line); padding-left:14px; }
.adm__form-acoes { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }

/* ── Tela inicial (home) ────────────────────────────────── */
.nav__item--inicio { margin-bottom: 12px; }
.home { max-width: 920px; margin: 0 auto; }
.home-hero {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 30px; margin-bottom: 26px;
  box-shadow: var(--shadow-soft); text-align: center;
}
.home-hero__logo { height: 56px; width: auto; display: inline-block; }
.home-hero__rule { height: 2px; width: 64px; background: var(--gold); border-radius: 2px; margin: 18px auto; }
.home-hero__title { font-size: 24px; font-weight: 700; color: var(--navy); margin: 0 0 8px; }
.home-hero__sub { color: var(--text-soft); font-size: 14px; line-height: 1.6; margin: 0 auto; max-width: 560px; }
.home-hero__sub b { color: var(--navy); }
.home-sec {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-faint); margin: 0 0 12px 4px;
}
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.home-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .08s;
}
.home-card:hover { border-color: var(--gold-soft); box-shadow: var(--shadow); transform: translateY(-1px); }
.home-card:active { transform: translateY(0); }
.home-card__ico {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--surface-alt); border: 1px solid var(--line);
}
.home-card--adm .home-card__ico { background: rgba(168,144,104,.12); border-color: var(--gold-soft); }
.home-card__body { display: flex; flex-direction: column; min-width: 0; }
.home-card__nome { font-weight: 700; font-size: 14px; color: var(--navy); line-height: 1.25; }
.home-card__setor { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.home-empty { color: var(--text-faint); font-size: 14px; padding: 30px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
