/* Hortus 360 · app.css */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--f-text); min-height: 100vh; }
h1, h2, h3 { font-family: var(--f-title); font-weight: 600; margin: 0; color: var(--ink); }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: 17px; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255,140,0,.45); }
h1:focus { outline: none; box-shadow: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.center { text-align: center; }
.sub { color: var(--ink2); margin-top: 6px; }
.kicker { font: 600 12px var(--f-text); text-transform: uppercase; letter-spacing: .08em; color: var(--ink2); margin-bottom: 6px; }
.hint { color: var(--ink2); font-size: 13px; margin-top: 14px; }
.hint.pad { padding: 0 20px 16px; margin-top: 0; }
.hint-sm { color: var(--ink2); font-size: 13px; margin-top: 6px; }

/* ── Topo ── */
.top { background: #000000; color: #fff; position: sticky; top: 0; z-index: 30; }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 140px; display: flex; align-items: center; gap: 28px; }
.top a:focus-visible, .top button:focus-visible { outline-color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 20px var(--f-title); color: #fff; }
.brand b { color: var(--orange); font-weight: 700; }
.brand img { display: block; height: 120px; width: auto; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { text-decoration: none; color: #d8d8d8; padding: 8px 14px; border-radius: 8px; font-weight: 500; }
.top nav a:hover { background: #1c1c1f; color: #fff; }
.top nav a.active { background: #1c1c1f; color: #fff; box-shadow: inset 0 -2px 0 var(--orange); }
.who { display: flex; align-items: center; gap: 14px; }
.who-text { display: flex; flex-direction: column; text-align: right; line-height: 1.25; }
.who-company { font-weight: 600; font-size: 14px; }
.who-me { font-size: 12px; color: #b8b8b8; }
.who-cnpj { font-weight: 400; font-size: 12px; color: #b8b8b8; margin-left: 6px; }
.btn-top { background: transparent; border: 1px solid #3a3a3e; color: #fff; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.btn-top:hover { border-color: #fff; }

.page { max-width: 1120px; margin: 0 auto; padding: 32px 20px 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink2); text-decoration: none; font-size: 14px; margin-bottom: 10px; }
.back:hover { color: var(--ink); text-decoration: underline; }

.demo-foot { max-width: 1120px; margin: 0 auto; padding: 0 20px 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink2); font-size: 13px; }
body:has(.savebar) .demo-foot { padding-bottom: 100px; }
/* Rodapé fixo de 40 px; o corpo reserva o espaço dele (a entrada não o tem). */
.site-foot { position: fixed; left: 0; right: 0; bottom: 0; height: 40px; background: #000000; color: #ffffff; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; line-height: 1; z-index: 40; }
body:has(.site-foot) { padding-bottom: 40px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-weight: 500; }
.btn-link:hover { color: var(--pumpkin-t); }

/* ── Botões ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 42px; }
.btn-primary { background: var(--orange); color: #000; }
.btn-primary:hover { background: var(--orange-d); }
.btn-primary[disabled] { background: var(--chip); color: #8a8a90; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--ink); border-color: #cdcdcd; }
.btn-secondary:hover { border-color: var(--ink); }
.btn-danger { background: var(--pumpkin); color: #000; }
.btn-danger:hover { background: #d4440f; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 13px; }
.btn-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; color: var(--ink); }
.btn-icon:hover { border-color: var(--ink); }
.btn-icon.warn { color: var(--pumpkin-t); border-color: var(--pumpkin); }

/* ── Cartões ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h.wrap { flex-wrap: wrap; }
.card-b { padding: 20px; }

/* ── Início ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.stat-l { color: var(--ink2); font-size: 13px; }
.stat-v { font: 600 34px/1.2 var(--f-title); margin-top: 4px; }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.now-list, .attn { list-style: none; margin: 0; padding: 8px 20px; }
.now-row { display: grid; grid-template-columns: 130px 1fr 70px; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.now-row:last-child { border-bottom: 0; }
.meter { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--orange); border-radius: 4px; }
.now-num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.attn li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.attn li:last-child { border-bottom: 0; }
.attn a { text-decoration: none; }
.attn a:hover { text-decoration: underline; }

/* ── Lista de usuários ── */
.toolbar { flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; }
.search input[type=search] { width: 100%; padding-left: 38px; }
.search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink2); display: flex; }
.filter select { min-width: 170px; }
.uhead, .urow { display: grid; grid-template-columns: minmax(0, 2.4fr) 130px 160px 110px; gap: 12px; align-items: center; padding: 12px 20px; }
.uhead { font: 600 12px var(--f-text); text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); background: #f6f6f6; border-bottom: 1px solid var(--line); }
.urow { border-bottom: 1px solid var(--line); }
.urow:last-child { border-bottom: 0; }
.urow.owner { background: #f6f6f6; }
.ucell-main { display: flex; flex-direction: column; text-decoration: none; min-width: 0; align-items: flex-start; }
.ucell-main b { font-weight: 600; }
.ucell-main span { color: var(--ink2); font-size: 13px; overflow-wrap: anywhere; }
a.ucell-main:hover b { text-decoration: underline; }
.urow [role="cell"] { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.uactions { flex-direction: row !important; gap: 8px; justify-content: flex-end; align-items: center !important; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge-neutral { background: var(--chip); color: var(--ink); }
.badge-blocked { background: var(--pumpkin-bg); color: var(--pumpkin-t); }
.badge-admin, .ucell-main span.badge-admin { background: var(--black); color: var(--orange); font-size: 12px; margin-top: 4px; }
.empty { padding: 48px 20px; text-align: center; display: flex; flex-direction: column; gap: 4px; color: var(--ink2); }
.empty b { color: var(--ink); }

/* ── Formulários ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label { font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=time], select {
  background: #fff; border: 1px solid #cdcdcd; border-radius: 10px; padding: 10px 12px; min-height: 42px; width: 100%;
}
input:hover, select:hover { border-color: var(--ink2); }
.has-err input { border-color: var(--pumpkin); }
.err { color: var(--pumpkin-t); font-size: 13px; min-height: 0; }
.err:empty { display: none; }
.form { max-width: 560px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.btn-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: var(--ink2); border-radius: 8px; }
.next-step { margin: -4px 0 20px; }

/* ── Login (mesmo desenho da tela "Entrar" do Canva) ── */
.login-split { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--bg); }
.login-side { flex: 1 1 440px; background: #000000; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.login-logo { display: block; width: 400px; max-width: 100%; height: auto; }
.login-pitch { display: flex; flex-direction: column; gap: 20px; max-width: 460px; }
.login-pitch h1 { color: #fff; font-size: 44px; line-height: 1.1; letter-spacing: 0; }
.login-pitch p { font-size: 17px; line-height: 1.6; color: #c8c8c8; }
.login-by { font-size: 13px; color: #a6a6a6; }
.login-main { flex: 1 1 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 48px 32px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.login-card h2 { font-size: 28px; margin-bottom: 6px; }
.login-lead { color: var(--ink2); line-height: 1.5; }
.login-card form { display: flex; flex-direction: column; gap: 20px; }
.login-card .field { margin: 0; }
.login-card label { font-weight: 500; font-size: 13px; }
.login-card input { min-height: 48px; padding: 12px 14px; border-color: #8c8c8c; font-size: 16px; }
.login-card .has-err input, .login-card input[aria-invalid=true] { border-color: var(--pumpkin); }
.btn-lg { min-height: 48px; font-size: 16px; }
.login-fail { padding: 12px 14px; border-radius: 10px; background: var(--pumpkin-bg); color: var(--pumpkin-t); font-size: 14px; line-height: 1.4; }
.login-fail:empty { display: none; }
.login-card .mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.login-forgot { align-self: center; font-size: 14px; font-weight: 400; }
.login-note { padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--ink2); }
.login-demo { font-size: 13px; color: var(--ink2); text-align: center; max-width: 400px; }

/* ── Abas ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { background: none; border: 0; padding: 12px 18px; font-weight: 600; color: var(--ink2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--orange); }
.count { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 6px; background: var(--black); color: var(--orange); border-radius: 999px; font-size: 12px; text-align: center; }

/* ── Aplicativos ── */
.presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appcards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 20px; }
.appcard { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; align-self: start; }
.appcard.on { border-color: var(--black); }
.appcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.appcard-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.appcard-t b { font: 600 16px var(--f-title); }
.appcard-t span { color: var(--ink2); font-size: 13px; }
.appcard-body { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.switch { flex: none; width: 44px; height: 26px; border-radius: 999px; border: 0; background: #c8c8c8; position: relative; cursor: pointer; padding: 0; transition: background .15s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on { background: var(--orange); }
.switch.on span { transform: translateX(18px); background: #000; }
.sched-off { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: var(--ink2); font-size: 13px; }
.sched-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { min-width: 46px; min-height: 36px; padding: 6px 10px; border-radius: 999px; border: 1px solid #cdcdcd; background: #fff; cursor: pointer; font-weight: 500; }
.chip[aria-pressed=true] { background: var(--black); color: #fff; border-color: var(--black); }
.sched-times { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
.sched-times .field { margin-bottom: 0; }
.sched-sum { font-weight: 600; margin-top: 12px; }
.sched-err { color: var(--pumpkin-t); font-weight: 500; margin-top: 10px; font-size: 13px; }

/* ── Simulador ── */
.sim-ctl { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 14px 0; }
.sim-ctl .field { margin-bottom: 0; min-width: 160px; }
.sim-ctl .btn { min-height: 42px; }
.sim-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sim-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sim-row:last-child { border-bottom: 0; }
.sim-name { font-weight: 600; }
.sim-row.open .sim-state { background: var(--black); color: var(--orange); padding: 1px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.sim-row.closed .sim-state { color: var(--pumpkin-t); font-weight: 500; text-align: right; }
.sim-row.none { background: #f6f6f6; }
.sim-row.none .sim-state { color: var(--ink2); }

/* ── Barra de salvar ── */
.savebar { position: fixed; left: 0; right: 0; bottom: 40px; background: #fff; border-top: 1px solid var(--line); z-index: 20; }
.savebar-in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.savebar-btns { display: flex; gap: 10px; }
.dirty-msg { color: var(--ink2); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.dirty-msg.on { color: var(--ink); font-weight: 600; }
.dirty-msg i { width: 9px; height: 9px; border-radius: 50%; background: var(--pumpkin); display: inline-block; }

/* ── Aviso e janela ── */
.toast { position: fixed; left: 50%; bottom: 124px; transform: translate(-50%, 20px); background: var(--black); color: #fff; padding: 12px 20px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-overlay { position: fixed; inset: 0; background: rgba(11,11,12,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; padding: 26px; max-width: 440px; width: 100%; }
.modal h2 { font-size: 20px; margin-bottom: 10px; }
.modal p { color: var(--ink2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ── Telas estreitas ── */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .appcards { grid-template-columns: 1fr; }
  .who-text { display: none; }
  .top-in { gap: 12px; }
}
@media (max-width: 720px) {
  h1 { font-size: 24px; }
  .uhead { display: none; }
  .urow { grid-template-columns: 1fr auto; row-gap: 8px; padding: 14px 16px; }
  .urow .ucell-main { grid-column: 1 / 2; }
  .urow .uactions { grid-column: 2 / 3; grid-row: 1 / 2; }
  .urow [data-label] { grid-column: 1 / -1; flex-direction: row !important; align-items: center !important; gap: 10px; }
  .urow [data-label]::before { content: attr(data-label); color: var(--ink2); font-size: 13px; min-width: 84px; }
  .now-row { grid-template-columns: 100px 1fr 56px; }
  .sched-times { grid-template-columns: 1fr 1fr; }
  .sched-times .field:last-child { grid-column: 1 / -1; }
  .login-side { padding: 32px 24px; gap: 28px; }
  .login-pitch h1 { font-size: 32px; }
  .login-main { padding: 32px 16px; }
  .login-card { padding: 28px 24px; }
  .savebar-in { flex-direction: column; align-items: stretch; }
  body:has(.savebar) .demo-foot { padding-bottom: 160px; }
  .savebar-btns .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
