/* Suivi comptes — vues légères, lisible sur mobile */
:root {
  --bg: #0f1216;
  --surface: #181c24;
  --border: #2a3140;
  --text: #e8eaef;
  --muted: #8b95a5;
  --accent: #3d8bfd;
  --positive: #3ecf8e;
  --negative: #f87171;
  --font: "Segoe UI", system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  font-size: 15px;
}

a {
  color: var(--accent);
}

header.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header-leading {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

header.app-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}

.app-menu-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.app-menu-toggle-icon {
  display: block;
  width: 1.2rem;
  height: 0.12rem;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 -0.38rem 0 currentColor, 0 0.38rem 0 currentColor;
}

.app-nav-drawer {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.app-nav-drawer-backdrop {
  display: none;
}

.app-nav-drawer-panel {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

@media (max-width: 767px) {
  header.app-header {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  header.app-header h1 {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-menu-toggle {
    display: inline-flex;
  }

  .app-nav-drawer {
    flex: 0 0 auto;
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    visibility: hidden;
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
  }

  .app-nav-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
  }

  .app-nav-drawer-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .app-nav-drawer.is-open .app-nav-drawer-backdrop {
    opacity: 1;
  }

  .app-nav-drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(18rem, 88vw);
    max-width: 100%;
    flex: none;
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem 1.5rem;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .app-nav-drawer.is-open .app-nav-drawer-panel {
    transform: translateX(0);
  }

  .app-nav-drawer-panel .toolbar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.65rem;
  }

  .app-nav-drawer-panel .family-select-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .app-nav-drawer-panel .family-select {
    width: 100%;
    max-width: none;
  }

  .app-nav-drawer-panel .user-chip-wrap {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  body.app-nav-drawer-open {
    overflow: hidden;
    touch-action: none;
  }
}

@media (min-width: 768px) {
  .app-nav-drawer-panel .toolbar {
    justify-content: flex-end;
  }
}

.badge-unsaved {
  font-size: 0.75rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/** Même palette que .badge-unsaved — visible seulement lorsque des changements sont à enregistrer (attribut hidden mis à jour dans setDirty). */
button.toolbar-save-dirty {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.45);
}

button.toolbar-save-dirty:hover:not(:disabled) {
  filter: brightness(1.12);
  border-color: rgba(252, 211, 77, 0.6);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

button,
.file-btn label {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button.primary,
.file-btn label.primary {
  background: #1e3a5f;
  border-color: #2563ab;
  color: #dbeafe;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:not(:disabled):hover,
.file-btn label:hover {
  filter: brightness(1.1);
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

section.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

section.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Onglets par compte bancaire */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #141821;
  color: var(--text);
  cursor: pointer;
}

.tab:hover {
  border-color: var(--accent);
}

.tab.is-active {
  background: #1e3a5f;
  border-color: #2563ab;
  color: #dbeafe;
}

.tab-panel.is-hidden {
  display: none;
}

.account-recap-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.account-tab-charts {
  margin-top: 0.5rem;
}

.account-form-block,
.account-list-block {
  margin-top: 1.25rem;
}

.account-form-block h3,
.account-list-block h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.65rem;
  color: var(--muted);
}

.domain-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .domain-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

.domain-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #141821;
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
}

.domain-card:hover:not(:disabled) {
  border-color: var(--accent);
}

.domain-card:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.domain-card .title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.domain-card .desc {
  font-size: 0.85rem;
  color: var(--muted);
}

.picker-home-main {
  padding-top: 0.25rem;
}

.family-home-title {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  line-height: 1.2;
  color: var(--text);
}

.family-picker-members-panel {
  margin-bottom: 1rem;
}

.family-picker-members-panel h2 {
  margin-bottom: 0.65rem;
  font-size: 1rem;
}

.family-picker-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr));
  gap: 0.85rem 1rem;
  margin-top: 0.25rem;
}

@media (min-width: 520px) {
  .family-picker-members-grid {
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  }
}

.family-picker-member-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  padding: 0.65rem 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 18, 24, 0.35);
  box-sizing: border-box;
}

.family-picker-member-tile-self {
  border-color: rgba(61, 139, 253, 0.45);
  box-shadow: 0 0 0 1px rgba(61, 139, 253, 0.12);
}

