:root{
  --bg:#f6f4f8;
  --surface:#ffffff;
  --surface-2:#fbf8fc;
  --line:#eadff0;
  --text:#1f2430;
  --muted:#7f7888;

  --primary:#e100a8;
  --primary-2:#b0008f;
  --accent:#ff4fcf;
  --success:#39b97a;
  --danger:#e35d5d;

  --shadow:0 10px 28px rgba(176,0,143,.10);
  --radius:18px;
  --safe-top:env(safe-area-inset-top, 0px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);

  --topbar-h:84px;
  --bottom-nav-h:86px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
html{-webkit-text-size-adjust:100%}

body{
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

button,input,select,textarea{font:inherit}
button{-webkit-tap-highlight-color:transparent}
input,select,textarea{
  appearance:none;
  -webkit-appearance:none;
}

.appSplash{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.65), rgba(255,255,255,0) 40%),
    linear-gradient(180deg,#f7f4f8 0%, #f0ebf4 100%);
  transition:opacity .45s ease, visibility .45s ease;
}

.appSplash.is-hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.appSplashCard{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:28px;
  transform:translateY(-24px);
}

.appSplashLogo{
  width:260px;
  height:260px;
  object-fit:contain;
  display:block;
  margin-bottom:8px;
}

.appSplashTitle{
  margin-top:6px;
  font-size:28px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.6px;
  color:var(--text);
}

.appSplashReg{
  font-size:.58em;
  vertical-align:top;
  margin-left:2px;
}

.appSplashSub{
  margin-top:8px;
  font-size:14px;
  font-weight:700;
  color:var(--muted);
  letter-spacing:.2px;
}

.mobileApp{
  min-height:100vh;
  background:var(--bg);
}

.mobileTopbar{
  position:sticky;
  top:0;
  z-index:120;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:var(--topbar-h);
  padding:calc(12px + var(--safe-top)) 16px 12px;
  background:rgba(255,255,255,.94);
  border-bottom:1px solid var(--line);
  backdrop-filter:blur(12px);
}

.mobileBrand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.mobileLogo{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  overflow:hidden;
  background:#fff;
  box-shadow:0 10px 22px rgba(225,0,168,.18);
  border:1px solid rgba(225,0,168,.10);
}

.mobileLogoImg{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.mobileBrand > div:last-child{
  min-width:0;
}

.mobileTitle{
  font-size:17px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.2px;
}

.mobileSub{
  margin-top:3px;
  font-size:12px;
  color:var(--muted);
  font-weight:700;
}

.mobileTopActions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}

.iconBtn{
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(225,0,168,.08);
  font-size:18px;
  font-weight:800;
}

.mobileContent{
  padding:16px 14px calc(var(--bottom-nav-h) + 26px + var(--safe-bottom));
}

.view{display:none}
.view.is-active{display:block}

.heroStack{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.heroCard,
.mobileSectionCard{
  width:100%;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow);
}

.heroCard{padding:16px}
.mobileSectionCard{
  padding:16px;
  margin-bottom:14px;
}

.compactCard{margin-top:14px}
.previewCard{padding-bottom:12px}

.heroHead,
.sectionMiniHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.heroTitle,
.sectionMiniTitle{
  font-weight:900;
  letter-spacing:-.4px;
  color:var(--text);
}

.heroTitle{font-size:20px}
.sectionMiniTitle{font-size:19px}

.heroHint{
  margin-top:4px;
  color:var(--muted);
  font-size:13px;
  font-weight:600;
}

.mobileKpis{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.miniRadialCard{
  min-height:144px;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.miniRadial{
  width:108px;
  height:108px;
  border-radius:999px;
  display:grid;
  place-items:center;
  position:relative;
}

.miniRadial::before{
  content:"";
  position:absolute;
  inset:10px;
  background:#fff;
  border-radius:999px;
  z-index:1;
}

.miniRadialInner{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.miniRadialInner strong{
  font-size:25px;
  line-height:1;
  font-weight:900;
  letter-spacing:-.4px;
}

.miniRadialInner span{
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.35px;
}

.ring-a{
  background:conic-gradient(var(--primary) 0 285deg, #f3deee 285deg 360deg);
}

.ring-b{
  background:conic-gradient(var(--accent) 0 255deg, #fde6f7 255deg 360deg);
}

.ring-c{
  background:conic-gradient(var(--success) 0 300deg, #e5f6ee 300deg 360deg);
}

.moneyCard{
  margin-top:12px;
  background:linear-gradient(180deg,#ffffff,#fcf8fc);
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
}

.moneyCard.small{margin-top:0}

.moneyLabel{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  letter-spacing:.45px;
  text-transform:uppercase;
}

.moneyValue{
  margin-top:8px;
  font-size:34px;
  line-height:1.02;
  font-weight:900;
  letter-spacing:-.8px;
  word-break:break-word;
}

.quickGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.quickAction{
  min-height:54px;
  border:none;
  border-radius:16px;
  background:#fff;
  color:var(--text);
  font-weight:900;
  box-shadow:var(--shadow);
  border:1px solid var(--line);
  cursor:pointer;
  padding:12px;
}

.quickAction.primary{
  background:linear-gradient(180deg,var(--primary),var(--primary-2));
  color:#fff;
  border:none;
}

.stackFields{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.field{min-width:0}

.field label{
  display:block;
  margin:0 0 7px;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
  letter-spacing:.25px;
  text-transform:uppercase;
}

.fieldRow2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.input{
  width:100%;
  min-width:0;
  min-height:52px;
  padding:14px 14px;
  border-radius:15px;
  border:1px solid #eadff0;
  background:#fff;
  color:var(--text);
  outline:none;
  box-shadow:none;
}

.input::placeholder{color:#a79cac}

.input:focus{
  border-color:#f04cc8;
  box-shadow:0 0 0 4px rgba(225,0,168,.10);
}

textarea.input{
  resize:vertical;
  min-height:110px;
}

.mobileItems{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.mobileItemCard{
  border:1px solid var(--line);
  background:var(--surface-2);
  border-radius:18px;
  padding:12px;
}

.mobileItemGrid{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.itemRow2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.itemTotal{
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-top:1px dashed rgba(176,0,143,.12);
  padding-top:10px;
  margin-top:2px;
}

.itemTotal span{
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  text-transform:uppercase;
}

.itemTotal strong{
  font-size:18px;
  font-weight:900;
}

.itemDelete{
  width:100%;
  min-height:44px;
  border-radius:14px;
  border:1px solid #f0cccc;
  background:#fff3f3;
  color:#c95757;
  font-weight:800;
  cursor:pointer;
}

.totalsMobile{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin-top:14px;
}

.totMini{
  border:1px solid var(--line);
  background:var(--surface-2);
  border-radius:16px;
  padding:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.totMini span{
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.4px;
  font-weight:800;
}

.totMini strong{
  font-size:20px;
  font-weight:900;
  text-align:right;
}

.totMini.grand{
  background:linear-gradient(180deg,var(--primary),var(--primary-2));
  border-color:transparent;
}

.totMini.grand span,
.totMini.grand strong{
  color:#fff;
}

.mobileActionBar{
  position:sticky;
  bottom:calc(var(--bottom-nav-h) + 8px + var(--safe-bottom));
  z-index:60;
  display:grid;
  grid-template-columns:1fr auto auto 1fr;
  gap:10px;
  padding:10px;
  background:rgba(246,244,248,.92);
  backdrop-filter:blur(10px);
  border:1px solid rgba(234,223,240,.85);
  border-radius:18px;
  margin:6px 0 18px;
}

.flex1{width:100%}

.mobileListCards{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:12px;
}

.compactList .listCard{padding:12px 14px}

.listCard{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
}

.listCardTop{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}

.listTitle{
  font-size:16px;
  font-weight:900;
  line-height:1.2;
}

.listSub{
  margin-top:4px;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
  word-break:break-word;
}

.listMeta{
  margin-top:12px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.metaBlock{
  border:1px solid var(--line);
  background:#fff;
  border-radius:14px;
  padding:10px;
}

.metaLabel{
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.3px;
}

.metaValue{
  margin-top:5px;
  font-size:14px;
  font-weight:800;
  word-break:break-word;
}

.cardActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

.searchWrap{position:relative}

.searchInput{padding-right:48px}

.searchClear{
  position:absolute;
  top:50%;
  right:10px;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  border:none;
  border-radius:999px;
  background:#f5e8f2;
  color:#8a5b7d;
  font-weight:900;
  cursor:pointer;
  display:none;
}

.searchClear.show{
  display:grid;
  place-items:center;
}

.is-hidden{
  display:none !important;
}

.previewBox{
  width:100%;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
}

.mobilePreviewBox{
  height:68vh;
  min-height:520px;
}

.previewBox iframe{
  width:100%;
  height:100%;
  border:0;
  background:#fff;
}

.modal{
  position:fixed;
  inset:0;
  z-index:300;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:0;
  background:rgba(20,24,32,.30);
  backdrop-filter:blur(4px);
}

.mobileModalCard{
  width:100%;
  max-width:640px;
  border-radius:24px 24px 0 0;
  background:#fff;
  border:none;
  box-shadow:0 -10px 40px rgba(176,0,143,.12);
  max-height:90vh;
  overflow:auto;
}

.modalHead{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  padding:16px 16px 14px;
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  background:#fff;
  z-index:2;
}

.modalTitle{
  font-size:18px;
  font-weight:900;
}

.modalHint{
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
}

.modalBody{
  padding:16px;
}

.btn{
  min-height:46px;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid #eadff0;
  background:#fff;
  color:var(--text);
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  text-decoration:none;
}

.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.btn.ghost{background:#fff}

.btn.primary{
  background:linear-gradient(180deg,var(--primary),var(--primary-2));
  color:#fff;
  border:none;
}

.btn.danger{
  background:#fff2f2;
  color:#cb5555;
  border:1px solid #f2d4d4;
}

.smallBtn{
  min-height:40px;
  padding:9px 12px;
  font-size:13px;
}

.rowBtns{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  background:#f6edf4;
  color:#8a5b7d;
  white-space:nowrap;
}

.badge.ok{
  background:#e7f7ef;
  color:#248a5d;
}

.badge.warn{
  background:#fff1f8;
  color:#b0008f;
}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 11px;
  border-radius:999px;
  background:var(--surface-2);
  border:1px solid var(--line);
  font-size:12px;
  font-weight:800;
  color:var(--text);
}

.hint{
  color:var(--muted);
  font-size:12px;
  margin-top:8px;
}

.bottomNav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:120;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:8px;
  min-height:var(--bottom-nav-h);
  padding:10px 12px calc(10px + var(--safe-bottom));
  background:rgba(255,255,255,.95);
  border-top:1px solid var(--line);
  backdrop-filter:blur(12px);
}

.bottomLink{
  border:none;
  background:transparent;
  color:var(--muted);
  min-height:50px;
  border-radius:14px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  padding:8px 6px;
}

.bottomLink.is-active{
  background:linear-gradient(180deg,var(--primary),var(--primary-2));
  color:#fff;
  box-shadow:0 8px 18px rgba(225,0,168,.20);
}

@media (max-width:420px){
  .fieldRow2,
  .itemRow2,
  .quickGrid,
  .mobileKpis,
  .listMeta{
    grid-template-columns:1fr;
  }

  .mobileActionBar{
    grid-template-columns:1fr 1fr;
  }

  .moneyValue{
    font-size:30px;
  }

  .mobilePreviewBox{
    min-height:460px;
  }

  .appSplashLogo{
    width:120px;
    height:120px;
  }

  .appSplashTitle{
    font-size:24px;
  }
}

@media (max-width:380px){
  .mobileContent{
    padding-left:12px;
    padding-right:12px;
  }

  .bottomNav{
    gap:6px;
    padding-left:8px;
    padding-right:8px;
  }

  .bottomLink{
    font-size:11px;
    padding:8px 4px;
  }

  .mobileTitle{
    font-size:16px;
  }
}
