* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #3A7BFF;
  --sky: #7CC4FF;
  --sky-soft: #E7F1FF;
  --green: #25D366;
  --green-soft: #4CAF50;
  --red: #D32F2F;
  --red-soft: #FF6B6B;
  --yellow: #F5C86B;
  --text: #0A0A0A;
  --sub: #6B7280;
  --bg: #FFFFFF;
  --card: #F5F6F8;
  --border: #EEE;
  --input: #F5F6F8;
  --radius: 16px;
  --nav-h: 82px;
}

body.dark {
  --blue: #7CC4FF;
  --sky: #B7E0FF;
  --sky-soft: #16202E;
  --text: #F5F6F8;
  --sub: #9CA3AF;
  --bg: #0E1116;
  --card: #1A1F27;
  --border: #232830;
  --input: #1A1F27;
}

html { background: var(--bg); min-height: 100%; transition: background .25s ease; }
html, body {
  min-height: 100dvh; overscroll-behavior: none;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
body { background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.hidden { display: none !important; }

.crawler-only {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: none;
}

/* PROCESS INDICATOR */
.process-indicator {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #111;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 999;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  max-width: 92%;
}
.process-indicator.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.process-indicator.success { background: var(--green-soft); }
.process-indicator.error { background: var(--red); }
.process-indicator.warning { background: #E8A100; color: #fff; }
.process-indicator.retry { background: var(--yellow); color: #5B3D00; }
.process-icon { font-size: 14px; }
.process-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* TOP BAR */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: 12px 20px; background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  transition: background .25s ease, border-color .25s ease;
}
.logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -0.2px; color: var(--text); flex: 1; }
body.dark .brand { color: var(--sky); }

.bell-btn {
  background: none; border: none; cursor: pointer;
  width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--red-soft);
  transition: background .18s ease;
  animation: bellFloat 2.4s ease-in-out infinite;
}
.bell-btn svg { width: 24px; height: 24px; }
.bell-btn:active { background: rgba(255,107,107,.15); }
@keyframes bellFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* APP LAYOUT */
.content { padding: 20px 20px calc(var(--nav-h) + 30px); min-height: calc(100dvh - 60px); }
.screen { display: none; animation: fade .18s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.screen-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 14px; color: var(--text); }
body.dark .screen-title { color: var(--sky); }

/* SEARCH + CHIPS */
.search-row { margin-bottom: 10px; }
.search-row input {
  width: 100%; padding: 14px 16px;
  background: var(--input); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  font-size: 15px; outline: none;
  transition: border-color .15s ease;
}
.search-row input:focus { border-color: var(--blue); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 9px 16px; border-radius: 999px;
  background: var(--card); color: var(--text);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.chip:active { transform: scale(.95); }
.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }
body.dark .chip.active { color: #0E1116; }

/* BUY GRID */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.04);
  cursor: pointer; position: relative;
  transition: transform .15s ease, background .25s ease;
}
.card:active { transform: scale(.97); }
.card.flash { animation: greenFlash 1.2s ease; }
@keyframes greenFlash {
  0% { box-shadow: 0 0 0 0 rgba(76,175,80,.8); background: rgba(76,175,80,.15); }
  100% { box-shadow: 0 0 0 22px rgba(76,175,80,0); background: var(--card); }
}
.thumb {
  width: 100%; aspect-ratio: 1/1;
  background: linear-gradient(135deg,#E4E7EC,#CFD5DE);
  border-radius: 12px; margin-bottom: 10px;
  background-size: cover; background-position: center;
}
body.dark .thumb { background: linear-gradient(135deg,#232830,#2F3540); }
.item-name { font-size: 14px; font-weight: 600; }
.item-price { font-size: 14px; color: var(--sub); margin-top: 2px; }
body.dark .item-price { color: var(--sky); }
.item-cat { font-size: 12px; color: var(--sub); margin-top: 4px; opacity: .85; }
.item-ref { font-size: 11px; color: var(--sub); margin-top: 4px; font-weight: 700; letter-spacing: .3px; }

.card.sold { opacity: .55; }
.card.sold .thumb { filter: grayscale(1); }
.card.sold .item-price { text-decoration: line-through; }
.sold-badge {
  position: absolute; top: 14px; left: 14px;
  background: var(--red); color: #fff;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .5px;
}
.sold-timer {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,.65); color: #fff;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}

/* FORMS */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 13px; font-weight: 700; color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.3px;
}
body.dark .field-label { color: var(--sky); }
.opt { font-style: italic; font-weight: 500; text-transform: none; color: var(--sub); }
input, select, textarea {
  width: 100%; padding: 14px;
  background: var(--input); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  font-size: 15px; font-family: inherit; outline: none;
  transition: border-color .15s ease, background .25s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--red) !important; animation: shake .4s ease; }
textarea { min-height: 90px; resize: vertical; }

/* BUTTONS */
.primary-btn {
  width: 100%; padding: 16px;
  background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform .12s ease, background .2s ease;
}
body.dark .primary-btn { color: #0E1116; }
.primary-btn:active { transform: scale(.97); }
.primary-btn:disabled { opacity: .6; cursor: not-allowed; }

.ghost-btn {
  width: 100%; padding: 14px;
  background: var(--card); color: var(--text);
  border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform .12s ease;
}
.ghost-btn:active { transform: scale(.97); }

.danger-btn {
  background: var(--red); color: #fff; border: none;
  border-radius: var(--radius); padding: 16px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  width: 100%; transition: transform .12s ease;
}
.danger-btn:active { transform: scale(.97); }

.success-btn {
  background: var(--green-soft); color: #fff; border: none;
  border-radius: var(--radius); padding: 16px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  width: 100%; transition: transform .12s ease;
}
.success-btn:active { transform: scale(.97); }
.success-btn:disabled, .danger-btn:disabled { background: #C9CFD8 !important; color: #fff !important; cursor: not-allowed; }

.wa-btn {
  display: inline-block; background: var(--green); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 14px 22px; font-weight: 700; font-size: 15px;
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease;
}
.wa-btn:active { transform: scale(.95); }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.btn-shake { animation: shake .4s ease; }

@keyframes successPulse {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,.6); }
  100% { box-shadow: 0 0 0 18px rgba(37,211,102,0); }
}
.btn-success { background: var(--green-soft) !important; color: #fff !important; animation: successPulse .8s ease; }
.btn-error { background: var(--red) !important; color: #fff !important; animation: shake .4s ease; }

/* PROFILE SPLASH */
.profile-splash {
  position: relative;
  background: linear-gradient(135deg, var(--sky-soft), var(--bg) 70%);
  border-radius: 20px;
  padding: 26px 20px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
  overflow: hidden;
  animation: splashIn .6s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes splashIn {
  from { opacity: 0; transform: translateY(-14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.profile-splash::before {
  content: "";
  position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(58,123,255,.25), transparent 70%);
  animation: floatSlow 6s ease-in-out infinite;
}
@keyframes floatSlow {
  0%,100% { transform: translateY(0) scale(1); opacity: .9; }
  50% { transform: translateY(12px) scale(1.06); opacity: 1; }
}

.splash-ring {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--blue), var(--sky), var(--blue));
  padding: 3px;
  animation: ringSpin 5s linear infinite;
  flex: 0 0 auto;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }
.splash-ring .avatar {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 24px;
  animation: ringSpinBack 5s linear infinite;
}
@keyframes ringSpinBack { to { transform: rotate(-360deg); } }
body.dark .splash-ring .avatar { color: #0E1116; }

.profile-info { position: relative; z-index: 1; flex: 1; }
.profile-name { font-size: 20px; line-height: 1.3; animation: nameIn .5s ease .2s both; }
@keyframes nameIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.profile-uid { font-size: 12px; color: var(--sub); margin-top: 4px; font-weight: 700; letter-spacing: .3px; }

/* LISTS */
.list { display: flex; flex-direction: column; gap: 8px; }
.list.stagger .row { opacity: 0; transform: translateY(10px); animation: rowIn .4s cubic-bezier(.2,.8,.3,1.1) forwards; }
.list.stagger .row:nth-child(1) { animation-delay: .30s; }
.list.stagger .row:nth-child(2) { animation-delay: .38s; }
.list.stagger .row:nth-child(3) { animation-delay: .46s; }
.list.stagger .row:nth-child(4) { animation-delay: .54s; }
.list.stagger .row:nth-child(5) { animation-delay: .62s; }
.list.stagger .row:nth-child(6) { animation-delay: .70s; }
.list.stagger .row:nth-child(7) { animation-delay: .78s; }
.list.stagger .row:nth-child(8) { animation-delay: .86s; }
.list.stagger .row:nth-child(9) { animation-delay: .94s; }
.list.stagger .row:nth-child(10){ animation-delay: 1.02s; }
@keyframes rowIn { to { opacity: 1; transform: translateY(0); } }

.row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); padding: 18px 16px; border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s ease, transform .12s ease;
}
.row:active { transform: scale(.98); background: #ECEEF1; }
body.dark .row:active { background: #232830; }
.row-icon { font-size: 18px; }
.row-label { flex: 1; font-size: 16px; font-weight: 600; color: var(--text); }
.arrow { color: #B0B4BB; font-size: 20px; }
body.dark .arrow { color: var(--sky); }
.row.danger .row-label { color: var(--red); }

/* BOTTOM NAV */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 20;
  transition: background .25s ease, border-color .25s ease;
}
.nav-btn {
  background: none; border: none;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; padding: 8px 12px;
  color: rgba(10,10,10,0.55);
  transition: transform .18s ease, color .18s ease;
}
body.dark .nav-btn { color: rgba(183,224,255,0.55); }
.nav-btn .icon-box {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s ease, transform .18s ease;
}
.nav-btn svg { width: 24px; height: 24px; }
.nav-label { font-size: 12px; font-weight: 700; opacity: 0.85; }
.nav-btn.active { color: var(--blue); transform: translateY(-2px); }
.nav-btn.active .icon-box { background: rgba(58,123,255,0.12); }
body.dark .nav-btn.active .icon-box { background: rgba(124,196,255,0.18); }
.nav-btn.active .nav-label { opacity: 1; }

/* SHEETS */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.overlay.open { display: flex; }
.sheet {
  position: relative; width: 100%; max-width: 520px;
  background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 26px 22px calc(30px + env(safe-area-inset-bottom));
  max-height: 92dvh; overflow-y: auto;
  animation: slideUp .22s cubic-bezier(.2,.8,.3,1.1);
  transition: background .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-close {
  position: absolute; top: 14px; right: 16px;
  background: var(--card); border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer;
  font-size: 14px; color: var(--sub);
}
.sheet h2 { font-size: 22px; font-weight: 800; margin-bottom: 16px; letter-spacing: -0.3px; }
.sheet p { color: var(--sub); font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.sheet .big { font-size: 32px; font-weight: 800; color: var(--text); margin: 8px 0 14px; }
body.dark .sheet .big { color: var(--sky); }

/* CAROUSEL */
.carousel-wrap { position: relative; margin-bottom: 14px; }
.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 6px 8px; scroll-behavior: smooth; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel .slide {
  flex: 0 0 82%; aspect-ratio: 4/3;
  background: linear-gradient(135deg,#E4E7EC,#CFD5DE);
  border-radius: 16px; scroll-snap-align: center;
  display: flex; align-items: center; justify-content: center;
  color: var(--sub); font-weight: 700; font-size: 14px;
  background-size: cover; background-position: center;
}
body.dark .carousel .slide { background: linear-gradient(135deg,#232830,#2F3540); }
.carousel-hint { display: flex; justify-content: center; gap: 40px; color: var(--sub); font-size: 12px; font-weight: 700; margin-top: -4px; margin-bottom: 8px; }

.img-row { display: flex; gap: 12px; margin: 6px 0; }
.img-ph {
  flex: 1; aspect-ratio: 1/1;
  background: var(--input); border: 2px dashed #C9CFD8;
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--sub); font-size: 13px; font-weight: 700;
  text-align: center; line-height: 1.4;
  cursor: pointer; overflow: hidden;
  background-size: cover; background-position: center;
  transition: transform .12s ease, border-color .15s ease;
}
.img-ph:active { transform: scale(.97); border-color: var(--blue); }
body.dark .img-ph { border-color: #2F3540; color: var(--sky); }
.img-ph.has-image { border-style: solid; border-color: var(--green); color: transparent; }

/* TOGGLE */
.toggle-wrap {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 14px;
  padding: 16px; margin-bottom: 12px;
}
.switch {
  position: relative; width: 52px; height: 30px;
  background: #C9CFD8; border-radius: 999px;
  transition: background .2s ease; cursor: pointer;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; background: #fff; border-radius: 50%;
  transition: transform .2s ease;
}
.switch.on { background: var(--blue); }
.switch.on::after { transform: translateX(22px); }

/* DROPDOWN */
.search-drop { position: relative; }
.drop-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 220px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; z-index: 5;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  display: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.drop-list.open { display: block; }
.drop-item { padding: 12px 14px; font-size: 15px; cursor: pointer; transition: background .12s ease; }
.drop-item:hover, .drop-item:active { background: var(--card); }
.drop-empty { padding: 12px 14px; color: var(--sub); font-size: 14px; }

/* MISC */
.loc-list { display: flex; flex-direction: column; gap: 6px; max-height: 45vh; overflow-y: auto; }
.loc-item { padding: 14px 16px; background: var(--card); border-radius: 12px; font-size: 15px; font-weight: 600; }
body.dark .loc-item { color: var(--sky); }

.notif { background: var(--card); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.notif strong { display: block; font-size: 15px; margin-bottom: 4px; }
.notif span { color: var(--sub); font-size: 13px; }
.notif.read { opacity: .6; }

.map-ph {
  height: 120px; border-radius: 16px;
  background: linear-gradient(135deg,#E7F0FF,#F5F8FF);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue); font-weight: 800; font-size: 16px;
  margin-bottom: 14px;
}
body.dark .map-ph { background: linear-gradient(135deg,#152033,#1E2B42); color: var(--sky); }

.counters { display: flex; gap: 10px; }
.counter { flex: 1; background: var(--card); border-radius: 14px; padding: 16px; text-align: center; }
.counter strong { display: block; font-size: 22px; font-weight: 800; }
body.dark .counter strong { color: var(--sky); }
.counter span { color: var(--sub); font-size: 13px; }

.wa-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.wa-row p { flex: 1; margin: 0; font-size: 13px; color: var(--sub); }

.detail-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.detail-row {
  display: flex; justify-content: space-between;
  padding: 12px 14px; background: var(--card); border-radius: 12px;
  font-size: 15px;
}
.detail-row span:first-child { color: var(--sub); }
.detail-row span:last-child { font-weight: 700; }
.detail-row.total { background: rgba(58,123,255,.10); border: 1px solid rgba(58,123,255,.25); }
body.dark .detail-row.total { background: rgba(124,196,255,.14); border-color: rgba(124,196,255,.3); }

.sheet-actions { display: flex; gap: 10px; margin-top: 12px; }
.sheet-actions button { flex: 1; }

.locked-note {
  font-size: 13px; color: var(--sub);
  background: var(--card); padding: 10px 14px;
  border-radius: 12px; margin-bottom: 12px; text-align: center;
}
body.dark .locked-note { color: var(--sky); }

.muted { color: var(--sub); text-align: center; margin-top: 14px; }

/* TRACKER */
.tracker-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 16px; color: var(--text); }
body.dark .tracker-title { color: var(--sky); }

.tracker-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border: 1px solid var(--border);
  padding: 14px 16px; border-radius: 14px;
  margin-bottom: 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .12s ease;
}
.tracker-item:active { transform: scale(.98); }

.counterparty {
  background: linear-gradient(135deg, var(--sky-soft), var(--card));
  border-radius: 14px; padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid rgba(58,123,255,.18);
}
body.dark .counterparty { border-color: rgba(124,196,255,.22); }
.cp-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--sub); margin-bottom: 4px; }
.cp-name { font-size: 16px; font-weight: 800; }
.cp-phone { font-size: 13px; color: var(--sub); margin-top: 2px; }

.timeline { position: relative; padding-left: 6px; }
.timeline::before {
  content: ""; position: absolute; left: 23px; top: 20px; bottom: 20px;
  width: 2px; background: var(--border);
}
.tl-day {
  display: flex; gap: 14px; margin-bottom: 22px;
  position: relative;
  opacity: 0; transform: translateY(10px);
  animation: dayIn .35s ease forwards;
}
.tl-day:nth-child(1) { animation-delay: .05s; }
.tl-day:nth-child(2) { animation-delay: .10s; }
.tl-day:nth-child(3) { animation-delay: .15s; }
.tl-day:nth-child(4) { animation-delay: .20s; }
.tl-day:nth-child(5) { animation-delay: .25s; }
.tl-day:nth-child(6) { animation-delay: .30s; }
.tl-day:nth-child(7) { animation-delay: .35s; }
.tl-day:nth-child(8) { animation-delay: .40s; }
.tl-day:nth-child(9) { animation-delay: .45s; }
.tl-day:nth-child(10){ animation-delay: .50s; }
@keyframes dayIn { to { opacity: 1; transform: translateY(0); } }

.tl-num {
  flex: 0 0 36px; height: 36px; border-radius: 50%;
  background: var(--card); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  position: relative; z-index: 1;
  border: 2px solid var(--bg);
}
.tl-day.done .tl-num { background: var(--green-soft); color: #fff; }
.tl-day.pending .tl-num { background: var(--yellow); color: #5B3D00; }
.tl-day.action .tl-num { background: var(--red); color: #fff; animation: pulseRed 1.8s infinite ease-in-out; }
.tl-day.info .tl-num { background: var(--blue); color: #fff; }
.tl-day.transit .tl-num { background: var(--blue); color: #fff; }
.tl-day.calendar .tl-num { background: var(--blue); color: #fff; }
@keyframes pulseRed {
  0%,100% { box-shadow: 0 0 0 0 rgba(211,47,47,.5); }
  50% { box-shadow: 0 0 0 10px rgba(211,47,47,0); }
}

.tl-body { flex: 1; background: var(--card); border-radius: 14px; padding: 14px 16px; }
.tl-day.action .tl-body { background: rgba(211,47,47,.06); border: 1px solid rgba(211,47,47,.25); }
.tl-body h4 { font-size: 15px; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.tl-body p { font-size: 13px; color: var(--sub); line-height: 1.45; margin: 0; }

.tl-actions { display: flex; gap: 8px; margin-top: 10px; }
.tl-actions button {
  flex: 1; padding: 10px; border-radius: 10px;
  border: none; font-size: 13px; font-weight: 700;
  cursor: pointer; background: var(--bg); color: var(--text);
  transition: transform .1s ease;
}
.tl-actions button:active { transform: scale(.96); }
.tl-actions button.okay { background: var(--blue); color: #fff; }
body.dark .tl-actions button.okay { color: #0E1116; }
.tl-actions button.okay.confirmed { background: var(--green-soft); }

.pay-btn {
  width: 100%; margin-top: 12px; padding: 14px;
  background: var(--red); color: #fff;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 800; cursor: pointer;
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
  0%,100% { transform: scale(1); box-shadow: 0 4px 12px rgba(211,47,47,.35); }
  50% { transform: scale(1.015); box-shadow: 0 6px 22px rgba(211,47,47,.55); }
}
.pay-btn:active { transform: scale(.97); }

.income-block {
  margin-top: 10px; padding: 18px; border-radius: 16px;
  background: linear-gradient(135deg, #E8F9EC, #F5FFF8);
  border: 1px solid rgba(76,175,80,.3);
}
body.dark .income-block { background: linear-gradient(135deg,#0F2015,#152B1C); border-color: rgba(76,175,80,.35); }
.income-block h3 { font-size: 17px; font-weight: 800; margin-bottom: 4px; color: var(--green-soft); display: flex; align-items: center; gap: 8px; }
.income-block p { font-size: 13px; color: var(--sub); margin-bottom: 12px; }
.income-block button {
  width: 100%; padding: 14px;
  background: var(--green-soft); color: #fff;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 800; cursor: pointer;
  transition: transform .12s ease;
}
.income-block button:active { transform: scale(.97); }
.income-block button:disabled { background: #C9CFD8 !important; cursor: not-allowed; }

/* PILL TOGGLE */
.pill-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
.pill-toggle button {
  flex: 1; padding: 14px; border-radius: 999px;
  background: var(--card); color: var(--sub);
  border: 1px solid var(--border);
  font-size: 14px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, background .18s ease, color .18s ease;
}
.pill-toggle button:active { transform: scale(.97); }
.pill-toggle button.active { background: var(--red); color: #fff; border-color: var(--red); }
.pill-toggle svg { width: 18px; height: 18px; }

/* PAY METHODS */
.pay-methods { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.pay-method {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; background: var(--card); border-radius: 14px;
  cursor: pointer; transition: transform .12s ease, background .18s ease;
}
.pay-method:active { transform: scale(.97); }
.pay-method .pm-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
body.dark .pay-method .pm-icon { background: #232830; }
.pay-method .pm-icon.wa { background: var(--green); }
.pay-method .pm-icon.gm { background: #EA4335; }
.pay-method .pm-icon svg { width: 22px; height: 22px; }
.pay-method .pm-icon.wa svg, .pay-method .pm-icon.gm svg { stroke: #fff; }
.pay-method .pm-text { flex: 1; }
.pay-method .pm-text strong { display: block; font-size: 15px; color: var(--text); }
.pay-method .pm-text span { font-size: 13px; color: var(--sub); }
.pay-method .pm-arrow { color: var(--sub); font-size: 20px; }

.secure-note { text-align: center; font-size: 12px; color: var(--sub); margin-top: 14px; }

/* TOAST */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px);
  transform: translateX(-50%) translateY(20px);
  background: #111; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.income-warning {
  background: rgba(211,47,47,.08);
  color: var(--red);
  padding: 10px 14px; border-radius: 12px;
  font-size: 13px; font-weight: 700; margin-top: 4px;
}
body.dark .income-warning { background: rgba(211,47,47,.18); }

/* AUTH SCREENS */
.auth-screen {
  display: none;
  position: fixed; inset: 0;
  background: linear-gradient(160deg, var(--sky-soft), var(--bg) 60%);
  z-index: 100;
  overflow-y: auto;
  padding: 40px 24px calc(40px + env(safe-area-inset-bottom));
}
.auth-screen.active { display: flex; align-items: center; justify-content: center; animation: authIn .35s ease; }
@keyframes authIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.auth-inner {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.auth-back {
  position: absolute; top: -8px; left: -8px;
  background: var(--card); border: none;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 22px; color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo {
  width: 120px; height: 120px;
  border-radius: 28px;
  object-fit: cover;
  margin: 0 auto 8px;
  box-shadow: 0 12px 30px rgba(58,123,255,.25);
  animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.auth-title {
  font-size: 26px; font-weight: 800;
  text-align: center; letter-spacing: -0.5px;
  color: var(--text);
}
body.dark .auth-title { color: var(--sky); }
.auth-tag {
  text-align: center;
  font-size: 14px; color: var(--sub);
  margin-bottom: 24px;
  line-height: 1.5;
}
.auth-head {
  font-size: 24px; font-weight: 800;
  margin: 12px 0 18px;
  letter-spacing: -0.5px;
  color: var(--text);
}
body.dark .auth-head { color: var(--sky); }
.auth-note {
  font-size: 12px; color: var(--sub);
  text-align: center; margin-top: 8px; line-height: 1.5;
}
.auth-error {
  color: var(--red);
  font-size: 13px; font-weight: 700;
  min-height: 18px;
  padding-left: 4px;
}

.auth-btn {
  width: 100%; padding: 16px;
  border: none; border-radius: 14px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, background .18s ease;
}
.auth-btn:active { transform: scale(.97); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }
.auth-btn.primary { background: var(--blue); color: #fff; }
body.dark .auth-btn.primary { color: #0E1116; }
.auth-btn.ghost {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border);
}
.auth-btn.google {
  background: #fff; color: #222;
  border: 1px solid #E1E5EB;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
body.dark .auth-btn.google { background: #1A1F27; color: #F5F6F8; border-color: #232830; }

.g-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: #EA4335; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}

.auth-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--sub); font-size: 12px; font-weight: 700;
  margin: 6px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* MODAL BLUR */
.modal-blur {
  position: fixed; inset: 0;
  background: rgba(10,14,20,.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
}
.modal-blur.center { align-items: center; }
.modal-blur.open { display: flex; }

.modal-sheet {
  width: 100%; max-width: 520px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 26px 22px calc(30px + env(safe-area-inset-bottom));
  max-height: 92dvh;
  display: flex; flex-direction: column;
  animation: modalUp .28s cubic-bezier(.2,.8,.3,1.1);
  transition: background .25s ease;
  overflow-y: auto;
}
@keyframes modalUp { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.3px; }
body.dark .modal-title { color: var(--sky); }
.modal-sub { color: var(--sub); font-size: 14px; margin-bottom: 16px; line-height: 1.5; }

.modal-scroll { overflow-y: auto; margin-bottom: 16px; padding-right: 4px; }

.rules-list {
  padding-left: 20px;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 16px;
}
.rules-list li { font-size: 15px; line-height: 1.5; color: var(--text); }
.rules-love {
  font-size: 13px; color: var(--blue);
  font-style: italic; text-align: center;
  padding: 10px; background: var(--sky-soft);
  border-radius: 12px;
}
body.dark .rules-love { color: var(--sky); }

.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; }

.modal-form { max-height: 60dvh; overflow-y: auto; padding-right: 4px; }

/* CREDENTIALS BLOCK */
.cred-block {
  background: var(--card);
  border-radius: 16px;
  padding: 8px 14px;
  margin: 8px 0 16px;
}
.cred-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.cred-row:last-child { border-bottom: none; }
.cred-label { color: var(--sub); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.cred-value { font-size: 15px; font-weight: 800; letter-spacing: .3px; color: var(--text); word-break: break-word; text-align: right; }
body.dark .cred-value { color: var(--sky); }

/* DOWNLOAD APP MODAL */
.download-popup {
  width: 92%; max-width: 420px;
  background: var(--bg);
  border-radius: 22px;
  padding: 26px 22px;
  animation: popIn .25s cubic-bezier(.2,.8,.3,1.1);
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  text-align: center;
}
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.download-icon-wrap {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--sky-soft), var(--blue-soft, #E7F1FF));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  animation: logoFloat 3s ease-in-out infinite;
}
.download-icon-wrap svg {
  width: 36px; height: 36px;
  stroke: var(--blue);
  stroke-width: 2;
}
body.dark .download-icon-wrap svg { stroke: var(--sky); }

.download-title {
  font-size: 22px; font-weight: 800;
  margin-bottom: 6px; letter-spacing: -0.3px;
}
body.dark .download-title { color: var(--sky); }

.download-sub {
  font-size: 14px; color: var(--sub);
  margin-bottom: 20px; line-height: 1.5;
}

.download-benefits {
  text-align: left;
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.download-benefit {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text); font-weight: 600;
}
.download-benefit .check {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--green-soft); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex: 0 0 auto;
}

.download-btn {
  width: 100%; padding: 16px;
  background: var(--sky, #7CC4FF);
  color: #fff;
  border: none; border-radius: 14px;
  font-size: 16px; font-weight: 800;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .12s ease, background .18s ease;
  margin-bottom: 10px;
}
.download-btn:active { transform: scale(.97); }
.download-btn svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2; }
body.dark .download-btn { color: #0E1116; }