/*
  SEYVO APP — Phase 48G
  Couche applicative stable et non conflictuelle.

  Rôle unique de ce fichier : sécurité layout app, cartes app scopées,
  tableaux app, médias et formulaires. Les styles de pages restent dans
  css/pages/*.css pour éviter les overlaps.
*/

.seyvo-shell-body,
.seyvo-app-shell-body,
.seyvo-shell-body .seyvo-shell,
.seyvo-shell-body .seyvo-shell-content,
.seyvo-shell-body main,
.seyvo-shell-body .container,
.seyvo-shell-body .container-fluid,
.seyvo-shell-body .row,
.seyvo-shell-body [class*="col-"] {
  min-width: 0;
}

/* Shell layout — force full viewport width at every level */
.seyvo-shell-body,
.seyvo-app-shell-body {
  width: 100% !important;
  max-width: 100vw;
}

.seyvo-shell-body .seyvo-shell,
.seyvo-admin-shell-body .seyvo-admin-shell {
  width: 100% !important;
  max-width: 100%;
}

.seyvo-shell-body,
.seyvo-app-shell-body {
  overflow-x: hidden;
  background: var(--sv-bg);
  color: var(--sv-text);
}

.seyvo-shell-body .container,
.seyvo-shell-body .container-fluid {
  max-width: 100%;
}

.seyvo-shell-body .card,
.seyvo-shell-body .seyvo-card,
.seyvo-shell-body .app-card,
.seyvo-shell-body .module-card,
.seyvo-shell-body .dashboard-card {
  border-color: var(--sv-border);
  border-radius: var(--seyvo-radius-md);
  box-shadow: var(--seyvo-shadow-xs);
  background: var(--sv-surface);
}

.seyvo-shell-body .card-body,
.seyvo-shell-body .card-header,
.seyvo-shell-body .card-footer {
  min-width: 0;
  border-color: var(--sv-border);
}

.seyvo-shell-body .table-responsive,
.seyvo-shell-body .sv-table-scroll,
.seyvo-shell-body .sv-overflow-x-auto {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--seyvo-radius-sm);
}

.seyvo-shell-body table {
  max-width: 100%;
}

.seyvo-shell-body .table th,
.seyvo-shell-body .table td {
  vertical-align: middle;
}

.seyvo-shell-body .nav-pills,
.seyvo-shell-body .nav-tabs,
.seyvo-shell-body .sv-scroll-tabs {
  min-width: 0;
}

.seyvo-shell-body .sv-scroll-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

.seyvo-shell-body .sv-scroll-tabs .nav-link {
  white-space: nowrap;
}

.seyvo-shell-body iframe,
.seyvo-shell-body canvas,
.seyvo-shell-body img,
.seyvo-shell-body video {
  max-width: 100%;
}

.seyvo-shell-body textarea,
.seyvo-shell-body input,
.seyvo-shell-body select {
  max-width: 100%;
}

.seyvo-shell-body .btn,
.seyvo-shell-body .dropdown-menu,
.seyvo-shell-body .badge,
.seyvo-shell-body .alert,
.seyvo-shell-body .form-control,
.seyvo-shell-body .custom-select,
.seyvo-shell-body .input-group,
.seyvo-shell-body .list-group-item {
  min-width: 0;
}

.seyvo-shell-body .btn,
.seyvo-shell-body .dropdown-item {
  overflow-wrap: anywhere;
}

.seyvo-shell-body .card-title,
.seyvo-shell-body .card-text,
.seyvo-shell-body .table td,
.seyvo-shell-body .table th,
.seyvo-shell-body .dropdown-item,
.seyvo-shell-body .alert,
.seyvo-shell-body .badge {
  overflow-wrap: anywhere;
}

.link-settings-container,
.link-settings-wrapper,
.biolink-settings-wrapper {
  min-width: 0;
  max-width: 100%;
}

/* Device preview rules moved to components/device-preview.css. */

