@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&family=Open+Sans:wght@400;500;600&display=swap');

:root {
  --deep-green: var(--p-forest-700);
  --green: var(--accent-teal);
  --teal: var(--accent-teal);
  --cream: var(--bg-page-alt);
  --cream-dark: var(--bg-elevated);
  --orange: #ff7043;
  --yellow: #ffc107;
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --white: var(--bg-elevated);
  --border: var(--border-soft);
  --shadow: 0 8px 24px var(--shadow-soft);
}

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

html {
  min-height: 100%;
  background: var(--cream);
}

body {
  min-height: 100%;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--cream);
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  -webkit-appearance: none;
  appearance: none;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
}

/* =========================
   HEADER
   ========================= */

.app-header {
  height: 68px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-page-alt);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--deep-green);
  color: var(--yellow);
  font-size: 16px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--p-forest-700);
  padding: 3px;
  box-sizing: border-box;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(20, 57, 46, 0.15);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 140ms ease;
}

.icon-button:hover {
  background: var(--hover-teal-light);
}

.icon-button:active {
  background: var(--cream-dark);
}

/* =========================
   HOME
   ========================= */

.home {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 24px 20px 110px;
}

.welcome {
  padding: 8px 0 26px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent-gold-text);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.welcome h1 {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 40px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.welcome-text {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1.45;
  font-weight: 400;
}

/* =========================
   SEARCH
   ========================= */

.search-section {
  margin-bottom: 28px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(20, 57, 46, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  cursor: text;
}

.search-box:focus-within {
  border-color: var(--p-forest-500);
  box-shadow: 0 4px 18px rgba(20, 57, 46, 0.10);
}

.search-icon {
  color: var(--teal);
  font-size: 25px;
  line-height: 1;
  transform: rotate(-20deg);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-box input::placeholder {
  color: var(--text-tertiary);
}

/* =========================
   SECTIONS
   ========================= */

.quick-section,
.recent-section {
  margin-bottom: 28px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* =========================
   QUICK ACCESS
   ========================= */

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.quick-card {
  min-height: 84px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(20, 57, 46, 0.10);
  transition: transform 120ms ease, box-shadow 120ms ease;
  font-family: inherit;
}

.quick-card:active {
  transform: scale(0.985);
  box-shadow: 0 2px 8px rgba(20, 57, 46, 0.15);
}

.quick-card-green {
  background: linear-gradient(135deg, #00695c, #008f80);
}

.quick-card-gold {
  background: linear-gradient(135deg, #9b7414, #c49728);
}

.quick-card-wide {
  grid-column: 1 / -1;
  min-height: 74px;
  background: var(--p-forest-700);
  color: var(--p-cream-100);
  box-shadow: 0 4px 16px rgba(8, 31, 25, 0.2);
}

.quick-card-wide .quick-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
  font-size: 22px;
}

.quick-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  color: currentColor;
}

.quick-card-wide .quick-arrow {
  color: var(--p-cream-100);
}

.quick-card-wide svg {
  color: var(--p-gold-400);
}

.quick-card-wide .quick-arrow svg {
  color: var(--p-cream-100);
}

.quick-card::after {
  content: "";
  position: absolute;
  width: 75px;
  height: 75px;
  right: -27px;
  bottom: -34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.quick-icon {
  width: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #fff8d9;
}

.quick-card strong,
.quick-card small {
  display: block;
  position: relative;
  z-index: 1;
}

.quick-card strong {
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.quick-card small {
  margin-top: 2px;
  font-size: 10px;
  opacity: 0.9;
}

.quick-arrow {
  margin-left: auto;
  position: relative;
  z-index: 2;
  font-size: 23px;
  opacity: 0.85;
}

/* =========================
   RECENTS
   ========================= */

.text-button {
  background: transparent;
  border: none;
  color: var(--accent-gold-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 140ms ease;
}

.text-button:hover {
  background: rgba(184, 147, 90, 0.10);
}

.recent-list {
  overflow: hidden;
  border-top: 1px solid var(--border);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.recent-item:hover {
  border-color: var(--p-forest-500);
}

.recent-item:active {
  transform: scale(0.985);
  box-shadow: 0 2px 10px rgba(20, 57, 46, 0.08);
}

.recent-item:active {
  transform: scale(0.985);
  box-shadow: 0 2px 10px var(--shadow-soft);
}

.recent-number {
  flex: 0 0 auto;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--p-forest-700);
  color: var(--p-gold-400);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recent-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.recent-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-arrow {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

/* =========================
   BOTTOM NAVIGATION
   ========================= */

.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(66px + env(safe-area-inset-bottom));
  padding: 7px 12px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  background: var(--bg-page-translucent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 9px;
  cursor: pointer;
}

.nav-icon {
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.nav-item.active {
  color: var(--teal);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  color: var(--text-primary);
}

/* =========================
   TABLET / DESKTOP
   ========================= */

@media (min-width: 700px) {
  .app-header {
    padding-inline: 32px;
  }

  .home {
    padding-inline: 32px;
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    width: min(100%, 680px);
    transform: translateX(-50%);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
}


/* =========================================================
   LUCIDE
   Adaptation des icônes SVG au design original de la Home
   ========================================================= */

[data-lucide] {
  display: block;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.brand-mark {
  display: grid;
  place-items: center;
}

.brand-mark svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.icon-button {
  display: grid;
  place-items: center;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.search-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  transform: none;
}

.search-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.quick-icon {
  display: grid;
  place-items: center;
}

.quick-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.quick-arrow {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 0;
}

.quick-arrow svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.nav-icon {
  display: grid;
  place-items: center;
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.recent-arrow {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 0;
}

.recent-arrow svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.quick-card,
.nav-item,
.icon-button,
.text-button {
  -webkit-tap-highlight-color: transparent;
}

.quick-card:active {
  transform: scale(0.985);
}

.nav-item:active,
.icon-button:active {
  transform: scale(0.94);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ============================================================
   HEADER ACTIONS (ajouté v5)
   ============================================================ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   RÉCENTS — État vide (ajouté v6)
   ============================================================ */
.recent-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.5;
  font-style: italic;
  margin: 0;
}