.family-picker-member-avatar-wrap {
  flex-shrink: 0;
}

.family-picker-member-avatar {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
  background: var(--bg);
}

.family-picker-member-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
}

.family-picker-member-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
}

.family-picker-member-you {
  font-size: 0.72rem;
  font-weight: 600;
  color: #93c5fd;
  letter-spacing: 0.02em;
}

.domain-default-badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.picker-domain-groups {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.picker-domain-group-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.domains-admin-toolbar {
  margin-bottom: 1rem;
}

.domain-cat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.domain-cat-modal-box {
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow: auto;
}

.domain-cat-edit-row {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) minmax(8rem, 2fr) 4.5rem auto;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .domain-cat-edit-row {
    grid-template-columns: 1fr;
  }
}

.domain-cat-edit-id,
.domain-cat-edit-label,
.domain-cat-edit-sort {
  font: inherit;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.domain-cat-modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

button.secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.family-domains-admin {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.family-domains-admin .family-domains-mount {
  margin-top: 0.5rem;
}

.family-domains-editor .family-domains-head.family-domains-head-simple {
  grid-template-columns: 1fr 4rem;
}

.family-domains-editor .family-domains-head {
  display: grid;
  grid-template-columns: 1fr 4rem;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.family-domain-row.family-domain-row-two {
  grid-template-columns: 1fr auto;
}

.family-domain-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.family-domain-row:last-child {
  border-bottom: none;
}

.family-domain-name-title {
  font-weight: 600;
}

.family-domains-editor > button.primary {
  margin-top: 1rem;
}

.domains-admin-wrap .domain-catalog-editor {
  max-width: 44rem;
}

.domain-catalog-row .domain-catalog-key {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.domain-catalog-row h3 {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.domain-field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.5rem 0 0.25rem;
}

.domain-catalog-label,
.domain-catalog-desc {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.domain-catalog-desc {
  resize: vertical;
  min-height: 4rem;
}

.domain-catalog-default-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.domain-catalog-editor > .primary {
  margin-top: 1.25rem;
}

.form-grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .form-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

label.field span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #2563ab;
  outline-offset: 0;
}

.money-pos {
  color: var(--positive);
}

.money-neg {
  color: var(--negative);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.45rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.1rem;
}

.empty-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.charts-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.charts-row.charts-row-fullwidth {
  width: 100%;
  max-width: 100%;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .charts-row {
    grid-template-columns: 1fr 1fr;
  }

  .charts-row.charts-row-fullwidth {
    grid-template-columns: 1fr;
  }
}

.chart-box {
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 220px;
}

.chart-box h3 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.chart-box-wide {
  width: 100%;
  max-width: 100%;
  min-height: 0;
}

svg.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

svg.chart-svg-wide {
  min-width: 0;
  max-width: 100%;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  display: inline-block;
}

.summary-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.tile {
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}

.tile .name {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.tile .val {
  font-size: 1.05rem;
  font-weight: 600;
}

.tile-actions {
  margin-top: 0.55rem;
}

.tile-actions button {
  width: 100%;
  font-size: 0.78rem;
  padding: 0.32rem 0.45rem;
}

.tile.spotify-balance-low {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.15);
}

.spotify-alert {
  margin: 0 0 0.5rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: 0.9rem;
}

table .meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.row-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.row-actions button {
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Modales (comptes / analytique) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/** Au-dessus de #app-modal : confirmations sans fermer la modale parente */
.modal-backdrop.confirm-modal-layer {
  z-index: 220;
  align-items: center;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  margin: 2rem auto;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 0.9;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1rem 1.1rem 1.15rem;
  max-height: min(80vh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.confirm-modal-message {
  white-space: pre-line;
  margin: 0 0 1rem;
  line-height: 1.5;
}

/** Suivi Bébé (domaine BOTTLES) */
.bottles-follow-panel .panel-head {
  margin-bottom: 0.45rem;
}

.bottles-subtab-in-panel {
  padding-top: 0.1rem;
}

button.tile.bottles-baby-tile {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

button.tile.bottles-baby-tile:hover:not(:disabled) {
  border-color: var(--accent);
}

.bottles-baby-tile .val {
  font-size: 0.98rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.bottles-baby-tile-selected {
  border-color: rgba(61, 139, 253, 0.55) !important;
  background: rgba(61, 139, 253, 0.1) !important;
  box-shadow: inset 0 0 0 1px rgba(61, 139, 253, 0.12);
}

.bottles-tile-caption {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.bottles-subtab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

button.bottles-subtab {
  font-size: 0.82rem;
  padding: 0.28rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

button.bottles-subtab:hover {
  color: var(--text);
  border-color: var(--accent);
}

button.bottles-subtab-selected {
  color: var(--text);
  border-color: rgba(61, 139, 253, 0.55);
  background: rgba(61, 139, 253, 0.1);
}

.bottles-growth-charts-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  align-items: start;
  margin-top: 0.35rem;
}

@media (max-width: 640px) {
  .bottles-growth-charts-row {
    grid-template-columns: 1fr;
  }
}

.bottles-growth-charts-row .bottles-growth-chart-block {
  min-width: 0;
}

.bottles-growth-charts-row .bottles-growth-chart-title {
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}

.bottles-growth-charts-row .bottles-growth-chart-holder {
  margin-top: 0.25rem;
}

.bottles-growth-charts-row svg.bottles-growth-svg {
  max-width: 100%;
  max-height: 150px;
}

.bottles-growth-chart-block + .bottles-growth-chart-block {
  margin-top: 1.1rem;
}

.bottles-growth-chart-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.bottles-chart-block {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.bottles-chart-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.bottles-chart-meta {
  margin: 0 0 0.65rem;
}

.bottles-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 120px;
  padding: 0 0.15rem;
}

.bottles-chart-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.bottles-chart-track {
  width: 100%;
  max-width: 40px;
  margin: 0 auto;
  height: 88px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.bottles-chart-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), #2563c4);
  border-radius: 4px 4px 0 0;
  min-height: 0;
  transition: height 0.15s ease;
}

.bottles-chart-xlbl {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.bottles-feed-row .family-select-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.bottles-feed-main-row input[type="date"],
.bottles-feed-main-row input[type="time"] {
  font-size: 0.92rem;
}

.bottles-feed-main-row input[type="text"] {
  max-width: 5rem;
  min-width: 3rem;
}

.bottles-ml-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

button.bottles-ml-quick-btn {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  padding: 0.3rem 0.55rem;
  min-width: 2.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  cursor: pointer;
}

button.bottles-ml-quick-btn:hover {
  border-color: var(--accent);
  background: rgba(61, 139, 253, 0.12);
}

input.bottles-ref-inline-num {
  width: 100%;
  max-width: 5.5rem;
  font-size: 0.85rem;
  padding: 0.25rem 0.45rem;
}

.bottles-ref-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}

input.bottles-growth-inline {
  max-width: 6rem;
  font-size: 0.92rem;
}

.bottles-growth-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.bottles-panel-tab h2 {
  margin-bottom: 0.35rem;
}

.bottles-growth-chart-holder {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.5rem;
}

.bottles-growth-legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.bottles-growth-leg-w {
  color: var(--accent);
}

.bottles-growth-leg-h {
  color: var(--positive);
}

svg.bottles-growth-svg {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
}

.bottles-growth-plot-border {
  stroke: var(--border);
  stroke-width: 1;
}

.bottles-growth-path-w {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottles-growth-path-h {
  stroke: var(--positive);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottles-growth-dot-w {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 1;
}

.bottles-growth-dot-h {
  fill: var(--positive);
  stroke: var(--surface);
  stroke-width: 1;
}

text.bottles-growth-axis-lbl {
  fill: var(--muted);
  font-size: 9px;
  font-family: var(--font), system-ui, sans-serif;
}

.modal-h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.5rem 0 0.25rem;
  color: var(--muted);
}

.spotify-mem-id {
  font-size: 0.72rem;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--muted);
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-new-member {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.modal-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  width: 100%;
}

.form-grid .modal-btns,
.form-grid .modal-err,
.modal-form .modal-btns,
.modal-form .modal-err {
  grid-column: 1 / -1;
}

.modal-table {
  margin-top: 1rem;
}

.th-actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.modal-err {
  color: var(--negative);
  font-size: 0.85rem;
  margin: 0 0 0.5rem 0;
  width: 100%;
}

footer.meta {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Budget couple — synthèse en colonnes */
.budget-summary-wrap {
  margin-top: 0.5rem;
}

table.budget-summary {
  min-width: 100%;
}

table.budget-summary th,
table.budget-summary td {
  text-align: right;
}

table.budget-summary th:first-child,
table.budget-summary td:first-child {
  text-align: left;
}

tr.budget-couple-part {
  background: rgba(0, 0, 0, 0.12);
}

tr.budget-couple-part .budget-part-label {
  padding-left: 1.5rem;
  color: var(--muted);
  font-size: 0.92em;
}

tr.budget-couple-part .budget-pct-amt {
  font-size: 0.95em;
  white-space: nowrap;
}

tr.budget-couple-part .budget-solde-reste {
  font-size: 0.95em;
  white-space: nowrap;
}

table.budget-summary tr.budget-couple-part th,
table.budget-summary tr.budget-couple-part td {
  text-align: right;
}

table.budget-summary tr.budget-couple-part td.budget-part-label {
  text-align: left;
}

/* Connexion & administration utilisateurs */
.auth-wrap {
  max-width: 360px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 1rem;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-form input {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.auth-error {
  color: var(--negative);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.user-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.user-chip-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg);
}

.user-chip {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.family-chip {
  font-size: 0.85rem;
  font-weight: 600;
  color: #c7d7f0;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(61, 139, 253, 0.45);
  border-radius: 6px;
  background: rgba(61, 139, 253, 0.12);
}

.family-select-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.family-select-label {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.family-select {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  max-width: 14rem;
}

button.danger {
  background: rgba(127, 29, 29, 0.45);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.toolbar button.danger {
  background: #7f1d1d;
  border-color: #b91c1c;
  color: #fef2f2;
}

.users-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.users-inline-form input,
.users-inline-form select {
  font: inherit;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

table.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.users-table th,
table.users-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.users-actions {
  white-space: nowrap;
}

.users-actions button {
  margin-right: 0.35rem;
}

.users-mount {
  overflow-x: auto;
}

.users-name-edit {
  min-width: 5.5rem;
  max-width: 12rem;
  font: inherit;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.account-profile .profile-photo-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.account-profile .profile-photo-preview {
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated, #1a1d24);
}

.account-profile .profile-photo-preview[hidden] {
  display: none;
}

.account-profile .profile-photo-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.account-profile .profile-photo-input {
  max-width: 12rem;
}

.account-profile .profile-name-input,
.account-profile .profile-pwd-input {
  display: block;
  width: 100%;
  max-width: 22rem;
  box-sizing: border-box;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 0.35rem;
}

.account-profile .profile-pwd-hint {
  margin-top: 0.75rem;
}

/* Gestion des familles */
.families-manage .family-new {
  margin-bottom: 1.25rem;
}

.families-manage .family-card {
  margin-top: 1rem;
}

.families-manage .family-card h2 {
  margin-top: 0;
}

.families-manage .family-card h3 {
  font-size: 1rem;
  margin: 1rem 0 0.35rem;
}

.families-manage .family-card .danger {
  margin: 0.75rem 0 0.5rem;
}

.families-manage .family-card .family-delete-btn {
  margin-top: 1.25rem;
  cursor: pointer;
  position: relative;
  z-index: 20;
  isolation: isolate;
}

.family-rename-row input {
  min-width: 12rem;
}

.family-members-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.family-member-li {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.family-member-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.family-member-remove-btn {
  margin-left: auto;
}

.family-member-domain-access {
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.family-member-domain-access-hint {
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.family-member-domain-access-modes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.family-member-domain-radio-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--text);
}

.family-member-domain-checks {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0 0.65rem;
}

.family-member-domain-check-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.family-member-domain-check-row-off {
  opacity: 0.45;
  cursor: not-allowed;
}

.family-member-domain-check-title {
  font-weight: 500;
}

.family-card-readonly {
  opacity: 0.92;
  border-style: dashed;
}

.family-picker-member-admin {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.family-add-user-select {
  min-width: 12rem;
}
