/* Application CSS pour la Charte Visuelle iDAKTO */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--idk-font);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.6;
  color: var(--idk-grey-text);
  background: var(--idk-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--idk-font);
  font-weight: 700;
  color: var(--idk-navy);
  margin: 0 0 12px;
  line-height: 1.2;
}

h1 { font-size: 36px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
h4 { font-size: 17px; }

p {
  margin: 0 0 16px;
}

a {
  color: var(--idk-navy);
  text-decoration: underline;
}

a:hover {
  color: var(--idk-navy-hover);
}

/* Accessibilité & Focus visible */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 5, 123, 0.35);
  border-radius: var(--idk-radius-sm);
}

/* Conteneurs et grilles */
.idk-container, .container {
  width: 100%;
  max-width: var(--idk-container);
  margin: 0 auto;
  padding: 0 24px;
}

.idk-grid-row, .grid-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -12px;
}

.grid-row--middle {
  align-items: center;
}

.grid-row--gutters {
  margin: 0 -12px;
}

.idk-col-12, .col-12 { width: 100%; padding: 0 12px; box-sizing: border-box; }
.idk-col-9, .col-9, .col-md-9 { width: 75%; padding: 0 12px; box-sizing: border-box; }
.idk-col-8, .col-8, .col-md-8 { width: 66.666%; padding: 0 12px; box-sizing: border-box; }
.idk-col-7, .col-7, .col-md-7 { width: 58.333%; padding: 0 12px; box-sizing: border-box; }
.idk-col-6, .col-6, .col-md-6, .col-sm-6 { width: 50%; padding: 0 12px; box-sizing: border-box; }
.idk-col-5, .col-5, .col-md-5 { width: 41.666%; padding: 0 12px; box-sizing: border-box; }
.idk-col-4, .col-4, .col-md-4, .col-sm-4 { width: 33.333%; padding: 0 12px; box-sizing: border-box; }
.idk-col-3, .col-3, .col-md-3 { width: 25%; padding: 0 12px; box-sizing: border-box; }

/* Neutral utility classes */
.py-4 { padding-top: 24px; padding-bottom: 24px; }
.py-6 { padding-top: 40px; padding-bottom: 40px; }
.p-2 { padding: 12px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; }
.mb-6 { margin-bottom: 40px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mr-1 { margin-right: 6px; }
.mr-2 { margin-right: 12px; }
.text-sm { font-size: 13.5px; line-height: 1.5; color: var(--idk-grey-text); }
.text-xs { font-size: 12px; line-height: 1.4; color: var(--idk-text-muted); font-weight: 500; }
.text-bold { font-weight: 700; }
.text-muted { color: var(--idk-text-muted) !important; font-weight: 500; }
.text-right { text-align: right; }
.lead { font-size: 18px; font-weight: 500; color: var(--idk-navy); line-height: 1.5; margin-bottom: 24px; }

/* Neutral tile / card / table / form aliases */
.card, .idk-card {
  background: #fff;
  border-radius: var(--idk-radius-card);
  border: 1.5px solid var(--idk-border);
  box-shadow: var(--idk-shadow-card);
}
.tile {
  background: #ffffff;
  border-radius: var(--idk-radius-card);
  border: 1.5px solid var(--idk-border);
  padding: 20px 24px;
  box-shadow: 0 2px 4px rgba(0, 5, 123, 0.04);
}
.tile__title { font-size: 32px; font-weight: 700; margin: 0 0 6px; line-height: 1.1; }
.tile__desc { font-size: 14px; font-weight: 600; color: #1E293B; margin: 0; line-height: 1.35; }
.table-container {
  overflow-x: auto;
  border-radius: var(--idk-radius-card);
  border: 1.5px solid var(--idk-border);
  background: #fff;
  margin-bottom: 24px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  background: #f1f5f9;
  color: var(--idk-navy);
  font-weight: 700;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--idk-border);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--idk-border);
  vertical-align: middle;
  color: var(--idk-grey-text);
}
.breadcrumb { font-size: 12px; margin-bottom: 16px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; padding: 0; margin: 0; gap: 8px; }
.breadcrumb a { color: var(--idk-text-muted); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; color: var(--idk-navy); }
.input-group, .select-group, .upload-group { margin-bottom: 16px; }
.label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13.5px; color: var(--idk-navy); }
.input, .select, .textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--idk-border);
  border-radius: var(--idk-radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--idk-grey-text);
  background: #fff;
  box-sizing: border-box;
}

/* Password and action buttons */
.btn-copy {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--idk-radius-pill);
  background: var(--idk-tint);
  color: var(--idk-navy);
  border: 1.5px solid var(--idk-navy);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.btn-copy:hover {
  background: var(--idk-navy);
  color: #fff;
}
.btn-copy.btn-copied {
  background: #16774D !important;
  color: #fff !important;
  border-color: #16774D !important;
}
.btn-toggle-decoded {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--idk-radius-pill);
  border: 1.5px solid var(--idk-navy);
  background: #fff;
  color: var(--idk-navy);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}
