/* Composants visuels reutilisables: cartes, badges, tables, boutons et etats. */

.app-card {
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow);
}

.app-card__header,
.app-toolbar,
.app-table-card__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--app-border);
}

.app-section-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #eef4ef;
  color: var(--app-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.app-badge--warning {
  background: rgba(185, 138, 47, 0.14);
  color: #8a6500;
}

.app-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.app-status-badge.lineosoft-freshness-chip-state {
  gap: 0.5rem;
  padding: 0.22rem 0.62rem;
  border: 1px solid rgba(47, 107, 79, 0.18);
  border-radius: 999px;
  background: rgba(47, 107, 79, 0.12);
  color: var(--app-accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-transform: uppercase;
  box-shadow: none;
}

.app-status-badge__dot {
  display: inline-block;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: var(--app-status-dot, rgba(255, 255, 255, 0.92));
  box-shadow: 0 0 0 0.12rem rgba(255, 255, 255, 0.28);
}

.app-status-badge .app-status-badge__dot.lineosoft-freshness-dot {
  width: 0.58rem;
  height: 0.58rem;
  background: var(--app-accent);
  box-shadow: 0 0 0 0.16rem rgba(47, 107, 79, 0.14);
}

.app-status-badge.lineosoft-freshness-chip-state.app-status-badge--draft {
  border-color: rgba(102, 115, 107, 0.18);
  background: rgba(247, 248, 247, 0.96);
  color: var(--app-text-muted);
}

.app-status-badge.app-status-badge--draft .app-status-badge__dot.lineosoft-freshness-dot {
  background: #88928b;
  box-shadow: 0 0 0 0.16rem rgba(136, 146, 139, 0.12);
}

.app-status-badge.lineosoft-freshness-chip-state.app-status-badge--confirmed {
  border-color: rgba(47, 107, 79, 0.24);
  background: rgba(47, 107, 79, 0.12);
  color: var(--app-accent);
}

.app-status-badge.lineosoft-freshness-chip-state.app-status-badge--in-progress {
  border-color: rgba(185, 138, 47, 0.3);
  background: rgba(255, 248, 235, 0.96);
  color: #8a6500;
}

.app-status-badge.app-status-badge--in-progress .app-status-badge__dot.lineosoft-freshness-dot {
  background: var(--app-warning);
  box-shadow: 0 0 0 0.16rem rgba(185, 138, 47, 0.12);
}

.app-status-badge.lineosoft-freshness-chip-state.app-status-badge--completed {
  border-color: rgba(47, 107, 79, 0.24);
  background: rgba(47, 107, 79, 0.12);
  color: var(--app-accent);
}

.app-status-badge.lineosoft-freshness-chip-state.app-status-badge--cancelled {
  border-color: rgba(164, 73, 73, 0.24);
  background: rgba(255, 244, 244, 0.96);
  color: var(--app-danger);
}

.app-status-badge.app-status-badge--cancelled .app-status-badge__dot.lineosoft-freshness-dot {
  background: var(--app-danger);
  box-shadow: 0 0 0 0.16rem rgba(164, 73, 73, 0.12);
}

.app-table {
  margin: 0;
  --bs-table-bg: transparent;
}

.app-table > :not(caption) > * > * {
  padding: 0.95rem 1rem;
  border-color: var(--app-border);
}

.app-form-control,
.app-form-select,
.app-content input.form-control,
.app-content select.form-select,
.app-content textarea.form-control {
  min-height: 3rem;
  border-radius: 0.9rem;
}

.app-content .alert {
  border-radius: var(--app-radius-md);
  border-color: transparent;
}

.app-content .btn {
  border-radius: 0.9rem;
  font-weight: 600;
}

.app-content .btn-primary {
  background: var(--app-accent);
  border-color: var(--app-accent);
}

.app-content .btn-primary:hover,
.app-content .btn-primary:focus-visible {
  background: var(--app-accent-strong);
  border-color: var(--app-accent-strong);
}

.app-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  vertical-align: -0.125em;
}

.app-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding-inline: 0.55rem;
}

.btn-sm.app-icon-btn {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.35rem 0.48rem;
}

.app-icon-btn .app-icon {
  width: 1rem;
  height: 1rem;
}

.app-inline-action {
  position: relative;
}

.app-inline-action > summary {
  list-style: none;
  cursor: pointer;
}

.app-inline-action > summary::-webkit-details-marker {
  display: none;
}

.app-inline-action__panel {
  position: absolute;
  right: 0;
  z-index: 20;
  display: grid;
  width: min(20rem, 80vw);
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding: 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 0.95rem;
  background: var(--app-surface-strong);
  box-shadow: var(--app-shadow);
  text-align: left;
}

.app-notification-region {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1100;
  display: grid;
  width: min(26rem, calc(100vw - 2rem));
  gap: 0.75rem;
  pointer-events: none;
}

.app-notification {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--app-notification-border, var(--app-border));
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(23, 38, 30, 0.18);
  color: var(--app-text);
  pointer-events: auto;
  transform: translateY(0);
  opacity: 1;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.app-notification.is-leaving {
  transform: translateY(-0.35rem);
  opacity: 0;
}

.app-notification__marker {
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--app-notification-color, var(--app-accent));
  box-shadow: 0 0 0 0.2rem var(--app-notification-glow, rgba(47, 107, 79, 0.12));
}

.app-notification__body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.app-notification__title {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
}

.app-notification__message {
  color: var(--app-text-muted);
  font-size: 0.9rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.app-notification__close {
  display: inline-grid;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--app-text-muted);
  font-size: 1.25rem;
  line-height: 1;
}

.app-notification__close:hover,
.app-notification__close:focus-visible {
  background: rgba(23, 38, 30, 0.08);
  color: var(--app-text);
}

.app-notification--success {
  --app-notification-color: var(--app-accent);
  --app-notification-border: rgba(47, 107, 79, 0.24);
  --app-notification-glow: rgba(47, 107, 79, 0.14);
}

.app-notification--info {
  --app-notification-color: #3a6f8f;
  --app-notification-border: rgba(58, 111, 143, 0.24);
  --app-notification-glow: rgba(58, 111, 143, 0.14);
}

.app-notification--warning {
  --app-notification-color: var(--app-warning);
  --app-notification-border: rgba(185, 138, 47, 0.3);
  --app-notification-glow: rgba(185, 138, 47, 0.15);
}

.app-notification--error {
  --app-notification-color: var(--app-danger);
  --app-notification-border: rgba(164, 73, 73, 0.28);
  --app-notification-glow: rgba(164, 73, 73, 0.15);
}

@media (max-width: 767.98px) {
  .app-notification-region {
    top: auto;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: auto;
  }
}
