:root {
  --brand: #7a2e1d; --brand-2: #a8482f; --bg: #f6f1ea; --card: #fff; --ink: #2a211c; --muted: #7c6f66;
  --line: #e6dcd1; --ok: #2f7d4a; --ok-bg: #e3f2e7; --wait: #9a6a00; --wait-bg: #fff3d1; --bad: #a3322a; --bad-bg: #fbe4e1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 16px; }
[hidden] { display: none !important; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--brand); color: #fff; }
.brand { font-weight: 700; font-size: 18px; } .brand span { font-weight: 400; opacity: .8; }
.who { font-size: 14px; } .link { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; cursor: pointer; padding: 4px; }
main { max-width: 720px; margin: 0 auto; padding: 16px 12px 80px; }
h1 { font-size: 22px; margin: 0 0 12px; } h2 { font-size: 18px; margin: 0; } h3 { margin: 20px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
input, select { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; font-size: 17px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 44px; }
label.check input { width: auto; min-height: 0; margin: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; } .grid .wide { grid-column: 1 / -1; }
button { font: inherit; cursor: pointer; border-radius: 10px; padding: 10px 14px; min-height: 44px; border: 1px solid transparent; }
button:disabled { opacity: .5; cursor: wait; }
.primary { background: var(--brand); color: #fff; } .primary:hover { background: var(--brand-2); }
form > .primary, .row-actions .primary { width: 100%; font-weight: 600; }
.ghost { background: #fff; border-color: var(--line); color: var(--ink); } .ghost.danger { color: var(--bad); }
.muted { color: var(--muted); font-size: 14px; } .loading { text-align: center; color: var(--muted); }
.preview { min-height: 1.2em; margin: 2px 0 10px; font-weight: 600; color: var(--brand); }
.month-bar { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.month-bar h2 { text-transform: capitalize; } .month-bar button { width: 48px; font-size: 22px; padding: 4px; }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.total { border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.total span { font-size: 13px; } .total b { font-size: 26px; } .total small { font-size: 12px; opacity: .8; }
.total.ok { background: var(--ok-bg); color: var(--ok); } .total.wait { background: var(--wait-bg); color: var(--wait); }
.entries, .people { list-style: none; margin: 0; padding: 0; }
.entry, .people li { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.entry.pending { border-left-color: #e0a800; } .entry.approved { border-left-color: var(--ok); } .entry.rejected { border-left-color: var(--bad); opacity: .75; }
.entry-main { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.entry-hours { font-weight: 700; font-size: 18px; white-space: nowrap; }
.note { font-size: 14px; color: var(--muted); margin-top: 4px; }
.entry-foot { margin-top: 6px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.badge.pending { background: var(--wait-bg); color: var(--wait); } .badge.approved { background: var(--ok-bg); color: var(--ok); } .badge.rejected { background: var(--bad-bg); color: var(--bad); }
.entry-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; } .entry-actions button { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 24px; background: transparent; border: 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.tabs button { flex: 1 1 0; min-width: 0; padding-left: 6px; padding-right: 6px; background: #fff; border-color: var(--line); white-space: nowrap; }
.tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tabs b { background: #e0a800; color: #fff; border-radius: 99px; padding: 0 7px; font-size: 13px; } .tabs b:empty { display: none; }
.row-actions { margin-bottom: 12px; }
.summary { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); }
.summary th, .summary td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; }
.summary th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.summary tbody tr { cursor: pointer; } .summary tbody tr:hover, .summary tr.selected { background: #fbf6ef; }
.summary tfoot td { font-weight: 600; border-bottom: 0; }
details.card summary { cursor: pointer; font-weight: 600; } details.card[open] summary { margin-bottom: 12px; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-left-color: var(--brand); }
.people li.inactive { opacity: .55; border-left-color: var(--line); } .people .entry-actions { margin-top: 0; }
dialog { border: 0; border-radius: 16px; padding: 18px; width: min(460px, 94vw); }
dialog::backdrop { background: rgba(30, 20, 15, .45); }
.dialog-actions { display: flex; gap: 8px; } .dialog-actions button { flex: 1; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ok); color: #fff;
  padding: 12px 18px; border-radius: 12px; max-width: 92vw; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 20; }
.toast.bad { background: var(--bad); }
@media (max-width: 420px) { .tabs button { padding: 8px 6px; font-size: 14px; } .grid { grid-template-columns: 1fr 1fr; } }

.quick-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; min-height: 96px; text-align: left;
  background: var(--brand); color: #fff; border-radius: 14px; }
.quick-btn span { font-size: 20px; font-weight: 700; } .quick-btn b { font-size: 16px; font-weight: 500; opacity: .9; } .quick-btn small { font-size: 13px; }
.quick-btn.sent { background: var(--ok-bg); color: var(--ok); border-color: #b9dcc3; }
.quick-btn.open { outline: 3px solid #e0a800; }
#quickForm { margin-top: 14px; } #quickForm h2 { margin-bottom: 10px; }
.other-day { padding: 0; overflow: hidden; border: 2px solid var(--brand); }
.other-day > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px;
  color: var(--brand); font-size: 18px; font-weight: 700; background: #fff; }
.other-day > summary::-webkit-details-marker { display: none; }
.other-day > summary::after { content: '›'; margin-left: auto; font-size: 28px; line-height: 1; }
.other-day[open] > summary::after { content: '✕'; font-size: 20px; }
details.other-day[open] > summary { background: #fbf6ef; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.other-day summary small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.other-icon { font-size: 26px; }
.other-day > form { padding: 16px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; margin: 2px 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border-radius: 0; background: #fff; color: var(--ink); font-weight: 600; }
.seg button.active { background: var(--brand); color: #fff; }
.day-picker { margin-bottom: 10px; }
.day-title { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.day-title b { color: var(--ink); }
.day-row { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; align-items: center; }
.day-row input { margin-top: 0; text-align: center; }
.day-arrow { font-size: 26px; padding: 0; height: 46px; line-height: 1; }
.day-arrow:disabled { opacity: .3; cursor: default; }
.field-title { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.badge.area-sala { background: #e6eefb; color: #2b5797; } .badge.area-cucina { background: #fbe9dc; color: #9a4a12; }
