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

:root {
  /* HSL Palette */
  --h-primary: 210;
  --s-primary: 100%;
  --l-primary: 50%;

  --c-primary: hsl(var(--h-primary), var(--s-primary), var(--l-primary));
  /* #0055ff approx */
  --c-primary-light: hsl(var(--h-primary), 100%, 65%);
  --c-primary-dark: hsl(var(--h-primary), 100%, 40%);

  --c-accent: hsl(150, 100%, 35%);
  /* Green */
  --c-danger: hsl(350, 80%, 55%);
  /* Red */
  --c-warn: hsl(35, 90%, 55%);
  /* Orange */

  --c-bg: #f8fafc;
  --c-card: #ffffff;
  --c-text: #0f172a;
  --c-text-light: #64748b;
  --c-border: #e2e8f0;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── MODE SOMBRE (Modernized) ── */
body.dark-mode {
  --c-bg: #0f172a;
  --c-card: #1e293b;
  --c-text: #f1f5f9;
  --c-text-light: #94a3b8;
  --c-border: #334155;

  --c-primary: hsl(210, 100%, 60%);
  --c-primary-light: hsl(210, 100%, 70%);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

body.dark-mode .card,
body.dark-mode .modal,
body.dark-mode .navbar,
body.dark-mode .nav-sidebar {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea {
  background: rgba(15, 23, 42, 0.5);
  color: var(--c-text);
  border-color: var(--c-border);
}

body.dark-mode .edl-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.dark-mode-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
}

.dark-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* ── Global Search ── */
.global-search {
  position: relative;
  margin-right: 20px;
  z-index: 1000;
}

.global-search__input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search__icon {
  position: absolute;
  left: 12px;
  font-size: 16px;
  pointer-events: none;
  opacity: 0.7;
}

.global-search__input {
  width: 300px;
  padding: 8px 32px 8px 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  transition: all 0.3s;
}

.global-search__input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.global-search__input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  width: 400px;
}

.global-search__clear {
  position: absolute;
  right: 10px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.global-search__clear:hover {
  background: rgba(255, 255, 255, 0.3);
}

.global-search__results {
  position: absolute;
  top: 45px;
  left: 0;
  right: 0;
  max-height: 500px;
  overflow-y: auto;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: none;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.global-search__header {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--c-border);
}

.global-search__section {
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
}

.global-search__section:first-child {
  border-top: none;
}

.global-search__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--c-text);
  transition: background 0.2s;
  border-bottom: 1px solid var(--c-border);
}

.global-search__item:last-child {
  border-bottom: none;
}

.global-search__item:hover {
  background: var(--c-bg);
}

.global-search__item-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.global-search__item-content {
  flex: 1;
  min-width: 0;
}

.global-search__item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.global-search__item-subtitle {
  font-size: 12px;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search__item-badge {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.global-search__item-badge--draft {
  background: #fef3c7;
  color: #92400e;
}

.global-search__item-badge--completed {
  background: #d1fae5;
  color: #065f46;
}

.global-search__item-badge--archived {
  background: #e5e7eb;
  color: #374151;
}

.global-search__loading,
.global-search__empty,
.global-search__error {
  padding: 40px 20px;
  text-align: center;
  color: var(--c-muted);
}

.global-search__empty {
  color: var(--c-text);
}

.global-search__error {
  color: var(--c-danger);
}

@media (max-width: 768px) {
  .global-search__input {
    width: 200px;
  }

  .global-search__input:focus {
    width: 250px;
  }
}

/* ── Document Navigation (Prev/Next) ── */
.doc-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 20px;
}

.doc-navigation__counter {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  padding: 0 8px;
  white-space: nowrap;
}

.doc-navigation__btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.doc-navigation__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.doc-navigation__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .doc-navigation {
    margin-right: 10px;
    gap: 4px;
  }

  .doc-navigation__counter {
    display: none;
  }

  .doc-navigation__btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ── Room Status Indicators ── */
.room-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: auto;
  white-space: nowrap;
  transition: all 0.2s;
}

