.nav-side { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; flex: none; }
.nav-logout {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: #FDECEC;
  color: #D23B3A;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.nav-logout svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-logout:active { background: #F8D4D4; }
.nav-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border: 0.5px solid #93BFF2;
  border-radius: 999px;
  background: #E6F1FB;
  color: #185FA5;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.nav-date svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-date:active { background: #D5E8F8; }
.month-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding: 0 3px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 0.5px solid #D7E6F6;
  box-shadow: 0 1px 2px rgba(24, 95, 165, 0.06);
  color: #185FA5;
  font-size: 13px;
  font-weight: 600;
}
.month-nav button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #F3F8FD;
  color: #185FA5;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.month-nav button svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.month-nav button:active { background: #D5E8F8; }
.month-nav button.month-label {
  width: auto;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: transparent;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.month-nav button.month-label svg { width: 13px; height: 13px; stroke-width: 1.8; }
.month-picks { display: flex; gap: 8px; margin-bottom: 12px; }
.month-picks select {
  flex: 1;
  border: 0.5px solid #D9DCE0;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 16px;
  background: #fff;
  color: #1F2329;
}
button.num {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
button.num span { font-size: 13px; font-weight: 400; color: #86909C; }
.chip .minus {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #185FA5;
  color: #fff;
  font-style: normal;
  font-size: 14px;
  line-height: 14px;
  text-align: center;
  font-weight: 700;
}
.editbar {
  background: #E6F1FB;
  color: #185FA5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 12px;
}
.editbar.warn { background: #FAF0DC; color: #8A5A0B; }
.empty { text-align: center; color: #86909C; font-size: 13px; padding: 36px 12px; }
.search input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 0;
  background: transparent;
  font-size: 16px;
  color: #1F2329;
}
.search input::placeholder { color: #86909C; }
.addcat { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.addcat select {
  flex: 1;
  border: 0.5px solid #D9DCE0;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: #1F2329;
}
.quick-dates { display: flex; gap: 8px; margin: 2px 0 12px; }
.quick-dates button {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  border: 0.5px solid #93BFF2;
  background: #E6F1FB;
  color: #185FA5;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pick-preview { text-align: center; color: #4E5969; font-size: 13px; margin: 0 0 14px; }
.exp-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.exp-metrics span {
  background: #F4F8FC;
  color: #86909C;
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 8px;
}
.exp-metrics b { color: #185FA5; font-weight: 700; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: rgba(31, 35, 41, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 80;
  max-width: 86%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, 0.45);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mask[hidden] { display: none !important; }
.mask.cal-open {
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 32, 0.45);
  padding: 24px 16px;
}
.mask.cal-open .sheet {
  width: min(360px, 100%);
  height: auto;
  max-height: calc(100% - 24px);
  margin: 0 auto;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 18px 48px rgba(15, 23, 32, 0.22);
  overflow: auto;
}
.mask.cal-open .sheet::before { display: none; }
.cal-screen {
  height: auto;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.cal-bar, .cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  flex: none;
}
.cal-bar strong { font-size: 17px; font-weight: 600; }
.cal-bar button, .cal-foot button {
  border: none;
  background: none;
  color: #4E5969;
  font-size: 15px;
  cursor: pointer;
  padding: 6px 2px;
}
.cal-ok { color: #185FA5 !important; font-weight: 700; }
.cal-summary { text-align: center; color: #185FA5; font-size: 15px; font-weight: 600; margin: 0 16px 8px; }
.cal-ends { display: flex; gap: 10px; padding: 0 16px 8px; }
.cal-ends button {
  flex: 1;
  border: 0.5px solid #E5E7EB;
  background: #F7F8FA;
  border-radius: 12px;
  padding: 8px 10px;
  text-align: left;
  color: #1F2329;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.cal-ends button em { display: block; font-style: normal; color: #86909C; font-size: 12px; font-weight: 400; }
.cal-ends button.on { border-color: #185FA5; background: #F3F8FD; }
.cal-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 8px;
  flex: none;
}
.cal-month span { font-size: 18px; font-weight: 700; }
.cal-month button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #F3F8FD;
  color: #185FA5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cal-month button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week { padding: 0 10px; color: #86909C; font-size: 13px; text-align: center; flex: none; }
.cal-week span { padding: 6px 0; }
.cal-grid { flex: none; padding: 0 8px 8px; gap: 2px 0; }
.cal-day {
  height: 44px;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1F2329;
  font-size: 15px;
}
.cal-day span {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.cal-day.is-out { color: #C9CDD4; }
.cal-day.is-today span { box-shadow: inset 0 0 0 1.5px #185FA5; color: #185FA5; font-weight: 700; }
.cal-day.in-range { background: #E6F1FB; }
.cal-day.is-start { border-radius: 999px 0 0 999px; }
.cal-day.is-end { border-radius: 0 999px 999px 0; }
.cal-day.is-on span, .cal-day.is-start span, .cal-day.is-end span { background: #185FA5; color: #fff; font-weight: 700; box-shadow: none; }
.cal-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 4px 16px 16px;
}
.cal-months button {
  height: 52px;
  border: 0.5px solid #E8EAED;
  background: #F7F9FB;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #1F2329;
  cursor: pointer;
}
.cal-months button.on { background: #185FA5; color: #fff; border-color: #185FA5; }
.cal-months button:disabled { opacity: 0.35; cursor: default; }
.cal-foot {
  border-top: 0.5px solid #F0F1F3;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
}
.cal-foot button { color: #185FA5; font-weight: 600; }
.sheet {
  width: min(414px, 100%);
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 82vh;
  overflow: auto;
  box-shadow: 0 -12px 32px rgba(15, 23, 32, 0.12);
}
.sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #E1E4E8;
  margin: 6px auto 12px;
}
.sheet h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.field { display: block; margin-bottom: 12px; font-size: 13px; color: #4E5969; }
.field span { display: block; margin-bottom: 6px; }
.field input, .sheet input[type="text"], .sheet input[type="number"], .sheet input[type="password"], .sheet input[type="date"], .sheet select {
  width: 100%;
  border: 0.5px solid #D9DCE0;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 16px;
  outline: none;
  background: #fff;
  color: #1F2329;
}
.field input:focus, .sheet input:focus, .sheet select:focus { border-color: #185FA5; }
.sheet .actions { display: flex; flex-direction: column; gap: 8px; }
.sheet .actions button {
  width: 100%;
  border-radius: 10px;
  border: 0.5px solid #E5E7EB;
  background: #fff;
  padding: 12px 0;
  font-size: 15px;
  color: #1F2329;
  cursor: pointer;
}
.sheet .actions button.danger { color: #E24B4A; }
.sheet .actions button.pri { background: #185FA5; color: #fff; border-color: #185FA5; font-weight: 600; }
.app.auth .navbar, .app.auth .tabbar { display: none; }
.app.auth .content {
  display: flex;
  padding-top: calc(20px + env(safe-area-inset-top));
  background: linear-gradient(180deg, #D9EBFA 0%, #F3F5F8 46%);
}
.login { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px 2px 24px; }
.login .brand { text-align: center; margin-bottom: 22px; }
.login .logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: #FFFFFF;
  box-shadow: 0 10px 24px rgba(24, 95, 165, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login .logo svg { width: 36px; height: 36px; stroke: #185FA5; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login h2 { font-size: 24px; font-weight: 700; color: #185FA5; letter-spacing: -0.3px; }
.login .sub { color: #6B7785; font-size: 13px; margin-top: 6px; }
.login .card { padding: 20px 16px 16px; }
.remember { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-size: 13px; color: #4E5969; }
.remember input { width: 16px; height: 16px; accent-color: #185FA5; }
.login .btn { display: block; width: 100%; border: none; }
.copy {
  border: none;
  background: #E8F7F0;
  color: #0F6E56;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
}
@media (max-width: 390px) {
  .navbar { padding-left: 12px; padding-right: 12px; gap: 6px; }
  .navbar h1 { font-size: 16px; }
  .nav-side { gap: 6px; }
  .nav-date, .nav-logout { padding-left: 8px; padding-right: 8px; }
}
@media (min-width: 480px) {
  body { padding: 24px 0; }
  .app {
    height: min(896px, calc(100dvh - 48px));
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(15, 23, 32, 0.16);
  }
  .navbar { padding-left: 20px; padding-right: 20px; }
}
