/* ==========================================================================
   FabElectrolysis Checklist — soft pink / beige / cream theme
   Built for iPad and phone first.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,500;1,600&family=Poppins:wght@300;400;500&family=Nunito+Sans:wght@400;600;700&display=swap');

/* Palette lifted straight from the fab checklist mark */
:root {
  --cream:        #FFFDFB;
  --beige:        #F4EDE5;
  --beige-deep:   #EADCCB;
  --blush:        #FCEDF1;
  --pink:         #F2C3D3;
  --pink-deep:    #E8759B;
  --rose:         #D2617F;
  --rose-dark:    #A94666;
  --ink:          #3B2A2E;
  --ink-soft:     #8A7377;
  --line:         #EEDFDF;
  --green:        #8FB89B;
  --shadow:       0 2px 10px rgba(178, 124, 133, .08);
  --shadow-lift:  0 8px 28px rgba(178, 124, 133, .16);
  --r:            18px;
  --safe-b:       env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 12% -8%,  var(--blush) 0%, transparent 62%),
    radial-gradient(1000px 560px at 92% 4%,   #FBF1E6   0%, transparent 58%),
    var(--cream);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ typography -- */

h1, h2, h3 {
  font-family: 'Poppins', -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  letter-spacing: -.2px;
}

.muted { color: var(--ink-soft); }

/* ----------------------------------------------------------------- logo --- */

.logo { display: inline-flex; align-items: center; gap: 13px; }

.logo-mark {
  width: 64px; height: 64px;
  display: block;
  flex-shrink: 0;
}

.logo-words { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }

.logo-fab {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 34px;
  color: var(--pink-deep);
  letter-spacing: .5px;
}

.logo-checklist {
  font-family: 'Poppins', -apple-system, 'Segoe UI', sans-serif;
  font-weight: 300;
  font-size: 21px;
  color: var(--ink);
  letter-spacing: .2px;
  margin-top: 2px;
}

.logo-sm { gap: 9px; }
.logo-sm .logo-mark { width: 34px; height: 34px; }
.logo-sm .logo-fab { font-size: 20px; }
.logo-sm .logo-checklist { font-size: 12.5px; margin-top: 1px; }

/* ---------------------------------------------------------- login/setup --- */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 253, 251, .92);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 34px 28px calc(28px + var(--safe-b));
  box-shadow: var(--shadow-lift);
}

.brand { text-align: center; margin-bottom: 28px; }

.brand-sub {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

label {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--ink-soft);
}

input[type=text], input[type=password], input[type=date], select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 14px 15px;
  font: inherit;
  font-size: 16px;              /* 16px stops iOS zoom-on-focus */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--pink-deep);
  box-shadow: 0 0 0 3px rgba(243, 198, 204, .45);
}

textarea { resize: vertical; line-height: 1.5; }

.hint {
  margin: 20px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--ink-soft);
}

.hint code {
  background: var(--beige);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 12px;
}

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s, filter .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .3; cursor: default; }

.btn-primary {
  background: linear-gradient(160deg, var(--pink-deep), var(--rose));
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  background: rgba(255, 255, 255, .75);
  border-color: var(--line);
  color: var(--rose-dark);
}

