/* Compléments propres à WA Router, construits sur les tokens du design system */

/* Texte blanc sur la couleur de marque (le noir prévu par le design system est illisible sur #1a0dab) */
.cw-btn--primary { color: var(--white); }

.app-wordmark {
  font: 400 1.5rem/1 var(--font-serif);
  color: var(--black);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.app-sidebar .app-wordmark { padding: 0.75rem 0.75rem 1.25rem; }
.app-account-form { margin-top: auto; }
.app-logout { font: inherit; cursor: pointer; }

/* Connexion */
.app-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1rem;
  background: var(--gray);
}
.app-login__card {
  width: 100%;
  max-width: 24rem;
  background: var(--white);
  border-radius: var(--radius-xmd);
  padding: 2rem 1.5rem;
}
.app-error {
  margin: 0;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  background: var(--red-50);
  color: var(--red-500);
  font-size: 0.8125rem;
}

/* Champs */
.app-field { display: flex; flex-direction: column; gap: 0.375rem; }
.app-field__label { font: 500 0.8125rem/1.3125rem var(--font-sans); color: var(--gray-1000); }
.app-field .cw-muted code, .cw-section-sub code { font-size: 0.75rem; }
.app-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.app-grow { flex: 1; min-width: 14rem; }
.app-mt { margin-top: 1rem; }

.app-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.app-inline-form .cw-btn { height: var(--control-h); }

/* Cartes : séparées par le fond, pas par des bordures */
.app-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-xmd);
  background: var(--gray-50);
}
.app-card--gray { background: var(--gray); }
.app-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.app-card__title { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }

.app-url {
  font: 400 0.8125rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--gray-700);
  word-break: break-all;
}
.app-url--big {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-base);
  background: var(--white);
  font-size: 0.9375rem;
  color: var(--gray-1000);
}

.app-phones td { background: var(--white); }
.app-phones tr:first-child td:first-child { border-top-left-radius: var(--radius-base); }
.app-phones tr:first-child td:last-child { border-top-right-radius: var(--radius-base); }
.app-phones tr:last-child td { border-bottom: 0; }
.app-phones tr:last-child td:first-child { border-bottom-left-radius: var(--radius-base); }
.app-phones tr:last-child td:last-child { border-bottom-right-radius: var(--radius-base); }
.app-cell-actions { width: 1%; text-align: right; }
.app-cell-actions form { margin: 0; }

.app-details summary { cursor: pointer; font-size: 0.8125rem; color: var(--gray-500); }
.app-details[open] { display: flex; flex-direction: column; gap: 1rem; }
.app-details[open] summary { margin-bottom: 0.25rem; }
.app-link-danger {
  border: 0;
  background: none;
  padding: 0;
  color: var(--red-500);
  font: 500 0.8125rem var(--font-sans);
  cursor: pointer;
}

.app-test-result { margin: 0; font-size: 0.875rem; }

/* Événements */
.app-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.app-pills .cw-pill { text-decoration: none; }
.app-table-wrap { overflow-x: auto; }
.app-row-link { cursor: pointer; }
.app-row-link:hover td { background: var(--gray-50); }
.app-row-link a { color: inherit; }
.app-nowrap { white-space: nowrap; }
.app-error-cell { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-badge--error { background: var(--red-50); color: var(--red-500); }
.app-badge--error .cw-dot { background: var(--red-500); }
.cw-badge--success .cw-dot { background: var(--green-500); }
.cw-badge--warning .cw-dot { background: var(--warning-500); }

.app-dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin: 0;
}
.app-dl > div { background: var(--gray); border-radius: var(--radius-base); padding: 0.75rem 1rem; min-width: 0; }
.app-dl dt { font: 500 0.75rem/1.3 var(--font-sans); color: var(--gray-500); margin-bottom: 0.25rem; }
.app-dl dd { margin: 0; font-size: 0.875rem; overflow-wrap: anywhere; }

.app-pre {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-base);
  background: var(--gray);
  font: 400 0.75rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: auto;
  max-height: 32rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Toast */
.app-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  max-width: min(28rem, calc(100vw - 2rem));
}
.app-toast__dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: var(--green-500); flex-shrink: 0; }
.app-toast__dot--error { background: var(--red-500); }

@media (max-width: 768px) {
  .app-toast { bottom: calc(6rem + env(safe-area-inset-bottom)); left: 1rem; right: 1rem; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-grid .cw-stat { padding: 1rem; }
  .app-inline-form > * { width: 100%; }
  .app-grow { min-width: 0; }
}

/* URL à copier */
.app-copy { display: flex; gap: 0.5rem; align-items: center; }
@media (max-width: 768px) { .app-copy { flex-direction: column; align-items: stretch; } }
.app-copy .app-url--big { flex: 1; min-width: 0; }
.app-copy .cw-btn { height: var(--control-h); }

