/* --- Design tokens — CogefinEasy (aligné app mobile) --- */
:root {
  --color-red: #d32f2f;
  --color-red-hover: #b71c1c;
  --color-bg: #f2f2f2;
  --color-bg-gray: #f2f2f2;
  --color-bar: #f8f6fa;
  --color-modal-surface: #f3f1f7;
  --color-surface: #ffffff;
  --color-surface-soft: #f8f6fa;
  --color-text: #212121;
  --color-text-muted: #616161;
  --color-dark: #1c252c;
  --color-dark-hover: #141a20;
  --color-border: #e0e0e0;
  --color-folder: #e6b32a;
  --shadow-sm: 0 1px 2px rgba(28, 37, 44, 0.06);
  --shadow-md: 0 8px 28px rgba(28, 37, 44, 0.08);
  --shadow-lg: 0 24px 56px rgba(28, 37, 44, 0.14);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1120px;
  --transition: 0.2s ease;
  --red-ring: rgba(211, 47, 47, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

button,
input {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.link-ghost {
  border: none;
  background: none;
  padding: 0.35rem 0;
  color: var(--color-text);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
  text-decoration: none;
  display: inline-block;
  font-size: inherit;
  font-family: inherit;
}

.link-ghost:hover,
.link-ghost:focus-visible {
  color: var(--color-red);
}

.main {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  background: var(--color-bar);
}

.app-footer__inner {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.muted {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Views */
.view.is-hidden {
  display: none !important;
}

.page-head {
  margin-bottom: 2rem;
}

.page-title {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.page-subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.05rem;
  max-width: 42ch;
}

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1rem;
  padding: 0.25rem 0;
  transition: color var(--transition);
  text-decoration: none;
  font-size: inherit;
  font-family: inherit;
}

a.link-back,
a.link-back:visited {
  color: var(--color-text-muted);
}

.link-back:hover,
.link-back:focus-visible {
  color: var(--color-red);
}

.quick-deposit-body {
  padding-bottom: 2rem;
}

.quick-deposit-lead {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.target-folder-banner {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.target-folder-banner__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.target-folder-banner__path {
  display: block;
  font-size: 1rem;
  color: var(--color-text);
  word-break: break-word;
}

.target-folder-banner__sp {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.internal-client-bar {
  margin-bottom: 1.25rem;
}

.internal-client-bar.is-hidden {
  display: none !important;
}

.input-text--select {
  max-width: 420px;
  cursor: pointer;
}

/* Accueil — bandeaux pleine largeur (fonds comme mobile) */
.view--home {
  margin-bottom: 1rem;
}

.home-band--white {
  position: relative;
  padding: 0.5rem 0 2rem;
  margin-top: -0.5rem;
}

.home-band--white::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  top: 0;
  bottom: 0;
  background: var(--color-surface);
  z-index: 0;
  border-bottom: 1px solid var(--color-border);
}

.home-band--white .hero {
  position: relative;
  z-index: 1;
}

.home-band--gray {
  position: relative;
  padding: 1.75rem 0 2.75rem;
  margin-top: 0;
}

.home-band--gray::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  top: 0;
  bottom: 0;
  background: var(--color-bg-gray);
  z-index: 0;
}

.home-band--gray > * {
  position: relative;
  z-index: 1;
}

.home-user-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 1.75rem;
  letter-spacing: -0.01em;
  gap: 0.35rem;
}

.home-user-strip__meta {
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Hero Accueil */
.hero {
  text-align: center;
  max-width: 38rem;
  margin: 0 auto;
}

.hero--brand {
  max-width: 30rem;
}

.logo-block {
  margin: 0 auto 1.35rem;
  width: auto;
  max-width: min(320px, 100%);
  min-height: 72px;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.logo-block__img {
  width: 100%;
  max-width: 260px;
  height: auto;
  max-height: 72px;
  object-fit: contain;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.hero__title {
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

.hero__sub {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 720px;
  margin: 0 auto;
}

.action-grid--single {
  grid-template-columns: 1fr;
  max-width: 480px;
  gap: 0;
  justify-items: stretch;
}

@media (min-width: 640px) {
  .action-grid--single {
    max-width: 560px;
  }
}

.action-card {
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 1.75rem 1.75rem 1.5rem;
  border-radius: 20px;
  background: var(--color-red);
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 160px;
}

.action-card:focus-visible {
  outline: 3px solid var(--color-dark);
  outline-offset: 3px;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: var(--color-red-hover);
}

.action-card__icon {
  display: inline-flex;
  opacity: 0.95;
}

.action-card__label {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.action-card__hint {
  font-size: 0.95rem;
  opacity: 0.92;
  line-height: 1.45;
}

a.action-card {
  text-decoration: none;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

a.action-card:visited {
  color: #fff;
}

.action-card--main {
  min-height: 178px;
  padding: 2rem 2.35rem 1.85rem;
  width: 100%;
}

@media (max-width: 480px) {
  .action-card--main {
    padding: 1.75rem 1.5rem 1.5rem;
    min-height: 168px;
  }
}

.action-grid--dual {
  grid-template-columns: 1fr;
  max-width: 640px;
}

@media (min-width: 600px) {
  .action-grid--dual {
    grid-template-columns: 1fr 1fr;
    max-width: 720px;
  }
}

.action-card--split {
  min-height: 152px;
}

.role-pill {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-dark);
  color: #fff;
  vertical-align: middle;
}

/* Dropzone */
.dropzone-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--color-border);
  padding: 2rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.dropzone-card:focus-within {
  border-color: var(--color-red);
  box-shadow: var(--shadow-md);
}

.dropzone-card--dragover {
  border-color: var(--color-red);
  background: #fff8f8;
  box-shadow: 0 0 0 4px var(--red-ring);
}

.dropzone-card__inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
}

@media (min-width: 720px) {
  .dropzone-card__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.dropzone-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.dropzone-card__desc {
  margin: 0 0 0.5rem;
  color: var(--color-text-muted);
}

.dropzone-card__formats {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.dropzone-card__formats strong {
  color: var(--color-text);
  font-weight: 600;
}

.dropzone-card--secondary {
  padding: 1.35rem 1.25rem;
  margin-top: 1.5rem;
  border-width: 2px;
  opacity: 0.98;
}

.dropzone-card--secondary .dropzone-card__title {
  font-size: 1.1rem;
}

.dropzone-card--hero {
  min-height: 220px;
  padding: 2.5rem 1.75rem;
  margin-bottom: 2rem;
}

.dropzone-card--hero .dropzone-card__title {
  font-size: 1.5rem;
}

@media (min-width: 720px) {
  .dropzone-card--hero {
    min-height: 260px;
  }
}

.dropzone-card__feedback {
  margin: 1rem 0 0;
  min-height: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.dropzone-card__feedback.is-success {
  color: #047857;
}

.dropzone-card__feedback.is-error {
  color: var(--color-red);
}

.help-banner {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.75rem;
}

/* Browser panel */
.browser-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.breadcrumb-item {
  border: none;
  background: none;
  padding: 0.2rem 0.35rem;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.breadcrumb-item:hover,
.breadcrumb-item:focus-visible {
  color: var(--color-red);
  background: rgba(211, 47, 47, 0.08);
}

.breadcrumb-item.is-current {
  color: var(--color-text);
  font-weight: 700;
  pointer-events: none;
}

.breadcrumb-sep {
  color: var(--color-border);
  user-select: none;
}

.folder-frame {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.25rem 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.folder-frame__head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .folder-frame__head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.folder-frame__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.folder-frame__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.item-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.item-row:hover {
  border-color: rgba(211, 47, 47, 0.35);
  box-shadow: var(--shadow-sm);
}

.item-row__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-red);
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}

.item-row__icon--file {
  color: var(--color-dark);
}

.item-row__main {
  min-width: 0;
}

.item-row__name {
  font-weight: 600;
  margin: 0;
  word-break: break-word;
}

.item-row__meta {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.item-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.btn--row {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn--row:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}

/* Vue Créer document — barre lavande + pied fixe */
.create-shell {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  padding-bottom: 0.5rem;
}

.create-toolbar {
  position: relative;
  margin-bottom: 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid transparent;
}

.create-toolbar::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  top: 0;
  bottom: 0;
  background: var(--color-bar);
  border-bottom: 1px solid var(--color-border);
  z-index: 0;
}

.create-toolbar__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

@media (min-width: 480px) {
  .create-toolbar__inner {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
}

.create-toolbar__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}

.create-body .create-lead {
  margin: 0 0 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.98rem;
}

.create-bottom-bar {
  margin-top: auto;
  padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom, 0));
  position: sticky;
  bottom: 0;
  z-index: 40;
}

.create-bottom-bar::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  top: 0;
  bottom: 0;
  background: var(--color-bar);
  border-top: 1px solid var(--color-border);
  z-index: 0;
}

.create-bottom-bar__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Create document layout */
.create-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .create-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .thumbs-strip {
    flex: 1;
    max-width: 420px;
  }

  .create-card {
    flex: 1.2;
  }
}

.thumbs-strip {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.75rem;
  scrollbar-width: thin;
}

@media (min-width: 900px) {
  .thumbs-strip {
    flex-direction: column;
    overflow-x: visible;
    max-height: 480px;
    overflow-y: auto;
  }
}

.thumb-card {
  flex: 0 0 auto;
  width: 140px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 0.65rem;
  box-shadow: var(--shadow-sm);
}

.thumb-card__preview {
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, #eef0f3, #e2e6ea);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.thumb-card__label {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.thumb-card__tools {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
}

.icon-btn {
  border: none;
  background: var(--color-surface-soft);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition);
}

.icon-btn:hover {
  background: rgba(211, 47, 47, 0.1);
  color: var(--color-red);
}

.icon-btn--danger {
  color: var(--color-red);
}

.icon-btn--danger:hover {
  background: rgba(211, 47, 47, 0.12);
  color: var(--color-red-hover);
}

.icon-btn--neutral:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-muted);
}

.create-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.45rem;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 560px) {
  .field-row {
    flex-direction: row;
    align-items: center;
  }

  .field-row .input-text {
    flex: 1;
  }

  .field-row--filename .input-dash-wrap {
    flex: 1;
  }
}

.input-text {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-soft);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-text:focus {
  outline: none;
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px var(--red-ring);
}

.input-dash-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  border: 2px dashed #bdbdbd;
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-dash-wrap:focus-within {
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px var(--red-ring);
}

.input-dash-wrap__icon {
  color: var(--color-text-muted);
  flex-shrink: 0;
  display: flex;
}

.input-text--dashed {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0.5rem 0;
}

.input-text--dashed:focus {
  box-shadow: none;
}

.field-row--filename .input-dash-wrap {
  width: 100%;
}

.segment-actions {
  margin-bottom: 1.75rem;
}

.segment-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.segment-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.create-card__footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.25rem;
  border-top: none;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  box-sizing: border-box;
}

a.btn:visited {
  color: inherit;
}

a.btn--danger:visited {
  color: #fff;
}

.btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.btn--danger {
  background: var(--color-red);
  color: #fff;
}

.btn--danger:hover {
  background: var(--color-red-hover);
}

.btn--dark {
  background: var(--color-dark);
  color: #fff;
}

a.btn--dark:visited {
  color: #fff;
}

.btn--dark:hover {
  background: var(--color-dark-hover);
  color: #fff;
}

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

.btn--ghost:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}

