/* Bruno OS — interface (mobile primeiro, desktop com barra lateral) */
:root {
  --bg: #111214;
  --petrol: #061f28;
  --petrol-2: #0a3340;
  --lime: #c8f55a;
  --lime-2: #dcfa80;
  --ink: #111214;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, .62);
  --faint: rgba(255, 255, 255, .45);
  --line: rgba(255, 255, 255, .1);
  --glass: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
  --danger: #ff8a7a;
  --ok: #c8f55a;
  --warn: #ffd27a;
  --r-lg: 24px;
  --r-md: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--font); overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lime); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* Fundo com brilho (mesmo clima do site) */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; animation: float 9s ease-in-out infinite; }
.g1 { width: 440px; height: 440px; left: -180px; top: -150px; background: radial-gradient(closest-side, rgba(200, 245, 90, .13), transparent); }
.g2 { width: 520px; height: 520px; right: -240px; top: 40vh; background: radial-gradient(closest-side, rgba(16, 92, 110, .5), transparent); animation-delay: -5s; }
@keyframes float { 50% { translate: 0 -16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

#app { position: relative; z-index: 1; min-height: 100dvh; }
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot img { animation: pulse 1.4s ease-in-out infinite; border-radius: 18px; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.94); } }

/* Vidro */
.glass {
  background: var(--glass); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 12px 32px -8px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.lime {
  background: linear-gradient(180deg, var(--lime-2), var(--lime)); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 30px -8px rgba(200, 245, 90, .45);
}
.press { transition: transform .15s; }
.press:active { transform: scale(.97); }
.rv { animation: up .6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes up { 0% { opacity: .01; transform: translateY(14px); } }

/* ---------- Estrutura ---------- */
.shell { min-height: 100dvh; }
.main {
  padding: calc(var(--safe-t) + 18px) calc(var(--safe-r) + 18px) calc(var(--safe-b) + 108px) calc(var(--safe-l) + 18px);
  max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
}

/* Tab bar (iPhone) */
.tabbar {
  position: fixed; z-index: 20; left: calc(var(--safe-l) + 14px); right: calc(var(--safe-r) + 14px);
  bottom: calc(var(--safe-b) + 12px); border-radius: 999px; padding: 6px;
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(24, 26, 29, .72);
}
.tab {
  flex: 1; min-height: 52px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10.5px; font-weight: 600; color: rgba(255, 255, 255, .72); text-decoration: none;
}
.tab svg { width: 21px; height: 21px; }
.tab[aria-current="page"] { background: linear-gradient(180deg, var(--lime-2), var(--lime)); color: var(--ink); }

/* Barra lateral (computador) */
.side { display: none; }
@media (min-width: 900px) {
  .tabbar { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 4px; position: fixed; top: 16px; bottom: 16px; left: 16px; width: 236px;
    border-radius: 28px; padding: 18px 12px; overflow: auto; z-index: 10;
  }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-weight: 700; font-size: 17px; }
  .side .brand img { width: 34px; height: 34px; border-radius: 9px; }
  .side h6 { margin: 14px 12px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
  .side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: rgba(255, 255, 255, .8); text-decoration: none; font-weight: 500; }
  .side a:hover { background: rgba(255, 255, 255, .06); }
  .side a[aria-current="page"] { background: linear-gradient(180deg, var(--lime-2), var(--lime)); color: var(--ink); }
  .side svg { width: 18px; height: 18px; flex: none; }
  .main { margin-left: 268px; max-width: 980px; padding: 32px 32px 48px; }
  .home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
}

/* ---------- Topo de página ---------- */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.top .kicker { font-size: 13px; color: var(--muted); }
.top h1 { margin: 2px 0 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 999px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--glass); color: #fff;
}
.icon-btn svg { width: 19px; height: 19px; }
.actions { display: flex; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--lime); text-decoration: none; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- Início ---------- */
.phrase { margin: 4px 0 0; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, .85); display: flex; gap: 10px; align-items: flex-start; }
.phrase q { quotes: "“" "”"; flex: 1; }
.phrase q::before, .phrase q::after { color: var(--lime); font-weight: 700; }
.phrase button { flex: none; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.phrase button svg { width: 16px; height: 16px; }

.hero { border-radius: 26px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.hero .lbl { font-size: 13px; color: rgba(17, 18, 20, .75); display: flex; justify-content: space-between; }
.hero .big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.hero .row { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: rgba(17, 18, 20, .78); }
.hero strong { color: var(--ink); }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: #fff; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi strong { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.kpi.alert strong { color: var(--danger); }

.card { border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.card-h h2 { margin: 0; font-size: 16px; font-weight: 600; }
.card-h a, .card-h span { font-size: 13px; font-weight: 600; text-decoration: none; }
.card-h span { color: var(--muted); font-weight: 500; }
.empty { color: var(--faint); font-size: 14px; padding: 10px 0; }
.empty a { font-weight: 600; }

.task { display: flex; align-items: center; gap: 12px; min-height: 50px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: #fff; }
.box { width: 24px; height: 24px; flex: none; border-radius: 8px; border: 1.8px solid rgba(255, 255, 255, .4); display: grid; place-items: center; }
.box svg { width: 14px; height: 14px; opacity: 0; }
.task.done .box { background: var(--lime); border-color: var(--lime); }
.task.done .box svg { opacity: 1; }
.task.done .t1 { text-decoration: line-through; color: rgba(255, 255, 255, .5); }

.item { display: flex; align-items: center; gap: 12px; min-height: 56px; color: #fff; text-decoration: none; padding: 4px 0; }
.item + .item { border-top: 1px solid rgba(255, 255, 255, .06); }
.item .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.t1 { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t2 { font-size: 12.5px; color: rgba(255, 255, 255, .55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.val { font-size: 14px; font-weight: 600; white-space: nowrap; }
.val.in { color: var(--lime); }
.val.out { color: #fff; }
.date {
  width: 44px; height: 44px; flex: none; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
}
.date b { font-size: 15px; line-height: 1; }
.date i { font-style: normal; font-size: 9.5px; font-weight: 600; letter-spacing: .04em; }
.date.today { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.date.late { background: rgba(255, 138, 122, .18); border-color: rgba(255, 138, 122, .5); color: var(--danger); }
.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--muted); }
.chip.late { background: rgba(255, 138, 122, .16); color: var(--danger); }
.chip.ok { background: rgba(200, 245, 90, .14); color: var(--lime); }

.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--lime), var(--lime-2)); }

/* ---------- Listas e módulos ---------- */
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.seg::-webkit-scrollbar { display: none; }
.seg a { flex: none; padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; color: rgba(255, 255, 255, .78); border: 1px solid var(--line); background: var(--glass); min-height: 40px; display: inline-flex; align-items: center; }
.seg a[aria-current="page"] { background: var(--lime); color: var(--ink); border-color: var(--lime); }
@media (min-width: 900px) { .seg { margin: 0; padding: 2px 0; } }

.search { position: relative; }
.search input { width: 100%; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); padding: 0 14px 0 40px; font-size: 16px; }
.search svg { position: absolute; left: 13px; top: 14px; width: 18px; height: 18px; color: var(--faint); }

.fab {
  position: fixed; z-index: 21; right: calc(var(--safe-r) + 20px); bottom: calc(var(--safe-b) + 92px);
  width: 56px; height: 56px; border-radius: 999px; display: grid; place-items: center; border: 0; cursor: pointer; text-decoration: none;
}
.fab svg { width: 24px; height: 24px; }
@media (min-width: 900px) { .fab { bottom: 32px; right: 32px; } }

.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-grid a { border-radius: 20px; padding: 16px; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; }
.menu-grid svg { width: 24px; height: 24px; color: var(--lime); }
.menu-grid small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.group-title { margin: 8px 2px 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
@media (min-width: 600px) { .menu-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Formulários ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06); padding: 12px 14px; font-size: 16px; /* 16px evita zoom no iPhone */
  outline: none; -webkit-appearance: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23ffffff99' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.field select option { background: #1b1d20; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200, 245, 90, .18); }
.field.err input, .field.err select { border-color: var(--danger); }
.field .hint { font-size: 12px; color: var(--faint); }
.switch { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); }
.switch input { width: 46px; height: 28px; min-height: 0; padding: 0; border-radius: 99px; background: rgba(255, 255, 255, .2); position: relative; cursor: pointer; border: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch input:checked { background: var(--lime); }
.switch input:checked::after { left: 21px; }
.btn { min-height: 52px; border-radius: 16px; border: 0; padding: 0 20px; font-weight: 700; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.ghost { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: #fff; }
.btn.danger { background: rgba(255, 138, 122, .12); border: 1px solid rgba(255, 138, 122, .4); color: var(--danger); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }
.note { font-size: 13px; color: var(--muted); border-left: 3px solid var(--lime); padding: 8px 12px; background: rgba(200, 245, 90, .06); border-radius: 0 12px 12px 0; }
.err-msg { color: var(--danger); font-size: 14px; min-height: 20px; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.sim { width: 100%; border-collapse: collapse; font-size: 13px; }
.sim th, .sim td { padding: 8px 4px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sim th:first-child, .sim td:first-child { text-align: left; }
.sim th { color: var(--muted); font-weight: 600; }

/* ---------- Login ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-t) + 24px) 22px calc(var(--safe-b) + 24px); max-width: 440px; margin: 0 auto; gap: 22px; }
.auth .logo { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 20px 50px -12px rgba(200, 245, 90, .25); }
.auth h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.auth p { margin: 0; color: var(--muted); }
.secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 18px; letter-spacing: .06em; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px dashed rgba(255, 255, 255, .25); text-align: center; user-select: all; -webkit-user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 16px; }
.codes span { padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); text-align: center; }
.otp { letter-spacing: .4em; text-align: center; font-size: 24px !important; font-weight: 700; }

/* Toast */
#toast {
  position: fixed; z-index: 50; left: 50%; top: calc(var(--safe-t) + 12px); transform: translate(-50%, -140%);
  max-width: min(92vw, 420px); padding: 12px 16px; border-radius: 16px; background: rgba(30, 32, 35, .95); border: 1px solid var(--line);
  font-size: 14px; transition: transform .3s cubic-bezier(.2, .7, .2, 1); display: flex; gap: 12px; align-items: center;
}
#toast.show { transform: translate(-50%, 0); }
#toast button { background: var(--lime); color: var(--ink); border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 700; cursor: pointer; }

.hide-values .money { filter: blur(7px); }
.offline-bar { font-size: 13px; text-align: center; padding: 8px; border-radius: 12px; background: rgba(255, 210, 122, .12); color: var(--warn); }
.card p.t2, p.t2 { white-space: normal; }
