:root {
  /* Paleta Senac: azul institucional + laranja de acento */
  --bg: #eaf1f8;
  --bg-2: #dfeaf5;
  --surface: #ffffff;
  --ink: #12263f;
  --muted: #5a6b80;
  --blue: #0060a9;
  --blue-700: #004e8c;
  --blue-900: #013a6b;
  --orange: #f28c1e;
  --orange-soft: #fdefdc;
  --orange-ink: #9a5400;
  --rust: #c0492f;
  --line: #d6e0ea;
  --line-soft: #e8eef5;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(18,38,63,.05), 0 10px 30px rgba(18,38,63,.07);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* ---- Logo Senac (imagem oficial) ---- */
.senac-logo { display: block; height: 40px; width: auto; }
/* Na topbar azul usamos a versão branca do logo, sem caixa */
.brand .senac-logo { height: 42px; }

/* ---- Top bar ---- */
.topbar {
  background: linear-gradient(120deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--blue) 100%);
  color: #eaf3fb;
}
.topbar .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 72px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; color: #fff; text-decoration: none; margin-right: auto; }
.brand .divider { width: 1px; height: 34px; background: rgba(255,255,255,.28); }
.brand .app { display: flex; flex-direction: column; line-height: 1.15; }
.brand .app b { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand .app small { font-size: 11.5px; color: #a9cbe8; letter-spacing: .03em; text-transform: uppercase; }

.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a, .nav button {
  font: inherit; font-size: 14px; color: #d3e5f6; text-decoration: none;
  padding: 8px 13px; border-radius: 10px; border: 0; background: transparent; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.10); color: #fff; }
.nav a.active { background: rgba(255,255,255,.16); color: #fff; }

/* ---- Área de perfil (separada do menu principal) ---- */
.profile-area {
  position: relative; margin-left: 14px; padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.20);
}
.profile-area > summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  font: inherit; cursor: pointer; padding: 6px 10px 6px 6px; border-radius: 999px;
}
.profile-area > summary::-webkit-details-marker { display: none; }
.profile-area > summary::after { content: '▾'; font-size: 10px; color: #a9cbe8; margin-left: 2px; }
.profile-area:hover > summary, .profile-area[open] > summary { background: rgba(255,255,255,.10); }
.profile-area .avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--orange); color: #fff;
  font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: -.02em;
}
.profile-area .profile-name { font-size: 14px; color: #eaf3fb; font-weight: 500; }
.profile-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 20;
  display: flex; flex-direction: column; min-width: 190px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.profile-menu a, .profile-menu button {
  font: inherit; font-size: 14px; color: var(--ink); text-decoration: none; text-align: left;
  padding: 9px 12px; border-radius: 8px; border: 0; background: transparent; cursor: pointer;
}
.profile-menu a:hover, .profile-menu button:hover { background: var(--line-soft); }
.profile-menu a.active { color: var(--blue); font-weight: 600; }
.profile-menu form { display: contents; }

/* faixa/onda sob a topbar */
.wavebar { height: 8px; background: var(--orange); position: relative; overflow: hidden; }
.wavebar svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---- Page ---- */
main { padding: 34px 0 72px; }
.page-title { font-family: var(--display); font-weight: 600; font-size: 27px; letter-spacing: -.02em; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 26px; font-size: 15px; max-width: 68ch; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px;
}
.card + .card { margin-top: 22px; }
.card h2 { font-family: var(--display); font-size: 16px; font-weight: 600; margin: 0 0 18px; letter-spacing: -.01em; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title-row h2 { margin: 0; }

.layout-sim { display: grid; gap: 22px; align-items: start; }
@media (min-width: 820px) { .layout-sim { grid-template-columns: 420px 1fr; } }

.grid { display: grid; gap: 22px; }
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }

/* ---- Forms ---- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field { margin-bottom: 18px; }
input[type=text], input[type=email], input[type=password], input[type=number] {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink);
  background: #fbfdff; border: 1px solid var(--line); border-radius: 11px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,96,169,.15); background: #fff; }

/* Campo herói: horas */
.hours-field { margin-bottom: 22px; }
.hours-box {
  display: flex; align-items: baseline; gap: 10px;
  background: linear-gradient(180deg, #f4f9ff, #ecf4fd);
  border: 1.5px solid #cfe0f1; border-radius: 14px; padding: 14px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.hours-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,96,169,.14); }
.hours-box input {
  border: 0; background: transparent; padding: 0; width: 100%;
  font-family: var(--mono); font-size: 40px; font-weight: 700; color: var(--blue-900); letter-spacing: -.02em;
}
.hours-box input:focus { box-shadow: none; }
.hours-box .unit { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--muted); }

.prefix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fbfdff; }
.prefix:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,96,169,.15); }
.prefix span { display: flex; align-items: center; padding: 0 13px; background: var(--line-soft); color: var(--muted); font-size: 14px; font-family: var(--mono); }
.prefix input { border: 0; box-shadow: none; background: transparent; border-radius: 0; }
.prefix input:focus { box-shadow: none; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } }

