
:root{
  --bg:#fff9f8;--card:#fff;--text:#2f2624;--muted:#8f7d78;--line:#efe2df;
  --pink:#ef5f82;--pink-soft:#fde8ed;--beige:#f8efe7;--green:#edf5e5;--violet:#f2eafa;
  --shadow:0 16px 40px rgba(87,57,51,.08);
}
*{box-sizing:border-box}
html{background:var(--bg)}
body{margin:0;background:linear-gradient(#fffdfc,#fff8f7);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text)}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.app{max-width:520px;margin:auto;min-height:100vh;position:relative;padding-bottom:120px}
.header{display:flex;justify-content:space-between;align-items:center;padding:calc(22px + env(safe-area-inset-top)) 20px 16px}
.header h1{font-family:Georgia,serif;font-style:italic;font-weight:500;font-size:31px;margin:0}
.header h1 span{color:var(--pink);font-size:20px}
.header p{margin:4px 0 0;font-size:17px}
.header-icon{position:relative;border:0;background:transparent;width:48px;height:48px}
.header-icon svg{width:34px;fill:none;stroke:#513b37;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.header-icon i{position:absolute;width:10px;height:10px;background:var(--pink);border-radius:50%;right:7px;top:5px}
main{padding:0 14px}
.screen{display:none}.screen.active{display:block}
.week-card{background:var(--card);border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);overflow:hidden}
.week-head{display:flex;justify-content:space-between;align-items:center;padding:18px 16px;border-bottom:1px solid var(--line)}
.week-head h2{margin:0;font-size:22px;text-align:center}
.week-head p{margin:5px 0 0;text-align:center;color:var(--muted)}
.arrow{width:48px;height:48px;border:0;border-radius:16px;background:var(--pink-soft);color:var(--pink);font-size:33px;line-height:1}
.week-grid{display:grid;grid-template-columns:repeat(7,1fr)}
.day-column{min-height:190px;padding:14px 4px 12px;text-align:center;border-right:1px solid var(--line);background:#fff;position:relative}
.day-column:last-child{border-right:0}
.day-column.selected{background:linear-gradient(#fff,#fff0f3)}
.day-name{font-size:13px;color:#51413e;text-transform:uppercase}
.day-column.weekend .day-name,.day-column.weekend .day-number{color:var(--pink)}
.day-number{font-size:22px;font-weight:700;margin-top:7px}
.day-column.selected .day-number{display:flex;align-items:center;justify-content:center;margin:7px auto 0;width:42px;height:42px;border-radius:50%;background:var(--pink);color:#fff}
.event-dots{display:flex;gap:5px;flex-wrap:wrap;justify-content:center;max-width:34px;margin:15px auto 0;min-height:32px;align-content:flex-start}
.event-dots i{width:9px;height:9px;border-radius:50%;background:#e1b17a}
.event-dots i:nth-child(2n){background:#ed84a0}
.event-dots i:nth-child(3n){background:#a98ad2}
.event-count{position:absolute;left:3px;right:3px;bottom:12px;font-size:11px;color:#5e4c48}
.finance-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:14px 0}
.finance-card{min-height:183px;padding:14px 12px;border-radius:22px;border:1px solid rgba(255,255,255,.9);display:flex;flex-direction:column;box-shadow:0 10px 28px rgba(86,54,49,.05)}
.finance-card.rose{background:linear-gradient(145deg,#fff7f7,#fde8ec)}
.finance-card.green{background:linear-gradient(145deg,#fff,#edf5e5)}
.finance-card.violet{background:linear-gradient(145deg,#fff,#f1eafa)}
.finance-icon{width:45px;height:45px;border-radius:50%;display:grid;place-items:center;margin-bottom:10px}
.rose .finance-icon{background:#ffe1e7;color:#e84970}.green .finance-icon{background:#e8f3db;color:#679548}.violet .finance-icon{background:#eee3fa;color:#8e5bc0}
.finance-icon svg{width:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.finance-card h3{font-size:14px;line-height:1.35;margin:0 0 auto;font-weight:600}
.finance-card strong{font-size:21px;margin-top:12px}
.rose strong{color:#e9436c}.green strong{color:#5c9140}.violet strong{color:#8351b8}
.appointments-panel{background:var(--card);border:1px solid var(--line);border-radius:24px;padding:16px;box-shadow:var(--shadow)}
.panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.panel-head h2{font-size:20px;margin:0}.panel-head p{margin:4px 0 0;color:var(--muted);font-size:13px}
.appointments-list{display:grid;gap:10px}
.appointment{display:grid;grid-template-columns:72px 1fr;border:1px solid var(--line);border-radius:18px;overflow:hidden;background:linear-gradient(90deg,#fff,#fff8f8)}
.appointment-time{display:flex;flex-direction:column;justify-content:center;align-items:center;color:var(--pink);font-weight:700;border-left:4px solid var(--pink);padding:12px 7px;font-size:15px}
.appointment-body{padding:13px;display:grid;grid-template-columns:1fr auto;gap:8px}
.appointment-body h3{margin:0 0 4px;font-size:16px}.appointment-body p{margin:0;color:var(--muted);font-size:13px}
.appointment-price{font-weight:700;align-self:center}
.client-tag{display:inline-block;margin-top:7px;padding:5px 9px;border-radius:999px;background:var(--pink-soft);color:var(--pink);font-size:11px}
.empty{padding:26px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:18px}
.floating-add{position:fixed;right:max(18px,calc((100vw - 520px)/2 + 18px));bottom:110px;z-index:15;width:74px;height:74px;border:0;border-radius:50%;background:linear-gradient(145deg,#f76c8b,#eb4f76);color:#fff;box-shadow:0 14px 30px rgba(234,80,118,.35);display:flex;flex-direction:column;justify-content:center;align-items:center}
.floating-add span{font-size:34px;line-height:.8}.floating-add small{font-size:12px;margin-top:6px}
.bottom-nav{position:fixed;left:50%;transform:translateX(-50%);bottom:0;width:min(520px,100%);display:grid;grid-template-columns:repeat(5,1fr);background:rgba(255,255,255,.96);backdrop-filter:blur(20px);border-top:1px solid var(--line);padding:12px 5px calc(10px + env(safe-area-inset-bottom));z-index:20}
.bottom-nav button{border:0;background:transparent;color:#5a413c;display:flex;flex-direction:column;align-items:center;gap:5px;padding:0}
.bottom-nav svg{width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.bottom-nav span{font-size:12px;font-weight:600}
.bottom-nav button.active{color:var(--pink)}
.center-nav{transform:translateY(-15px)}
.center-icon{width:60px;height:60px;border-radius:50%;background:#fff;box-shadow:0 10px 26px rgba(93,57,50,.13);display:grid;place-items:center;border:1px solid #f3e4e1}
.center-icon svg{width:36px}
.section-title{display:flex;justify-content:space-between;align-items:end;margin:6px 3px 14px}
.section-title.secondary{margin-top:28px}
.section-title span{font-size:12px;color:var(--muted)}.section-title h2{margin:2px 0 0;font-family:Georgia,serif;font-size:25px;font-weight:500}
.round.small{width:42px;height:42px;border:0;border-radius:15px;background:var(--pink-soft);color:var(--pink);font-size:23px}
.simple-list{display:grid;gap:10px}
.simple-card{background:#fff;border:1px solid var(--line);border-radius:19px;padding:14px;box-shadow:0 10px 24px rgba(80,53,48,.05)}
.simple-card h3{margin:0 0 4px}.simple-card p{margin:3px 0;color:var(--muted);font-size:13px}.simple-card strong{float:right}
.source{display:inline-block;margin-top:7px;padding:5px 9px;border-radius:999px;background:var(--pink-soft);color:var(--pink);font-size:11px}
.delete{border:0;background:transparent;color:#bb7d89;padding:8px 0 0;font-size:12px}
dialog{border:0;padding:0;width:min(92vw,480px);max-height:88vh;border-radius:26px;background:#fff;box-shadow:0 30px 90px rgba(48,30,27,.3)}
dialog::backdrop{background:rgba(51,33,29,.45);backdrop-filter:blur(4px)}
form{padding:18px;max-height:88vh;overflow:auto}
.modal-head{display:flex;justify-content:space-between;align-items:start}.modal-head span{font-size:12px;color:var(--muted)}.modal-head h3{font-family:Georgia,serif;font-size:24px;font-weight:500;margin:3px 0}
.close{border:0;background:var(--beige);width:38px;height:38px;border-radius:50%;font-size:22px}
label{display:block;margin-top:13px;font-size:12px;color:var(--muted)}
input,select,textarea{width:100%;margin-top:6px;padding:13px 14px;border:1px solid var(--line);border-radius:15px;background:#fff;outline:none}
textarea{min-height:76px;resize:vertical}
menu{display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:16px 0 0;margin:0}
.ghost,.save{border:0;border-radius:15px;padding:13px;font-weight:700}.ghost{background:var(--beige)}.save{background:var(--pink);color:#fff}
.hidden{display:none!important}
@media(max-width:430px){
  .finance-card{padding:12px 9px;min-height:175px}.finance-card h3{font-size:12px}.finance-card strong{font-size:18px}
  .week-grid{overflow-x:auto}.day-column{min-width:52px}
}


/* Version 4: separate finance and analytics */
.finance-overview{display:grid;gap:10px}
.overview-main{
  padding:20px;border-radius:24px;
  background:linear-gradient(145deg,#f6eafa,#ffecef);
  border:1px solid var(--line);box-shadow:var(--shadow)
}
.overview-main span,.overview-main small,.overview-row span,.overview-row small{
  display:block;color:var(--muted);font-size:12px
}
.overview-main strong{display:block;font-size:31px;margin:8px 0;color:#7f55ad}
.overview-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.overview-row article{
  padding:15px;border-radius:20px;background:#fff;border:1px solid var(--line);
  box-shadow:0 9px 24px rgba(80,53,48,.05)
}
.overview-row strong{display:block;font-size:20px;margin:7px 0}
.overview-row article:first-child strong{color:#5f9544}
.overview-row article:last-child strong{color:#e34b70}

.analytics-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.analytics-card{
  min-height:142px;padding:16px;border-radius:22px;border:1px solid rgba(255,255,255,.9);
  display:flex;flex-direction:column;justify-content:space-between
}
.analytics-card span{font-size:13px;color:#705f5a}
.analytics-card strong{font-size:25px;line-height:1.05}
.analytics-card small{font-size:11px;color:var(--muted);line-height:1.35}
.pink-card{background:linear-gradient(145deg,#fff,#fde7ec)}
.green-card{background:linear-gradient(145deg,#fff,#edf5e5)}
.lilac-card{background:linear-gradient(145deg,#fff,#f1eafa)}
.wide-card{grid-column:1/-1;min-height:115px}
.wide-card strong{font-size:21px}
.analytics-section{
  margin-top:14px;padding:16px;border-radius:23px;background:#fff;
  border:1px solid var(--line);box-shadow:0 10px 28px rgba(80,53,48,.05)
}
.analytics-head span{font-size:12px;color:var(--muted)}
.analytics-head h3{margin:3px 0 14px;font-size:19px}
.bars-list{display:grid;gap:12px}
.bar-row{display:grid;grid-template-columns:92px 1fr 34px;gap:9px;align-items:center}
.bar-label{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar-track{height:10px;border-radius:999px;background:#f5ece9;overflow:hidden}
.bar-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#f2a1b4,#e85a7c)}
.bar-value{text-align:right;font-size:12px;font-weight:700}
.weekday-chart{
  height:170px;display:grid;grid-template-columns:repeat(7,1fr);gap:7px;
  align-items:end;padding-top:8px
}
.weekday-item{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px}
.weekday-value{font-size:11px;color:var(--muted)}
.weekday-bar-wrap{height:120px;width:100%;display:flex;align-items:flex-end;justify-content:center}
.weekday-bar{
  width:70%;min-height:4px;border-radius:9px 9px 3px 3px;
  background:linear-gradient(#b997d9,#f1c1cf)
}
.weekday-name{font-size:10px;color:#75635e}
.summary-list{display:grid;gap:2px}
.summary-list article{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line)}
.summary-list article:last-child{border-bottom:0}
.summary-list span{font-size:13px;color:var(--muted)}
.summary-list strong{font-size:16px}


/* Version 5 — redesigned weekly calendar */
.week-card{
  overflow:hidden;
  border:1px solid rgba(224,203,198,.72);
  border-radius:28px;
  background:rgba(255,255,255,.94);
  box-shadow:0 16px 38px rgba(92,58,51,.08);
}

.week-head{
  min-height:94px;
  padding:17px 16px 16px;
  border-bottom:1px solid #f2e7e4;
  background:linear-gradient(180deg,#fff,#fffcfb);
}

.week-head h2{
  font-size:20px;
  letter-spacing:-.02em;
}

.week-head p{
  margin-top:4px;
  font-size:13px;
}

.arrow{
  width:46px;
  height:46px;
  border-radius:16px;
  background:linear-gradient(145deg,#fff0f3,#fde5ea);
  box-shadow:none;
  font-size:30px;
}

.week-grid{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  padding:8px 7px 9px;
  gap:4px;
  background:#fff;
  overflow:visible;
}

.day-column{
  appearance:none;
  -webkit-appearance:none;
  min-width:0;
  min-height:166px;
  padding:13px 2px 10px;
  border:0;
  border-radius:18px;
  background:transparent;
  color:var(--text);
  position:relative;
  transition:transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.day-column::after{
  content:"";
  position:absolute;
  top:18px;
  right:-2px;
  width:1px;
  height:112px;
  background:#f2e8e5;
}

.day-column:last-child::after{
  display:none;
}

.day-column.selected{
  background:linear-gradient(180deg,#fff0f3 0%,#fff8f9 100%);
  box-shadow:inset 0 0 0 1px #f8dce3;
}

.day-name{
  font-size:11px;
  font-weight:600;
  letter-spacing:.02em;
  color:#806d68;
}

.day-column.weekend .day-name,
.day-column.weekend .day-number{
  color:#e65b7c;
}

.day-number{
  margin-top:8px;
  font-size:20px;
  line-height:1;
  font-weight:750;
}

.day-column.selected .day-number{
  width:39px;
  height:39px;
  margin-top:5px;
  background:linear-gradient(145deg,#f36a89,#e95176);
  box-shadow:0 8px 18px rgba(235,83,119,.25);
  font-size:19px;
}

.event-dots{
  min-height:28px;
  max-width:30px;
  margin:15px auto 0;
  gap:4px;
}

.event-dots i{
  width:7px;
  height:7px;
}

.event-count{
  left:0;
  right:0;
  bottom:8px;
  padding:0 1px;
  color:#8e7a75;
  font-size:9px;
  line-height:1.15;
  white-space:normal;
}

.day-column.selected .event-count{
  color:#d95375;
  font-weight:650;
}

/* Keep the weekly layout readable on narrow iPhones */
@media(max-width:430px){
  .week-grid{
    gap:2px;
    padding-left:5px;
    padding-right:5px;
  }

  .day-column{
    min-width:0;
    min-height:158px;
    border-radius:16px;
  }

  .day-name{
    font-size:10px;
  }

  .day-number{
    font-size:19px;
  }

  .day-column.selected .day-number{
    width:37px;
    height:37px;
  }

  .event-count{
    font-size:8.5px;
  }
}


/* Version 6 — editing, statuses and data safety */
.card-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:9px;
}
.card-action{
  border:0;
  border-radius:11px;
  padding:7px 10px;
  font-size:11px;
  font-weight:650;
}
.card-action.edit{
  background:#f5ece9;
  color:#6f5751;
}
.card-action.delete{
  background:#fff0f2;
  color:#c95670;
}
.status-chip{
  display:inline-flex;
  align-items:center;
  margin-top:7px;
  margin-right:5px;
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:650;
}
.status-planned{background:#f4eafa;color:#8053aa}
.status-completed{background:#eaf4e3;color:#5d8d45}
.status-cancelled{background:#f4ece9;color:#9b7770}
.appointment.cancelled{
  opacity:.58;
  filter:saturate(.55);
}
.appointment.completed{
  background:linear-gradient(90deg,#fff,#f7fbf3);
}
.data-card{
  display:grid;
  grid-template-columns:52px 1fr;
  gap:13px;
  padding:17px;
  margin-bottom:12px;
  border-radius:22px;
  border:1px solid var(--line);
  background:#fff;
  box-shadow:0 10px 28px rgba(80,53,48,.05);
}
.data-card.backup-card{background:linear-gradient(145deg,#fff,#f0f6e9)}
.data-card.restore-card{background:linear-gradient(145deg,#fff,#f7eaf0)}
.data-card.info-card{background:linear-gradient(145deg,#fff,#f4edf9)}
.data-icon{
  width:48px;height:48px;border-radius:16px;
  background:rgba(255,255,255,.85);
  display:grid;place-items:center;
}
.data-icon svg{
  width:25px;height:25px;fill:none;stroke:#c75f78;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
.data-card h3{margin:2px 0 6px;font-size:17px}
.data-card p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}
.data-action{
  grid-column:1/-1;
  border:0;border-radius:14px;padding:12px;
  background:var(--pink);color:#fff;font-weight:700;text-align:center;
}
.file-action{display:block;cursor:pointer}
.file-action input{display:none}
.danger-note{
  margin-top:10px;
  padding:10px 12px;
  border-radius:13px;
  background:#fff3f4;
  color:#a95d6c;
  font-size:12px;
  line-height:1.4;
}


/* Version 7 — visible save feedback */
.toast{
  position:fixed;
  left:50%;
  bottom:calc(112px + env(safe-area-inset-bottom));
  z-index:100;
  max-width:calc(100vw - 32px);
  padding:12px 18px;
  border-radius:999px;
  background:rgba(49,39,36,.94);
  color:#fff;
  font-size:13px;
  font-weight:700;
  box-shadow:0 14px 38px rgba(35,23,20,.25);
  opacity:0;
  transform:translate(-50%,18px);
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
}
.toast.show{
  opacity:1;
  transform:translate(-50%,0);
}
.save:disabled{
  opacity:.65;
  cursor:wait;
}


/* Version 8 — Web Push settings */
.notification-card{background:linear-gradient(145deg,#fff,#fff0f3)}
.settings-label{
  grid-column:1/-1;
  display:block;
  margin:0;
  color:var(--muted);
  font-size:12px;
}
.settings-label input,.settings-label select{
  margin-top:6px;
}
.notification-actions{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.notification-actions .data-action{
  grid-column:auto;
}
.secondary-data-action{
  background:#f2e8e5;
  color:#6b514b;
}
.notification-hint{
  grid-column:1/-1;
  padding:10px 12px;
  border-radius:13px;
  background:rgba(255,255,255,.7);
  font-size:11px!important;
}
.notification-card.enabled{
  box-shadow:inset 0 0 0 2px #b9d9a8,0 10px 28px rgba(80,53,48,.05);
}