.btn-toggle-decoded:hover {
  background: var(--idk-tint);
}

/* En-tête public */
.idk-header {
  background: #fff;
  box-shadow: var(--idk-shadow-header);
  position: sticky;
  top: 0;
  z-index: 100;
}

.idk-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.idk-header__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.idk-header__logo {
  height: 40px;
  width: auto;
  display: block;
}

.idk-header__service {
  font-weight: 700;
  font-size: 16px;
  color: var(--idk-navy);
  text-decoration: none;
  border-left: 2px solid var(--idk-border);
  padding-left: 14px;
}

.idk-header__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.idk-header__link {
  color: var(--idk-navy);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--idk-radius-sm);
}

.idk-header__link:hover {
  background: var(--idk-tint);
  text-decoration: none;
}

/* Bandeau démonstrateur */
.idk-notice {
  background: #FFF5EC;
  border-bottom: 1px solid rgba(242, 131, 39, 0.3);
  padding: 8px 24px;
  font-size: 13px;
  color: #8C4406;
  display: flex;
  align-items: center;
  gap: 10px;
}

.idk-notice__tag {
  background: var(--idk-orange);
  color: #00057B;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* Hero avec courbe */
.idk-hero {
  background: var(--idk-navy);
  color: #fff;
  padding: 48px 0 16px;
}

.idk-hero h1 {
  color: #fff;
  font-size: 40px;
  margin-bottom: 12px;
}

.idk-hero p.lead {
  color: #fff;
  font-size: 18px;
  line-height: 1.5;
  max-width: 800px;
  margin-bottom: 24px;
}

.idk-curve {
  display: block;
  width: 100%;
  height: 40px;
  margin-bottom: 24px;
}

/* Layout Back-Office (Espaces Déclarant & Opérateur) */
.idk-app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.idk-sidebar {
  background: var(--idk-gradient);
  padding: 24px 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.idk-sidebar__logo {
  height: 34px;
  width: auto;
  margin: 0 12px 28px;
  display: block;
}

.idk-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.idk-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--idk-radius-sm);
  transition: background 0.15s;
}

.idk-sidebar__link:hover {
  background: rgba(255, 255, 255, 0.10);
  text-decoration: none;
}

.idk-sidebar__link.active {
  background: rgba(255, 255, 255, 0.16);
}

.idk-sidebar__link.active::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--idk-orange);
  flex-shrink: 0;
}

.idk-sidebar__footer {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.idk-main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.idk-topbar {
  background: #fff;
  box-shadow: var(--idk-shadow-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
}

.idk-topbar__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--idk-navy);
  margin: 0;
}

.idk-topbar__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.idk-content {
  padding: 32px;
  flex-grow: 1;
}

/* Boutons */
.idk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--idk-radius-pill);
  font-family: var(--idk-font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  line-height: 1.2;
}

.idk-btn:hover {
  text-decoration: none;
}

.idk-btn--primary {
  background: var(--idk-orange);
  color: #00057B;
  font-weight: 600;
  padding: 13px 32px 13px 26px;
}

.idk-btn--primary::after {
  content: "›";
  font-size: 19px;
  line-height: 0;
  margin-left: 2px;
}

.idk-btn--primary:hover {
  background: var(--idk-orange-hover);
  color: #00057B;
}

.idk-btn--secondary {
  background: var(--idk-navy);
  color: #fff;
  padding: 13px 28px;
}

.idk-btn--secondary:hover {
  background: var(--idk-navy-hover);
  color: #fff;
}

.idk-btn--tertiary {
  background: transparent;
  border: 2px solid var(--idk-navy);
  color: var(--idk-navy);
  padding: 11px 26px;
}

.idk-btn--tertiary:hover {
  background: var(--idk-tint);
}

.idk-btn--sm {
  padding: 8px 18px;
  font-size: 13px;
}

.idk-btn--sm::after {
  content: none;
}

/* Cartes */
.idk-card {
  background: var(--idk-surface);
  border-radius: var(--idk-radius-card);
  box-shadow: var(--idk-shadow-card);
  border: 1px solid var(--idk-border);
  padding: 24px;
  margin-bottom: 24px;
}

.idk-card--compact {
  padding: 16px;
}

/* Badges */
.idk-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--idk-radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.idk-badge--success {
  background: rgba(13, 92, 54, 0.12);
  color: #0d5c36;
}

.idk-badge--warning {
  background: rgba(154, 52, 18, 0.12);
  color: #9a3412;
}

.idk-badge--danger {
  background: rgba(197, 40, 40, 0.12);
  color: var(--idk-danger);
}

