/* ==========================================================================
   Digardom
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #0b0b12;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-hi: rgba(255, 255, 255, 0.11);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hi: rgba(255, 255, 255, 0.24);
  --blur: blur(28px) saturate(160%);
  --blur-lg: blur(40px) saturate(180%);

  --r-xl: 30px;
  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 12px;

  --ink: rgba(255, 255, 255, 0.96);
  --ink-2: rgba(255, 255, 255, 0.66);
  --ink-3: rgba(255, 255, 255, 0.42);

  --violet: #7c9dfa;
  --pink: #f97ec2;
  --blue: #4fb8e8;
  --mint: #3ed8ae;
  --amber: #ffb454;
  --red: #ff6161;

  --grad-primary: linear-gradient(135deg, var(--violet), #6c6ff0);
  --grad-mint: linear-gradient(135deg, var(--mint), var(--blue));

  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.4, 0, .2, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   AMBIENT BACKGROUND
   ========================================================================== */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.45;
  animation: drift 30s ease-in-out infinite;
}

.orb-a {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #6c6ff0, transparent 70%);
  top: -140px;
  left: -120px;
}

.orb-b {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #3ed8ae, transparent 70%);
  top: 40%;
  right: -140px;
  animation-delay: -10s;
}

.orb-c {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #4fb8e8, transparent 70%);
  bottom: -160px;
  left: 10%;
  animation-delay: -20s;
}

@keyframes drift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(40px, -30px) scale(1.08);
  }

  66% {
    transform: translate(-30px, 25px) scale(0.94);
  }
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   GLASS PRIMITIVES
   ========================================================================== */
.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}

.glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.glass-strong {
  background: var(--glass-hi);
  border-color: var(--glass-border-hi);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-bottom));
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 16px 10px;
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 55px;
  height: 55px;
  overflow: hidden;
  border-radius: 11px;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
}

.role-chip.parent {
  color: var(--violet);
  border-color: rgba(157, 123, 250, 0.4);
  background: rgba(157, 123, 250, 0.14);
}

.role-chip.babysitter {
  color: var(--mint);
  border-color: rgba(79, 224, 176, 0.4);
  background: rgba(79, 224, 176, 0.14);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  transition: all .2s var(--spring);
}

.icon-btn:hover {
  background: var(--glass-hi);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ==========================================================================
   CHILD SWITCHER
   ========================================================================== */
.child-rail {
  display: flex;
  gap: 8px;
  padding: 4px 16px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  z-index: 5;
}

.child-rail::-webkit-scrollbar {
  display: none;
}

.child-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 14px 8px 8px;
  border-radius: 30px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--spring);
  white-space: nowrap;
}