.btn-danger { background: #fff; border-color: #EBC3C3; color: #B4636B; }

.btn-block { width: 100%; margin-top: 6px; }

.btn-tiny { padding: 8px 13px; font-size: 13px; border-radius: 10px; }

/* --------------------------------------------------------------- alerts --- */

.alert {
  padding: 13px 16px;
  margin-bottom: 16px;
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-bad  { background: #FDECEE; border: 1px solid #F2CBD0; color: #9C4A57; }
.alert-good { background: #EFF6F0; border: 1px solid #CFE3D4; color: #4C7357; }

/* -------------------------------------------------------------- app shell -- */

.app-body { padding-bottom: calc(40px + var(--safe-b)); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 252, 249, .88);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 20px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.topbar-left { min-width: 0; }

.topbar-hello {
  margin: 2px 0 0;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.topbar-date {
  margin: 12px 0 0;
  font-size: 25px;
  line-height: 1.15;
  color: var(--rose-dark);
}

.topbar-right { display: flex; gap: 8px; flex-shrink: 0; }

/* ----------------------------------------------------------------- tabs --- */

.tabs {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px 12px;
  display: flex;
  gap: 10px;
}

.tab {
  flex: 1;
  padding: 12px 10px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  text-decoration: none;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition: all .18s;
  -webkit-tap-highlight-color: transparent;
}

.tab.is-active {
  background: linear-gradient(160deg, var(--blush), var(--beige));
  border-color: var(--pink);
  color: var(--rose-dark);
  box-shadow: var(--shadow);
}

.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .8);
  color: var(--rose);
}

/* ----------------------------------------------------------------- main --- */

.app-main { max-width: 820px; margin: 0 auto; padding: 20px; }

.hidden { display: none !important; }

.empty {
  padding: 26px 4px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ------------------------------------------------------------- progress --- */

.progress {
  height: 8px;
  margin-bottom: 18px;
  background: var(--beige);
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--pink), var(--pink-deep));
  transition: width .35s ease;
}

.all-done {
  margin: 22px 0 0;
  padding: 16px;
  text-align: center;
  font-family: 'Poppins', -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--rose-dark);
  background: linear-gradient(160deg, var(--blush), var(--beige));
  border-radius: var(--r);
}

/* ------------------------------------------------------------ task list --- */

.task-list { list-style: none; margin: 0; padding: 0; }

.task {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: background .2s, border-color .2s, opacity .2s;
  overflow: hidden;
}

.task.is-done {
  background: linear-gradient(160deg, #FBF4EE, #F7EFF0);
  border-color: var(--pink);
}

.task-main {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 8px 17px 17px;
  font: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tick {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border: 2px solid var(--pink);
  border-radius: 50%;
  background: #fff;
  position: relative;
  transition: all .18s;
}

.tick::after {
  content: '';
  position: absolute;
  left: 9px; top: 4px;
  width: 7px; height: 14px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(.4);
  opacity: 0;
  transition: all .18s;
}

.task.is-done .tick {
  background: linear-gradient(160deg, var(--pink-deep), var(--rose));
  border-color: var(--rose);
}

.task.is-done .tick::after { opacity: 1; transform: rotate(45deg) scale(1); }

.task-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.task-title {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  transition: color .2s;
}

.task.is-done .task-title { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--pink); }

.task-meta { font-size: 12.5px; color: var(--rose); font-weight: 600; }

.note-btn {
  align-self: stretch;
  padding: 0 18px;
  background: none;
  border: 0;
  border-left: 1px solid var(--line);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.note-dot {
  display: block;
  width: 22px; height: 22px;
  border: 2px solid var(--beige-deep);
  border-radius: 7px;
  position: relative;
}

.note-dot::before, .note-dot::after {
  content: '';
  position: absolute;
  left: 4px;
  height: 2px;
  background: var(--beige-deep);
  border-radius: 2px;
}
.note-dot::before { top: 5px;  width: 10px; }
.note-dot::after  { top: 10px; width: 6px;  }

.task.has-note .note-dot { border-color: var(--rose); }
.task.has-note .note-dot::before,
.task.has-note .note-dot::after { background: var(--rose); }

.note-panel {
  grid-column: 1 / -1;
  padding: 0 17px 15px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.note-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.note-shown {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 17px 14px 61px;
  font-size: 14px;
  font-style: italic;
  line-height: 1.5;
  color: var(--rose-dark);
}

/* ----------------------------------------------------------------- admin -- */

.admin-main { max-width: 880px; }

.card {
  margin-bottom: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.card-title { margin: 0 0 14px; font-size: 24px; color: var(--rose-dark); }
.card-sub   { margin: 0 0 14px; font-size: 19px; color: var(--rose-dark); }

.date-picker { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.date-picker input[type=date] { flex: 1; min-width: 150px; margin-top: 0; }

.stat-row { display: flex; gap: 10px; }

.stat {
  flex: 1;
  padding: 14px 10px;
  text-align: center;
  background: linear-gradient(160deg, var(--blush), var(--beige));
  border-radius: 14px;
}

.stat-num {
  display: block;
  font-family: 'Poppins', -apple-system, 'Segoe UI', sans-serif;
  font-size: 25px;
  font-weight: 500;
  color: var(--rose-dark);
}

.stat-label {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.log-list { list-style: none; margin: 0; padding: 0; }

.log-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.log-row:last-child { border-bottom: 0; }

.log-state {
  flex-shrink: 0;
  width: 12px; height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: #EFDCDC;
}
.log-row.is-done   .log-state { background: var(--green); }
.log-row.is-missed .log-state { background: #EDD6D6; }

.log-body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.log-title { font-size: 15px; line-height: 1.4; }
.log-row.is-missed .log-title { color: var(--ink-soft); }

.log-note {
  font-size: 13.5px;
  font-style: italic;
  line-height: 1.5;
  color: var(--rose-dark);
  background: var(--blush);
  padding: 6px 10px;
  border-radius: 9px;
  align-self: flex-start;
}

.log-when { flex-shrink: 0; text-align: right; }
.log-when strong { display: block; font-size: 14px; color: var(--rose); }
.log-when small  { font-size: 11.5px; color: var(--ink-soft); }

.mini-list { list-style: none; margin: 0; padding: 0; }

.mini-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}

.mini-date { width: 92px; font-size: 13.5px; font-weight: 600; }

.mini-bar {
  flex: 1;
  height: 8px;
  background: var(--beige);
  border-radius: 20px;
  overflow: hidden;
}
.mini-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--pink-deep));
}

.mini-num { width: 52px; text-align: right; font-size: 12.5px; color: var(--ink-soft); }

/* --------------------------------------------------------- admin forms --- */

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input[type=text] { flex: 1; min-width: 180px; margin-top: 0; }
.inline-form select { width: auto; margin-top: 0; }

.stack-form label { margin-bottom: 14px; }
.stack-form select { margin-top: 6px; }

.edit-list { list-style: none; margin: 0; padding: 0; }

.edit-list > li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.edit-list > li:last-child { border-bottom: 0; }

.edit-row { display: flex; gap: 8px; flex: 1; min-width: 220px; align-items: center; }
.edit-row input[type=text], .edit-row input[type=password] { margin-top: 0; flex: 1; padding: 10px 12px; }

.edit-tools { display: flex; gap: 6px; }

.user-row.is-off { opacity: .5; }
.user-id { min-width: 150px; }
.user-id strong { display: block; font-size: 15px; }
.user-id small  { font-size: 12px; color: var(--ink-soft); }

/* ---------------------------------------------------------------- toast --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 50;
  padding: 13px 22px;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--rose);
  border-radius: 30px;
  box-shadow: var(--shadow-lift);
  animation: rise .22s ease;
}

.toast-bad { background: #B4636B; }

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ------------------------------------------------------------ big screens */

@media (min-width: 760px) {
  .topbar-date { font-size: 32px; }
  .task-title  { font-size: 17.5px; }
  .app-main    { padding: 26px 20px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