/* CRM kanban boards */
.seyvo-shell-body .crm-kanban {
  display: grid;
  grid-template-columns: repeat(var(--crm-kanban-columns, 5), minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.seyvo-shell-body .crm-kanban::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.seyvo-shell-body .crm-col {
  min-width: 0;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 14px 32px rgba(15, 23, 42, .045);
}

.seyvo-shell-body .crm-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 2px 4px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.seyvo-shell-body .crm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, .04);
}

.seyvo-shell-body .crm-col-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seyvo-shell-body .crm-col-count {
  min-width: 28px;
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .05);
}

.seyvo-shell-body .crm-col-total {
  padding: 9px 4px 10px;
  color: #66759a;
  font-size: 13px;
  font-weight: 650;
}

.seyvo-shell-body .crm-col-body {
  flex: 1;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-radius: 8px;
  transition: background .16s ease, box-shadow .16s ease;
}

.seyvo-shell-body .crm-col-body.drag-over {
  background: rgba(58, 82, 245, .07);
  box-shadow: inset 0 0 0 2px rgba(58, 82, 245, .32);
}

.seyvo-shell-body .crm-card {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .055);
  cursor: grab;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.seyvo-shell-body .crm-card:hover {
  transform: translateY(-1px);
  border-color: rgba(58, 82, 245, .18);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
}

.seyvo-shell-body .crm-card.dragging {
  opacity: .55;
  transform: rotate(.4deg) scale(.99);
}

.seyvo-shell-body .crm-card-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #1f2430;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seyvo-shell-body .crm-card-name:hover {
  color: var(--sv-primary);
  text-decoration: none;
}

.seyvo-shell-body .crm-card-sub {
  min-width: 0;
  overflow: hidden;
  color: #8a90a2;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seyvo-shell-body .crm-card .badge {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1199.98px) {
  .seyvo-shell-body .crm-kanban {
    grid-template-columns: repeat(var(--crm-kanban-columns, 5), minmax(240px, 1fr));
  }
}


/* App footer — global app/admin footer source
   Fix Phase 48N: .seyvo-footer existed in wrappers but had no complete style. */
.seyvo-footer {
  margin-top: 1.5rem;
  color: var(--sv-muted);
}

.seyvo-footer > .seyvo-page-container {
  padding-top: 0;
  padding-bottom: 1.5rem;
}

.seyvo-footer footer,
.seyvo-footer .footer,
.seyvo-footer .container,
.seyvo-footer .container-fluid {
  min-width: 0;
}

.seyvo-footer footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sv-border);
  color: var(--sv-muted);
  font-size: .84rem;
}

.seyvo-footer footer a,
.seyvo-footer a {
  color: var(--sv-muted);
  text-decoration: none;
  transition: color .15s ease;
}

.seyvo-footer footer a:hover,
.seyvo-footer a:hover {
  color: var(--sv-primary);
  text-decoration: none;
}

.seyvo-footer img {
  max-height: 24px;
  opacity: .72;
  filter: grayscale(1);
}

.seyvo-admin-footer {
  background: transparent;
  border: 0;
}

