/* =============================================
   COMPLIANCE APP — EIFFEL INVESTMENT GROUP
   Style principal — Charte graphique officielle
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');

/* --- VARIABLES DE COULEUR (Charte Eiffel IG) --- */
:root {
  --navy: #00143B;       /* Bleu principal officiel Pantone 282C */
  --navy-mid: #001d56;
  --navy-light: #002470;
  --gold: #D18F41;       /* Ocre officiel */
  --gold-light: #e8aa60;
  --teal: #006660;       /* Turquoise officiel */
  --white: #ffffff;
  --off-white: #f5f5f3;
  --text-primary: #00143B;
  --text-secondary: #4a5568;
  --text-muted: #8a9ab0;
  --border: #e2e8f0;
  --success: #006660;
  --success-bg: #e8f4f4;
  --error: #c0392b;
  --error-bg: #fdf0ee;
  --shadow-sm: 0 1px 3px rgba(0,20,59,0.06), 0 1px 2px rgba(0,20,59,0.04);
  --shadow-md: 0 4px 16px rgba(0,20,59,0.10), 0 2px 6px rgba(0,20,59,0.05);
  --shadow-lg: 0 12px 40px rgba(0,20,59,0.15);
  --radius: 8px;
  --radius-sm: 5px;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--off-white);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- UTILITAIRES --- */
.hidden { display: none !important; }

/* --- SCREENS --- */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; min-height: 100vh; }

#screen-login {
  background: var(--navy);
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

#screen-login.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Rayonnement Eiffel IG — lignes diagonales caractéristiques */
#screen-login::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    linear-gradient(128deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.07) 12%, transparent 12%),
    linear-gradient(128deg, transparent 16%, rgba(255,255,255,0.05) 16%, rgba(255,255,255,0.05) 26%, transparent 26%),
    linear-gradient(128deg, transparent 30%, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.04) 38%, transparent 38%),
    linear-gradient(128deg, transparent 42%, rgba(255,255,255,0.03) 42%, rgba(255,255,255,0.03) 48%, transparent 48%);
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 52px 48px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: fadeUp 0.6s ease both;
  margin: auto;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.login-divider {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 28px;
}

.login-title {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.login-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin-bottom: 36px;
}

.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: var(--white);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

.btn-microsoft:hover {
  background: var(--off-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-microsoft:active { transform: translateY(0); }

.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
}

/* =============================================
   NAVBAR
   ============================================= */

.navbar {
  background: var(--navy);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 64px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  margin-right: 40px;
  flex-shrink: 0;
}

.nav-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.3px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: rgba(255,255,255,0.5);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }

.nav-tab.active {
  background: rgba(209,143,65,0.15);
  color: var(--gold-light);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.user-avatar {
  width: 34px; height: 34px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  line-height: 1;
}

.user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.btn-lang {
  padding: 5px 12px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-lang:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); }
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.07);
  border: none;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 4px;
}

.btn-logout:hover { background: rgba(255,255,255,0.12); color: var(--white); }

/* =============================================
   CONTENU PRINCIPAL
   ============================================= */

.main-content {
  flex: 1;
  padding: 32px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- EN-TÊTE DE SECTION --- */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.section-title {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.3px;
}

.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- BOUTON PRIMAIRE --- */
.btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.bulk-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13.5px;
}

.bulk-result-item.restricted {
  background: #fde8e8;
  border: 1px solid #f5c6c6;
}

.bulk-result-item.clean {
  background: var(--success-bg);
  border: 1px solid #b2d8d8;
}

.bulk-result-icon { font-size: 16px; flex-shrink: 0; }

/* --- ÉTATS DE CHARGEMENT / VIDE / ERREUR --- */
.loading-state, .empty-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  gap: 16px;
  color: var(--text-muted);
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.error-state { color: var(--error); }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- BARRE DE RECHERCHE --- */
.search-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.search-bar-container:focus-within {
  border-color: var(--navy);
}

.search-bar-container svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
  width: 100%;
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* --- TABLEAU --- */
.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.table-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: rgba(209,143,65,0.12);
  padding: 4px 12px;
  border-radius: 20px;
}

.table-date {
  font-size: 12px;
  color: var(--text-muted);
}

.table-wrapper {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead tr {
  background: var(--navy);
}

.data-table thead th {
  padding: 13px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #f8f9fb; }

.data-table tbody td {
  padding: 13px 16px;
  font-size: 14px;
  color: var(--text-primary);
}

/* Badges de statut */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table thead th.sortable:hover {
  background: #1a2e5a;
}

.data-table thead th.sortable span {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 4px;
}

.data-table thead th.sort-asc span,
.data-table thead th.sort-desc span {
  opacity: 1;
  color: var(--gold-light);
}
.badge-nda { background: #fef3c7; color: #92400e; }
.badge-active { background: var(--success-bg); color: var(--success); }

/* Bouton PDF dans tableau */
.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pdf:hover { border-color: var(--navy); color: var(--navy); background: #f0f4f8; }

/* =============================================
   FORMULAIRE DE DÉCLARATION
   ============================================= */

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus { border-color: var(--navy); }
.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.form-message {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}

.form-message.success { background: var(--success-bg); color: var(--success); }
.form-message.error { background: var(--error-bg); color: var(--error); }

/* =============================================
   ONGLET DÉCLARER — 3 CARTES
   ============================================= */

.declare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.declare-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.declare-card-form {
  grid-column: 1 / -1;
}

.declare-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.declare-card-badge { align-self: flex-start; }

.declare-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.declare-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.declare-card-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- TOOLTIP RÈGLES --- */
.tooltip-container { position: relative; }

.tooltip-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(0,20,59,0.06);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tooltip-btn:hover { background: rgba(0,20,59,0.1); border-color: var(--navy); }

.tooltip-box {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tooltip-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.tooltip-box p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tooltip-box p strong { color: var(--text-primary); }

.declare-card-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.declare-card-clickable,
.declare-card-clickable * {
  cursor: pointer;
}

.declare-card-clickable:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.declare-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(209,143,65,0.08);
  border: 1px solid rgba(209,143,65,0.25);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.declare-alert svg { flex-shrink: 0; margin-top: 1px; color: var(--gold); }

@media (max-width: 900px) {
  .declare-grid { grid-template-columns: 1fr; }
  .declare-card-form { grid-column: 1; }
}

/* =============================================
   ONGLET SAISIE COMPLIANCE
   ============================================= */

.forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.form-card-icon {
  width: 48px; height: 48px;
  background: rgba(0, 20, 59, 0.08);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  margin-bottom: 16px;
}

.form-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.form-card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.form-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.form-card-info {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-form-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-form-open:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.forms-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(209, 143, 65, 0.08);
  border: 1px solid rgba(209, 143, 65, 0.25);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.forms-note svg { color: var(--gold); flex-shrink: 0; margin-top: 1px; }

@media (max-width: 768px) {
  .forms-grid { grid-template-columns: 1fr; }
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .nav-title { display: none; }
  .nav-tab span { display: none; }
  .main-content { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; }
  .user-info { display: none; }
}
