* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #fafafa; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: #111; -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
svg { display: block; }
.tn { font-variant-numeric: tabular-nums; }
.green { color: #16a34a; } .muted { color: #9a9aa0; } .warn { color: #ea580c; }

.app { height: 100%; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
main { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.view[hidden] { display: none; }

/* Seletor de trabalho */
.seg { margin: 12px 20px 0; background: #e9e9ec; border-radius: 12px; padding: 3px; display: flex; flex-shrink: 0; }
.seg button { flex: 1; min-width: 0; padding: 9px 6px; font-size: 15px; font-weight: 600; color: #777; border-radius: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .15s, color .15s; }
.seg button.on { background: #fff; color: #111; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.seg .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; margin-left: 6px; vertical-align: 2px; }

/* Registrar */
.rg .mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 380px; }
.clock { font-size: 80px; font-weight: 200; letter-spacing: -2px; line-height: 1; }
.date { font-size: 16px; color: #888; margin-bottom: 44px; }
.btn {
  width: min(56vw, 220px); height: min(56vw, 220px); border-radius: 50%;
  background: #111; color: #fff; font-size: 25px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: scale(.95); }
.btn.ok { background: #16a34a; }
.last { text-align: center; font-size: 15px; color: #888; padding: 0 20px 26px; flex-shrink: 0; }

/* Histórico */
.hhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 0 22px; flex-shrink: 0; }
.hhead h1 { font-size: 32px; font-weight: 700; letter-spacing: -.5px; }
.hhead .acts { display: flex; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; background: #ececef; display: flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 20px; height: 20px; }
.month { text-align: center; margin-top: 14px; flex-shrink: 0; }
.month .nav { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; }
.month .nav button { width: 44px; height: 34px; font-size: 26px; line-height: 1; color: #999; }
.month .nav button:disabled { opacity: .25; }
.month .nav span { font-size: 16px; font-weight: 600; }
.big { font-size: 54px; font-weight: 700; letter-spacing: -1.5px; margin-top: 2px; line-height: 1.1; }
.month small { font-size: 14px; color: #888; }
.list { background: #fff; margin: 16px 14px 20px; border-radius: 18px; overflow: hidden; flex-shrink: 0; }
.band { display: flex; justify-content: space-between; align-items: center; padding: 9px 16px; background: #f1f1f3; font-size: 12px; font-weight: 600; color: #777; text-transform: uppercase; letter-spacing: .5px; }
.band b { font-size: 15px; color: #111; letter-spacing: 0; text-transform: none; }
.d { display: flex; align-items: center; gap: 14px; padding: 11px 16px; position: relative; cursor: pointer; }
.d + .d::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; border-top: 1px solid #f0f0f2; }
.d:active { background: #f6f6f7; }
.d .dt { width: 34px; text-align: center; line-height: 1.1; flex-shrink: 0; }
.d .dt b { display: block; font-size: 21px; }
.d .dt small { font-size: 11px; color: #999; text-transform: uppercase; }
.d .pp { flex: 1; font-size: 16px; line-height: 1.5; }
.d .pp i { font-style: normal; color: #bbb; margin: 0 5px; }
.d .pp b { font-weight: 600; }
.d .tt { font-weight: 700; font-size: 18px; }
.empty { padding: 34px 24px; text-align: center; color: #999; font-size: 15px; line-height: 1.5; }

/* Abas */
.tabs { display: flex; background: #fff; border-top: 1px solid #e8e8ea; padding-bottom: env(safe-area-inset-bottom); flex-shrink: 0; }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; font-size: 11px; font-weight: 600; color: #aaa; }
.tabs button.on { color: #111; }
.tabs svg { width: 24px; height: 24px; }

/* Aviso */
.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: #111; color: #fff; border-radius: 14px; padding: 12px 16px;
  font-size: 15px; display: flex; align-items: center; gap: 14px; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: opacity .2s, transform .2s; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: #7dd3fc; font-weight: 600; padding: 2px 0; }

/* Painel inferior */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.32); opacity: 0; pointer-events: none; transition: opacity .2s; display: flex; align-items: flex-end; z-index: 10; }
.sheet-bg.show { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-height: 88%; overflow-y: auto; background: #f2f2f4;
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .25s ease;
}
.sheet-bg.show .sheet { transform: none; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: #d0d0d5; margin: 0 auto 14px; }
.sheet h3 { font-size: 22px; font-weight: 700; padding: 0 4px; }
.sheet .sub { color: #888; font-size: 14px; margin: 3px 4px 16px; }
.sheet .label { font-size: 12px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .5px; margin: 0 4px 6px; }
.group { background: #fff; border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; min-height: 52px; }
.row + .row { border-top: 1px solid #f0f0f2; }
.row .n { width: 22px; color: #aaa; font-size: 14px; font-weight: 600; }
.row .grow { flex: 1; font-size: 16px; color: #555; }
.row .tag { font-size: 11px; color: #999; background: #f1f1f3; border-radius: 6px; padding: 2px 6px; }
.row .del { color: #dc2626; font-size: 15px; padding: 6px 2px 6px 8px; margin-left: auto; }
.row .addb { font-weight: 600; font-size: 16px; padding: 6px 2px 6px 8px; }
input[type=time], input[type=date], input[type=text] {
  font: inherit; font-size: 17px; border: 0; background: #f1f1f3; border-radius: 9px;
  padding: 7px 10px; color: #111; -webkit-user-select: text; user-select: text; min-height: 36px;
}
input[type=text] { width: 100%; background: transparent; padding-left: 0; }
.menu .item { display: block; width: 100%; text-align: left; padding: 15px 14px; font-size: 16px; }
.menu .item + .item { border-top: 1px solid #f0f0f2; }
.primary { display: block; width: 100%; padding: 15px; border-radius: 14px; background: #111; color: #fff; font-weight: 600; font-size: 16px; }
