/* ============================================================
   Facturation, habillée comme le Cockpit (widgets iPhone).
   Demande de Léo, 2026-11-12 : « ce style, pour l'outil de facturation ».
   Couche posée APRÈS styles.css : elle change les jetons et les surfaces,
   pas le fonctionnement. Pour revenir à « Blue Glass » : retirer la ligne
   <link rel="stylesheet" href="ios.css" /> de index.html.
   ============================================================ */

:root {
  --ambient: #f2f2f7;

  /* Encre : le noir doux et les gris d'Apple */
  --ink-900: #1c1c1e;
  --ink-700: #3a3a3c;
  --ink-500: #6e6e73;
  --ink-400: #8e8e93;
  --ink-on-deep: #ffffff;
  --ink-on-deep-soft: rgba(255, 255, 255, 0.72);

  /* Marque : le bleu système */
  --brand-900: #0040dd;
  --brand-800: #0051e6;
  --brand-700: #0062f0;
  --brand-600: #007aff;
  --brand-500: #007aff;
  --brand-400: #409cff;
  --brand-300: #8fc2ff;
  --brand-200: #cfe4ff;
  --brand-100: #eaf3ff;

  --positive: #34c759;  --positive-ink: #248a3d;
  --negative: #ff3b30;  --negative-ink: #d70015;
  --caution:  #ff9500;  --caution-ink:  #c93400;

  /* Plus de verre : des cartes blanches, nettes */
  --glass-frost-bg: #ffffff;
  --glass-frost-border: transparent;
  --glass-frost-blur: none;
  --glass-sheet-bg: #ffffff;
  --glass-sheet-border: transparent;
  --glass-sheet-blur: none;
  /* La carte héro : noire, comme une carte Apple */
  --glass-deep-bg: linear-gradient(150deg, #2c2c2e 0%, #1c1c1e 100%);
  --glass-deep-border: transparent;
  --sheen: 0 0 0 transparent;
  --sheen-deep: 0 0 0 transparent;

  --rule: #e5e5ea;
  --rule-soft: #f0f0f3;

  --shadow-xs: 0 1px 2px rgba(28, 28, 30, 0.05);
  --shadow-sm: 0 1px 2px rgba(28, 28, 30, 0.06), 0 8px 24px rgba(28, 28, 30, 0.07);
  --shadow-md: 0 2px 4px rgba(28, 28, 30, 0.06), 0 12px 30px rgba(28, 28, 30, 0.09);
  --shadow-lg: 0 4px 8px rgba(28, 28, 30, 0.06), 0 24px 48px rgba(28, 28, 30, 0.12);
  --shadow-deep: 0 2px 4px rgba(28, 28, 30, 0.1), 0 16px 36px rgba(28, 28, 30, 0.2);

  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 24px;
  --r-xl: 28px;

  --bleu: #007aff;
}

body {
  background: var(--ambient);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  font-feature-settings: normal;
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 400;
}
::selection { background: rgba(0, 122, 255, 0.2); }
.orb { display: none; }

h1, h2, h3, .brand-name { letter-spacing: -0.02em; }
.page-header h1 { font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -0.022em; }
h2 { font-size: 22px; line-height: 28px; font-weight: 700; }
.label { letter-spacing: 0.02em; color: var(--ink-400); font-weight: 600; }

/* La barre de gauche : une liste Apple, sans carte de verre */
.sidebar {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.brand { border-bottom-color: var(--rule); }
.brand-mark { background: var(--bleu); border-radius: 12px; box-shadow: none; }
.nav a { color: var(--ink-700); font-weight: 500; border-radius: 12px; }
.nav a:hover { background: rgba(0, 0, 0, 0.04); }
.nav a.active { background: #ffffff; color: var(--ink-900); box-shadow: var(--shadow-sm); font-weight: 600; }
.nav a.active::before { display: none; }
.nav a.active .nav-icon { color: var(--bleu); }
.rail-foot { border-top-color: var(--rule); }

/* Cartes */
.panel, .panel.frost, .stat, .year-card, .pay-card, .totals-box, .empty-state {
  background: #ffffff;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--shadow-sm);
}
.panel { border-radius: 24px; }
.stat { border-radius: 24px; }
.stat::before { display: none; }
.stat:hover { transform: none; box-shadow: var(--shadow-md); }
.stat .value { font-weight: 700; letter-spacing: -0.03em; color: var(--ink-900); }
.stat.alarm { background: #ffffff; }
.stat.alarm .value { color: var(--negative); }

/* Carte héro : noire, gros chiffre blanc */
.hero { border: 0; border-radius: 28px; }
.hero::before { background: radial-gradient(circle at 85% 0%, rgba(0, 122, 255, 0.35), transparent 60%); }
.hero .hero-value { font-weight: 700; letter-spacing: -0.035em; }

/* Boutons : pilules, bleu système */
.btn {
  background: #ffffff;
  border: 0;
  border-radius: 999px;
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--rule);
  font-family: inherit;
  font-weight: 600;
  color: var(--bleu);
}
.btn:hover { transform: none; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--rule); color: var(--bleu); }
.btn.primary { background: var(--bleu); color: #ffffff; box-shadow: var(--shadow-xs); }
.btn.primary:hover { background: #0062f0; color: #ffffff; }
.btn.ghost { color: var(--bleu); box-shadow: none; }
.btn.ghost:hover { background: rgba(0, 122, 255, 0.08); }
.btn.danger { background: #ffffff; color: var(--negative); box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--rule); }
.btn.danger:hover { background: rgba(255, 59, 48, 0.08); color: var(--negative); }
.btn.small { border-radius: 999px; }
.hero .btn { background: rgba(255, 255, 255, 0.16); color: #ffffff; box-shadow: none; }
.hero .btn:hover { background: rgba(255, 255, 255, 0.24); color: #ffffff; }

.icon-btn { background: #ffffff; border: 0; box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--rule); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Contrôle segmenté, comme sur iPhone */
.seg { background: #e9e9ee; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 999px; }
.seg button { border-radius: 999px; font-family: inherit; font-weight: 500; color: var(--ink-500); }
.seg button.active { background: #ffffff; color: var(--ink-900); box-shadow: var(--shadow-xs); }

/* Pastilles de statut, couleurs Apple */
.chip { background: #f2f2f7; color: var(--ink-700); }
.hero .chip { background: rgba(255, 255, 255, 0.16); }
.badge.draft     { color: #6e6e73; background: #f2f2f7; }
.badge.sent      { color: #0062f0; background: rgba(0, 122, 255, 0.12); }
.badge.partial   { color: #c93400; background: rgba(255, 149, 0, 0.16); }
.badge.paid      { color: #248a3d; background: rgba(52, 199, 89, 0.16); }
.badge.overdue   { color: #d70015; background: rgba(255, 59, 48, 0.12); }
.badge.cancelled { color: #8e8e93; background: #f2f2f7; }

/* Champs */
input, select, textarea, .search-input { font-family: inherit; }
.search-input, .field input, .field select, .field textarea {
  background: #ffffff;
  border-color: var(--rule);
  border-radius: 12px;
}
:focus-visible { box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3); border-color: var(--bleu); }

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

/* Dans le Cockpit (affichée dans son onglet) : moins de marges */
html.dans-cockpit .sidebar { margin: 12px 8px 12px 16px; top: 12px; height: calc(100vh - 24px); }
html.dans-cockpit .view { padding-top: 24px; }
