:root {
  --bg-main: #18181b;
  --bg-surface: #27272a;
  --bg-surface-hover: #303036;
  --bg-surface-active: #383840;
  --bg-elevated: #202024;
  --border-color: #3f3f46;
  --border-subtle: #323238;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-border: rgba(59, 130, 246, 0.55);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --success: #22c55e;
  --warning: #f59e0b;
  --folder-amber: #f59e0b;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.48);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

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

html,
body {
  height: 100%;
  width: 100%;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}

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

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

.hidden {
  display: none !important;
}

/* ==========================================================================
   BOUTONS ET CONTRÔLES COMMUNS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 13px;
  border: 1px solid transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-surface-hover);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-primary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-color);
}

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

.btn-danger:hover:not(:disabled) {
  background-color: var(--danger-hover);
}

.btn-danger-ghost {
  background-color: transparent;
  color: #fca5a5;
  border-color: transparent;
}

.btn-danger-ghost:hover:not(:disabled) {
  background-color: var(--danger-soft);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.4);
}

.input-field {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
  user-select: text;
}

.input-field:focus {
  border-color: var(--accent);
}

/* ==========================================================================
   ÉCRAN DE CONNEXION
   ========================================================================== */
.auth-wrapper {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-main);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.auth-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.auth-logo svg {
  width: 22px;
  height: 22px;
}

.auth-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.auth-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap .input-field {
  padding-right: 40px;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.password-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

.password-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.auth-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background-color: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-size: 13px;
  user-select: text;
}

.auth-submit {
  width: 100%;
  height: 38px;
  font-size: 14px;
}

.auth-footer-links {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.link-btn {
  color: var(--accent);
  text-decoration: underline;
  font-size: inherit;
}

.link-btn:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   STRUCTURE GÉNÉRALE STYLE EXPLORATEUR WINDOWS 11
   ========================================================================== */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg-main);
}

/* Barre de titre / Onglets supérieurs */
.window-header {
  height: 44px;
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
}

.window-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
}

.window-brand svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.window-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all 0.12s ease;
}

.nav-tab svg {
  width: 15px;
  height: 15px;
}

.nav-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface);
}

.nav-tab.active {
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border-color: var(--border-color);
}

.window-user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 12.5px;
  color: var(--text-primary);
}

.user-role-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-soft);
  color: #93c5fd;
  border: 1px solid var(--accent-border);
  font-weight: 600;
  text-transform: uppercase;
}

/* Barre de commandes (Ruban Windows 11) */
.command-bar {
  min-height: 48px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.command-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.command-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-color);
  margin: 0 4px;
}