.child-chip .av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.child-chip.active {
  background: var(--grad-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(157, 123, 250, 0.35);
}

.child-chip.add {
  border-style: dashed;
  color: var(--ink-3);
  padding: 8px 16px;
}

/* ==========================================================================
   HERO / HEADER CARD
   ========================================================================== */
.hero {
  margin: 0 16px 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-av {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(157, 123, 250, 0.35), rgba(249, 126, 194, 0.35));
  border: 1px solid var(--glass-border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.hero h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 3px;
}

.hero p {
  font-size: 12px;
  color: var(--ink-2);
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.main {
  position: relative;
  z-index: 2;
}

.view {
  animation: rise .4s var(--spring);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.h-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 4px 0 16px;
}

.h-sub {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: -12px;
  margin-bottom: 16px;
}

/* ==========================================================================
   STATS
   ========================================================================== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  padding: 14px 8px;
  text-align: center;
  transition: transform .25s var(--spring);
}

.stat:active {
  transform: scale(0.96);
}

.stat-ico {
  font-size: 22px;
  display: block;
  margin-bottom: 6px;
}

.stat-val {
  font-size: 20px;
  font-weight: 800;
}

.stat-lbl {
  font-size: 9.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
  padding: 18px;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--violet);
  background: rgba(157, 123, 250, 0.14);
  border: 1px solid rgba(157, 123, 250, 0.3);
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s var(--spring);
}

.card-link:hover {
  background: rgba(157, 123, 250, 0.24);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all .2s var(--spring);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  width: 100%;
}

.btn:hover {
  background: var(--glass-hi);
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: var(--grad-primary);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(157, 123, 250, 0.35);
}

.btn.mint {
  background: var(--grad-mint);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(79, 224, 176, 0.3);
}

.btn.danger {
  background: rgba(255, 107, 107, 0.16);
  border-color: rgba(255, 107, 107, 0.35);
  color: var(--red);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
}

.btn.auto {
  width: auto;
}

.btn.sm {
  padding: 9px 14px;
  font-size: 13px;
  border-radius: 13px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.fab-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  padding: 0;
  flex-shrink: 0;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all .2s var(--spring);
}

.fab-icon:hover {
  background: var(--glass-hi);
}

.fab-icon.danger {
  color: var(--red);
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.3);
}

.fab-icon.on {
  background: var(--grad-primary);
  border-color: transparent;
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  font-weight: 600;
}

.input,
.textarea,
select.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: all .2s var(--ease);
  font-family: inherit;
}

.input:focus,
.textarea:focus {
  border-color: var(--violet);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(157, 123, 250, 0.18);
}

.textarea {
  resize: vertical;
  min-height: 70px;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-3);
}

.checkbox {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  accent-color: var(--violet);
  cursor: pointer;
  flex-shrink: 0;
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.seg-item {
  flex: 1;
  padding: 8px 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s var(--ease);
}

.seg-item.active {
  background: var(--glass-hi);
  color: var(--ink);
}

/* ==========================================================================
   LIST ROWS
   ========================================================================== */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.row:last-child {
  border-bottom: none;
}

.row-text {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.4;
}

.row-text.done {
  text-decoration: line-through;
  color: var(--ink-3);
}

.row-meta {
  font-size: 11px;
  color: var(--ink-3);
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge.urgent {
  background: rgba(255, 107, 107, 0.18);
  color: var(--red);
}

.badge.routine {
  background: rgba(99, 179, 255, 0.18);
  color: var(--blue);
}

.badge.sante {
  background: rgba(79, 224, 176, 0.18);
  color: var(--mint);
}

.badge.divers {
  background: rgba(255, 196, 100, 0.18);
  color: var(--amber);
}

/* ==========================================================================
   JOURNAL ENTRIES
   ========================================================================== */
.entry {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.entry:last-child {
  border-bottom: none;
}

.entry-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.entry-body {
  flex: 1;
  min-width: 0;
}

.entry-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.entry-title {
  font-size: 13.5px;
  font-weight: 700;
}

.entry-time {
  font-size: 11px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.entry-detail {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
}

.entry-notes {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
  font-style: italic;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.type-btn {
  padding: 14px 4px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all .2s var(--spring);
  font-size: 10.5px;
  font-weight: 600;
}

.type-btn span.i {
  font-size: 22px;
}

.type-btn.active {
  background: var(--grad-primary);
  color: white;
  border-color: transparent;
}

/* ==========================================================================
   TIMELINE / PLANNING
   ========================================================================== */
.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.tl-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
}

.tl-dot.done {
  background: var(--mint);
}

.tl-dot.now {
  background: var(--pink);
  box-shadow: 0 0 0 5px rgba(249, 126, 194, 0.2);
}

.tl-time {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  width: 44px;
  flex-shrink: 0;
}

.tl-label {
  flex: 1;
  font-size: 13.5px;
}

.tl-label.done {
  color: var(--ink-3);
  text-decoration: line-through;
}

/* ==========================================================================
   CONTACTS
   ========================================================================== */
.contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.contact-av {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.contact-name {
  font-size: 13.5px;
  font-weight: 700;
}

.contact-role {
  font-size: 11.5px;
  color: var(--ink-2);
}

.contact-call {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--grad-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(79, 224, 176, 0.3);
}

/* ==========================================================================
   BOTTOM NAV - floating liquid glass bar
   ========================================================================== */
.tabbar-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 12px calc(12px + var(--safe-bottom));
  pointer-events: none;
}

.tabbar-shell {
  position: relative;
  max-width: 620px;
  width: 100%;
  pointer-events: all;
}

.tabbar {
  pointer-events: all;
  display: flex;
  gap: 2px;
  padding: 6px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(20, 20, 32, 0.55);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--glass-border-hi);
  border-radius: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  scroll-behavior: smooth;
}

.tabbar-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
  z-index: 5;
  background: none;
  transition: color .2s ease;
}

.tabbar-arrow:active {
  color: var(--ink);
}

.tabbar-arrow.left {
  left: 0;
  border-radius: 26px 0 0 26px;
  background: linear-gradient(90deg, #6c6ff0 45%, transparent 100%);
  justify-content: flex-start;
  padding-left: 9px;
}

.tabbar-arrow.right {
  right: 0;
  border-radius: 0 26px 26px 0;
  background: linear-gradient(270deg, #6c6ff0 45%, transparent 100%);
  justify-content: flex-end;
  padding-right: 9px;
}

.tabbar::-webkit-scrollbar {
  display: none;
}

.sidebar-brand {
  display: none;
}

.tab-item {
  flex: 1;
  min-width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px;
  border-radius: 19px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .25s var(--spring);
  position: relative;
}

.tab-item.active {
  background: var(--glass-hi);
  color: var(--ink);
}

.tab-ico {
  font-size: 18px;
}

.tab-lbl {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tab-badge {
  position: absolute;
  top: 4px;
  right: 10px;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ==========================================================================
   FULL-SCREEN GATES (auth / family)
   ========================================================================== */
.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  padding: 34px 26px;
  text-align: center;
}

.gate-logo {
  width: 50px;
  height: 50px;
  border-radius: 22px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin: 0 auto 18px;
  box-shadow: 0 12px 32px rgba(157, 123, 250, 0.4);
}

.gate-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.gate-sub {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 22px;
  line-height: 1.5;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.option-card {
  padding: 20px 10px;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  cursor: pointer;
  transition: all .25s var(--spring);
  color: var(--ink);
}

.option-card:hover {
  transform: translateY(-2px);
  background: var(--glass-hi);
}

.option-card .oi {
  font-size: 30px;
  display: block;
  margin-bottom: 8px;
}

.option-card .ot {
  font-size: 13.5px;
  font-weight: 700;
}

.option-card .od {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

.code-display {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 7px;
  text-align: center;
  padding: 16px 10px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(157, 123, 250, 0.16), rgba(249, 126, 194, 0.16));
  border: 1px solid var(--glass-border-hi);
  font-family: 'SF Mono', ui-monospace, monospace;
  margin-bottom: 14px;
}

.error-text {
  color: var(--red);
  font-size: 12px;
  margin: 8px 0;
  min-height: 14px;
}

.info-text {
  color: var(--mint);
  font-size: 12px;
  margin: 8px 0;
}

.hint-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(157, 123, 250, 0.1);
  border: 1px solid rgba(157, 123, 250, 0.22);
  font-size: 11.5px;
  color: var(--ink-2);
  text-align: left;
  line-height: 1.5;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 10px auto 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--violet);
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   MEMBERS LIST (settings)
   ========================================================================== */
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.member-row:last-child {
  border-bottom: none;
}

.member-av {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.member-name {
  font-size: 13px;
  font-weight: 600;
}

.member-email {
  font-size: 11px;
  color: var(--ink-3);
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty {
  text-align: center;
  padding: 30px 14px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.empty .ei {
  font-size: 30px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.7;
}

/* ==========================================================================
   MISC
   ========================================================================== */
.readonly-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(255, 196, 100, 0.1);
  border: 1px solid rgba(255, 196, 100, 0.25);
  color: var(--amber);
  font-size: 11.5px;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

@media (max-width: 380px) {
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .type-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .tab-lbl {
    display: none;
  }
}

/* ==========================================================================
   DESKTOP / WIDE SCREEN LAYOUT
   ========================================================================== */
@media (min-width: 900px) {
  .app-shell {
    padding-bottom: 40px;
    padding-left: 232px;
  }

  .container {
    max-width: 760px;
    padding: 0 24px;
  }

  .topbar {
    padding: 24px 24px 10px;
  }

  .topbar .brand {
    display: none;
  }

  .topbar {
    justify-content: flex-end;
  }

  .child-rail {
    padding: 4px 24px 14px;
  }

  .hero {
    margin: 0 24px 20px;
  }

  .tabbar-wrap {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 232px;
    padding: 24px 16px;
    align-items: stretch;
    justify-content: flex-start;
  }

  .tabbar-shell {
    max-width: none;
    height: 100%;
  }

  .tabbar-arrow {
    display: none;
  }

  .tabbar {
    flex-direction: column;
    max-width: none;
    width: 100%;
    height: 100%;
    border-radius: 26px;
    padding: 14px 10px;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 18px;
  }

  .sidebar-brand .brand-mark {
    width: 20px;
    height: 20px;
    font-size: 16px;
  }

  .sidebar-brand .brand-name {
    font-size: 15px;
    font-weight: 700;
  }

  .tab-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    min-width: 0;
  }

  .tab-lbl {
    display: inline;
    font-size: 12.5px;
  }

  .tab-badge {
    position: static;
    margin-left: auto;
  }

  .stat-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 860px;
  }
}

/* ==========================================================================
   ICON CHIPS — grille d'icônes rondes + label (sélection multiple)
   ========================================================================== */
.chip-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}

.icon-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 4px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .2s var(--spring);
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
}

.icon-chip:hover {
  background: var(--glass-hi);
  transform: translateY(-1px);
}

.icon-chip-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  font-size: 17px;
  color: var(--ink-2);
  transition: all .2s var(--spring);
}

.icon-chip.active {
  border-color: rgba(124, 157, 250, 0.5);
  background: rgba(124, 157, 250, 0.1);
  color: var(--ink);
}

.icon-chip.active .icon-chip-circle {
  background: var(--grad-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(124, 157, 250, 0.4);
}

.icon-chip-label {
  line-height: 1.25;
}

/* ==========================================================================
   ALERT BANNER — signes d'alerte / urgence
   ========================================================================== */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 16px 14px;
  border-radius: var(--r-lg);
  background: rgba(255, 97, 97, 0.1);
  border: 1px solid rgba(255, 97, 97, 0.3);
}

.alert-banner .ai {
  font-size: 18px;
  color: var(--red);
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-banner-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 2px;
}

.alert-banner-text {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.4;
}

.alert-banner .btn {
  width: auto;
  flex-shrink: 0;
}

/* ==========================================================================
   HISTORY CALENDAR
   ========================================================================== */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-nav-label {
  font-size: 14.5px;
  font-weight: 700;
  text-transform: capitalize;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.cal-dow {
  text-align: center;
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 700;
  padding-bottom: 6px;
  text-transform: uppercase;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .2s var(--ease);
  position: relative;
  min-width: 0;
  padding: 0;
}

@media (max-width: 400px) {
  .cal-grid {
    gap: 4px;
  }

  .cal-day {
    border-radius: 9px;
    font-size: 10.5px;
  }

  .cal-dow {
    font-size: 8.5px;
    padding-bottom: 4px;
  }

  .cal-nav-label {
    font-size: 13px;
  }
}

.cal-day:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cal-day.empty {
  visibility: hidden;
}

.cal-day.today {
  border-color: var(--glass-border-hi);
}

.cal-day.active {
  background: var(--grad-primary);
  color: white;
}

.cal-day.active .dot {
  background: white !important;
}

.cal-day .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 2px;
}

.cal-day.level-none .dot {
  background: transparent;
}

.cal-day.level-ok .dot {
  background: var(--mint);
}

.cal-day.level-warn .dot {
  background: var(--amber);
}

.cal-day.level-alert {
  background: rgba(255, 97, 97, 0.14);
  border-color: rgba(255, 97, 97, 0.3);
}

.cal-day.level-alert .dot {
  background: var(--red);
}

.cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
}

.cal-legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ==========================================================================
   MODAL / CONFIRM DIALOG
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  animation: fadeIn .2s var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-card {
  width: 100%;
  max-width: 420px;
  margin-bottom: 0;
  padding: 26px 22px calc(22px + var(--safe-bottom));
  border-radius: 26px 26px 0 0;
  animation: slideUp .3s var(--spring);
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }

  .modal-card {
    border-radius: 24px;
    margin-bottom: 24px;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-title {
  font-size: 16.5px;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-text {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ==========================================================================
   INSTALL BANNER
   ========================================================================== */
.install-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 16px 14px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(124, 157, 250, 0.14), rgba(62, 216, 174, 0.14));
  border: 1px solid var(--glass-border-hi);
}

.install-banner .ii {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.install-banner-title {
  font-size: 12.5px;
  font-weight: 700;
}

.install-banner-text {
  font-size: 11px;
  color: var(--ink-2);
}

.install-banner .btn {
  width: auto;
  flex-shrink: 0;
}

/* ==========================================================================
   PRINT (résumé PDF)
   ========================================================================== */
@media print {

  .bg,
  .tabbar-wrap,
  .topbar,
  .child-rail,
  .install-banner,
  .alert-banner,
  footer.sig-d,
  .btn,
  .fab-icon {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .app-shell {
    padding: 0 !important;
  }

  .glass,
  .card {
    background: white !important;
    border: 1px solid #ddd !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    color: black !important;
  }

  .ink-2,
  .row-meta,
  .entry-time {
    color: #555 !important;
  }
}

/* ─────────────────────────────────
BACKGROUND IMAGE
────────────────────────────────── */
.bg-image {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url('heronobg.png');
  background-size: 50%;
  /* ← Réduis ici (30%, 50%, 60%) */
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  opacity: 1;
  /* ← Plus discret */
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(139, 92, 246, 0.40), transparent 60%),
    radial-gradient(800px 560px at 100% 0%, rgba(52, 211, 153, 0.24), transparent 55%),
    radial-gradient(1000px 700px at 50% 110%, rgba(236, 72, 153, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(11, 11, 18, 0.3) 0%, rgba(11, 11, 18, 0.6) 100%);
}

/* Désactiver sur mobile pour les performances */
@media (max-width: 768px) {
  .bg-image {
    background-attachment: scroll;
  }
}

/* Option : Masquer le background sur la page d'auth si tu préfères */
.auth-screen~.bg-image {
  opacity: 0.15;
  /* Plus discret pendant la connexion */
}

/* ==========================================================================
   TOAST
   ========================================================================== */
.toast-stack {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: 100%;
  max-width: 420px;
  padding: 0 16px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(20, 20, 32, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  animation: toastIn .25s cubic-bezier(.34, 1.56, .64, 1);
  width: 100%;
}

.toast-success i {
  color: var(--mint);
}

.toast-error i {
  color: var(--red);
}

.toast-info i {
  color: var(--violet);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   OFFLINE BANNER
   ========================================================================== */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2500;
  text-align: center;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--amber);
  color: #1a1200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.toast-undo-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.toast-undo-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ─────────────────────────────────
   FOOTER — Signature capsule (style Toma Digital)
   ────────────────────────────────── */
footer.sig-d {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.1rem;
  margin: 32px auto 16px;
  max-width: 600px;
  border-radius: 999px;
  background: rgba(11, 11, 18, 0.55);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
}

footer.sig-d:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(124, 157, 250, 0.15);
}

.sig-aw {
  position: relative;
  flex-shrink: 0;
}

.sig-ar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--violet);
  box-shadow: 0 0 20px rgba(124, 157, 250, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 157, 250, 0.1);
}

.logo-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  color: var(--violet);
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.sig-content {
  flex: 1;
  min-width: 0;
}

.sig-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.sig-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.sig-divider {
  color: var(--violet);
  font-weight: 300;
}

.sig-tagline {
  font-size: 0.8rem;
  color: var(--ink-2);
  font-weight: 500;
}

.sig-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--ink-3);
  font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
}

.sig-version {
  background: rgba(124, 157, 250, 0.14);
  color: var(--violet);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.65rem;
}

.sig-separator {
  color: var(--glass-border);
}

.sig-privacy {
  color: var(--ink-3);
}

@media (max-width: 640px) {
  footer.sig-d {
    flex-direction: column;
    text-align: center;
    border-radius: 24px;
    padding: 1.25rem;
    gap: 0.75rem;
  }

  .sig-brand {
    justify-content: center;
  }

  .sig-meta {
    justify-content: center;
  }
}

/* ==========================================================================
   COULEURS PAR TYPE — icônes vivantes sur fond sombre
   ========================================================================== */
.stat-ico.c-amber,
.entry-ico.c-amber {
  color: var(--amber);
  background: rgba(255, 180, 84, 0.14);
}

.stat-ico.c-violet,
.entry-ico.c-violet {
  color: var(--violet);
  background: rgba(124, 157, 250, 0.14);
}

.stat-ico.c-blue,
.entry-ico.c-blue {
  color: var(--blue);
  background: rgba(79, 184, 232, 0.14);
}

.stat-ico.c-pink,
.entry-ico.c-pink {
  color: var(--pink);
  background: rgba(249, 126, 194, 0.14);
}

.stat-ico.c-mint,
.entry-ico.c-mint {
  color: var(--mint);
  background: rgba(62, 216, 174, 0.14);
}

.stat-ico.c-red,
.entry-ico.c-red {
  color: var(--red);
  background: rgba(255, 97, 97, 0.14);
}

.stat-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 17px;
}

.entry-ico {
  border-radius: 12px;
}

.type-btn.c-amber {
  color: var(--amber);
}

.type-btn.c-violet {
  color: var(--violet);
}

.type-btn.c-blue {
  color: var(--blue);
}

.type-btn.c-pink {
  color: var(--pink);
}

.type-btn.c-mint {
  color: var(--mint);
}

.type-btn.c-red {
  color: var(--red);
}

.type-btn.c-amber .i {
  color: var(--amber);
}

.type-btn.c-violet .i {
  color: var(--violet);
}

.type-btn.c-blue .i {
  color: var(--blue);
}

.type-btn.c-pink .i {
  color: var(--pink);
}

.type-btn.c-mint .i {
  color: var(--mint);
}

.type-btn.c-red .i {
  color: var(--red);
}

/* ==========================================================================
   RAPPORT D'HISTORIQUE (téléchargement)
   ========================================================================== */
.report-cover {
  text-align: center;
  padding: 32px 24px;
  margin: 18px 0 16px;
  background: linear-gradient(135deg, rgba(124, 157, 250, 0.1), rgba(249, 126, 194, 0.08));
}

.report-cover-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  margin: 0 auto 16px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 10px 26px rgba(124, 157, 250, 0.35);
}

.report-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.report-sub {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 10px;
}

.report-meta {
  font-size: 11.5px;
  color: var(--ink-3);
}

.report-day {
  margin-bottom: 12px;
}

.report-day-title {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: capitalize;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--violet);
}

.report-footer {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  padding: 24px 0 40px;
}

@media print {
  .report-cover {
    background: #f4f4fa !important;
  }

  .report-day-title {
    color: #6c6ff0 !important;
  }
}