/* ============================================================
   DVAA ADMIN — CSS PROPRE (~380 lignes, 0 duplication)
============================================================ */

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  color: #1e293b;
  background: #f1f5f9;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.screen { min-height: 100vh; }

/* === LOGIN === */
#login-screen {
  background: #f8fafc;
}

.login-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.login-brand {
  flex: 1;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.brand-content {
  position: relative;
  z-index: 2;
  max-width: 480px;
}

.brand-logo {
  font-size: 64px;
  margin-bottom: 24px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.brand-content h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.brand-content p {
  font-size: 18px;
  color: #cbd5e1;
  line-height: 1.6;
}

.brand-bg-pattern {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(circle at 20% 150%, rgba(56, 189, 248, 0.15) 0%, transparent 50%),
                    radial-gradient(circle at 80% -20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
  z-index: 1;
}

.login-form-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #ffffff;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: transparent;
}

.login-header {
  margin-bottom: 32px;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.login-header p {
  color: #64748b;
  font-size: 15px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.login-field label {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
}

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

.input-wrap .icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  display: flex;
}

.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.input-wrap input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-wrap input::placeholder {
  color: #94a3b8;
}

.btn-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
}

.btn-login:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

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

.login-error-msg {
  color: #dc2626;
  background-color: #fee2e2;
  border: 1px solid #fca5a5;
  font-size: 14px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  display: none;
}
.login-error-msg:not(:empty) {
  display: block;
}

/* Base button keep default */
.btn-primary {
  padding: 12px 24px;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover { background: #1e293b; }

.error-msg { color: #ef4444; font-size: 13px; margin-top: 12px; min-height: 18px; }

@media (max-width: 768px) {
  .login-brand { display: none; }
  .login-form-container { padding: 24px; }
}

/* === TOPBAR === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { font-size: 20px; }
.topbar-title { font-size: 16px; font-weight: 600; color: #1e3a5f; }

.topbar-nav { display: flex; gap: 4px; }

.nav-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-btn:hover { background: #f1f5f9; color: #1e3a5f; }
.nav-btn.active { background: #1e3a5f; color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.btn-ghost {
  padding: 6px 14px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover { border-color: #94a3b8; color: #475569; }

/* === TABS === */
.tab-pane { display: none; padding: 24px; }
.tab-pane.active { display: block; }

/* === SECTION LABELS === */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 10px;
  margin-top: 20px;
}

.section-label:first-child { margin-top: 0; }

/* === CONTENU — TOOLBAR FIXE === */
.content-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.content-toolbar .toolbar-sep {
  width: 1px;
  height: 28px;
  background: #e2e8f0;
  margin: 0 4px;
  flex-shrink: 0;
}

.draft-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.draft-badge.saved { background: #d1fae5; color: #065f46; }
.draft-badge.modified { background: #fef3c7; color: #92400e; }

.btn-publish {
  padding: 6px 14px;
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-publish:hover { background: #047857; }

.btn-reset {
  padding: 6px 14px;
  background: #fff;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.btn-reset:hover { border-color: #94a3b8; }

/* Toolbar groups */
.toolbar-group {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.toolbar-group.mode-global { background: #eff6ff; display: flex; }
.toolbar-group.mode-text { background: #fef3c7; display: flex; }
.toolbar-group.mode-image { background: #fff7ed; display: flex; }

.toolbar-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.toolbar-group input[type="number"],
.toolbar-group input[type="text"] {
  width: 56px;
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  text-align: center;
}

.toolbar-group select {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}

.toolbar-group input[type="color"] {
  width: 28px;
  height: 28px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: #fff;
}

.style-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  flex-shrink: 0;
}

.style-btn:hover { border-color: #1e3a5f; }
.style-btn.active { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s;
  white-space: nowrap;
}

.toggle-btn:hover { border-color: #94a3b8; }
.toggle-btn.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }

.btn-replace {
  padding: 5px 12px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-replace:hover { background: #2563eb; }

/* === IFRAME WRAPPER === */
.iframe-wrapper {
  position: relative;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
}

.iframe-wrapper iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

/* === DESIGN === */
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.design-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.design-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; color: #1e293b; }

.design-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.design-row label { font-size: 13px; color: #64748b; }

.design-row input[type="color"] {
  width: 36px;
  height: 36px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  cursor: pointer;
  background: #fff;
}

.design-row input[type="text"] {
  width: 90px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
}

.design-row select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
}

.btn-save-design {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: #1e3a5f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* === MEDIA === */
.media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.media-header h2 { font-size: 20px; font-weight: 600; }

.media-upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  background: #f8fafc;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.media-upload-area:hover { border-color: #1e3a5f; background: #eff6ff; }
.media-upload-area.dragover { border-color: #3b82f6; background: #eff6ff; }
.media-upload-area input[type="file"] { display: none; }
.media-upload-area p { color: #64748b; font-size: 14px; margin-top: 8px; }
.media-upload-icon { font-size: 36px; }

.media-search {
  width: 100%;
  max-width: 320px;
  padding: 8px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  margin-bottom: 16px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.media-item {
  position: relative;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}

.media-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.media-item img { width: 100%; height: 120px; object-fit: cover; display: block; }
.media-item-info { padding: 8px 10px; }
.media-item-name { font-size: 11px; color: #64748b; word-break: break-all; }
.media-item-actions { padding: 6px 10px 8px; display: flex; gap: 6px; }
.media-item-actions button {
  flex: 1;
  padding: 4px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}

.media-item-actions .btn-copy:hover { background: #eff6ff; border-color: #3b82f6; color: #2563eb; }
.media-item-actions .btn-del:hover { background: #fef2f2; border-color: #ef4444; color: #dc2626; }

/* === PUBLISH === */
.publish-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 28px;
  max-width: 560px;
}

.publish-card h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.publish-card p { color: #64748b; font-size: 13px; margin-bottom: 20px; }

.publish-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-export {
  padding: 10px 20px;
  background: #fff;
  color: #1e3a5f;
  border: 1.5px solid #1e3a5f;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-export:hover { background: #eff6ff; }

.btn-force-publish {
  padding: 10px 20px;
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-force-publish:hover { background: #047857; }

/* === USERS === */
.users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.users-header h2 { font-size: 20px; font-weight: 600; }

.btn-add-user {
  padding: 8px 16px;
  background: #1e3a5f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
}

.users-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.users-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
}

.users-table tr:last-child td { border-bottom: none; }
.users-table tr:hover td { background: #f8fafc; }

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.role-badge.admin { background: #eff6ff; color: #1d4ed8; }
.role-badge.editor { background: #f0fdf4; color: #15803d; }

.btn-user-edit, .btn-user-delete {
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-user-edit:hover { border-color: #3b82f6; color: #2563eb; }
.btn-user-delete:hover { border-color: #ef4444; color: #dc2626; background: #fef2f2; }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}

.modal h2 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.modal-field label { font-size: 13px; font-weight: 500; color: #64748b; }

.modal-field input,
.modal-field select {
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
}

.modal-field input:focus,
.modal-field select:focus { outline: none; border-color: #1e3a5f; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-modal-save { background: #1e3a5f; color: #fff; border: none; }
.btn-modal-cancel { background: #fff; color: #64748b; border: 1.5px solid #e2e8f0; }

/* === TOAST === */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease;
}

.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.info { background: #1e3a5f; }

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

/* === LIVE PREVIEW MODAL === */
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.9);
  z-index: 500;
  display: none;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
}

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

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.preview-devices { display: flex; gap: 6px; }

.device-btn {
  padding: 6px 12px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.6);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.device-btn.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.btn-close-preview {
  padding: 8px 18px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.preview-device-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  padding: 10px;
}

.preview-device-wrapper iframe {
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.preview-device-wrapper.desktop iframe { width: 100%; height: 100%; min-height: 500px; }
.preview-device-wrapper.tablet iframe { width: 768px; height: 600px; }
.preview-device-wrapper.mobile iframe { width: 375px; height: 600px; }

/* === STATS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
}

.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #1e3a5f; }
.stat-card .stat-label { font-size: 12px; color: #94a3b8; margin-top: 4px; }

body {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-dark-2: #1e293b;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.15);
    --radius: 6px;
    --radius-lg: 10px;
    --toolbar-h: 56px;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-light);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; font-size: 13px; font-weight: 500; border: none;
    border-radius: var(--radius); cursor: pointer; transition: all .2s;
    white-space: nowrap; text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-dark-2); color: white; }
.btn-secondary:hover { background: var(--bg-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-icon {
    background: transparent; border: none; padding: 8px; cursor: pointer;
    color: rgba(255,255,255,.6); border-radius: var(--radius); font-size: 18px; line-height: 1;
}
.btn-icon:hover { background: rgba(255,255,255,.1); color: white; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 9px 12px; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-family: inherit; transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ========== LOGIN ========== */
.login-screen {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%); padding: 20px;
}
.login-card {
    background: white; border-radius: var(--radius-lg); padding: 40px;
    width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-icon { font-size: 48px; display: block; margin-bottom: 16px; }
.login-header h1 { font-size: 1.5rem; color: var(--bg-dark); margin-bottom: 4px; }
.login-header p { color: var(--text-secondary); }
.login-error {
    margin-top: 16px; padding: 12px; background: #fef2f2; color: var(--danger);
    border-radius: var(--radius); text-align: center; display: none;
}
.login-error.show { display: block; }

/* ========== ADMIN APP ========== */
.admin-app { display: flex; flex-direction: column; min-height: 100vh; }

/* ========== TOOLBAR ========== */
.toolbar {
    position: sticky; top: 0; z-index: 100; display: flex; align-items: center;
    justify-content: space-between; padding: 0 16px; height: var(--toolbar-h);
    background: var(--bg-dark); color: white; box-shadow: var(--shadow-md); gap: 8px;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.toolbar-center {
    display: flex; align-items: center; gap: 8px; flex: 1;
    justify-content: center; min-width: 0;
}

.toolbar-brand {
    display: flex; align-items: center; gap: 8px; color: white;
    font-weight: 600; font-size: 15px; text-decoration: none; flex-shrink: 0;
}
.toolbar-brand:hover { color: rgba(255,255,255,.8); }

.toolbar-btn {
    display: flex; align-items: center; gap: 5px; padding: 7px 12px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius); color: rgba(255,255,255,.85);
    font-size: 13px; font-weight: 500; cursor: pointer; transition: all .2s;
    flex-shrink: 0; white-space: nowrap;
}
.toolbar-btn:hover { background: rgba(255,255,255,.15); color: white; }
.toolbar-btn.primary { background: var(--success); border-color: var(--success); color: white; }
.toolbar-btn.primary:hover { background: #0d9668; }

.toolbar-user { display: flex; flex-direction: column; align-items: flex-end; margin-right: 8px; }
.toolbar-user .user-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.toolbar-user .user-role { font-size: 11px; color: rgba(255,255,255,.5); }

/* ========== TABS ========== */
.tabs-nav {
    display: flex; gap: 4px; padding: 0 16px; background: var(--bg-white);
    border-bottom: 2px solid var(--border);
}
.tab-btn {
    display: flex; align-items: center; gap: 8px; padding: 12px 18px;
    background: transparent; border: none; border-bottom: 2px solid transparent;
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all .2s; margin-bottom: -2px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ========== PANELS ========== */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-header { margin-bottom: 24px; padding-top: 24px; }
.panel-header h2 { font-size: 1.25rem; margin-bottom: 4px; }
.panel-header p { color: var(--text-secondary); font-size: 13px; }

.tab-content { flex: 1; padding: 0 24px 24px; overflow-y: auto; }

/* ========== SECTION CARDS ========== */
.section-card {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.section-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.section-card-header h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.section-status {
    font-size: 11px; padding: 4px 10px; border-radius: 12px; font-weight: 500;
}
.section-status.published { background: #dcfce7; color: #166534; }
.section-status.draft { background: #fef3c7; color: #92400e; }

.editable-field { margin-bottom: 14px; }
.editable-field:last-child { margin-bottom: 0; }
.editable-field label {
    display: block; font-size: 11px; color: var(--text-secondary);
    margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px;
}
.editable-field .field-content {
    padding: 10px 12px; background: var(--bg-light); border: 1px solid transparent;
    border-radius: var(--radius); min-height: 40px; font-size: 14px;
    transition: all .2s; cursor: text;
}
.editable-field .field-content:hover { background: #f1f5f9; border-color: var(--border); }
.editable-field .field-content.editable { outline: 2px solid var(--primary); background: white; }

/* ========== DESIGN ========== */
.design-options { max-width: 600px; }
.option-group {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.option-group h3 { font-size: 1rem; margin-bottom: 16px; }

.color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 4px; }
.color-option { text-align: center; }
.color-option label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.color-option input[type="color"] {
    width: 100%; height: 42px; border: 2px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
}

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-item { text-align: center; padding: 16px; background: var(--bg-light); border-radius: var(--radius); }
.stat-value { display: block; font-size: 1.75rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-secondary); }

/* ========== MEDIA ========== */
.media-toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.search-box { flex: 1; min-width: 200px; display: flex; gap: 8px; }
.search-box input { flex: 1; padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.media-item {
    background: var(--bg-white); border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow); transition: transform .2s;
}
.media-item:hover { transform: translateY(-3px); }
.media-preview { aspect-ratio: 1; background: var(--bg-light); overflow: hidden; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-info { padding: 10px 12px; }
.media-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.media-actions { display: flex; gap: 4px; padding: 8px 10px 12px; }
.media-actions .btn { flex: 1; }

/* ========== PUBLISH ========== */
.publish-sections { display: flex; flex-direction: column; gap: 12px; }
.section-status-card {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 16px 20px; box-shadow: var(--shadow);
}
.section-status-info h4 { font-size: 15px; margin-bottom: 4px; }
.status-badge { display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 10px; font-weight: 500; }
.status-badge.published { background: #dcfce7; color: #166534; }
.status-badge.draft { background: #fef3c7; color: #92400e; }

/* ========== USERS ========== */
.users-actions { margin-bottom: 20px; }
.users-list { background: var(--bg-white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.user-row {
    display: grid; grid-template-columns: 1fr 1fr 120px 140px; gap: 16px;
    align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-row.header {
    background: var(--bg-light); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary);
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 500; }
.user-email { font-size: 12px; color: var(--text-secondary); }

.user-role-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.user-role-badge.admin { background: #fef3c7; color: #92400e; }
.user-role-badge.editor { background: #dcfce7; color: #166534; }
.user-role-badge.author { background: #e0f2fe; color: #0369a1; }

.user-row-meta { font-size: 12px; color: var(--text-secondary); }
.user-actions { display: flex; gap: 6px; }

/* ========== MODAL ========== */
.modal {
    display: none; position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.6);
    align-items: center; justify-content: center; padding: 20px;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--bg-white); border-radius: var(--radius-lg); width: 100%;
    max-width: 450px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; }
.modal-close {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; font-size: 24px; color: var(--text-secondary);
    cursor: pointer; border-radius: var(--radius);
}
.modal-close:hover { background: var(--bg-light); }
.modal-body { padding: 20px; }

/* ========== SETTINGS PANEL ========== */
.settings-panel {
    position: fixed; top: 0; right: -400px; width: 400px; height: 100vh;
    background: var(--bg-white); box-shadow: -4px 0 20px rgba(0,0,0,.2);
    z-index: 400; transition: right .3s ease; display: flex; flex-direction: column;
}
.settings-panel.active { right: 0; }
.settings-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 399; display: none; }
.settings-overlay.active { display: block; }
.settings-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.settings-content { padding: 20px; flex: 1; overflow-y: auto; }
.settings-section { margin-bottom: 24px; }
.settings-section h4 { font-size: 14px; margin-bottom: 12px; color: var(--text-secondary); }

/* ========== LIVE PREVIEW MODAL ========== */
.live-preview-modal {
    display: none; position: fixed; inset: var(--toolbar-h) 0 0 0;
    background: #111827; z-index: 500; flex-direction: column;
}
.live-preview-modal.active { display: flex; }
.live-preview-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: #0f172a;
    border-bottom: 1px solid rgba(255,255,255,.1); flex-shrink: 0;
}
.live-preview-header-left { display: flex; align-items: center; gap: 8px; color: white; font-size: 13px; font-weight: 500; }
.live-preview-header-left span { color: rgba(255,255,255,.5); font-size: 12px; }
.breakpoint-group { display: flex; gap: 4px; background: rgba(255,255,255,.1); padding: 4px; border-radius: var(--radius); }
.bp-btn {
    padding: 6px 10px; background: transparent; border: none;
    border-radius: 4px; color: rgba(255,255,255,.6); cursor: pointer;
    font-size: 16px; transition: all .15s;
}
.bp-btn:hover { background: rgba(255,255,255,.1); color: white; }
.bp-btn.active { background: var(--primary); color: white; }
.live-preview-actions { display: flex; align-items: center; gap: 8px; }
.live-preview-body {
    flex: 1; display: flex; align-items: center; justify-content: center;
    overflow: auto; padding: 20px;
}
#livePreviewFrame {
    border: none; border-radius: 8px; background: white;
    box-shadow: 0 20px 60px rgba(0,0,0,.5); transition: width .3s ease;
}
#livePreviewFrame[data-bp="desktop"] { width: 100%; max-width: 1200px; height: 100%; }
#livePreviewFrame[data-bp="tablet"] { width: 768px; height: 100%; }
#livePreviewFrame[data-bp="mobile"] { width: 375px; height: 100%; }

/* ========== TOAST ========== */
.toast {
    position: fixed; bottom: 30px; right: 30px; padding: 12px 18px;
    background: var(--bg-dark); color: white; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); transform: translateY(100px); opacity: 0;
    transition: all .3s ease; z-index: 1000; font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ========== LOADING ========== */
.loading-spinner {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: none; align-items: center; justify-content: center;
    z-index: 9999; backdrop-filter: blur(4px);
}
.loading-spinner.active { display: flex; }
.spinner {
    width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.3);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .toolbar-center { display: none; }
    .tabs-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-btn span { display: none; }
    .user-row { grid-template-columns: 1fr 1fr; }
    .settings-panel { width: 100%; right: -100%; }
    .media-toolbar { flex-direction: column; }
    .search-box { min-width: 100%; }
    .color-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .live-preview-modal.active { flex-direction: column; }
    #livePreviewFrame[data-bp="tablet"],
    #livePreviewFrame[data-bp="mobile"] { width: 100%; }
}

/* ========== CONTENT GRID ========== */
.content-edit-grid { display: flex; flex-direction: column; gap: 16px; }

    min-height: 100vh;
}

/* Toolbar */
.toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    background: var(--bg-dark);
    color: white;
    box-shadow: var(--shadow-md);
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-center {
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.toolbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
    font-size: 16px;
}
.toolbar-brand:hover { color: rgba(255,255,255,0.8); }

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}
.toolbar-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}
.toolbar-btn.primary {
    background: var(--success);
    color: white;
}
.toolbar-btn.primary:hover {
    background: #0d9668;
}
.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    margin: 0 8px;
    flex-shrink: 0;
}

.toolbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 12px;
}
.user-name {
    font-weight: 600;
    font-size: 13px;
}
.user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Tab Content */
.tab-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

.panel-header {
    margin-bottom: 24px;
}
.panel-header h2 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}
.panel-header p {
    color: var(--text-secondary);
}

/* Content Sections */
.content-sections {
    display: grid;
    gap: 20px;
}

/* Content Workspace */
.content-workspace {
    display: flex;
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.content-main {
    flex: 1;
    overflow-y: auto;
    padding-right: 0;
}

.section-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-card-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}
.section-status.published {
    background: #dcfce7;
    color: #166534;
}
.section-status.draft {
    background: #fef3c7;
    color: #92400e;
}

.section-content {
    min-height: 60px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius);
    cursor: text;
    transition: all 0.2s;
}
.section-content:hover {
    background: #f1f5f9;
}
.section-content.editable {
    outline: 2px solid var(--primary);
    background: white;
}

.editable-field {
    margin-bottom: 16px;
}
.editable-field:last-child {
    margin-bottom: 0;
}
.editable-field label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.editable-field .field-content {
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: var(--radius);
    cursor: text;
    min-height: 40px;
}
.editable-field .field-content:hover {
    background: #f1f5f9;
}

/* Design Options */
.design-options {
    max-width: 600px;
}

.option-group {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.option-group h3 {
    font-size: 1rem;
    margin-bottom: 16px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.color-option {
    text-align: center;
}
.color-option label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.color-option input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

/* Media Grid */
.media-toolbar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.upload-area {
    flex-shrink: 0;
}

.search-box {
    flex: 1;
    display: flex;
    gap: 8px;
}
.search-box input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.media-item {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}
.media-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.media-preview {
    aspect-ratio: 1;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-info {
    padding: 12px;
}
.media-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.media-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.media-actions {
    display: flex;
    gap: 4px;
    padding: 0 12px 12px;
}
.media-actions button {
    flex: 1;
    padding: 6px;
    font-size: 12px;
}

/* Publish Grid */
.publish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.publish-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}
.publish-card h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.stat-item {
    text-align: center;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius);
}
.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.export-buttons {
    margin: 16px 0;
}
.zone-exports {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 16px;
}
.zone-export-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.zone-export-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.registrations-list {
    max-height: 300px;
    overflow-y: auto;
}
.registration-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}
.registration-item:last-child {
    border-bottom: none;
}
.registration-info {
    display: flex;
    flex-direction: column;
}
.registration-name {
    font-weight: 500;
}
.registration-meta {
    font-size: 12px;
    color: var(--text-secondary);
}
.registration-zone {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-light);
}

/* Users List */
.users-actions {
    margin-bottom: 20px;
}

.users-list {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.user-row {
    display: grid;
    grid-template-columns: 1fr 1fr 150px 100px;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.user-row:last-child {
    border-bottom: none;
}
.user-row.header {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.user-info {
    display: flex;
    flex-direction: column;
}
.user-name {
    font-weight: 500;
}
.user-email {
    font-size: 13px;
    color: var(--text-secondary);
}

.user-role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.user-role-badge.author { background: #e0f2fe; color: #0369a1; }
.user-role-badge.editor { background: #dcfce7; color: #166534; }
.user-role-badge.admin { background: #fef3c7; color: #92400e; }
.user-role-badge.dev { background: #fce7f3; color: #be185d; }

.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.user-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}
.user-status.waitlist .status-dot {
    background: var(--warning);
}

.user-actions {
    display: flex;
    gap: 8px;
}

/* Inline Editor */
.edit-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    z-index: 200;
}
.edit-overlay.active {
    display: flex;
}

.edit-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-dark);
}

.format-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.format-btn:hover {
    background: rgba(255,255,255,0.1);
}

.format-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    margin: 0 4px;
}

.format-select {
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 13px;
}

#textColorPicker {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.edit-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.edit-area {
    width: 100%;
    max-width: 800px;
    min-height: 200px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
    font-size: 16px;
    line-height: 1.8;
    box-shadow: var(--shadow-lg);
}
.edit-area:focus {
    outline: none;
}

.edit-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-lg {
    max-width: 700px;
}

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

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius);
}
.modal-close:hover {
    background: var(--bg-light);
}

.modal-body {
    padding: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Revisions List */
.revisions-list {
    max-height: 400px;
    overflow-y: auto;
}
.revision-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.revision-item:last-child {
    border-bottom: none;
}
.revision-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.revision-type {
    font-weight: 500;
    text-transform: capitalize;
}
.revision-date {
    font-size: 12px;
    color: var(--text-secondary);
}
.revision-author {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-white);
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    z-index: 400;
    transition: right 0.3s ease;
}
.settings-panel.active {
    right: 0;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 399;
    display: none;
}
.settings-overlay.active {
    display: block;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.settings-content {
    padding: 20px;
}
.settings-section {
    margin-bottom: 24px;
}
.settings-section h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 20px;
    background: var(--bg-dark);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast.success {
    background: var(--success);
}
.toast.error {
    background: var(--danger);
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Toast improvements */
.toast::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
}

.toast.success::before {
    content: '✓';
}

.toast.error::before {
    content: '✕';
}

.toast.info::before {
    content: 'ℹ';
}

/* ============================================
   LIVE PREVIEW SYSTEM
   ============================================ */

/* Live Preview Button */
.live-preview-btn {
    position: relative;
    background: var(--bg-dark-2);
    color: var(--text-light);
}

.live-preview-btn:hover {
    background: var(--bg-dark);
    color: white;
}

.live-preview-btn.active {
    background: var(--primary);
    color: white;
}

.live-preview-btn.active::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* Live Preview Container */
.live-preview-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-white);
    z-index: 900;
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.live-preview-container.active {
    display: flex;
}

/* Preview Header */
.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.preview-action-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.preview-action-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

.preview-action-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.preview-action-btn.close:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Preview Body */
.preview-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.preview-admin-panel {
    width: 400px;
    min-width: 300px;
    background: var(--bg-light);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 20px;
}

/* Preview Iframe */
.preview-iframe-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.preview-iframe-wrapper[data-device="desktop"] iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-iframe-wrapper[data-device="tablet"] iframe {
    width: 768px;
    height: 100%;
    border: none;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.preview-iframe-wrapper[data-device="mobile"] iframe {
    width: 375px;
    height: 100%;
    border: none;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

#previewFrame {
    background: white;
}

/* Device Switcher */
.preview-device-switcher {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.8);
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.device-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.device-btn:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.device-btn.active {
    color: var(--primary);
    background: rgba(37,99,235,0.2);
}

/* Changes Indicator */
.preview-changes-indicator {
    position: absolute;
    bottom: 80px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-changes-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.changes-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Live Edit Mode - Highlight modified elements */
.live-edit-highlight {
    outline: 2px dashed var(--primary) !important;
    outline-offset: 2px;
    animation: highlight-pulse 1s ease-in-out;
}

@keyframes highlight-pulse {
    0%, 100% { outline-color: var(--primary); }
    50% { outline-color: var(--success); }
}

/* Responsive */
@media (max-width: 768px) {
    .toolbar-center {
        display: none;
    }
    .tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn span {
        display: none;
    }
    .publish-grid {
        grid-template-columns: 1fr;
    }
    .user-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    
    /* Live Preview responsive */
    .live-preview-container.active {
        flex-direction: column;
    }
    
    .preview-admin-panel {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .preview-iframe-wrapper {
        height: 60%;
    }
}

/* ============================================
   INLINE TEXT EDITOR
   ============================================ */

.inline-text-editor {
    position: fixed;
    z-index: 10000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    transform: translateY(10px);
}

.inline-text-editor.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.editor-toolbar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
    min-width: 580px;
}

.toolbar-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    margin: 0 4px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.2);
}

.toolbar-btn.active {
    background: var(--primary, #3b82f6);
    border-color: var(--primary, #3b82f6);
}

.toolbar-btn.close:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.toolbar-select {
    height: 32px;
    padding: 0 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    min-width: 120px;
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--primary, #3b82f6);
}

.toolbar-select option {
    background: #1e293b;
    color: #fff;
}

/* Color picker */
.color-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.color-label {
    position: absolute;
    left: 8px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.color-input {
    width: 36px;
    height: 32px;
    padding: 2px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: pointer;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Link editor */
.link-editor {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.link-editor input {
    flex: 1;
    height: 32px;
    padding: 0 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.link-editor input::placeholder {
    color: rgba(255,255,255,0.5);
}

.link-editor input:focus {
    outline: none;
    border-color: var(--primary, #3b82f6);
}

/* Toolbar hint */
.toolbar-hint {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

/* Selected element indicator */
.selected-for-edit {
    outline: 2px dashed var(--primary, #3b82f6) !important;
    outline-offset: 4px;
    cursor: text !important;
}

/* Animation on hover */
.selected-for-edit:hover {
    outline-color: var(--success, #10b981) !important;
}

/* Content Edit Grid */
.content-edit-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Section Status Card */
.section-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}
.section-status-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}
.status-badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}
.status-badge.published {
    background: #dcfce7;
    color: #166534;
}
.status-badge.draft {
    background: #fef3c7;
    color: #92400e;
}

/* Publish Sections */
.publish-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Live Preview Modal */
.live-preview-modal {
    display: none;
    position: fixed;
    inset: 56px 0 0 0;
    background: var(--bg-dark);
    z-index: 500;
    flex-direction: column;
}
.live-preview-modal.active {
    display: flex;
}

.live-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.live-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.breakpoint-group {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.1);
    padding: 4px;
    border-radius: var(--radius);
}
.bp-btn {
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
}
.bp-btn:hover { background: rgba(255,255,255,0.1); }
.bp-btn.active { background: var(--primary); }

.live-preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
}
.live-preview-body iframe {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    max-height: calc(100vh - 120px);
    border: none;
    border-radius: 8px;
    background: white;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .toolbar-center {
        display: none;
    }
    .tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn span {
        display: none;
    }
    .publish-grid {
        grid-template-columns: 1fr;
    }
    .user-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    .live-preview-modal.active {
        flex-direction: column;
    }
    .live-preview-body iframe {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .inline-text-editor {
        min-width: auto;
        width: calc(100vw - 20px);
        left: 10px !important;
    }
    .editor-toolbar {
        min-width: auto;
        padding: 10px;
    }
    .toolbar-main {
        gap: 6px;
    }
    .toolbar-select {
        min-width: 100px;
    }
}

#previewFrame .editable-element {
    transition: outline 0.15s ease;
}

#previewFrame .editable-element:hover {
    outline: 2px dashed rgba(59, 130, 246, 0.5) !important;
    outline-offset: 2px;
    cursor: text;
}

#previewFrame .editable-element.selected {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 3px;
}

.browse-mode {
    position: relative;
}

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

.inline-floating-toolbar {
    animation: toolbarSlideIn 0.2s ease;
}

/* Quick edit overlay */
.preview-edit-hint {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.browse-mode:hover .preview-edit-hint {
    opacity: 1;
}

/* ============================================
   LIVE PREVIEW - NOUVELLE VERSION
   ============================================ */
.live-preview-container {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.live-preview-container.active {
    display: flex;
}

/* Workspace avec Property Panel */
.content-workspace.with-property-panel .live-preview-container {
    display: flex;
}

.content-workspace.with-property-panel {
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.content-workspace.with-property-panel .content-main {
    background: var(--bg-white);
}

.content-workspace.with-property-panel .live-preview-container {
    flex: 1;
    border-radius: 0;
    box-shadow: none;
}

.content-workspace.with-property-panel .property-panel {
    border-radius: 0;
    border-left: 1px solid var(--border);
}

.live-preview-container .preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    color: white;
}

.live-preview-container .preview-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

.live-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    font-size: 11px;
    font-weight: normal;
}

.preview-badge {
    display: none;
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.breakpoint-switcher {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
}

.breakpoint-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.2s;
}

.breakpoint-btn:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.breakpoint-btn.active {
    background: var(--primary);
    color: white;
}

.preview-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.2s;
}

.preview-action-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.preview-action-btn.close:hover {
    background: var(--danger);
}

.preview-body {
    flex: 1;
    overflow: hidden;
    background: #f1f5f9;
}

.preview-frame-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
}

.preview-frame-wrapper.tablet {
    padding: 20px;
}

.preview-frame-wrapper.mobile {
    padding: 20px;
}

.preview-frame-wrapper.tablet .preview-frame {
    max-width: 768px;
    margin: 0 auto;
}

.preview-frame-wrapper.mobile .preview-frame {
    max-width: 375px;
    margin: 0 auto;
}

.preview-frame {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 600px;
    border: none;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-lg);
}

.preview-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px;
    background: rgba(255,255,255,0.95);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text-secondary);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.preview-hint svg {
    color: var(--primary);
    opacity: 0.6;
}

.preview-hint p {
    font-size: 15px;
    max-width: 280px;
}

.preview-hint .hint-subtitle {
    font-size: 12px;
    color: var(--text-light);
}

/* ============================================
   PROPERTY PANEL - NOUVELLE SIDEBAR
   ============================================ */
.property-panel {
    display: none;
    width: 320px;
    min-width: 320px;
    height: 100%;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    flex-direction: column;
    overflow: hidden;
}

.property-panel.active {
    display: flex;
}

.property-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

.property-panel-header .panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.property-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.no-selection-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.no-selection-message .no-selection-icon {
    margin-bottom: 20px;
    color: var(--text-light);
    opacity: 0.5;
}

.no-selection-message p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.no-selection-message .hint {
    font-size: 12px;
    color: var(--text-light);
}

/* Property Sections */
.property-section {
    margin-bottom: 24px;
}

.property-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-light);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.property-section-header span:first-child {
    font-weight: 600;
    font-size: 13px;
}

.element-tag {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-white);
    padding: 2px 8px;
    border-radius: 4px;
}

.property-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Property Rows */
.property-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.property-row.full-width {
    flex-direction: column;
    align-items: stretch;
}

.property-row label {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}

.property-row.full-width label {
    margin-bottom: 6px;
}

/* Color Input */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-color {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.color-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 60px;
}

.btn-clear {
    padding: 4px 8px;
    font-size: 11px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-clear:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Range Input */
.range-input-wrapper,
.size-input-wrapper,
.spacing-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.property-range {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

.property-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.range-value,
.size-value {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: right;
}

/* Select */
.property-select {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
}

.property-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Textarea */
.property-textarea {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 80px;
}

.property-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Number Input */
.property-number {
    width: 70px;
    padding: 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.property-number:focus {
    outline: none;
    border-color: var(--primary);
}

/* Style Toggles */
.style-toggles {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    margin: 16px 0;
}

.style-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.style-toggle:hover {
    background: var(--bg-white);
    border-color: var(--text-light);
}

.style-toggle.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Alignment Buttons */
.align-buttons {
    display: flex;
    gap: 4px;
}

.align-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

.align-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Edit Overlay */
.edit-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.edit-overlay.active {
    display: flex;
}

.edit-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

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

.edit-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

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

.edit-modal-body {
    flex: 1;
    padding: 20px;
    overflow: auto;
}

.edit-area {
    min-height: 200px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-size: 16px;
    line-height: 1.6;
}

.edit-area:focus {
    border-color: var(--primary);
}

.edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* Property Panel Additional Styles */
.property-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.property-row:last-child {
    border-bottom: none;
}

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

.property-value {
    font-size: 13px;
    color: var(--text-primary);
    font-family: monospace;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-badge {
    display: inline-block;
    padding: 4px 8px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    font-family: monospace;
}

.classes-value {
    font-size: 11px;
    max-width: 160px;
}

.btn-edit-element,
.btn-delete-element {
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s;
}

.btn-edit-element:hover {
    background: var(--bg-light);
    border-color: var(--primary);
}

.btn-delete-element:hover {
    background: #fee;
    border-color: var(--danger);
    color: var(--danger);
}
/* ============================================================
   DRAFT TOOLBAR & PREVIEW (Tab 1: Contenu)
============================================================ */
#panel-content {
  display: none;
  flex-direction: column;
  height: calc(100vh - 56px); /* 100vh minus topbar */
  background: #f8fafc;
}
#panel-content.active {
  display: flex !important;
}

.draft-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  font-size: 13px;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 12px;
}

.dtb-left, .dtb-center, .dtb-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dtb-center {
  flex: 1;
  justify-content: center;
}

.dtb-tools {
  display: none;
  align-items: center;
  gap: 12px;
  background: #f1f5f9;
  padding: 6px 16px;
  border-radius: 8px;
}

.dtb-tools.active {
  display: flex;
}

.dtb-label {
  font-weight: 500;
  color: #475569;
}

.color-pick {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  background: none;
}
.color-pick::-webkit-color-swatch-wrapper { padding: 0; }
.color-pick::-webkit-color-swatch { border: none; border-radius: 3px; }

.dtb-sep {
  width: 1px;
  height: 20px;
  background: #cbd5e1;
  margin: 0 4px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-icon:hover { background: #e2e8f0; }

.num-input, .sel-input, .hex-input {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 13px;
  color: #1e293b;
}
.num-input { width: 60px; }
.sel-input { padding: 4px 24px 4px 8px; }

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #475569;
  font-weight: 500;
}

.badge-draft {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #d1fae5;
  color: #059669;
}

.btn-green {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}
.btn-green:hover { background: #059669; }

.btn-gray {
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}
.btn-gray:hover { background: #f1f5f9; }

/* Iframe container */
.draft-frame-wrap {
  flex: 1;
  padding: 24px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#draft-frame {
  width: 100%;
  max-width: 1400px;
  height: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* ============================================================
   DESIGN TAB & APP CARDS
============================================================ */
.panel-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 32px;
  max-width: 800px;
  margin: 32px auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.panel-card h2 {
  margin: 0 0 24px 0;
  font-size: 20px;
  color: #1e293b;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.color-row .hex-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
}
.color-row .btn-gray {
  padding: 8px 12px;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}
