/* ==========================================================================
   Hub Bertolini Advogados — estilos
   CSS próprio, sem Tailwind/CDN: nada de terceiros é baixado para montar o
   visual, e qualquer ajuste de cor/fonte é feito nas variáveis abaixo.
   ========================================================================== */

:root {
  --ink: #1c1c1c;        /* preto do logo */
  --ink-2: #2b2b2b;
  --stone: #5f5f5f;      /* texto secundário */
  --mist: #9a9a9a;       /* rótulos */
  --line: #e7e4df;       /* bordas */
  --line-2: #d6d2cb;
  --paper: #f6f5f2;      /* fundo (off-white quente) */
  --card: #ffffff;
  --ok: #2f7a4f;   --ok-bg: #e8f3ec;
  --warn: #946312; --warn-bg: #fbf1de;
  --bad: #b23b3b;  --bad-bg: #fbeaea;
  --info: #3a5a80; --info-bg: #e9eff6;
  --radius: 14px;
  --font-head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ---------- utilitários ---------- */
.muted { color: var(--stone); }
.faint { color: var(--mist); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 600; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row-center { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.error-text { color: var(--bad); font-size: 13px; margin-top: 8px; }
.ok-text { color: var(--ok); font-size: 13px; }
.eyebrow {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist);
}

.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- login ---------- */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(120% 90% at 50% 0%, #2e2e2e 0%, #1c1c1c 55%, #121212 100%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 20px;
  padding: 44px 36px 32px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.login-card .logo { width: 180px; margin: 0 auto 28px; }
.login-card h1 { font-size: 18px; margin-bottom: 4px; }
.btn-microsoft {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  padding: 13px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-microsoft:hover { background: #3a3a3a; }

/* ---------- cabeçalho ---------- */
.app-header { background: var(--ink); color: #fff; }
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; text-align: left; color: #fff; min-width: 0; }
.brand .icon { width: 34px; height: 34px; flex: none; }
.brand .wordmark { height: 26px; width: auto; }
.brand .hub-label { border-left: 1px solid rgba(255,255,255,0.25); padding-left: 14px; }
.brand .hub-label .eyebrow { color: rgba(255,255,255,0.55); }
.brand .hub-label p:last-child { font-size: 13px; color: rgba(255,255,255,0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .brand .wordmark { display: none; } .brand .hub-label { border-left: 0; padding-left: 0; } }
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.header-link {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.header-link:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.header-link.plain { border-color: transparent; }

main { max-width: 1080px; margin: 0 auto; padding: 28px 16px 64px; }

/* ---------- cartões e listas ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card.flush { padding: 0; }
.card-title { font-family: var(--font-head); font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.card-head { padding: 18px 22px 0; }
.list > * + * { border-top: 1px solid var(--line); }
.list-item { padding: 14px 22px; }
.empty { padding: 18px 22px; color: var(--mist); font-size: 14px; }

.page-title { font-size: 24px; margin-top: 10px; }
.page-sub { color: var(--stone); margin: 4px 0 22px; }
.section-label { margin: 28px 0 10px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--stone);
  text-decoration: none;
}
.back-link:hover { color: var(--ink); }
.back-link svg { width: 16px; height: 16px; }

/* ---------- formulários ---------- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: 12px; color: var(--stone); }
.input, .select, .textarea {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  background: #fff;
  min-width: 0;
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
.textarea { width: 100%; resize: vertical; }
.w-full { width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #3a3a3a; }
.btn-outline { border-color: var(--line-2); background: #fff; }
.btn-outline:hover:not(:disabled) { border-color: var(--ink); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.1); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.link-btn { font-size: 13px; color: var(--stone); }
.link-btn:hover { color: var(--ink); text-decoration: underline; }
.link-danger { font-size: 13px; color: var(--bad); }
.link-danger:hover { text-decoration: underline; }
.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fff;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  background: #f0eeea;
  color: var(--stone);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.dark { background: var(--ink); color: #fff; }

.score {
  width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--stone);
}
.score.pos { color: var(--ok); border-color: #b9dcc6; background: var(--ok-bg); }
.score.neg { color: var(--bad); border-color: #ecc2c2; background: var(--bad-bg); }
.score-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.score-picker button { width: 36px; height: 36px; }
.score-picker button.none { width: auto; padding: 0 12px; border-radius: 999px; font-size: 12px; }
.score-picker button.active { outline: 2px solid var(--ink); outline-offset: 1px; }

.avatar {
  width: 38px; height: 38px; flex: none;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
}

/* ---------- início ---------- */
.hello { font-size: 26px; }
.alert-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.alert-bar.warn { background: var(--warn-bg); color: var(--warn); }
.alert-bar.info { background: var(--info-bg); color: var(--info); }
.alert-bar:hover { filter: brightness(0.98); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .eyebrow { margin-bottom: 8px; }
.stat-value { font-family: var(--font-head); font-weight: 600; font-size: 17px; line-height: 1.3; }
.stat-sub { font-size: 13px; color: var(--stone); margin-top: 2px; }

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
}
.tile:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 12px 28px rgba(0,0,0,0.07); }
.tile-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.tile-icon svg { width: 21px; height: 21px; }
.tile-title { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.tile-desc { font-size: 13px; color: var(--stone); line-height: 1.45; }
.tile-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.tile-wide .tile-icon { background: #fff; color: var(--ink); margin: 0; flex: none; }
.tile-wide .tile-desc { color: rgba(255,255,255,0.7); }
.tile-wide .tile-arrow { font-size: 20px; color: rgba(255,255,255,0.7); flex: none; }
.tile-wide:hover { border-color: var(--ink); box-shadow: 0 12px 28px rgba(0,0,0,0.18); }

/* ---------- calendário de férias (mês) ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; color: var(--mist); text-align: center; padding-bottom: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.cal-day {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 5px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.cal-day.out { background: transparent; border-color: transparent; }
.cal-day.weekend { background: #faf9f7; }
.cal-day.holiday { background: #f3f1ec; }
.cal-day.today { border-color: var(--ink); }
.cal-num { font-size: 11px; color: var(--stone); }
.cal-chip {
  font-size: 10px;
  line-height: 1.5;
  border-radius: 4px;
  padding: 0 4px;
  background: var(--ink);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-chip.pending { background: var(--warn-bg); color: var(--warn); }
.cal-more { font-size: 10px; color: var(--stone); }
@media (max-width: 520px) { .cal-day { min-height: 48px; } .cal-chip { font-size: 9px; padding: 0 2px; } }

.balance-big { font-family: var(--font-head); font-size: 34px; font-weight: 600; line-height: 1.1; }
.meter { height: 6px; background: #eeebe6; border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ink); }

/* ---------- sala de reuniões (linha do tempo do dia) ---------- */
.day-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline { position: relative; border-left: 1px solid var(--line); margin-left: 52px; }
.tl-hour {
  height: 44px;
  border-top: 1px solid var(--line);
  position: relative;
  cursor: pointer;
}
.tl-hour:hover { background: #faf9f7; }
.tl-hour span {
  position: absolute;
  left: -52px;
  top: -9px;
  width: 44px;
  text-align: right;
  font-size: 11px;
  color: var(--mist);
}
.tl-block {
  position: absolute;
  left: 8px;
  right: 8px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 4px 10px;
  font-size: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.tl-block.mine { background: #4a4a4a; }
.tl-block .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--bad); z-index: 2; }
.tl-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 999px; background: var(--bad); }

/* ---------- links úteis ---------- */
.astrea-card { background: var(--ink); color: #fff; border-color: var(--ink); }
.astrea-card .muted { color: rgba(255,255,255,0.7); }
.astrea-card .btn-primary { background: #fff; color: var(--ink); }
.astrea-card .btn-primary:hover { background: #e9e9e9; }
.astrea-card details summary { cursor: pointer; font-size: 14px; color: rgba(255,255,255,0.85); }
.astrea-card ol { margin: 10px 0 0; padding-left: 20px; color: rgba(255,255,255,0.8); font-size: 14px; }
.astrea-card ol li + li { margin-top: 4px; }
.link-row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; text-decoration: none; }
.link-row:hover .link-title { text-decoration: underline; }
.link-title { font-weight: 500; }
.ext { width: 14px; height: 14px; color: var(--mist); flex: none; }

/* ---------- regras recolhíveis ---------- */
details.rules summary { cursor: pointer; font-weight: 500; font-size: 14px; list-style: none; display: flex; justify-content: space-between; }
details.rules summary::-webkit-details-marker { display: none; }
details.rules summary::after { content: "Ver ▾"; color: var(--stone); font-weight: 400; font-size: 13px; }
details.rules[open] summary::after { content: "Ocultar ▴"; }
details.rules ul { margin: 12px 0 0; padding-left: 20px; color: var(--stone); font-size: 14px; }
details.rules li + li { margin-top: 6px; }

/* ---------- tabela simples ---------- */
.table-wrap { overflow-x: auto; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mist); font-weight: 600; padding: 10px 22px; border-bottom: 1px solid var(--line); }
table.simple td { padding: 12px 22px; border-bottom: 1px solid var(--line); }
table.simple tr:last-child td { border-bottom: 0; }
table.simple tr.clickable { cursor: pointer; }
table.simple tr.clickable:hover td { background: #faf9f7; }

/* ---------- aviso flutuante ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--bad); }
