/* ===============================================================
   LAYOUT — cards, formulaires, boutons, dropdown
   =============================================================== */

/* ===============================================================
   CARDS
   =============================================================== */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.card-header h2 { margin: 0; }

/* ===============================================================
   FORMULAIRES
   =============================================================== */
.input-row {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1rem;
}

@media (max-width: 600px) {
  .input-row { grid-template-columns: 1fr; }
}

.field { position: relative; }

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input,
input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.15s ease;
}

.field input:hover { border-color: var(--border-strong); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ===============================================================
   AUTOCOMPLETE DROPDOWN
   =============================================================== */
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  z-index: 50;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.dropdown.open { display: block; }

.dropdown-item {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}

.dropdown-item:last-child { border-bottom: none; }

.dropdown-item:hover, .dropdown-item.highlight {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ===============================================================
   BUTTONS
   =============================================================== */
.btn-primary {
  margin-top: 1.25rem;
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

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

/* ===============================================================
   VIEW TOGGLE (arbre / liste)
   =============================================================== */
.view-toggle {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
  gap: 1px;
}

.view-toggle button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: 5px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.view-toggle button:hover { color: var(--text); }

.view-toggle button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ===============================================================
   EMPTY STATE
   =============================================================== */
.empty-state {
  padding: 1.25rem 0 1.5rem;
}

/* ===============================================================
   TUTORIAL — highlights & flèche inter-onglet
   =============================================================== */
@keyframes tutorial-pulse {
  0%   { outline-color: transparent; box-shadow: 0 0 0 0 rgba(250,149,73,0); }
  15%  { outline-color: var(--accent); box-shadow: 0 0 0 6px rgba(250,149,73,.25); }
  70%  { outline-color: var(--accent); box-shadow: 0 0 0 6px rgba(250,149,73,.25); }
  100% { outline-color: transparent; box-shadow: 0 0 0 0 rgba(250,149,73,0); }
}
.tutorial-hl {
  outline: 2px solid var(--accent) !important;
  outline-offset: 4px;
  border-radius: 8px;
  animation: tutorial-pulse 2.8s ease forwards;
  position: relative;
  z-index: 10;
}

@keyframes tutorial-arrow-bounce {
  from { transform: translateX(-50%) translateY(0); }
  to   { transform: translateX(-50%) translateY(-6px); }
}
.tutorial-tab-arrow {
  position: fixed;
  z-index: 9999;
  background: var(--accent);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  animation: tutorial-arrow-bounce 0.5s ease-in-out infinite alternate;
  box-shadow: 0 4px 14px rgba(250,149,73,.4);
}
.tutorial-tab-arrow::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--accent);
  border-top: none;
}

/* Liens cliquables dans le guide */
.guide-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

/* Grille du guide d'accueil */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  text-align: left;
}
.guide-section {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
}
.guide-section-icon {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.guide-section h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}
.guide-section p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 0.4rem;
}
.guide-section p:last-child { margin-bottom: 0; }
.guide-section strong { color: var(--accent); font-weight: 600; }

.placeholder {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.placeholder h1 { color: var(--text); margin-bottom: 0.5rem; }