.sort-select {
  height: 34px;
  padding: 0 10px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.sort-select:focus {
  border-color: var(--accent);
}

.view-switcher {
  display: inline-flex;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.view-btn svg {
  width: 15px;
  height: 15px;
}

.view-btn.active {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Barre d'adresse, Fil d'Ariane (Breadcrumb) et Recherche */
.address-bar {
  height: 44px;
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  flex-shrink: 0;
}

.nav-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid transparent;
  flex-shrink: 0;
}

.nav-icon-btn:hover:not(:disabled) {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.nav-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-icon-btn svg {
  width: 16px;
  height: 16px;
}

.breadcrumb-box {
  flex: 1;
  height: 32px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.breadcrumb-box::-webkit-scrollbar {
  display: none;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.breadcrumb-item svg {
  width: 14px;
  height: 14px;
  color: var(--folder-amber);
}

.breadcrumb-item:hover,
.breadcrumb-item.drop-target-hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.breadcrumb-item.current {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 12px;
  padding: 0 2px;
  user-select: none;
}

.search-box {
  position: relative;
  width: 260px;
  flex-shrink: 0;
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 32px;
  padding: 0 28px 0 32px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
}

/* ==========================================================================
   CORPS DE L'EXPLORATEUR (VOLET LATÉRAL + ZONE PRINCIPALE)
   ========================================================================== */
.explorer-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Volet de navigation gauche */
.sidebar-pane {
  width: 255px;
  background-color: var(--bg-elevated);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-tree-section {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.sidebar-section-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 4px 10px 8px;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  text-align: left;
  border: 1px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-node svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--folder-amber);
}

.tree-node.root-node svg {
  color: var(--accent);
}

.tree-node:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.tree-node.active {
  background-color: var(--accent-soft);
  color: var(--text-primary);
  border-color: var(--accent-border);
  font-weight: 500;
}

.tree-node.drop-target-hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

/* Jauge de stockage dans le volet latéral */
.storage-widget {
  margin: 10px;
  padding: 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.storage-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.storage-widget-header svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.storage-bar-track {
  width: 100%;
  height: 8px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.storage-bar-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  transition: width 0.25s ease, background-color 0.25s ease;
}

.storage-bar-fill.warn {
  background-color: var(--warning);
}

.storage-bar-fill.danger {
  background-color: var(--danger);
}

.storage-text-main {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.storage-text-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Zone principale des fichiers */
.content-pane {
  flex: 1;
  background-color: var(--bg-main);
  overflow-y: auto;
  padding: 16px 20px;
  position: relative;
}

.section-heading {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading span.count-pill {
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* Grille de dossiers */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.folder-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

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

.folder-card.selected,
.folder-card.drop-target-hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

.folder-icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--folder-amber);
  flex-shrink: 0;
}

.folder-icon-wrap svg {
  width: 32px;
  height: 32px;
}

.folder-meta {
  flex: 1;
  min-width: 0;
}

.folder-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Grille de fichiers (Photos & Vidéos) */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 12px;
}

.file-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

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

.file-card.selected {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

.file-thumb-box {
  position: relative;
  width: 100%;
  height: 140px;
  background-color: #121215;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.file-thumb-img,
.file-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-fallback-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-secondary);
}

.file-fallback-icon svg {
  width: 36px;
  height: 36px;
}

.video-play-badge {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(24, 24, 27, 0.82);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  pointer-events: none;
}

.video-play-badge svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.ext-badge {
  position: absolute;
  bottom: 7px;
  right: 7px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background-color: rgba(24, 24, 27, 0.86);
  border: 1px solid var(--border-color);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
}

.item-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background-color: rgba(24, 24, 27, 0.85);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.folder-card:hover .item-select-checkbox,
.file-card:hover .item-select-checkbox,
.folder-card.selected .item-select-checkbox,
.file-card.selected .item-select-checkbox {
  opacity: 1;
}

.folder-card.selected .item-select-checkbox,
.file-card.selected .item-select-checkbox {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.item-select-checkbox svg {
  width: 13px;
  height: 13px;
}

.file-info-box {
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.file-info-text {
  min-width: 0;
  flex: 1;
}

.file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-quick-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.icon-action-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.icon-action-btn:hover {
  background-color: var(--bg-main);
  color: var(--text-primary);
}

.icon-action-btn.danger:hover {
  color: #fca5a5;
}

.icon-action-btn svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   VUE EN LISTE DÉTAILLÉE (STYLE WINDOWS EXPLORER DETAILS)
   ========================================================================== */
.details-table-wrap {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  overflow: hidden;
}

.details-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.details-table th {
  height: 36px;
  padding: 0 12px;
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.details-table td {
  height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

.details-table tbody tr {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.details-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

.details-table tbody tr.selected {
  background-color: var(--accent-soft);
}

.details-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.details-name-cell svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* État dossier vide */
.empty-folder-state {
  margin: 48px auto;
  max-width: 440px;
  text-align: center;
  padding: 36px 24px;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-folder-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: var(--radius-md);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.empty-folder-icon svg {
  width: 24px;
  height: 24px;
}

.empty-folder-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-folder-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* ==========================================================================
   OVERLAY DRAG & DROP SUR TOUTE LA FENÊTRE
   ========================================================================== */
.dropzone-overlay {
  position: fixed;
  inset: 12px;
  background-color: rgba(24, 24, 27, 0.9);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dropzone-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.dropzone-box svg {
  width: 42px;
  height: 42px;
  color: var(--accent);
  margin-bottom: 12px;
}

.dropzone-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.dropzone-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   PANNEAU DE PROGRESSION D'UPLOAD EN TEMPS RÉEL (% ET VITESSE)
   ========================================================================== */
.upload-panel {
  position: fixed;
  right: 20px;
  bottom: 44px;
  width: 360px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  z-index: 1200;
}

.upload-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.upload-panel-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.upload-percent-badge {
  font-weight: 600;
  color: var(--accent);
}

.upload-progress-track {
  width: 100%;
  height: 8px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  transition: width 0.1s linear;
}

.upload-detail-line {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   VISIONNEUSE INTÉGRÉE (LIGHTBOX PHOTO HD & VIDÉO)
   ========================================================================== */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 15, 18, 0.96);
  z-index: 1800;
  display: flex;
  flex-direction: column;
}

.lightbox-topbar {
  height: 54px;
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.lightbox-file-meta {
  min-width: 0;
}

.lightbox-filename {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-filesub {
  font-size: 12px;
  color: var(--text-secondary);
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px 64px;
}

.lightbox-media-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease;
}

.lightbox-media-video {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  background-color: #000;
  outline: none;
}

.lightbox-raw-card {
  max-width: 420px;
  padding: 28px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
}

.lightbox-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.lightbox-nav-arrow:hover:not(:disabled) {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent);
}

.lightbox-nav-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.lightbox-nav-arrow.prev {
  left: 16px;
}

.lightbox-nav-arrow.next {
  right: 16px;
}

.lightbox-nav-arrow svg {
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   PAGE D'ADMINISTRATION (RÉSERVÉE À TAFFY)
   ========================================================================== */
.admin-pane {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background-color: var(--bg-main);
}

.admin-container {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.stat-card-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-card-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.admin-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.admin-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.admin-panel-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.quota-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quota-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.log-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.log-badge.success {
  background-color: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.log-badge.failed {
  background-color: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.log-badge.blocked {
  background-color: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.log-badge.logout {
  background-color: var(--bg-main);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   MENU CONTEXTUEL CLIC DROIT
   ========================================================================== */
.context-menu {
  position: fixed;
  min-width: 210px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 5px;
  box-shadow: var(--shadow-lg);
  z-index: 1900;
}

.context-menu-item {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
  text-align: left;
}

.context-menu-item svg {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
}

.context-menu-item:hover {
  background-color: var(--bg-surface-hover);
}

.context-menu-item.danger {
  color: #fca5a5;
}

.context-menu-item.danger svg {
  color: #fca5a5;
}

.context-menu-sep {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

/* ==========================================================================
   MODALES (DOSSIER, RENOMMAGE, DÉPLACEMENT, SUPPRESSION, RGPD)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 1950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}

.modal-card.modal-lg {
  max-width: 680px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  user-select: text;
}

.modal-footer {
  padding: 12px 20px;
  background-color: var(--bg-elevated);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.move-folder-list {
  max-height: 260px;
  overflow-y: auto;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px;
}

/* ==========================================================================
   BARRE D'ÉTAT INFÉRIEURE & BANDEAU RGPD COOKIES
   ========================================================================== */
.status-bar {
  height: 30px;
  background-color: var(--bg-elevated);
  border-top: 1px solid var(--border-color);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.status-bar-left,
.status-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 38px;
  max-width: 860px;
  margin: 0 auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 2100;
}

.cookie-banner-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.cookie-banner-text strong {
  color: var(--text-primary);
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Notifications Toast */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2200;
}

.toast-item {
  min-width: 260px;
  max-width: 400px;
  padding: 11px 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  color: var(--text-primary);
}

.toast-item.error {
  border-left-color: var(--danger);
}

.toast-item.success {
  border-left-color: var(--success);
}

.privacy-section {
  margin-bottom: 14px;
}

.privacy-section h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.privacy-section p,
.privacy-section li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.privacy-section ul {
  padding-left: 18px;
  margin-top: 4px;
}

@media (max-width: 820px) {
  .sidebar-pane {
    width: 200px;
  }
  .search-box {
    width: 170px;
  }
}

@media (max-width: 640px) {
  .sidebar-pane {
    display: none;
  }
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}