@media (max-width: 767.98px) {
  .seyvo-shell-body h1,
  .seyvo-shell-body .h1,
  .seyvo-shell-body .spm-hero h1,
  .seyvo-shell-body .nfc-admin-premium h1 {
    font-size: 1.85rem;
  }

  .seyvo-footer footer {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 575.98px) {
  .seyvo-shell-body .text-nowrap:not(.dropdown-toggle):not(.badge) {
    white-space: normal !important;
  }

  .seyvo-shell-body .btn,
  .seyvo-shell-body .dropdown-item {
    white-space: normal;
  }

  .seyvo-shell-body .input-group {
    flex-wrap: wrap;
  }

  .seyvo-shell-body .input-group > .form-control,
  .seyvo-shell-body .input-group > .custom-select {
    flex: 1 1 180px;
  }
}

/* Module layout safety */
.spm-wrap,
.studio-page,
.studio-card,
.studio-card-soft,
.nfc-glass,
.nfc-card,
.nfc-stat,
.nfc-builder-panel,
.nfc-activation-card {
  min-width: 0;
  max-width: 100%;
}

.spm-grid,
.spm-form-grid,
.studio-grid,
.nfc-grid-2,
.nfc-grid-3 {
  min-width: 0;
}

.spm-panel,
.spm-card,
.spm-table,
.spm-panel-body,
.spm-row-actions,
.spm-actions,
.studio-actions,
.nfc-actions {
  min-width: 0;
}

.spm-table {
  width: 100%;
}

.spm-panel-body {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spm-row-actions,
.spm-actions,
.studio-actions,
.nfc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.spm-btn,
.studio-btn-primary,
.studio-btn-ghost,
.nfc-btn,
.nfc-action {
  white-space: normal;
  text-align: center;
}

@media (max-width: 767.98px) {
  .spm-wrap,
  .studio-page {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .spm-grid,
  .spm-form-grid,
  .studio-grid,
  .nfc-grid-2,
  .nfc-grid-3 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .spm-panel,
  .spm-card,
  .studio-card,
  .studio-card-soft,
  .nfc-glass,
  .nfc-card {
    border-radius: var(--seyvo-radius-md);
  }

  .spm-row-actions,
  .spm-actions,
  .studio-actions,
  .nfc-actions {
    justify-content: flex-start;
  }

  .spm-btn,
  .studio-btn-primary,
  .studio-btn-ghost,
  .nfc-btn,
  .nfc-action {
    min-height: 40px;
  }
}

/* ============================================================
   Design consistency layer
   Normalizes legacy Bootstrap views, spm production modules,
   studio modules and NFC screens around the Seyvo token system.
   ============================================================ */

.seyvo-shell-body {
  background: var(--seyvo-shell-bg);
  color: var(--sv-text);
  font-family: var(--sv-font-sans);
}

.seyvo-shell-body main > .container,
.seyvo-shell-body main > .container-fluid,
.seyvo-shell-body main > .spm-wrap,
.seyvo-shell-body main > .studio-page,
.seyvo-shell-body main > .nfc-admin-premium,
.seyvo-shell-body main > .nfc-premium-shell {
  width: 100%;
  max-width: var(--seyvo-container-max);
  margin-left: auto;
  margin-right: auto;
}

.seyvo-shell-body main > .container,
.seyvo-shell-body main > .container-fluid,
.seyvo-shell-body main > .spm-wrap,
.seyvo-shell-body main > .studio-page,
.seyvo-shell-body main > .nfc-admin-premium {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

.seyvo-shell-body h1,
.seyvo-shell-body .h1,
.seyvo-shell-body h2,
.seyvo-shell-body .h2,
.seyvo-shell-body h3,
.seyvo-shell-body .h3 {
  color: var(--sv-ink);
  font-weight: 800;
  letter-spacing: 0;
}

.seyvo-shell-body h1,
.seyvo-shell-body .h1,
.seyvo-shell-body .spm-hero h1,
.seyvo-shell-body .nfc-admin-premium h1 {
  font-size: 2.15rem;
  line-height: 1.12;
}

.seyvo-shell-body .card,
.seyvo-shell-body .sv-account-card,
.seyvo-shell-body .spm-card,
.seyvo-shell-body .spm-panel,
.seyvo-shell-body .studio-card,
.seyvo-shell-body .studio-card-soft,
.seyvo-shell-body .nfc-glass,
.seyvo-shell-body .nfc-card,
.seyvo-shell-body .nfc-stat,
.seyvo-shell-body .nfc-builder-panel {
  border: 1px solid var(--sv-border);
  border-radius: var(--seyvo-radius-md);
  background: var(--sv-surface);
  box-shadow: var(--seyvo-shadow-xs);
}

.seyvo-shell-body .card-header,
.seyvo-shell-body .card-footer,
.seyvo-shell-body .spm-panel-head {
  border-color: var(--sv-border);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,247,253,.84));
}

.seyvo-shell-body .card-body,
.seyvo-shell-body .spm-panel-body {
  padding: 1.25rem;
}

.seyvo-shell-body .spm-hero,
.seyvo-shell-body .nfc-hero,
.seyvo-shell-body .nfc-activation-hero {
  border: 1px solid var(--sv-border);
  border-radius: var(--seyvo-radius-lg);
  box-shadow: var(--seyvo-shadow-soft);
}

.seyvo-shell-body .spm-hero {
  background:
    radial-gradient(circle at top right, rgba(var(--seyvo-primary-rgb), .10), transparent 34%),
    linear-gradient(135deg, var(--seyvo-white), var(--seyvo-cream));
}

.seyvo-shell-body .spm-eyebrow,
.seyvo-shell-body .nfc-activation-kicker {
  color: var(--sv-primary);
  letter-spacing: 0;
}

.seyvo-shell-body .spm-hero p,
.seyvo-shell-body .spm-muted,
.seyvo-shell-body .text-muted,
.seyvo-shell-body .sv-account-muted,
.seyvo-shell-body .nfc-stat span {
  color: var(--sv-muted) !important;
}

.seyvo-shell-body .btn,
.seyvo-shell-body .sv-btn,
.seyvo-shell-body .spm-btn,
.seyvo-shell-body .studio-btn-primary,
.seyvo-shell-body .studio-btn-ghost,
.seyvo-shell-body .nfc-btn,
.seyvo-shell-body .nfc-action {
  border-radius: var(--seyvo-radius-sm);
  font-weight: 750;
  letter-spacing: 0;
  min-height: 38px;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.seyvo-shell-body .btn:hover,
.seyvo-shell-body .sv-btn:hover,
.seyvo-shell-body .spm-btn:hover,
.seyvo-shell-body .nfc-btn:hover,
.seyvo-shell-body .nfc-action:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.seyvo-shell-body .btn-primary,
.seyvo-shell-body .sv-btn-primary,
.seyvo-shell-body .spm-btn-primary,
.seyvo-shell-body .studio-btn-primary {
  background: var(--sv-primary) !important;
  border-color: var(--sv-primary) !important;
  color: var(--seyvo-white) !important;
  box-shadow: 0 10px 24px rgba(var(--seyvo-primary-rgb), .20);
}

.seyvo-shell-body .btn-light,
.seyvo-shell-body .btn-secondary,
.seyvo-shell-body .sv-btn-secondary,
.seyvo-shell-body .spm-btn-light,
.seyvo-shell-body .spm-btn-soft,
.seyvo-shell-body .studio-btn-ghost {
  background: var(--seyvo-cream) !important;
  border-color: var(--sv-border) !important;
  color: var(--sv-text) !important;
}

.seyvo-shell-body .btn-danger,
.seyvo-shell-body .spm-btn-danger {
  background: var(--seyvo-danger-soft) !important;
  border-color: rgba(var(--seyvo-danger-rgb), .18) !important;
  color: var(--seyvo-danger) !important;
}

.seyvo-shell-body .form-control,
.seyvo-shell-body .custom-select,
.seyvo-shell-body .spm-input,
.seyvo-shell-body .spm-select,
.seyvo-shell-body .spm-textarea,
.seyvo-shell-body textarea,
.seyvo-shell-body input,
.seyvo-shell-body select {
  border-color: var(--sv-border);
  border-radius: var(--seyvo-radius-sm);
  color: var(--sv-text);
}

.seyvo-shell-body .form-control:focus,
.seyvo-shell-body .custom-select:focus,
.seyvo-shell-body .spm-input:focus,
.seyvo-shell-body .spm-select:focus,
.seyvo-shell-body .spm-textarea:focus {
  border-color: rgba(var(--seyvo-primary-rgb), .45);
  box-shadow: 0 0 0 .2rem rgba(var(--seyvo-primary-rgb), .10);
}

.seyvo-shell-body .table,
.seyvo-shell-body .spm-table {
  color: var(--sv-text);
  background: transparent;
}

.seyvo-shell-body .table thead th,
.seyvo-shell-body .spm-table th {
  border-top: 0;
  border-bottom: 1px solid var(--sv-border);
  background: var(--seyvo-cream);
  color: var(--sv-muted);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.seyvo-shell-body .table td,
.seyvo-shell-body .spm-table td {
  border-top: 1px solid var(--sv-border);
}

.seyvo-shell-body .badge,
.seyvo-shell-body .sv-badge,
.seyvo-shell-body .spm-badge,
.seyvo-shell-body .nfc-chip {
  border-radius: var(--seyvo-radius-pill);
  font-weight: 800;
  letter-spacing: 0;
}

.seyvo-shell-body .spm-badge.active,
.seyvo-shell-body .spm-badge.done,
.seyvo-shell-body .spm-badge.valid,
.seyvo-shell-body .spm-badge.completed,
.seyvo-shell-body .spm-badge.ok,
.seyvo-shell-body .spm-badge.converted,
.seyvo-shell-body .spm-badge.replied,
.seyvo-shell-body .spm-badge.subscribed {
  background: var(--sv-primary-soft);
  color: var(--sv-primary);
}

.seyvo-shell-body .spm-badge.paused,
.seyvo-shell-body .spm-badge.pending,
.seyvo-shell-body .spm-badge.draft,
.seyvo-shell-body .spm-badge.unknown,
.seyvo-shell-body .spm-badge.warning,
.seyvo-shell-body .spm-badge.queued,
.seyvo-shell-body .spm-badge.contacted,
.seyvo-shell-body .spm-badge.opened,
.seyvo-shell-body .spm-badge.clicked {
  background: var(--seyvo-warning-soft);
  color: var(--seyvo-accent-gold-dark);
}

.seyvo-shell-body .spm-badge.archived,
.seyvo-shell-body .spm-badge.disabled,
.seyvo-shell-body .spm-badge.invalid,
.seyvo-shell-body .spm-badge.failed,
.seyvo-shell-body .spm-badge.bounced,
.seyvo-shell-body .spm-badge.unsubscribed,
.seyvo-shell-body .spm-badge.not_interested {
  background: var(--seyvo-danger-soft);
  color: var(--seyvo-danger);
}

.seyvo-shell-body .spm-grid,
.seyvo-shell-body .nfc-grid-2,
.seyvo-shell-body .nfc-grid-3 {
  gap: 1rem;
}

.seyvo-shell-body .spm-kpi strong,
.seyvo-shell-body .nfc-stat strong {
  color: var(--sv-ink);
  font-weight: 850;
}

.seyvo-shell-body .nfc-admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.seyvo-shell-body .nfc-admin-nav a {
  margin: 0;
  background: var(--seyvo-cream);
  border: 1px solid var(--sv-border);
  color: var(--sv-text);
}

.seyvo-shell-body .nfc-admin-nav a.active,
.seyvo-shell-body .nfc-admin-nav a:hover {
  background: var(--sv-primary);
  border-color: var(--sv-primary);
  color: var(--seyvo-white);
}

.seyvo-shell-body pre,
.seyvo-shell-body code,
.seyvo-shell-body .spm-code {
  border-radius: var(--seyvo-radius-sm);
}

@media (max-width: 991.98px) {
  .seyvo-shell-body main > .container,
  .seyvo-shell-body main > .container-fluid,
  .seyvo-shell-body main > .spm-wrap,
  .seyvo-shell-body main > .studio-page,
  .seyvo-shell-body main > .nfc-admin-premium {
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .seyvo-shell-body .spm-hero,
  .seyvo-shell-body .spm-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 575.98px) {
  .seyvo-shell-body main > .container,
  .seyvo-shell-body main > .container-fluid,
  .seyvo-shell-body main > .spm-wrap,
  .seyvo-shell-body main > .studio-page,
  .seyvo-shell-body main > .nfc-admin-premium {
    padding-left: .875rem;
    padding-right: .875rem;
  }

  .seyvo-shell-body .card-body,
  .seyvo-shell-body .spm-panel-body {
    padding: 1rem;
  }

  .seyvo-shell-body .spm-hero {
    padding: 1.1rem;
    border-radius: var(--seyvo-radius-md);
  }

  .seyvo-shell-body .spm-actions,
  .seyvo-shell-body .spm-row-actions,
  .seyvo-shell-body .studio-actions,
  .seyvo-shell-body .nfc-actions {
    width: 100%;
  }

  .seyvo-shell-body .spm-actions > *,
  .seyvo-shell-body .spm-row-actions > *,
  .seyvo-shell-body .studio-actions > *,
  .seyvo-shell-body .nfc-actions > * {
    flex: 1 1 auto;
  }
}