.opt-block {
  border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; background: #fcfdff;
}
.check { display: flex; align-items: flex-start; gap: 10px; }
.check input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--blue); }
.check label { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-family: var(--display); font-weight: 600; font-size: 15px;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-ghost { background: #fff; color: var(--blue); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { color: var(--rust); border-color: #e6c6bd; background: #fff; }
.btn-danger:hover { background: #f8ece8; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 20px; }
.alert-ok { background: var(--orange-soft); border: 1px solid #f2d6a8; color: var(--orange-ink); }
.alert-err { background: #f8e9e5; border: 1px solid #e6c3b9; color: var(--rust); }

/* ---- Payslip result ---- */
.slip { padding: 0; overflow: hidden; }
.slip-head {
  padding: 22px 26px; color: #fff;
  background: linear-gradient(120deg, var(--blue-900), var(--blue));
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
}
.slip-head .ref { color: #bcd8f0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.slip-head strong { font-family: var(--display); font-size: 22px; }
.badge { font-family: var(--mono); font-size: 11px; color: #fff; background: rgba(255,255,255,.18); padding: 5px 11px; border-radius: 999px; letter-spacing: .04em; }

table.slip-table { width: 100%; border-collapse: collapse; }
table.slip-table th, table.slip-table td { padding: 11px 16px; text-align: left; font-size: 14px; }
table.slip-table thead th { font-family: var(--display); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 600; }
table.slip-table thead th.num, table.slip-table td.num { text-align: right; }
table.slip-table tbody tr + tr td { border-top: 1px solid var(--line-soft); }
table.slip-table td.cod { font-family: var(--mono); color: var(--muted); width: 52px; }
table.slip-table td.num { font-family: var(--mono); }
.venc { color: var(--blue); }
.desc { color: var(--rust); }

.slip-totais .row { display: flex; justify-content: space-between; padding: 12px 26px; font-size: 14px; border-top: 1px solid var(--line-soft); }
.slip-totais .row .num { font-family: var(--mono); }

.liquido {
  background: linear-gradient(120deg, var(--orange-soft), #fff6ea);
  padding: 22px 26px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 1px solid #f1d7ac;
}
.liquido .lbl { font-family: var(--display); font-weight: 600; color: var(--orange-ink); }
.liquido .lbl small { display: block; font-family: var(--body); font-weight: 400; font-size: 11.5px; color: #b47b2e; text-transform: uppercase; letter-spacing: .04em; }
.liquido .val { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--orange-ink); letter-spacing: -.02em; }

.mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border-top: 1px solid var(--line); }
@media (min-width: 560px) { .mini { grid-template-columns: repeat(4, 1fr); } }
.mini .cell { background: #fff; padding: 14px 16px; }
.mini .cell .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mini .cell .v { font-family: var(--mono); font-size: 15px; margin-top: 4px; }

.result-empty { display: grid; place-items: center; min-height: 320px; text-align: center; color: var(--muted); }
.result-empty .big { font-family: var(--display); font-size: 17px; color: var(--ink); margin-bottom: 6px; }

/* ---- Gráfico ---- */
.chart-card .chart-box { position: relative; height: 300px; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.chart-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ---- Histórico tabela ---- */
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { padding: 12px 16px; font-size: 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
table.list thead th { font-family: var(--display); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.list td.num, table.list th.num { text-align: right; font-family: var(--mono); }
table.list tbody tr:hover { background: #f7fbff; }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; }

/* ---- Config faixas ---- */
.faixa-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.faixa-row .field { margin: 0; }
.iconbtn { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; color: var(--rust); font-size: 14px; }
.iconbtn:hover { background: #f8ece8; }

/* ---- Login ---- */
.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 410px; }
.login-top { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }
.login-top .senac-logo { height: 76px; margin: 0 0 6px; }
.login-tagline { color: var(--muted); font-size: 14px; margin-top: 10px; }
.foot-note { color: var(--muted); font-size: 13px; margin-top: 22px; text-align: center; }