.room-status-badge--complete {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.room-status-badge--partial {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde047;
}

.room-status-badge--started {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.room-status-badge--empty {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

/* Dark mode support */
body.dark-mode .room-status-badge--complete {
  background: #064e3b;
  color: #6ee7b7;
}

body.dark-mode .room-status-badge--partial {
  background: #78350f;
  color: #fde047;
}

body.dark-mode .room-status-badge--started {
  background: #1e3a8a;
  color: #93c5fd;
}

body.dark-mode .room-status-badge--empty {
  background: #374151;
  color: #9ca3af;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ── */
.navbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar__brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar__brand:hover {
  opacity: 0.8;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.navbar__user {
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar__user::before {
  content: '👤';
  font-size: 14px;
}

.navbar__btn {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.navbar__btn:hover {
  background: var(--c-bg);
  border-color: var(--c-text-light);
  transform: translateY(-1px);
}

.navbar__btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .navbar {
    padding: 12px 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 12px;
  }

  .navbar__brand {
    font-size: 16px;
  }

  .navbar__actions {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .navbar__user {
    display: none;
    /* Hide user on mobile to save space, or move to menu */
  }

  .navbar__btn {
    padding: 6px 12px;
    font-size: 12px;
    flex: 1;
    text-align: center;
  }
}

/* ── Container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}

.container--narrow {
  max-width: 500px;
}

@media (max-width: 768px) {
  .container {
    padding: 16px 12px;
  }
}

/* ── Cards ── */
.card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--c-border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
  letter-spacing: -0.01em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

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

.btn--primary {
  background: var(--c-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 6px -1px rgba(var(--h-primary), 100%, 50%, 0.3);
}

.btn--primary:hover {
  background: var(--c-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(var(--h-primary), 100%, 50%, 0.4);
}

.btn--accent {
  background: var(--c-accent);
  color: #fff;
}

.btn--accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(39, 174, 96, 0.4);
}

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

.btn--danger:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(231, 76, 60, 0.4);
}

.btn--outline {
  background: transparent;
  border-color: var(--c-border);
  color: var(--c-text);
  box-shadow: none;
}

.btn--outline:hover {
  background: var(--c-bg);
  border-color: var(--c-text-light);
  color: var(--c-text);
}

.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn--icon {
  padding: 8px;
  line-height: 1;
}

/* ── Form elements ── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--c-text-light);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(var(--h-primary), 100%, 50%, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--c-text-light);
  opacity: 0.7;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.form-select {
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #adb5bd;
  font-style: italic;
}

.form-textarea {
  min-height: 50px;
  resize: vertical;
  line-height: 1.4;
}

.form-select {
  cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
}

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

.form-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {

  .form-row,
  .form-row--3 {
    grid-template-columns: 1fr;
  }
}

/* ── Login page ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a5276 0%, #2c3e50 100%);
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  text-align: center;
  color: var(--c-primary);
  margin-bottom: 6px;
  font-size: 22px;
}

.login-card .subtitle {
  text-align: center;
  color: var(--c-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.login-error {
  background: #fde8e8;
  color: var(--c-danger);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

/* ── Dashboard ── */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.dash-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-box {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: 12px 20px;
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 100px;
}

.stat-box__num {
  font-size: 24px;
  font-weight: 700;
  color: var(--c-primary);
}

.stat-box__label {
  font-size: 11px;
  color: var(--c-muted);
  text-transform: uppercase;
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-bar .form-input {
  flex: 1;
  min-width: 200px;
}

/* ── EDL List ── */
.edl-list {
  display: grid;
  gap: 12px;
}

.edl-item {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.edl-item:hover {
  box-shadow: var(--shadow-lg);
}

.edl-item__title {
  font-weight: 700;
  font-size: 14px;
}

.edl-item__meta {
  font-size: 12px;
  color: var(--c-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.edl-item__actions {
  display: flex;
  gap: 6px;
}

/* Pin/Favorites */
.edl-item--pinned {
  border: 2px solid var(--c-accent);
  background: linear-gradient(135deg, var(--c-card) 0%, rgba(39, 174, 96, 0.05) 100%);
}

body.dark-mode .edl-item--pinned {
  background: linear-gradient(135deg, var(--c-card) 0%, rgba(46, 204, 113, 0.1) 100%);
}

.pin-indicator {
  font-size: 16px;
  animation: pin-pulse 2s infinite;
  display: inline-block;
}

@keyframes pin-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Completion badges */
.completion-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 10px;
  vertical-align: middle;
  border: 1px solid;
  white-space: nowrap;
}

.completion-badge--complete {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.completion-badge--partial {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde047;
}

.completion-badge--started {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.completion-badge--empty {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

/* Dark mode completion badges */
body.dark-mode .completion-badge--complete {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.3);
}

body.dark-mode .completion-badge--partial {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

body.dark-mode .completion-badge--started {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

body.dark-mode .completion-badge--empty {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.3);
}

/* Status badges */
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status--draft {
  background: #fef3cd;
  color: #856404;
}

.status--completed {
  background: #d4edda;
  color: #155724;
}

.status--archived {
  background: #e2e3e5;
  color: #383d41;
}

/* ── Zone editor ── */
.zone-card {
  background: var(--c-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

/* Drag & Drop styles */
.zone-card[draggable="true"] {
  cursor: move;
}

.zone-card.dragging {
  opacity: 0.4;
  transform: scale(0.98);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.zone-card.drop-above {
  border-top: 3px solid #27ae60;
  margin-top: 8px;
}

.zone-card.drop-below {
  border-bottom: 3px solid #27ae60;
  margin-bottom: 8px;
}

.drag-handle {
  font-size: 16px;
  color: #6c757d;
  cursor: move;
  padding: 0 8px;
  user-select: none;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.drag-handle:hover {
  opacity: 1;
}

.zone-card__head {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #1a5276;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 2px solid #dee2e6;
  transition: background 0.2s;
}

.zone-card__head:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.zone-card__head h3 {
  font-size: 14px;
  flex: 1;
  margin: 0;
  font-weight: 700;
  color: #1a5276;
}

.zone-card__body {
  padding: 16px 20px;
}

.zone-card__body.collapsed {
  display: none;
}

.zone-card__actions {
  display: flex;
  gap: 6px;
}

.zone-card__actions .btn {
  padding: 4px 10px;
  font-size: 13px;
}

.zone-card__actions .btn--danger {
  background: var(--c-danger);
  color: #fff;
  border-color: var(--c-danger);
}

.zone-card__actions .btn--danger:hover {
  background: #c0392b;
}

/* ── Photos drag & drop zone ── */
.photo-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.photo-drop-zone.drag-over {
  border-color: #2980b9;
  background: #eff6ff;
}
.photo-drop-hint {
  display: none;
  text-align: center;
  padding: 18px 12px;
  color: #9ca3af;
  font-size: 13px;
  pointer-events: none;
}
.photo-drop-zone.drag-over .photo-drop-hint,
.photo-drop-zone.drop-empty .photo-drop-hint {
  display: block;
}
.photo-upload-progress {
  height: 4px;
  background: #2980b9;
  border-radius: 0 0 4px 4px;
  transition: width 0.3s;
  display: none;
}

/* ── Photos grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 0;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 0 0 6px 6px;
  border-top: 1px solid #e9ecef;
}

.photo-grid:empty {
  display: none;
}

.photo-tile {
  position: relative;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.photo-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.photo-tile img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.photo-tile__rotate {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(52, 152, 219, 0.95);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 14px;
  line-height: 26px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.2s;
}

.photo-tile__rotate:hover {
  background: #2980b9;
  transform: scale(1.1) rotate(90deg);
}

.photo-tile__del {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(231, 76, 60, 0.95);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 14px;
  line-height: 26px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.2s;
}

.photo-tile__del:hover {
  background: #c0392b;
  transform: scale(1.1);
}

.photo-tile textarea {
  width: 100%;
  font-size: 11px;
  border: none;
  border-top: 1px solid #e9ecef;
  padding: 6px 8px;
  resize: none;
  height: 42px;
  font-family: inherit;
  background: #fafafa;
}

.photo-tile textarea:focus {
  outline: none;
  background: white;
  border-top-color: #27ae60;
}

/* ── History timeline ── */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--c-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-primary);
  border: 2px solid #fff;
}

.timeline-item__head {
  font-size: 12px;
  color: var(--c-muted);
}

.timeline-item__body {
  font-size: 13px;
  margin-top: 2px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--c-primary);
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}

.pagination .btn {
  min-width: 36px;
  text-align: center;
  justify-content: center;
}

.pagination .btn.active {
  background: var(--c-primary);
  color: #fff;
}

/* ── PDF Menu ── */
.pdf-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  min-width: 180px;
  margin-top: 2px;
}

.pdf-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--c-text);
  transition: background 0.2s;
}

.pdf-menu-item:hover {
  background: var(--c-bg);
}

.pdf-menu-item:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.pdf-menu-item:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Utilities ── */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--c-muted);
}

.text-sm {
  font-size: 12px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-4 {
  margin-top: 16px;
}

.mb-2 {
  margin-bottom: 8px;
}

.flex {
  display: flex;
}

.gap-2 {
  gap: 8px;
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   UX ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. BREADCRUMB (Fil d'Ariane) ── */
.breadcrumb {
  background: #fff;
  padding: 12px 24px;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb__item {
  color: var(--c-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb__item:hover {
  color: var(--c-primary-light);
  text-decoration: underline;
}

.breadcrumb__item--active {
  color: var(--c-text);
  font-weight: 500;
}

.breadcrumb__separator {
  color: var(--c-muted);
  font-size: 12px;
}

/* ── 2. BOUTON RETOUR EN HAUT ── */
.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all 0.3s;
}

.scroll-to-top:hover {
  background: var(--c-primary-light);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* ── 3. TOOLTIPS ── */
.tooltip {
  position: absolute;
  background: #2c3e50;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #2c3e50;
}

/* ── 4. TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast-notification {
  background: #fff;
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 500px;
  pointer-events: all;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification--show {
  opacity: 1;
  transform: translateY(0);
}

.toast-notification--success {
  border-left: 4px solid var(--c-accent);
}

.toast-notification--error {
  border-left: 4px solid var(--c-danger);
}

.toast-notification--warning {
  border-left: 4px solid var(--c-warn);
}

.toast-notification--info {
  border-left: 4px solid var(--c-primary);
}

.toast-notification__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-notification__message {
  flex: 1;
  font-size: 14px;
  color: var(--c-text);
}

.toast-notification__close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--c-muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.toast-notification__close:hover {
  background: var(--c-bg);
  color: var(--c-text);
}

/* ── 5. SIDEBAR DE NAVIGATION ── */
.nav-sidebar {
  position: fixed;
  left: 0;
  top: 120px;
  /* Sous navbar + breadcrumb */
  bottom: 0;
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--c-border);
  padding: 20px 0;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.nav-sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--c-text);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-sidebar__item:hover {
  background: var(--c-bg);
  border-left-color: var(--c-primary);
}

.nav-sidebar__item.active {
  background: #e3f2fd;
  border-left-color: var(--c-primary);
  color: var(--c-primary);
  font-weight: 500;
}

.nav-sidebar__icon {
  font-size: 18px;
  flex-shrink: 0;
}

.nav-sidebar__label {
  font-size: 13px;
}

/* Ajuster le container principal quand sidebar active */
body.with-sidebar .container {
  margin-left: 240px;
}

/* ── 6. INDICATEUR DE PROGRESSION ── */
.progress-indicator {
  position: sticky;
  top: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 12px 24px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-indicator__bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-indicator__fill {
  height: 100%;
  background: #fff;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-indicator__text {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

/* ── 7. BARRE D'ACTIONS GROUPÉES ── */
.bulk-actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid var(--c-primary);
  padding: 16px 24px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.bulk-actions-bar__count {
  font-weight: 600;
  color: var(--c-primary);
  font-size: 14px;
}

.bulk-actions-bar__actions {
  flex: 1;
  display: flex;
  gap: 8px;
}

.bulk-actions-bar__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--c-bg);
  color: var(--c-muted);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.bulk-actions-bar__close:hover {
  background: var(--c-danger);
  color: #fff;
}