/* Same look as the almostaddi.com homepage: gradient, cream cards, ink outlines. */
:root {
  --ink: #1a0b2e;
  --cream: #fff7ee;
  --paper: #fffdf9;
  --muted: #6d6177;
  --line: #e7dccf;
  --pink: #e0245e;
  --sun: #ffcf4a;
  --mint: #5ee0b5;
  --sky: #7cc8ff;
  --red: #e5383b;
  --grad: linear-gradient(140deg, #d6246e 0%, #8e2bb8 55%, #4b1fa8 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font: 500 16px/1.45 "Bricolage Grotesque", system-ui, sans-serif;
  color: var(--ink);
  background: var(--grad) fixed;
  overflow-x: hidden;
}
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: float 16s ease-in-out infinite alternate;
}
.blob.a { width: 420px; height: 420px; background: #ff6a3d; top: -160px; right: -100px; opacity: .35; }
.blob.b { width: 460px; height: 460px; background: #2a1490; bottom: -180px; left: -160px; opacity: .6; animation-duration: 20s; }
@keyframes float { to { transform: translate(30px, -40px) scale(1.08); } }

#app {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}
.loading { color: #fff; text-align: center; margin-top: 30vh; font-weight: 700; }

h1, h2, h3 { margin: 0; line-height: 1.1; }
h1 { font: 800 clamp(2rem, 8vw, 3rem)/1 "Outfit", system-ui, sans-serif; color: #fff; }
h2 { font: 800 1.5rem/1.1 "Outfit", system-ui, sans-serif; }
h3 { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0; }
.subhead { color: #fff; opacity: .8; font-weight: 700; margin-top: 6px; }
a { color: inherit; }

/* ───── Top bar ───── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 0 22px;
  color: #fff;
}
.brand { font: 800 1.25rem "Outfit", sans-serif; color: #fff; white-space: nowrap; flex: none; }
.brand a { text-decoration: none; border-radius: 8px; padding: 2px 3px; margin: 0 -3px; transition: background .15s, color .15s; }
.brand a + a { opacity: .75; font-weight: 700; }
.brand a:hover { background: var(--sun); color: var(--ink); opacity: 1; }
.who { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 10px; min-width: 0; font-weight: 700; font-size: .9rem; }

/* ───── Cards ───── */
.card {
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 20px;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.section-title { color: #fff; font: 800 1.1rem "Outfit", sans-serif; margin: 10px 0 -4px; }
.empty { color: var(--muted); text-align: center; padding: 8px 0; }
.empty.on-grad { color: rgba(255, 255, 255, .8); }

a.card.link { display: block; text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.card.link:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }

/* ───── Chips & badges ───── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
.chip.sun { background: var(--sun); }
.chip.mint { background: var(--mint); }
.chip.sky { background: var(--sky); }
.chip.pink { background: var(--pink); color: #fff; }
.chip.ink { background: var(--ink); color: var(--cream); }
.chip.ghost { border-color: transparent; background: rgba(26, 11, 46, .08); }

/* ───── Stats ───── */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { padding: 14px 18px; }
.stat .label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font: 800 clamp(1.6rem, 6vw, 2.2rem)/1.1 "Outfit", sans-serif; }

/* ───── Tabs ───── */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 8px; margin: 0 -4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 247, 238, .85);
  color: var(--ink);
  font: inherit; font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.tab.on { background: var(--ink); color: var(--cream); }
.tab .count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #fff; font-size: .75rem; text-align: center; }

/* ───── Buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font: inherit; font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }
.btn.primary { background: var(--pink); color: #fff; }
.btn.go { background: var(--mint); }
.btn.sky { background: var(--sky); }
.btn.dark { background: var(--ink); color: var(--cream); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { padding: 6px 12px; font-size: .85rem; border-radius: 11px; }
.btn.plain { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; padding: 6px 8px; }
.btn.plain:hover, .btn.plain:active { transform: none; box-shadow: none; }
.btn.block { width: 100%; }
.topbar .btn.plain { color: #fff; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ───── Forms ───── */
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: .9rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit; font-weight: 500;
}
textarea { min-height: 80px; resize: vertical; }
input[type=file] { font: inherit; font-size: .9rem; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--pink); }
.form-error { color: var(--red); font-weight: 700; font-size: .9rem; min-height: 1em; }
.hint { font-size: .8rem; color: var(--muted); font-weight: 500; }

/* ───── Auth ───── */
.auth { max-width: 420px; margin: 8vh auto 0; }
.auth h1 { text-align: center; margin-bottom: 22px; }
.auth h1.brand { display: block; font-size: clamp(2rem, 8vw, 3rem); line-height: 1.1; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; }
.seg button { padding: 9px; border: 0; background: #fff; font: inherit; font-weight: 800; cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--cream); }

/* ───── Tasks / items ───── */
.item { display: flex; flex-direction: column; gap: 10px; }
.item .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.item .details { white-space: pre-wrap; color: var(--muted); }
.item .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.points { font: 800 1.2rem "Outfit", sans-serif; white-space: nowrap; }
.status { font-weight: 800; font-size: .9rem; }
.status.ok { color: #138a5e; }
.status.wait { color: #b26b00; }
.status.no { color: var(--red); }
.photo { display: block; max-width: 100%; max-height: 360px; border: 2px solid var(--ink); border-radius: 12px; object-fit: contain; background: #fff; }
.note { background: #fff; border: 2px dashed var(--line); border-radius: 12px; padding: 8px 12px; white-space: pre-wrap; }

/* ───── History ───── */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.log li:first-child { border-top: 0; }
.log .delta { font-weight: 800; white-space: nowrap; }
.log .delta.plus { color: #138a5e; }
.log .delta.minus { color: var(--red); }

/* ───── Dialog ───── */
dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 22px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}
dialog::backdrop { background: rgba(26, 11, 46, .55); backdrop-filter: blur(3px); }
dialog form { display: flex; flex-direction: column; gap: 14px; }
dialog .buttons { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ───── Toasts ───── */
#toasts {
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 700;
  animation: pop .2s ease;
}
.toast.err { background: #ffd1d1; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 520px) {
  .card { padding: 16px; box-shadow: 4px 4px 0 var(--ink); border-radius: 18px; }
  .stats { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ───── Accounts-specific ───── */
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
.site-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.1rem; }
.site-link .go { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 1rem; }
a.card.site-link:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; font-weight: 700; font-size: .9rem; }
.links a { color: var(--ink); }
.reveal { font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; background: #fff; border: 2px dashed var(--ink); border-radius: 12px; padding: 10px 14px; user-select: all; word-break: break-all; }
.user-card { display: flex; flex-direction: column; gap: 12px; }
.user-card .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; }
.access-grid label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.access-grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--pink); }
.access-grid select { width: auto; padding: 4px 8px; font-size: .85rem; border-radius: 9px; }
.access-grid .dim { opacity: .55; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 180px; width: auto; }
.seg a.seg-link { padding: 9px; background: #fff; font-weight: 800; color: var(--ink); text-align: center; text-decoration: none; }
.seg a.seg-link.on { background: var(--ink); color: var(--cream); }

/* Back to the almostaddi.com homepage */

/* Forgot-password links under the log-in forms */
.forgot { text-align: center; font-weight: 700; color: var(--muted); }

/* A site with roles (GIFs): checkbox plus a role picker beside it */
.access-grid .role-site { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
.access-grid .role-site select { width: auto; padding: 4px 8px; font-size: .85rem; }
.access-grid .role-site select:disabled { opacity: .5; }
