/* ============ Agro Master Funcionários — visual ============ */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050d09; --bg2: #08150f;
  --glow1: rgba(46, 229, 157, .13); --glow2: rgba(245, 196, 81, .07); --glow3: rgba(56, 140, 255, .06);
  --card: rgba(255, 255, 255, .035); --card-strong: rgba(255, 255, 255, .06); --solid: #0b1a13; --solid2: #0f2219;
  --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .14);
  --text: #e7f3ed; --muted: #86a597; --faint: #5d7a6d;
  --accent: #2ee59d; --accent2: #12b878; --accent-ink: #03150c; --accent-soft: rgba(46, 229, 157, .12); --accent-line: rgba(46, 229, 157, .38);
  --gold: #f5c451; --gold-ink: #241a02; --gold-soft: rgba(245, 196, 81, .13);
  --red: #ff6f6f; --red-soft: rgba(255, 111, 111, .12);
  --amber: #f3b34c; --amber-soft: rgba(243, 179, 76, .13);
  --blue: #73b8ff; --blue-soft: rgba(115, 184, 255, .12);
  --input: rgba(255, 255, 255, .045);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --glass: blur(16px) saturate(140%);
  --radius: 18px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef4f0; --bg2: #e4ede8;
  --glow1: rgba(18, 184, 120, .14); --glow2: rgba(245, 196, 81, .14); --glow3: rgba(56, 140, 255, .07);
  --card: rgba(255, 255, 255, .78); --card-strong: #fff; --solid: #ffffff; --solid2: #f6faf8;
  --line: rgba(10, 50, 32, .1); --line2: rgba(10, 50, 32, .18);
  --text: #0f2a1e; --muted: #5d776b; --faint: #93a99e;
  --accent: #0fa36b; --accent2: #0b8557; --accent-ink: #ffffff; --accent-soft: rgba(15, 163, 107, .1); --accent-line: rgba(15, 163, 107, .4);
  --gold: #e3a92a; --gold-ink: #2a1d00; --gold-soft: rgba(227, 169, 42, .14);
  --red: #d14343; --red-soft: rgba(209, 67, 67, .09);
  --amber: #b07300; --amber-soft: rgba(227, 169, 42, .14);
  --blue: #2463a8; --blue-soft: rgba(36, 99, 168, .09);
  --input: #fff;
  --shadow: 0 14px 40px rgba(20, 60, 40, .1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  background-image:
    radial-gradient(900px 600px at 8% -10%, var(--glow1), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, var(--glow3), transparent 60%),
    radial-gradient(800px 600px at 60% 110%, var(--glow2), transparent 60%);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
::selection { background: var(--accent-soft); }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.pos { color: var(--accent); } .neg { color: var(--red); }
.strike { text-decoration: line-through; }
.sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; display: block; }
.hint.ok { color: var(--accent); font-weight: 650; } .hint.bad { color: var(--red); font-weight: 650; }
.loading, .empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-line); } 50% { box-shadow: 0 0 0 6px transparent; } }
.center-box { max-width: 420px; margin: 15vh auto; text-align: center; padding: 16px; }
.center-box .btn { margin-top: 12px; }
.ico { flex: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 12px;
  padding: 10px 16px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-ink);
  box-shadow: 0 6px 22px -8px var(--accent-line), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn .ico { width: 17px; height: 17px; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.big { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.btn.light, .btn.ghost { background: var(--card-strong); color: var(--text); border-color: var(--line2); box-shadow: none; }
.btn.ghost:hover, .btn.light:hover { border-color: var(--accent-line); color: var(--accent); }
.btn.gold { background: linear-gradient(135deg, #ffd56b, var(--gold)); color: var(--gold-ink); box-shadow: 0 6px 22px -8px rgba(245, 196, 81, .6), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: rgba(255, 111, 111, .3); box-shadow: none; }
.btn.icon { width: 46px; height: 46px; padding: 0; font-size: 26px; background: var(--card-strong); color: var(--text); border-color: var(--line2); box-shadow: none; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line2); background: var(--card-strong); color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.icon-btn .ico { width: 18px; height: 18px; }

/* ---------- Campos ---------- */
label { display: block; font-size: 13px; font-weight: 650; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  display: block; width: 100%; margin-top: 6px; border: 1px solid var(--line2); border-radius: 11px; background: var(--input); color: var(--text);
  padding: 11px 12px; outline: none; font-weight: 450; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
select option { background: var(--solid); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; }
.big-input { font-size: 26px !important; font-weight: 800 !important; letter-spacing: -.01em; }
.stack { display: grid; gap: 14px; }
.stack.narrow { max-width: 380px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; color: var(--text); background: var(--amber-soft); border: 1px solid rgba(243, 179, 76, .3); padding: 11px 13px; border-radius: 12px; }
.check input { margin-top: 2px; }
.chip { border: 1px solid var(--line2); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 650; cursor: pointer; color: var(--text); transition: all .15s; }
.chip:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.note { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px; padding: 10px 13px; font-size: 14px; margin: 0; color: var(--text); }
.note.warn { background: var(--amber-soft); border-color: rgba(243, 179, 76, .35); }
.note.bad { background: var(--red-soft); border-color: rgba(255, 111, 111, .35); color: var(--red); }

/* ---------- Tags ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 750; letter-spacing: .02em; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); white-space: nowrap; }
.tag.temp, .tag.vale { background: var(--gold-soft); color: var(--gold); border-color: rgba(245, 196, 81, .35); }
.tag.fixo, .tag.acerto { background: var(--blue-soft); color: var(--blue); border-color: rgba(115, 184, 255, .35); }
.tag.ok, .tag.credito { background: var(--accent-soft); color: var(--accent); }
.tag.bad { background: var(--red-soft); color: var(--red); border-color: rgba(255, 111, 111, .35); }
:root[data-theme="light"] .tag.temp, :root[data-theme="light"] .tag.vale { color: #8a6100; }

/* ---------- Avatares ---------- */
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; background: var(--card-strong); box-shadow: 0 0 0 2px var(--line2); }
.avatar.sm { width: 36px; height: 36px; }
.avatar.lg { width: 66px; height: 66px; box-shadow: 0 0 0 3px var(--accent-line); }
.avatar.xl { width: 170px; height: 170px; font-size: 54px; }
.avatar.ini { display: grid; place-items: center; font-weight: 800; color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), transparent); font-size: 16px; }
.avatar.sm.ini { font-size: 12.5px; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; position: relative; overflow: hidden; }
.auth::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 180deg, transparent, var(--glow1), transparent 30%, var(--glow2), transparent 60%); filter: blur(60px); animation: spin 40s linear infinite; }
.auth-card { position: relative; width: min(410px, 100%); background: var(--card); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid var(--line2); border-radius: 24px; padding: 30px; box-shadow: var(--shadow); animation: rise .4s ease; }
.auth-card h1 { font-size: 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand img { width: 50px; height: 50px; border-radius: 14px; box-shadow: 0 0 30px var(--accent-line); }
.auth-brand b { display: block; font-size: 18px; } .auth-brand span { color: var(--muted); }

/* ---------- Avisos ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; max-width: min(430px, calc(100vw - 32px)); }
.toast { background: var(--solid2); color: var(--text); border: 1px solid var(--line2); border-left: 4px solid var(--accent); padding: 13px 16px; border-radius: 13px; box-shadow: var(--shadow); font-weight: 600; animation: rise .25s ease; transition: opacity .4s, transform .4s; }
.toast.ok { border-left-color: var(--accent); } .toast.err { border-left-color: var(--red); } .toast.warn { border-left-color: var(--gold); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Janela ---------- */
#modal-root:not(.open) { display: none; }
.modal-bg { position: fixed; inset: 0; background: rgba(2, 8, 5, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 14px; overflow-y: auto; z-index: 40; }
:root[data-theme="light"] .modal-bg { background: rgba(15, 42, 30, .35); }
.modal { background: var(--solid); border: 1px solid var(--line2); width: min(570px, 100%); border-radius: 22px; padding: 22px; box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .02); margin-bottom: 4vh; animation: rise .22s ease; }
.modal.wide { width: min(1020px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { font-size: 21px; } .modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.x { border: 1px solid var(--line2); background: var(--card-strong); width: 38px; height: 38px; border-radius: 11px; font-size: 21px; cursor: pointer; flex: none; color: var(--muted); }
.x:hover { color: var(--red); border-color: rgba(255, 111, 111, .4); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.modal-actions.left { justify-content: flex-start; margin: 4px 0 20px; }
h3.sec { font-size: 16px; margin: 6px 0 10px; }
body.has-modal { overflow: hidden; }

/* ---------- Estrutura do escritório ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px; border-right: 1px solid var(--line); background: linear-gradient(180deg, var(--card), transparent); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 24px var(--accent-line); }
.brand b { display: block; font-size: 15px; } .brand span { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.mainnav { display: flex; flex-direction: column; gap: 4px; }
.mainnav a, .side-link { position: relative; display: flex; align-items: center; gap: 12px; color: var(--muted); text-decoration: none; padding: 11px 12px; border-radius: 12px; font-weight: 650; border: 1px solid transparent; background: none; cursor: pointer; text-align: left; width: 100%; transition: all .15s; }
.mainnav a:hover, .side-link:hover { color: var(--text); background: var(--card-strong); }
.mainnav a.on { color: var(--text); background: linear-gradient(90deg, var(--accent-soft), transparent); border-color: var(--accent-line); }
.mainnav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.mainnav a.on .ico { color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: 4px; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; margin-top: 8px; border-top: 1px solid var(--line); }
.who > div:nth-child(2) { flex: 1; min-width: 0; line-height: 1.2; }
.who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .who span { font-size: 11.5px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 26px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); }
.top-title { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.top-r { display: flex; align-items: center; gap: 8px; }
.only-mobile { display: none; }
.bell { position: relative; border: 1px solid var(--line2); background: var(--card-strong); color: var(--text); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.bell:hover { border-color: var(--accent-line); color: var(--accent); }
.badge { position: absolute; top: -6px; right: -6px; background: var(--gold); color: var(--gold-ink); border-radius: 999px; min-width: 21px; height: 21px; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; box-shadow: 0 0 14px rgba(245, 196, 81, .6); }
.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px; animation: rise .25s ease; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; background: linear-gradient(90deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cartões ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.cards.c3 { grid-template-columns: repeat(3, 1fr); }
.metric, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); }
.metric { position: relative; overflow: hidden; padding: 18px 18px 16px; }
.metric::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--muted), transparent); opacity: .5; }
.metric::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--card-strong), transparent 70%); }
.metric.pos::before { background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 1; }
.metric.pos::after { background: radial-gradient(circle, var(--accent-soft), transparent 70%); }
.metric.neg::before { background: linear-gradient(90deg, transparent, var(--red), transparent); opacity: 1; }
.metric.neg::after { background: radial-gradient(circle, var(--red-soft), transparent 70%); }
.metric span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.metric strong { display: block; font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.metric small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.metric.pos strong { color: var(--accent); text-shadow: 0 0 24px var(--accent-soft); } .metric.neg strong { color: var(--red); }
.metric.big { border-width: 1px; } .metric.big.pos { border-color: var(--accent-line); } .metric.big.neg { border-color: rgba(255, 111, 111, .4); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { padding: 20px; margin-bottom: 20px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.panel-head h2::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters input, .filters select { width: auto; margin-top: 0; padding: 9px 11px; font-size: 14px; }
.filters input[type=search] { min-width: 230px; flex: 1; }
.filters label { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.filters label input { margin-top: 0; }
.subtabs { display: inline-flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.subtabs button { border: 0; background: none; color: var(--muted); padding: 9px 15px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.subtabs button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 750; white-space: nowrap; }
tfoot td { font-weight: 800; border-top: 1px solid var(--line2); border-bottom: 0; }
table.compact th, table.compact td { padding: 9px 8px; font-size: 14px; }
tbody tr { transition: background .12s; }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover, tbody tr:hover { background: var(--card-strong); }
td.money { font-weight: 750; white-space: nowrap; }
td.num { text-align: center; }
tr.cancel td { color: var(--faint); text-decoration: line-through; }
tr.cancel td .tag { text-decoration: none; }
tr.unread td { background: var(--gold-soft); font-weight: 650; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.cP { color: var(--accent); font-weight: 800; } .cM { color: var(--amber); font-weight: 800; } .cF { color: var(--red); font-weight: 800; } .cN { color: var(--muted); font-weight: 700; }

/* ---------- Listas ---------- */
.people, .alerts, .list { list-style: none; margin: 0; padding: 0; }
.people li, .alerts li { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 12px; transition: background .12s; }
.people li:last-child, .alerts li:last-child { border-bottom: 0; }
.people li:hover, .alerts li:hover { background: var(--card-strong); }
.people li > div:not(.avatar):not(.mov-ico), .alerts li > div:not(.avatar) { flex: 1; min-width: 0; }
.people li b, .alerts li b { display: block; } .people li span, .alerts li span { font-size: 13px; color: var(--muted); }
.people li strong { white-space: nowrap; }
.alerts li.warn { box-shadow: inset 3px 0 0 var(--gold); } .alerts li.bad { box-shadow: inset 3px 0 0 var(--red); }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.inline-form { display: flex; gap: 8px; margin-top: 16px; }
.inline-form input { margin-top: 0; max-width: 340px; }
.mov-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; flex: none; }
.mov-ico.vale { background: var(--gold-soft); color: var(--gold); } .mov-ico.acerto { background: var(--blue-soft); color: var(--blue); } .mov-ico.credito { background: var(--accent-soft); color: var(--accent); }
.pick-search { font-size: 17px !important; margin-bottom: 10px; }
.pick { max-height: 55vh; overflow-y: auto; }

/* ---------- Ficha ---------- */
.ficha { display: grid; grid-template-columns: 190px 1fr; gap: 22px; margin-bottom: 20px; }
.ficha-foto img { width: 190px; height: 190px; object-fit: cover; border-radius: 20px; border: 1px solid var(--line2); box-shadow: 0 0 40px var(--accent-soft); }
.ficha-dados { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; margin: 0; align-content: start; }
.ficha-dados > div { padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.ficha-dados dt { font-size: 11px; color: var(--faint); font-weight: 750; text-transform: uppercase; letter-spacing: .06em; } .ficha-dados dd { margin: 3px 0 0; font-weight: 650; word-break: break-word; }
.ficha-dados .full { grid-column: 1 / -1; }

/* ---------- Cadastro ---------- */
.func-grid { display: grid; grid-template-columns: 270px 1fr; gap: 22px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 15px; align-content: start; }
.span2 { grid-column: 1 / -1; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 180px; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; border: 1px solid var(--line2); background: var(--card); border-radius: 12px; padding: 12px; font-weight: 750; color: var(--muted); transition: all .15s; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 20px -6px var(--accent-line); }
.seg input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- Câmera e assinatura ---------- */
.cam { position: relative; aspect-ratio: 4 / 3; background: #020604; border-radius: 16px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line2); }
.cam::after { content: ""; position: absolute; inset: 12px; border-radius: 10px; pointer-events: none;
  background: linear-gradient(var(--accent), var(--accent)) top left / 22px 2px, linear-gradient(var(--accent), var(--accent)) top left / 2px 22px,
    linear-gradient(var(--accent), var(--accent)) top right / 22px 2px, linear-gradient(var(--accent), var(--accent)) top right / 2px 22px,
    linear-gradient(var(--accent), var(--accent)) bottom left / 22px 2px, linear-gradient(var(--accent), var(--accent)) bottom left / 2px 22px,
    linear-gradient(var(--accent), var(--accent)) bottom right / 22px 2px, linear-gradient(var(--accent), var(--accent)) bottom right / 2px 22px;
  background-repeat: no-repeat; opacity: .8; }
.cam video, .cam img { width: 100%; height: 100%; object-fit: cover; }
.cam video { transform: scaleX(-1); }
.cam-msg { color: #8fb3a2; padding: 18px; text-align: center; font-size: 14px; }
.cam-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.comp-grid h4 { font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sig { position: relative; border: 2px dashed var(--line2); border-radius: 16px; background: #fff; aspect-ratio: 4 / 3; transition: border-color .2s, box-shadow .2s; }
.sig.signed { border-style: solid; border-color: var(--accent); box-shadow: 0 0 24px -6px var(--accent-line); }
.sig canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; border-radius: 14px; }
.sig-line { position: absolute; left: 8%; right: 8%; bottom: 22%; border-top: 1px solid #cfdcd5; text-align: center; font-size: 12px; color: #9ab0a4; padding-top: 4px; pointer-events: none; }
.sig.signed .sig-line { color: transparent; }
.recibo-txt { background: var(--card); border: 1px solid var(--line2); border-left: 3px solid var(--accent); border-radius: 14px; padding: 15px 17px; font-size: 16px; line-height: 1.65; margin: 0; }

/* ---------- Vale ---------- */
.mov-func { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.mov-func b { display: block; font-size: 18px; } .mov-func span { color: var(--muted); font-size: 14px; }
.saldo-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.saldo-box div { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; }
.saldo-box span { display: block; font-size: 11px; color: var(--faint); font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.saldo-box b { font-size: 16px; }
.saldo-box .hl { background: var(--accent-soft); border-color: var(--accent-line); } .saldo-box .hl b { font-size: 21px; color: var(--accent); }
.saldo-box .hl.neg { background: var(--red-soft); border-color: rgba(255, 111, 111, .4); } .saldo-box .hl.neg b { color: var(--red); }

/* ---------- Comprovante (sempre em "papel" branco) ---------- */
.comprovante { position: relative; background: #fff; color: #10231a; border-radius: 16px; padding: 22px; display: grid; gap: 14px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 20px 50px rgba(0, 0, 0, .35); }
.comprovante .recibo-txt { background: #f6f9f7; border-color: #dfe8e3; border-left-color: #12b878; color: #10231a; }
.comprovante .pos { color: #0f8f5c; } .comprovante .neg { color: #c43c3c; }
.comp-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #12b878; padding-bottom: 12px; }
.comp-head img { width: 44px; height: 44px; border-radius: 11px; }
.comp-head b { display: block; font-size: 16px; } .comp-head span { font-size: 13px; color: #5d776b; }
.comp-head > div { flex: 1; }
.comp-valor { font-size: 28px; color: #0f6b45; white-space: nowrap; }
.comp-dados { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; }
.comp-dados dt { font-size: 11px; color: #6c8479; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; } .comp-dados dd { margin: 2px 0 0; font-weight: 700; }
.comp-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.comp-imgs figure { margin: 0; text-align: center; }
.comp-imgs img, .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border: 1px solid #dfe8e3; border-radius: 12px; background: #fafcfb; }
.noimg { display: grid; place-items: center; color: #8aa093; }
.comp-imgs figcaption { font-size: 12px; color: #6c8479; margin-top: 4px; }
.carimbo { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); border: 5px solid #c43c3c; color: #c43c3c; font-size: 54px; font-weight: 900; padding: 4px 22px; border-radius: 12px; opacity: .55; pointer-events: none; letter-spacing: .08em; }

/* ---------- Grade de presença ---------- */
.legend { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.pc { width: 31px; height: 31px; border-radius: 9px; border: 1px solid transparent; font-weight: 800; cursor: pointer; display: inline-grid; place-items: center; font-size: 13px; padding: 0; transition: transform .1s; }
.pc:hover { transform: scale(1.12); }
.pc.P { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.pc.M { background: var(--amber-soft); color: var(--amber); border-color: rgba(243, 179, 76, .4); }
.pc.F { background: var(--red-soft); color: var(--red); border-color: rgba(255, 111, 111, .4); }
.pc.none { background: var(--card); color: var(--faint); border-color: var(--line); } .pc.none.we { opacity: .55; }
.grade th, .grade td { padding: 4px; text-align: center; }
.grade th { font-size: 10.5px; }
.grade th.today { color: var(--accent); }
.grade th.we { color: var(--faint); opacity: .7; }
.grade .sticky { position: sticky; left: 0; background: var(--solid); text-align: left; min-width: 190px; padding: 7px 10px; z-index: 1; box-shadow: 1px 0 0 var(--line); }

/* ---------- CAMPO (celular) ---------- */
.campo { max-width: 720px; margin: auto; padding-bottom: 116px; }
.campo-top { position: sticky; top: 0; z-index: 10; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); }
.campo-who { display: flex; align-items: center; gap: 10px; }
.campo-who img { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 0 18px var(--accent-line); }
.campo-who b { display: block; white-space: nowrap; } .campo-who span { font-size: 12px; color: var(--muted); display: block; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campo-top-r { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sync { font-size: 12px; font-weight: 750; padding: 5px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line2); }
.sync.ok { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.sync.pend { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); box-shadow: 0 0 16px rgba(245, 196, 81, .5); }
.campo-date { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 8px; }
.campo-date-label { text-align: center; } .campo-date-label b { display: block; font-size: 22px; font-weight: 800; } .campo-date-label span { color: var(--muted); font-size: 14px; }
.campo-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 14px; padding: 5px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.campo-tabs button { border: 0; background: none; border-radius: 12px; padding: 11px; font-weight: 800; color: var(--muted); cursor: pointer; font-size: 15px; }
.campo-tabs button.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-ink); box-shadow: 0 6px 20px -8px var(--accent-line); }
.campo-tabs button span { font-weight: 600; opacity: .8; font-size: 13px; }
.campo-tools { display: flex; gap: 8px; justify-content: space-between; padding: 8px 14px; }
.campo-lista { padding: 0 12px; }
.campo-grupo h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 6px 8px; display: flex; align-items: center; gap: 8px; }
.campo-grupo h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.campo-grupo h3 span { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 8px; }
.pcard { display: flex; align-items: center; gap: 11px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 9px; margin-bottom: 8px; transition: border-color .15s, background .15s, box-shadow .2s; }
.pcard.st-P { border-color: var(--accent-line); background: linear-gradient(90deg, var(--accent-soft), var(--card)); box-shadow: inset 3px 0 0 var(--accent); }
.pcard.st-M { border-color: rgba(243, 179, 76, .45); background: linear-gradient(90deg, var(--amber-soft), var(--card)); box-shadow: inset 3px 0 0 var(--amber); }
.pcard.st-F { border-color: rgba(255, 111, 111, .45); background: linear-gradient(90deg, var(--red-soft), var(--card)); box-shadow: inset 3px 0 0 var(--red); }
.pinfo { flex: 1; min-width: 0; } .pinfo b { display: block; line-height: 1.2; } .pinfo span { font-size: 12px; color: var(--muted); }
.pbtns { display: flex; gap: 6px; }
.pb { width: 50px; height: 50px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card-strong); font-weight: 900; font-size: 18px; cursor: pointer; color: var(--faint); transition: all .12s; }
.pb:active { transform: scale(.94); }
.pb.P.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 20px -4px var(--accent-line); }
.pb.M.on { background: linear-gradient(135deg, #ffd56b, var(--amber)); border-color: var(--amber); color: #2a1d00; box-shadow: 0 0 20px -4px rgba(243, 179, 76, .6); }
.pb.F.on { background: linear-gradient(135deg, #ff8b8b, var(--red)); border-color: var(--red); color: #2a0606; box-shadow: 0 0 20px -4px rgba(255, 111, 111, .6); }
.pb:disabled { opacity: .45; }
.campo-envios { padding: 10px 14px; display: grid; gap: 8px; }
.campo-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 14px; padding-bottom: max(12px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 14px; z-index: 10; border-top: 1px solid var(--line2); background: color-mix(in srgb, var(--solid) 88%, transparent); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); }
.campo-cont { display: flex; gap: 10px; flex-wrap: wrap; font-size: 15px; }

/* ---------- Telas menores ---------- */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 76px 1fr; }
  .side { padding: 18px 10px; align-items: center; }
  .brand div, .mainnav a span, .side-link span, .who > div:nth-child(2) { display: none; }
  .brand { padding: 0; }
  .mainnav a, .side-link { justify-content: center; padding: 12px; }
  .mainnav a.on::before { left: -10px; }
  .who { flex-direction: column; padding: 10px 0 0; }
  .grid2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .ficha-dados { grid-template-columns: 1fr 1fr; }
  .comp-dados { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30; flex-direction: row; padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line2); background: color-mix(in srgb, var(--solid) 90%, transparent); gap: 0; }
  .side .brand, .side-foot { display: none; }
  .mainnav { flex-direction: row; justify-content: space-around; width: 100%; gap: 2px; }
  .mainnav a { flex: 1; flex-direction: column; gap: 2px; padding: 7px 2px; font-size: 10.5px; }
  .mainnav a span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .mainnav a.on::before { left: 25%; right: 25%; top: -7px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 4px 4px; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 10px 14px; }
  .top-title { font-size: 13px; }
  .page { padding: 16px 14px 96px; }
  .page-head h1 { font-size: 24px; }
  .func-grid, .ficha, .comp-grid, .comp-imgs { grid-template-columns: 1fr; }
  .ficha-foto img { width: 140px; height: 140px; }
  .fields, .row2 { grid-template-columns: 1fr; }
  .saldo-box { grid-template-columns: 1fr 1fr; }
  .modal { padding: 16px; border-radius: 18px; }
  .modal-bg { padding: 10px 8px; }
  .filters input[type=search] { min-width: 0; }
  .metric strong { font-size: 22px; }
  #toasts { bottom: 84px; }
}
@media (max-width: 480px) {
  .cards, .cards.c3 { grid-template-columns: 1fr 1fr; }
  .metric { padding: 14px; }
  .ficha-dados, .comp-dados { grid-template-columns: 1fr; }
  .pb { width: 45px; height: 45px; }
  .campo-bar { justify-content: space-between; }
  .campo-bar .btn.big { padding: 13px 15px; font-size: 15px; }
  .top-r .btn.gold { padding: 9px 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Impressão (sempre claro) ---------- */
@media print {
  :root, :root[data-theme] { --bg: #fff; --card: #fff; --card-strong: #fff; --solid: #fff; --text: #10231a; --muted: #5d776b; --faint: #8aa093; --line: #dde6e1; --line2: #cfdbd4; --accent: #0f8f5c; --red: #c43c3c; --shadow: none; }
  body { background: #fff !important; color: #10231a; }
  .no-print, .side, .topbar, .x, .btn, .filters, #toasts, .subtabs { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; animation: none; }
  .page-head h1 { color: #10231a; background: none; }
  .panel, .metric { box-shadow: none; backdrop-filter: none; }
  body.has-modal #app { display: none; }
  body.has-modal { overflow: visible; }
  .modal-bg { position: static; background: none; padding: 0; overflow: visible; backdrop-filter: none; }
  .modal { box-shadow: none; border: 0; width: 100% !important; padding: 0; animation: none; }
  .comprovante { box-shadow: none; border: 1px solid #ccc; }
  .table-wrap { overflow: visible; }
  .grade .sticky { position: static; }
}
