/* MMB — Maquettes MVP (aperçu local) */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Sora:wght@400;500;600;700&display=swap");

:root {
  --ink: #0c1222;
  --ink-soft: #3d4a5c;
  --paper: #eef3f7;
  --paper-2: #e2ebf2;
  --teal: #0f6b63;
  --teal-deep: #0a4a45;
  --mint: #b8e6df;
  --gold: #d4a017;
  --danger: #c0392b;
  --ok: #1a7f4b;
  --line: rgba(12, 18, 34, 0.1);
  --shadow: 0 18px 50px rgba(12, 18, 34, 0.12);
  --radius: 18px;
  --font: "Sora", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #c8ebe6 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #d6e4f5 0%, transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.phone-shell {
  width: min(420px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 1.25rem 1rem 5.5rem;
  position: relative;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.brand-mark .mmb {
  font-size: 1.65rem;
  color: var(--teal-deep);
}

.brand-mark .full {
  font-size: 0.78rem;
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink-soft);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

h1,
h2,
.display {
  font-family: var(--display);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.85rem, 6vw, 2.35rem);
  margin: 0.4rem 0 0.75rem;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.lead {
  color: var(--ink-soft);
  font-size: 1rem;
  max-width: 34ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.95rem 1.25rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 107, 99, 0.35);
  width: 100%;
}

.btn-primary:hover {
  box-shadow: 0 14px 34px rgba(15, 107, 99, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--teal-deep);
  width: 100%;
  border: 1.5px solid rgba(15, 107, 99, 0.35);
}

.btn-row {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.btn-row form {
  display: grid;
  width: 100%;
}

.btn-row form .btn {
  width: 100%;
}

.link-btn {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-errors,
.field-errors {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0.35rem 0 0.75rem;
  line-height: 1.4;
}

.form-errors ul,
.field-errors ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.messages {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.messages li {
  border-radius: 14px;
  padding: 0.85rem 1.05rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
  border: 1px solid rgba(15, 107, 99, 0.25);
  background: rgba(15, 107, 99, 0.1);
  color: #0c4f4a;
}

.messages li.success {
  border-color: rgba(26, 127, 75, 0.35);
  background: rgba(26, 127, 75, 0.1);
  color: #145c36;
}

.messages li.warning {
  border-color: rgba(180, 120, 40, 0.35);
  background: rgba(180, 120, 40, 0.12);
  color: #7a4e12;
}

.messages li.error {
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.1);
  color: var(--danger);
}

.messages li.info {
  border-color: rgba(15, 107, 99, 0.25);
  background: rgba(15, 107, 99, 0.1);
  color: #0c4f4a;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 107, 99, 0.15);
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 1rem;
}

.check input {
  margin-top: 0.2rem;
}

.panel {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}

.solde-hero {
  padding: 1.4rem 1.2rem;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(15, 107, 99, 0.95), rgba(10, 74, 69, 0.98)),
    var(--teal-deep);
  color: #fff;
  margin: 1rem 0 1.1rem;
  position: relative;
  overflow: hidden;
}

.solde-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -40px;
  top: -50px;
  border-radius: 50%;
  background: rgba(184, 230, 223, 0.18);
}

.solde-hero .label {
  font-size: 0.8rem;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

.solde-hero .amount {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 0.2rem;
  position: relative;
  z-index: 1;
}

.solde-hero .meta {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
}

.quick-actions a {
  text-align: center;
  padding: 0.95rem 0.5rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.quick-actions .in {
  color: var(--ok);
}

.quick-actions .out {
  color: var(--danger);
}

.list {
  display: grid;
  gap: 0.55rem;
}

.row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

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

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn.edit:hover,
.icon-btn.edit:focus-visible {
  color: var(--teal-deep);
  border-color: rgba(15, 107, 99, 0.45);
  background: rgba(15, 107, 99, 0.08);
}

.icon-btn.delete:hover,
.icon-btn.delete:focus-visible {
  color: var(--danger);
  border-color: rgba(192, 57, 43, 0.4);
  background: rgba(192, 57, 43, 0.08);
}

.row-item .left {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

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

.modal-panel[hidden] {
  display: none !important;
}

.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.type-toggle label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.type-toggle input {
  accent-color: var(--teal);
}

.type-toggle label:has(input:checked) {
  border-color: var(--teal);
  background: rgba(15, 107, 99, 0.1);
  color: var(--teal-deep);
}

.row-item .title {
  font-weight: 600;
  font-size: 0.92rem;
}

.row-item .sub {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.row-item .amt {
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
}

.amt.pos {
  color: var(--ok);
}

.amt.neg {
  color: var(--danger);
}

.nav-bottom {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 0.55rem 0.35rem calc(0.55rem + env(safe-area-inset-bottom));
  z-index: 20;
}

.nav-bottom a {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: #8a96a8;
  padding: 0.45rem 0.25rem;
  border-radius: 12px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-bottom a .ico {
  color: inherit;
  opacity: 0.75;
}

.nav-bottom a.active {
  color: var(--teal-deep);
  background: rgba(15, 107, 99, 0.12);
  font-weight: 700;
}

.nav-bottom a.active .ico {
  opacity: 1;
  color: var(--teal);
  transform: scale(1.08);
}

.nav-bottom .ico {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
  transition: transform 0.15s ease, opacity 0.15s ease, color 0.15s ease;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.topbar-month {
  justify-content: flex-end;
}

.month-heading {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.35rem 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 107, 99, 0.1);
  color: var(--teal-deep);
}

.stat-bars {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.bar-row {
  display: grid;
  gap: 0.3rem;
}

.bar-row .head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

.track {
  height: 10px;
  border-radius: 999px;
  background: rgba(12, 18, 34, 0.08);
  overflow: hidden;
}

.fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), #1aa392);
}

.fill.out {
  background: linear-gradient(90deg, #c0392b, #e07468);
}

.fill.in {
  background: linear-gradient(90deg, #1a7f4b, #3cb371);
}

.stats-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.35rem 0 0.65rem;
}

.stats-section-title + .stat-bars {
  margin-top: 0;
}

.stats-totals {
  margin-top: 1rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.stats-totals .row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.stats-totals .solde {
  font-weight: 700;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
  margin-top: 0.15rem;
}

.stats-note {
  margin-top: 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.stats-note.ok {
  border-color: rgba(26, 127, 75, 0.35);
  background: rgba(26, 127, 75, 0.1);
  color: #145c36;
}

.stats-note.warn {
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.08);
  color: #8e2a22;
}

.report-banner {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(120deg, #fff7e0, #ffe8a8);
  border: 1px solid rgba(212, 160, 23, 0.35);
}

.report-banner strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.muted {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.hub-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.hub-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hub-grid a {
  display: block;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(12, 18, 34, 0.06);
  transition: transform 0.15s ease;
}

.hub-grid a:hover {
  transform: translateY(-2px);
}

.hub-grid .num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.06em;
}

.hub-grid .name {
  font-family: var(--display);
  font-size: 1.15rem;
  margin-top: 0.2rem;
}

.hub-grid .desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

.hint-box {
  margin-top: 1.75rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: rgba(15, 107, 99, 0.08);
  border: 1px dashed rgba(15, 107, 99, 0.35);
  font-size: 0.9rem;
}

.hint-box code {
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.tag-mock {
  position: fixed;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 50;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  opacity: 0.75;
}

@media (min-width: 900px) {
  .phone-shell {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    min-height: auto;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.35);
    box-shadow: var(--shadow);
  }
}