.btn--outline {
  background: var(--color-surface);
  color: var(--color-dark);
  border: 1px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-dark);
}

.btn--segment {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.btn--segment:hover {
  border-color: var(--color-red);
  color: var(--color-red);
}

.btn--text-danger {
  background: none;
  color: var(--color-red);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.btn--text-danger:hover {
  color: var(--color-red-hover);
  text-decoration: underline;
}

.full-width {
  width: 100%;
}

.btn--pill {
  border-radius: 999px;
}

.btn--save {
  padding-left: 1.75rem;
  padding-right: 1.75rem;
  border-radius: 12px;
  min-width: 10rem;
}

.btn--link-muted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.btn--link-muted:hover,
.btn--link-muted:focus-visible {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.04);
}

/* Modales */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-root.is-open {
  pointer-events: auto;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 33, 43, 0.45);
  backdrop-filter: blur(4px);
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--color-modal-surface);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  z-index: 1;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-root.is-open .modal-sheet:not(.is-hidden) {
  transform: translateY(0) scale(1);
}

.modal-sheet.is-hidden {
  display: none !important;
}

.modal-title {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.modal-actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.modal-folder-sub {
  margin: -0.5rem 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.modal-folder-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  padding: 0.5rem;
}

.modal-folder-item {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--transition);
}

.modal-folder-item:hover,
.modal-folder-item:focus-visible {
  background: rgba(211, 47, 47, 0.08);
}

.modal-folder-svg {
  flex-shrink: 0;
  color: var(--color-folder);
}

@media (max-width: 480px) {
  .modal-sheet {
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .footer-actions {
    justify-content: stretch;
  }

  .footer-actions .btn {
    flex: 1;
  }
}

/* Panneau debug auth — uniquement si l’API renvoie showDevAuthDebug (hors production) */
.dev-auth-debug {
  position: fixed;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 9998;
  max-width: min(22rem, calc(100vw - 1.5rem));
  padding: 0.65rem 0.85rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #e8eaed;
  background: rgba(22, 33, 43, 0.94);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-md);
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
}

.dev-auth-debug strong {
  color: #fff;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dev-auth-debug.is-hidden {
  display: none !important;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 10px;
  font-size: 12px;
  color: #888;
  background: transparent;
}

footer a {
  color: #0e5a12;
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  color: #0a4210;
  text-decoration: underline;
}
