/* ==========================================================================
   ND Photos CRM — Style principal (Dark Elegant)
   Mobile-first, optimisé Desktop avec Sidebar
   ========================================================================== */

/* ---------- Reset CSS ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Variables CSS ---------- */
:root {
  /* Fonds */
  --bg-primary: #121212;
  --bg-secondary: #181818;
  --bg-card: #252525;
  --bg-card-hover: #2e2e2e;
  --bg-input: #1e1e1e;

  /* Textes */
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0b0;
  --text-muted: #7a7a7a;

  /* Bordures */
  --border-color: #333333;
  --border-color-light: #3d3d3d;

  /* Accents métier */
  --accent-boudoir: #d4af37;
  --accent-boudoir-dark: #c5a059;
  --accent-mariage: #d8a4a6;
  --accent-mariage-dark: #c48b9f;

  /* États */
  --color-success: #8bc34a;
  --color-danger: #e57373;
  --color-info: #64b5f6;
  --color-warning: #ffb74d;

  /* Dimensions */
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 72px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Transitions */
  --transition-fast: 0.18s ease;
  --transition-medium: 0.3s ease;

  /* Ombres */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 8px 30px rgba(0, 0, 0, 0.55);
}

/* ---------- Base ---------- */
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.4rem;
}
h3 {
  font-size: 1.15rem;
}

p {
  color: var(--text-secondary);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color-light);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Layout : App Shell (Sidebar + Contenu)
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform var(--transition-medium);
}

.sidebar.is-open {
  transform: translateX(0);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar__brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--accent-boudoir),
    var(--accent-mariage)
  );
  flex-shrink: 0;
}

.sidebar__brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar__brand-name span {
  color: var(--accent-boudoir);
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.sidebar__nav-item {
  margin-bottom: 0.25rem;
}

.sidebar__nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
  white-space: nowrap;
}

.sidebar__nav-link:hover {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.sidebar__nav-link.is-active {
  background-color: rgba(212, 175, 55, 0.12);
  color: var(--accent-boudoir);
  border-left: 3px solid var(--accent-boudoir);
  padding-left: calc(1rem - 3px);
}

.sidebar__nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.sidebar__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Overlay Mobile ---------- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-medium);
}

.sidebar-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Topbar Mobile ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 1rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.topbar__title {
  font-size: 1.05rem;
  font-weight: 600;
}

.burger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
}

.burger-btn:hover {
  background-color: var(--bg-card);
}

.burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition:
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

/* ---------- Contenu principal ---------- */
.main-content {
  flex: 1;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

.content-wrapper {
  padding: 1.25rem;
}

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

.page-header__title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.page-header__subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==========================================================================
   Composants : Cartes
   ========================================================================== */

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.card:hover {
  background-color: var(--bg-card-hover);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--boudoir {
  background-color: rgba(212, 175, 55, 0.15);
  color: var(--accent-boudoir);
}

.badge--mariage {
  background-color: rgba(216, 164, 166, 0.15);
  color: var(--accent-mariage);
}

.badge--option {
  background-color: rgba(100, 181, 246, 0.15);
  color: var(--color-info);
}

.badge--service {
  background-color: rgba(139, 195, 74, 0.15);
  color: var(--color-success);
}

.badge--bien {
  background-color: rgba(255, 183, 77, 0.15);
  color: var(--color-warning);
}

/* ==========================================================================
   Composants : Boutons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast),
    opacity var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background-color: var(--accent-boudoir);
  color: #121212;
}

.btn--primary:hover {
  background-color: var(--accent-boudoir-dark);
}

.btn--mariage {
  background-color: var(--accent-mariage);
  color: #121212;
}

.btn--mariage:hover {
  background-color: var(--accent-mariage-dark);
}

.btn--outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color-light);
}

.btn--outline:hover {
  background-color: var(--bg-card);
}

.btn--danger {
  background-color: var(--color-danger);
  color: #121212;
}

.btn--sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* ==========================================================================
   Composants : Formulaires
   ========================================================================== */

.form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-boudoir);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* ==========================================================================
   Responsive : Desktop (Sidebar fixe)
   ========================================================================== */

@media (min-width: 992px) {
  .sidebar {
    transform: translateX(0);
    position: fixed;
  }

  .sidebar-overlay {
    display: none;
  }

  .main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }

  .topbar {
    display: none;
  }

  .content-wrapper {
    padding: 2rem 2.5rem;
  }

  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