.idk-badge--info {
  background: rgba(0, 5, 123, 0.10);
  color: var(--idk-navy);
}

/* Formulaires */
.idk-form-group {
  margin-bottom: 20px;
}

.idk-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--idk-navy);
  margin-bottom: 6px;
}

.idk-hint {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.idk-input, .idk-select, .idk-textarea {
  width: 100%;
  height: 44px;
  border: 1px solid var(--idk-border);
  border-radius: var(--idk-radius-sm);
  padding: 0 14px;
  font-family: var(--idk-font);
  font-weight: 500;
  font-size: 14px;
  color: var(--idk-navy);
  background: #fff;
}

.idk-textarea {
  height: auto;
  min-height: 90px;
  padding: 10px 14px;
}

.idk-input:focus, .idk-select:focus, .idk-textarea:focus {
  outline: none;
  border-color: var(--idk-navy);
  box-shadow: 0 0 0 3px rgba(0, 5, 123, 0.15);
}

.idk-form-group--error .idk-input,
.idk-form-group--error .idk-select,
.idk-form-group--error .idk-textarea {
  border-color: var(--idk-danger);
}

.idk-error-message {
  font-size: 12px;
  font-weight: 600;
  color: var(--idk-danger);
  margin-top: 6px;
}

/* Tableaux */
.idk-table-container {
  width: 100%;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--idk-border);
  border-radius: var(--idk-radius-card);
  margin-bottom: 24px;
}

.idk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.idk-table caption {
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--idk-navy);
  caption-side: top;
}

.idk-table th {
  background: var(--idk-tint);
  color: var(--idk-navy);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--idk-border);
}

.idk-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--idk-border);
  color: #333;
}

.idk-table tbody tr:hover {
  background: var(--idk-tint);
}

/* Alertes */
.idk-alert {
  padding: 16px 20px;
  border-radius: var(--idk-radius-sm);
  margin-bottom: 20px;
  border-left: 4px solid var(--idk-navy);
  background: #fff;
  box-shadow: var(--idk-shadow-card);
}

.idk-alert--info {
  border-left-color: var(--idk-navy);
  background: #F4F6FF;
}

.idk-alert--success {
  border-left-color: var(--idk-success);
  background: #F2FBF6;
}

.idk-alert--warning {
  border-left-color: var(--idk-warning);
  background: #FFF9F3;
}

.idk-alert--danger {
  border-left-color: var(--idk-danger);
  background: #FDF3F3;
}

.idk-alert__title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--idk-navy);
}

/* Indicateur d'étapes (Stepper / Wizard) */
.idk-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 20px;
  background: #fff;
  border-radius: var(--idk-radius-card);
  box-shadow: var(--idk-shadow-card);
}

.idk-stepper__item {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.idk-stepper__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--idk-border);
  color: var(--idk-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.idk-stepper__item.active .idk-stepper__num {
  background: var(--idk-orange);
  color: #00057B;
}

.idk-stepper__item.completed .idk-stepper__num {
  background: var(--idk-success);
  color: #fff;
}

.idk-stepper__label {
  font-weight: 600;
  font-size: 14px;
  color: var(--idk-navy);
}

/* Modale */
.idk-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 5, 123, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.idk-modal {
  background: #fff;
  border-radius: var(--idk-radius-card);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 600px;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
}

.idk-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* Onglets */
.idk-tabs {
  margin-bottom: 24px;
}

.idk-tabs__list {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--idk-border);
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
}

.idk-tabs__btn {
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  color: var(--idk-navy);
  border: 0;
  background: transparent;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.idk-tabs__btn.active {
  border-bottom-color: var(--idk-orange);
  color: var(--idk-navy);
}

/* Chiffres clés */
.idk-kpi {
  font-size: 38px;
  font-weight: 700;
  color: var(--idk-navy);
  line-height: 1;
  margin-bottom: 4px;
}

.idk-kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--idk-grey-text);
}

/* Pied de page */
.idk-footer {
  background: var(--idk-navy);
  color: #fff;
  padding: 48px 0 24px;
  margin-top: 48px;
}

.idk-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 13px;
}

.idk-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.idk-footer__logo {
  height: 36px;
  width: auto;
  margin-bottom: 20px;
}

.idk-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  list-style: none;
  padding: 0;
  margin: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 20px;
}

.idk-footer__copy {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

/* Responsive */
@media (max-width: 768px) {
  .idk-app {
    grid-template-columns: 1fr;
  }
  .idk-sidebar {
    display: none;
  }
  .idk-col-8, .idk-col-6, .idk-col-4, .idk-col-3 {
    width: 100%;
  }
  .idk-btn {
    width: 100%;
  }
  .idk-header__nav {
    flex-wrap: wrap;
  }
  h1 { font-size: 28px; }
}
