/* Sloth Adventures app: dark glass over a blurred photo (same family as Familia Finanzas OS). */
:root {
  --bg: #0c1210; --card: rgba(6, 11, 9, .5); --card-2: rgba(220, 255, 236, .06);
  --ink: #eef4ee; --muted: #a8b9af; --line: #dcffec1c; --line-2: #dcffec29;
  --accent: #6ee0a1; --accent-ink: #062a16; --amber: #f2c46d; --blue: #7cc4f5; --red: #ff9a8f;
  --t-red: #ff7b72; --t-orange: #ffa25c; --t-yellow: #f5d061; --t-lime: #c3e86e; --t-green: #6ee0a1; --t-gray: #9aa8a0;
  --r-lg: 22px; --r-md: 16px; --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; min-height: 100dvh; color: var(--ink); font: 500 16px/1.4 Urbanist, system-ui, sans-serif; background: var(--bg); padding: 0 16px calc(104px + env(safe-area-inset-bottom)); }
body::before { content: ""; position: fixed; inset: -40px; z-index: -1; background: linear-gradient(#0c121080, #0c1210d9), url(/bg.jpg) center/cover; filter: blur(16px) saturate(1.15); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3, p { margin: 0; }

.top, #view { max-width: 620px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 0 14px; }
.top img { border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }
.top-t { flex: 1; display: grid; line-height: 1.2; }
.top-t b { font-weight: 800; font-size: 18px; }
.top-t span { color: var(--muted); font-size: 14px; }
.top-t span::first-letter { text-transform: uppercase; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line-2); color: var(--muted); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sec { margin: 22px 0 10px; display: flex; align-items: baseline; justify-content: space-between; }
.sec h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.sec span { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 26px 12px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }

.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 14px 34px #0005, inset 0 1px 0 #ffffff12; }
.list { display: grid; gap: 10px; }

/* Counters on Hoy */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px 12px; text-align: left; }
.stat b { display: block; font-size: 28px; font-weight: 800; line-height: 1; }
.stat span { color: var(--muted); font-size: 13px; }

/* To-do card: what to do + one button */
.todo { padding: 16px; display: grid; gap: 12px; animation: rise .5s var(--ease) both; }
.todo-body { text-align: left; display: grid; gap: 2px; width: 100%; }
.kick { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.todo-body b { font-size: 19px; font-weight: 700; }
.todo-body small, .row small { color: var(--muted); font-size: 14.5px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.primary, .ghost, .danger { min-height: 50px; border-radius: 999px; padding: 0 20px; font-weight: 700; font-size: 16.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; transition: transform .2s var(--ease), filter .2s; }
.primary { background: linear-gradient(180deg, #8af0b6, var(--accent)); color: var(--accent-ink); box-shadow: 0 8px 22px #6ee0a133, inset 0 1px 0 #fff6; }
.ghost { background: var(--card-2); border: 1px solid var(--line-2); }
.danger { color: var(--red); border: 1px solid #ff9a8f44; }
.primary:active, .ghost:active, .danger:active, .row:active { transform: scale(.98); }
.primary svg, .ghost svg { width: 19px; height: 19px; flex: none; }
.btns { display: grid; gap: 10px; }
.btns.two { grid-template-columns: 1fr 1fr; }

/* Rows: trips and clients */
.row { width: 100%; padding: 14px; display: flex; align-items: center; gap: 13px; text-align: left; transition: transform .2s var(--ease); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-main b { font-size: 17.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { display: grid; justify-items: end; gap: 5px; flex: none; }
.row-end b { font-weight: 800; }
.cal { flex: none; width: 54px; height: 58px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.cal b { font-size: 21px; font-weight: 800; }
.cal span { font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--accent); letter-spacing: .06em; }
.ava { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--card-2); border: 1px solid var(--line-2); color: var(--accent); }

.chip { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); margin-bottom: 12px; }
.seg button { min-height: 42px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.seg button.is-on { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }

input, select, textarea { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-md); background: #0006; border: 1px solid var(--line-2); outline: 0; font-size: 16.5px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #a8b9af99; }
select option { color: #111; }
.search { margin-bottom: 12px; }
label { display: grid; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.form { display: grid; gap: 14px; }
.form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Bottom dock */
.dock { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; width: min(calc(100% - 28px), 460px); display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 4px; align-items: center; padding: 7px; border-radius: 999px; background: rgba(6, 11, 9, .78); border: 1px solid var(--line-2); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); box-shadow: 0 16px 40px #0009; }
.dock button { min-height: 56px; border-radius: 999px; display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.dock svg { width: 23px; height: 23px; }
.dock button.is-on { color: var(--accent); background: #6ee0a114; }
.dock .dock-add { width: 56px; background: linear-gradient(180deg, #8af0b6, var(--accent)); color: var(--accent-ink); margin-left: 4px; }

/* Bottom sheet */
#scrim { position: fixed; inset: 0; z-index: 30; background: #000a; animation: fade .25s both; }
#sheet { position: fixed; z-index: 31; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 620px); max-height: 92dvh; overflow-y: auto; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: #0e1613f2; border: 1px solid var(--line-2); border-bottom: 0; backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px); animation: up .38s var(--ease) both; }
@keyframes up { from { transform: translate(-50%, 40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 12px; }
.sheet-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.sheet-h div { flex: 1; min-width: 0; }
.sheet-h h3 { font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.sheet-h p { color: var(--muted); }
.x { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line-2); font-size: 20px; line-height: 1; color: var(--muted); }

/* Trip progress */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); margin: 4px 0 16px; }
.steps div { display: grid; justify-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); position: relative; text-align: center; }
.steps div::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #0c1210; border: 2px solid var(--line-2); z-index: 1; }
.steps div::after { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.steps div:first-child::after { display: none; }
.steps .done::before { background: var(--accent); border-color: var(--accent); }
.steps .done::after { background: var(--accent); }
.steps .done { color: var(--ink); }
.steps .now::before { box-shadow: 0 0 0 5px #6ee0a12e; }

.facts { display: grid; margin-bottom: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card-2); }
.facts div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts span { color: var(--muted); flex: none; }
.facts b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.facts .ok { color: var(--accent); } .facts .wait { color: var(--amber); }
.note { color: var(--muted); font-size: 14.5px; text-align: center; margin: -4px 0 12px; }
.sub-h { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }

#toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -20px); z-index: 50; padding: 11px 18px; border-radius: 999px; background: #eef4ee; color: #0c1210; font-weight: 700; opacity: 0; pointer-events: none; transition: .3s var(--ease); max-width: calc(100% - 32px); text-align: center; }
#toast.is-on { opacity: 1; transform: translate(-50%, 0); }

#login { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: #0c1210cc; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.login-card { width: min(100%, 360px); padding: 28px 22px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.login-card img { border-radius: 50%; object-fit: cover; }
.login-card h1 { font-size: 24px; font-weight: 800; }
.login-card p { color: var(--muted); }
.login-card input { text-align: center; letter-spacing: .3em; font-size: 22px; }
.err { color: var(--red) !important; min-height: 1.4em; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Stage colors: red = far from closing → green = done */
.chip.red, .kick.red { --t: var(--t-red); } .chip.orange, .kick.orange { --t: var(--t-orange); }
.chip.yellow, .kick.yellow { --t: var(--t-yellow); } .chip.lime, .kick.lime { --t: var(--t-lime); }
.chip.green, .kick.green { --t: var(--t-green); } .chip.gray, .kick.gray { --t: var(--t-gray); }
.kick[class*=" "] { color: var(--t); }
.chip[class*=" "] { color: var(--t); border-color: color-mix(in srgb, var(--t) 40%, transparent); background: color-mix(in srgb, var(--t) 10%, transparent); }
.facts .wait { color: var(--t-yellow); }

/* Compact phone sizing */
@media (max-width: 560px) {
  body { font-size: 15px; padding: 0 14px calc(92px + env(safe-area-inset-bottom)); }
  .top { padding: calc(10px + env(safe-area-inset-top)) 0 10px; gap: 10px; }
  .top img { width: 36px; height: 36px; } .top-t b { font-size: 17px; } .top-t span { font-size: 13px; }
  .icon-btn { width: 40px; height: 40px; }
  .stats { gap: 8px; } .stat { padding: 10px 12px; border-radius: 16px; } .stat b { font-size: 23px; } .stat span { font-size: 12.5px; }
  .sec { margin: 18px 0 8px; } .sec h2 { font-size: 19px; }
  .list { gap: 8px; } .card { border-radius: 18px; }
  .todo { padding: 13px; gap: 10px; } .todo-body b { font-size: 17px; } .todo-body small, .row small { font-size: 13.5px; }
  .kick { font-size: 11px; }
  .primary, .ghost, .danger { min-height: 46px; font-size: 15.5px; }
  .btns { gap: 8px; }
  .row { padding: 11px 12px; gap: 11px; } .row-main b { font-size: 16px; }
  .cal { width: 46px; height: 50px; border-radius: 12px; } .cal b { font-size: 18px; } .cal span { font-size: 10.5px; }
  .ava { width: 40px; height: 40px; }
  .chip { font-size: 11.5px; padding: 2px 9px; }
  .seg button { min-height: 38px; font-size: 14.5px; }
  input, select, textarea { min-height: 46px; padding: 10px 12px; border-radius: 14px; font-size: 16px; }
  textarea { min-height: 70px; } .form { gap: 11px; } label { font-size: 13.5px; gap: 5px; }
  .dock { bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px; } .dock button { min-height: 50px; font-size: 11.5px; } .dock svg { width: 21px; height: 21px; } .dock .dock-add { width: 50px; }
  #sheet { padding: 8px 14px calc(18px + env(safe-area-inset-bottom)); }
  .sheet-h { margin-bottom: 10px; } .sheet-h h3 { font-size: 20px; } .x { width: 36px; height: 36px; }
  .steps { margin: 2px 0 12px; } .steps div { font-size: 10.5px; }
  .facts { margin-bottom: 12px; } .facts div { padding: 9px 12px; font-size: 14.5px; }
  .note { font-size: 13.5px; } .sub-h { margin: 14px 0 6px; }
}

.link { color: var(--accent); font-weight: 700; font-size: 14.5px; padding: 6px 0; }
.dock button { position: relative; }
.badge { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--t-red); color: #2a0703; font: 800 11px/18px Urbanist, sans-serif; font-style: normal; }
@media (max-width: 560px) { .dock button { font-size: 10.5px; } .dock { width: calc(100% - 20px); } }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; position: relative; top: -2px; }
.dot.red { background: var(--t-red); box-shadow: 0 0 0 4px #ff7b7226; animation: pulse 1.8s ease-in-out infinite; }
.dot.yellow { background: var(--t-yellow); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px #ff7b7200; } }
.mini-list { padding: 4px 0; }
.mini { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k i" "b i" "s i"; text-align: left; padding: 11px 14px; border-top: 1px solid var(--line); }
.mini:first-child { border-top: 0; }
.mini .kick { grid-area: k; font-size: 10.5px; } .mini b { grid-area: b; font-size: 16px; font-weight: 700; } .mini small { grid-area: s; color: var(--muted); font-size: 13.5px; }
.mini i { grid-area: i; align-self: center; font-style: normal; font-size: 24px; color: var(--muted); }
.mini.more { display: block; text-align: center; color: var(--accent); font-weight: 700; font-size: 14.5px; }
.mini-empty { color: var(--muted); text-align: center; padding: 16px; }

/* Home overview */
.hero-urg, .follow { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 16px; text-align: left; }
.hero-urg { margin-top: 4px; border-color: #ff7b7255; background: linear-gradient(135deg, #ff7b721f, rgba(6,11,9,.5) 60%); }
.hero-urg span, .follow span { flex: 1; font-weight: 800; font-size: 18px; }
.hero-urg b { font-size: 30px; font-weight: 800; color: var(--t-red); }
.follow b { font-size: 24px; font-weight: 800; color: var(--t-yellow); }
.hero-urg em, .follow em { font-style: normal; color: var(--muted); font-weight: 700; font-size: 14px; }
.follow em { font-size: 24px; }
.follow { margin-top: 12px; }
.sq-row { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; margin: 0 -2px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.sq-row::-webkit-scrollbar { display: none; }
.sq { flex: none; width: 128px; min-height: 104px; padding: 12px; display: grid; align-content: space-between; gap: 6px; text-align: left; scroll-snap-align: start; border-radius: 16px; }
.sq .kick { font-size: 10px; line-height: 1.25; } .sq b { font-size: 16.5px; font-weight: 800; } .sq small { color: var(--muted); font-size: 13px; }
.pipe { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pipe-t { padding: 12px 4px 10px; display: grid; justify-items: center; gap: 2px; border-radius: 16px; border-top: 3px solid var(--t); }
.pipe-t b { font-size: 24px; font-weight: 800; color: var(--t); line-height: 1.1; } .pipe-t span { font-size: 11px; font-weight: 700; color: var(--muted); }
.pipe-t.red { --t: var(--t-red); } .pipe-t.orange { --t: var(--t-orange); } .pipe-t.yellow { --t: var(--t-yellow); } .pipe-t.lime { --t: var(--t-lime); } .pipe-t.green { --t: var(--t-green); }
.filter { margin: -2px 0 12px; font-size: 13px; padding: 5px 12px; }

/* Urgent squares: wrap in a grid (no side scroll), tight padding */
.sq-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; overflow: visible; padding: 8px 0 0; margin: 0; }
.sq { width: auto; min-height: 0; padding: 10px 12px; gap: 3px; align-content: start; border-radius: 14px; }
.sq .kick { font-size: 9.5px; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq b { font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq small { font-size: 12.5px; }
@media (min-width: 560px) { .sq-row { grid-template-columns: repeat(3, 1fr); } }

/* Mobile fixes */
.sheet-h { position: sticky; top: -10px; z-index: 2; margin: 0 -18px 12px; padding: 4px 18px 10px; background: #0e1613; }
@media (max-width: 560px) { .sheet-h { top: -8px; margin: 0 -14px 10px; padding: 4px 14px 8px; } }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; text-align: left; line-height: 24px; }
input::-webkit-date-and-time-value { text-align: left; }
.row-main small:last-child { overflow: visible; }
