:root {
  --bg: #fff7f4;
  --bg-soft: #fffdfb;
  --card: rgba(255,255,255,.86);
  --text: #2b2426;
  --muted: #75676b;
  --line: rgba(120, 89, 96, .16);
  --primary: #d96d83;
  --primary-dark: #b94e64;
  --accent: #f2c7d0;
  --good: #5b9279;
  --warn: #bc7c31;
  --danger: #be4b59;
  --shadow: 0 16px 44px rgba(89, 54, 63, .12);
  --radius: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body::before { content: ""; position: fixed; inset: 0; background: radial-gradient(circle at top left, #ffe3dc 0, transparent 34%), radial-gradient(circle at 95% 20%, #ffe9ef 0, transparent 28%), linear-gradient(135deg, #fff8f3 0%, #fff4f7 55%, #f9fbff 100%); z-index: -1; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: var(--primary-dark); }
.app-shell { max-width: 980px; margin: 0 auto; min-height: 100vh; padding: 18px 14px calc(92px + var(--safe-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 18px; }
.brand h1 { margin: 0; font-size: 28px; letter-spacing: -0.7px; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; background: rgba(255,255,255,.65); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; backdrop-filter: blur(18px); }
.card h2, .card h3 { margin: 0 0 10px; letter-spacing: -0.3px; }
.card h2 { font-size: 22px; }
.card h3 { font-size: 18px; }
.muted { color: var(--muted); }
.big-money { font-size: 32px; font-weight: 800; letter-spacing: -1px; margin: 2px 0; }
.money { font-weight: 750; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }
.divider { height: 1px; background: var(--line); margin: 10px 0; }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 12px 16px; border-radius: 17px; background: var(--primary); color: white; font-weight: 700; box-shadow: 0 10px 24px rgba(217, 109, 131, .25); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--primary-dark); box-shadow: none; border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.small { min-height: 34px; padding: 8px 11px; border-radius: 13px; font-size: 13px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
form { display: grid; gap: 10px; }
.field { display: grid; gap: 6px; }
label { color: var(--muted); font-size: 13px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.82); color: var(--text); border-radius: 16px; min-height: 46px; padding: 12px 13px; outline: none; }
textarea { min-height: 86px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(217,109,131,.12); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; max-width: 980px; margin: 0 auto; padding: 8px 10px calc(8px + var(--safe-bottom)); background: rgba(255, 250, 249, .88); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.tab { min-height: 52px; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 18px; color: var(--muted); font-size: 11px; background: transparent; }
.tab span { font-size: 18px; line-height: 1; }
.tab.active { background: #fff; color: var(--primary-dark); box-shadow: 0 8px 22px rgba(89, 54, 63, .1); font-weight: 700; }
.list { display: grid; gap: 9px; }
.item { background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.item.done { opacity: .58; }
.item.done .item-title { text-decoration: line-through; }
.item-title { font-weight: 750; }
.progress { height: 10px; background: rgba(217,109,131,.13); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--w, 0%); background: linear-gradient(90deg, var(--primary), #edb4c1); border-radius: inherit; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: rgba(217,109,131,.11); color: var(--primary-dark); font-size: 12px; font-weight: 700; }
.notice { padding: 12px; border-radius: 18px; background: rgba(188,124,49,.12); color: #6f4317; border: 1px solid rgba(188,124,49,.18); }
.empty { padding: 16px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 18px; background: rgba(255,255,255,.45); }
.login { display: grid; align-content: center; min-height: 100vh; max-width: 430px; margin: 0 auto; padding: 24px; }
.login-logo { width: 78px; height: 78px; display: grid; place-items: center; border-radius: 28px; background: #fff; box-shadow: var(--shadow); font-size: 36px; margin-bottom: 16px; }
.error { color: var(--danger); font-size: 14px; }
.success { color: var(--good); font-size: 14px; }
.linkish { background: transparent; color: var(--primary-dark); padding: 0; min-height: auto; box-shadow: none; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { padding: 12px; background: rgba(255,255,255,.6); border: 1px solid var(--line); border-radius: 18px; }
.kpi b { display: block; font-size: 18px; margin-top: 3px; }
.searchline { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
@media (max-width: 720px) {
  .grid.two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr; }
  .brand h1 { font-size: 25px; }
  .big-money { font-size: 28px; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .tabs { gap: 2px; padding-left: 6px; padding-right: 6px; }
  .tab { font-size: 10px; min-height: 50px; border-radius: 15px; }
}
.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto auto; gap: 8px; align-items: center; }
.cat-row input { min-height: 40px; padding: 9px 11px; }
.compact-list .item { padding: 11px 12px; }
.notice { margin-top: 10px; }
@media (max-width: 520px) {
  .cat-row { grid-template-columns: 1fr 90px; }
  .cat-row .btn { width: 100%; }
}

/* v8 clean interface */
.tabs { grid-template-columns: repeat(4, 1fr); }
.kpis.one { grid-template-columns: 1fr; }
.overdue-soft { background: rgba(255, 249, 246, .9); border-color: rgba(188,124,49,.18); }
.soft-warn { background: rgba(188,124,49,.10); color: #8a5a24; }
.tiny-badge { display: inline-flex; margin-left: 6px; padding: 3px 7px; border-radius: 999px; background: rgba(217,109,131,.10); color: var(--primary-dark); font-size: 11px; font-weight: 700; vertical-align: middle; }
.tiny-badge.warn { background: rgba(188,124,49,.11); color: #8a5a24; }
.tiny-badge.soon { background: rgba(91,146,121,.12); color: #3f735c; }
.item.task { transition: background .2s ease, border-color .2s ease; }
.item.task-today { background: rgba(255,255,255,.78); border-color: rgba(217,109,131,.18); }
.item.task-soon { background: rgba(247,253,250,.78); border-color: rgba(91,146,121,.20); }
.item.task-overdue { background: rgba(255,249,246,.82); border-color: rgba(188,124,49,.20); }
@media (max-width: 520px) {
  .tabs { grid-template-columns: repeat(4, 1fr); }
}

/* v9 folder edit + cleaner task time field */
.row > .field { flex: 1 1 0; min-width: 0; }
.task-date-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 150px); gap: 10px; align-items: end; }
.task-date-row .field { min-width: 0; }
.task-date-row input[type="time"] { text-align: center; padding-left: 10px; padding-right: 10px; }
.folder-actions { margin-top: 10px; justify-content: flex-start; }
.folder-actions .btn { box-shadow: none; }
.folder-item .muted { margin-top: 3px; }
@media (max-width: 560px) {
  .task-date-row { grid-template-columns: 1fr; }
}


/* v10: mobile finance folders only on home + safer iPhone date/time layout */
.task-date-row input { min-width: 0; max-width: 100%; }
.task-date-row input[type="date"], .task-date-row input[type="time"] { -webkit-appearance: none; appearance: none; }
@media (max-width: 560px) {
  .task-date-row { grid-template-columns: 1fr; gap: 10px; }
  .task-date-row input[type="date"], .task-date-row input[type="time"] { width: 100%; text-align: left; }
}
