/* ============================================================
   MON2EKAP — Admin Blog CSS — Design premium moderne
   Sidebar sombre, contenu clair, ergonomie maximale
   ============================================================ */

:root {
  /* Brand */
  --brand:          #243e59;
  --brand-dark:     #1a2f42;
  --brand-light:    #3a5a7a;
  /* Sidebar */
  --sidebar-bg:     #0d1b2a;
  --sidebar-hover:  rgba(255,255,255,0.07);
  --sidebar-active: rgba(36,62,89,0.9);
  --sidebar-border: rgba(255,255,255,0.06);
  --sidebar-text:   rgba(255,255,255,0.65);
  --sidebar-active-text: #ffffff;
  /* Content */
  --content-bg:     #f0f4f8;
  --card-bg:        #ffffff;
  --border:         #e2e8f0;
  --border-focus:   #243e59;
  /* Text */
  --text-main:      #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  /* Status */
  --success:        #10b981;
  --success-bg:     #ecfdf5;
  --warning:        #f59e0b;
  --warning-bg:     #fffbeb;
  --danger:         #ef4444;
  --danger-bg:      #fef2f2;
  --info:           #3b82f6;
  --info-bg:        #eff6ff;
  /* Misc */
  --radius-sm:      0.375rem;
  --radius-md:      0.625rem;
  --radius-lg:      1rem;
  --radius-xl:      1.25rem;
  --shadow-sm:      0 1px 3px rgb(0 0 0 / .06), 0 1px 2px rgb(0 0 0 / .06);
  --shadow-md:      0 4px 8px rgb(0 0 0 / .06), 0 2px 4px rgb(0 0 0 / .06);
  --shadow-lg:      0 10px 20px rgb(0 0 0 / .06), 0 4px 8px rgb(0 0 0 / .06);
  --transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w:      260px;
  --topbar-h:       64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--content-bg);
  height: 100%;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; transition: var(--transition); }
button { font-family: inherit; cursor: pointer; border: none; }

/* ── LAYOUT ──────────────────────────────────────────────── */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */

.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.admin-sidebar__brand {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.admin-sidebar__brand img {
  height: 32px;
  filter: brightness(0) invert(1);
}
.admin-sidebar__brand-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  line-height: 1;
}

.admin-sidebar__nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-sidebar__section {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  padding: 0.75rem 0.75rem 0.35rem;
  margin-top: 0.25rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.admin-nav-link:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,0.9);
}
.admin-nav-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.admin-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: #60a5fa;
  border-radius: 0 2px 2px 0;
}
.admin-nav-link svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}
.admin-nav-link.active svg,
.admin-nav-link:hover svg { opacity: 1; }

.admin-nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.admin-sidebar__footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--sidebar-border);
}
.admin-sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
}
.admin-sidebar__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.admin-sidebar__user-info { flex: 1; min-width: 0; }
.admin-sidebar__user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-sidebar__user-role {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
}
.admin-sidebar__logout {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.4);
  transition: var(--transition);
  flex-shrink: 0;
  background: none;
}
.admin-sidebar__logout:hover {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
}
.admin-sidebar__logout svg { width: 16px; height: 16px; }

/* ── MAIN CONTENT ────────────────────────────────────────── */

.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── TOPBAR ──────────────────────────────────────────────── */

.admin-topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-topbar__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-muted);
  transition: var(--transition);
}
.admin-topbar__toggle:hover { background: var(--content-bg); }
.admin-topbar__toggle svg { width: 20px; height: 20px; }

.admin-topbar__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.admin-topbar__spacer { flex: 1; }

.admin-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── CONTENT AREA ────────────────────────────────────────── */

.admin-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
}

/* ── PAGE HEADER ─────────────────────────────────────────── */

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.admin-page-header__text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}
.admin-page-header__text p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.admin-page-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── STATS CARDS ─────────────────────────────────────────── */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
}
.admin-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.admin-stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-stat-icon svg { width: 22px; height: 22px; }

.admin-stat-icon--blue   { background: var(--info-bg);    color: var(--info); }
.admin-stat-icon--green  { background: var(--success-bg); color: var(--success); }
.admin-stat-icon--amber  { background: var(--warning-bg); color: var(--warning); }
.admin-stat-icon--red    { background: var(--danger-bg);  color: var(--danger); }

.admin-stat-body {}
.admin-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}
.admin-stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── CARDS ───────────────────────────────────────────────── */

.admin-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.admin-card__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.admin-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}
.admin-card__body { padding: 1.5rem; }
.admin-card__body--flush { padding: 0; }

/* ── TABLE ───────────────────────────────────────────────── */

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.admin-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.875rem 1.25rem;
  background: var(--content-bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-main);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr {
  transition: var(--transition);
}
.admin-table tbody tr:hover {
  background: rgba(36,62,89,0.02);
}

.td-title {
  font-weight: 600;
  max-width: 280px;
}
.td-title a {
  color: var(--text-main);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.td-title a:hover { color: var(--brand); }

.td-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.td-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

/* ── BADGES ──────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge svg { width: 8px; height: 8px; }

.badge--published { background: var(--success-bg); color: #059669; }
.badge--draft     { background: var(--warning-bg); color: #d97706; }
.badge--new       { background: var(--info-bg);    color: #2563eb; }

/* ── BUTTONS ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(36,62,89,0.25);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(36,62,89,0.35);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(36,62,89,0.04);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
}
.btn-ghost:hover:not(:disabled) { background: var(--content-bg); color: var(--text-main); }

.btn-danger {
  background: var(--danger-bg);
  border-color: transparent;
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,0.2);
}
.btn-success:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
  transform: translateY(-1px);
  color: #fff;
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-sm svg { width: 14px; height: 14px; }

.btn-icon {
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  cursor: pointer;
}
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon:hover { border-color: var(--brand); color: var(--brand); background: rgba(36,62,89,0.04); }
.btn-icon--danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* ── FORMS ───────────────────────────────────────────────── */

.admin-form { display: flex; flex-direction: column; gap: 1.5rem; }

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

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

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.form-label .required {
  color: var(--danger);
  font-size: 0.85em;
}
.form-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}
.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.25rem;
}

.form-input,
.form-textarea,
.form-select {
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-main);
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  width: 100%;
  line-height: 1.5;
  outline: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36,62,89,0.1);
}
.form-input.is-error,
.form-textarea.is-error { border-color: var(--danger); }
.form-input.is-error:focus,
.form-textarea.is-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.char-counter {
  text-align: right;
  font-size: 0.72rem;
  color: var(--text-light);
  transition: color 0.2s;
}
.char-counter.warn { color: var(--warning); }
.char-counter.over { color: var(--danger); font-weight: 600; }

/* ── QUILL EDITOR ────────────────────────────────────────── */

.admin-editor-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.admin-editor-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36,62,89,0.1);
}
.ql-toolbar.ql-snow {
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  background: var(--content-bg);
  padding: 0.6rem 0.75rem;
}
.ql-container.ql-snow {
  border: none !important;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}
.ql-editor {
  min-height: 320px;
  padding: 1.25rem;
  color: var(--text-main);
  line-height: 1.75;
}
.ql-editor p { margin-bottom: 0.75rem; }
.ql-editor h2 { font-size: 1.3rem; font-weight: 700; margin: 1.5rem 0 0.75rem; }
.ql-editor h3 { font-size: 1.1rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.ql-editor a { color: var(--brand); text-decoration: underline; }
.ql-editor ul, .ql-editor ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.ql-editor blockquote {
  border-left: 3px solid var(--brand);
  padding: 0.5rem 1rem;
  background: rgba(36,62,89,0.04);
  margin: 1rem 0;
  color: var(--text-muted);
}

/* ── IMAGE UPLOAD ────────────────────────────────────────── */

.image-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--content-bg);
}
.image-upload-zone:hover,
.image-upload-zone.dragover {
  border-color: var(--brand);
  background: rgba(36,62,89,0.04);
}
.image-upload-zone input[type="file"] {
  display: none;
}
.image-upload-zone__icon {
  width: 48px; height: 48px;
  margin: 0 auto 0.75rem;
  color: var(--text-light);
}
.image-upload-zone__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.image-upload-zone__text strong { color: var(--brand); }
.image-upload-zone__hint {
  font-size: 0.75rem;
  color: var(--text-light);
}

.image-preview-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.image-preview-wrap img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}
.image-preview__remove {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}
.image-preview__remove:hover { background: var(--danger); }
.image-preview__remove svg { width: 14px; height: 14px; }

/* ── ALERTS ──────────────────────────────────────────────── */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.05rem; }
.alert strong { font-weight: 600; }
.alert--success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert--success svg { color: var(--success); }
.alert--error   { background: var(--danger-bg);  color: #991b1b; border: 1px solid #fecaca; }
.alert--error svg   { color: var(--danger); }
.alert--warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert--warning svg { color: var(--warning); }
.alert--info    { background: var(--info-bg);    color: #1e40af; border: 1px solid #bfdbfe; }
.alert--info svg    { color: var(--info); }

/* ── MODAL CONFIRM ───────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  transform: translateY(16px) scale(0.96);
  transition: var(--transition);
}
.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal__icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--danger-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.modal__icon svg { width: 24px; height: 24px; color: var(--danger); }
.modal__title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.modal__text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}
.modal__actions {
  display: flex;
  gap: 0.75rem;
}
.modal__actions .btn { flex: 1; justify-content: center; }

/* ── EMPTY STATE ─────────────────────────────────────────── */

.admin-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.admin-empty__icon {
  width: 60px; height: 60px;
  margin: 0 auto 1.25rem;
  color: var(--text-light);
}
.admin-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}
.admin-empty p { font-size: 0.875rem; }

/* ── LOGIN PAGE ──────────────────────────────────────────── */

.admin-login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a2f42 50%, #243e59 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.admin-login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.admin-login-box {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}
.admin-login-logo {
  text-align: center;
  margin-bottom: 0.5rem;
}
.admin-login-logo img { height: 40px; margin: 0 auto; }
.admin-login-badge {
  text-align: center;
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 2rem;
}
.admin-login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 0.4rem;
}
.admin-login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
}

.form-input-icon {
  position: relative;
}
/* Cibler uniquement le SVG icône direct (pas ceux dans le bouton toggle) */
.form-input-icon > svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-light);
  pointer-events: none;
  z-index: 1;
}
.form-input-icon .form-input {
  padding-left: 2.5rem;
}
/* Quand il y a un toggle (champ mot de passe) */
.form-input-icon:has(.password-toggle) .form-input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: var(--transition);
  z-index: 2;
}
.password-toggle:hover { color: var(--text-muted); }
.password-toggle svg { width: 16px; height: 16px; position: static; transform: none; }

/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 1024px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-topbar__toggle { display: flex; }
  .admin-content { padding: 1.25rem; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .admin-page-header { flex-direction: column; }
}

@media (max-width: 480px) {
  .admin-stats { grid-template-columns: 1fr; }
  .admin-login-box { padding: 1.75rem; }
  .modal__actions { flex-direction: column; }
}

/* ── SPINNER ─────────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── LEADS TABLE SPECIFICS ───────────────────────────────── */

.lead-phone {
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.82rem;
  background: var(--content-bg);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
}

/* ── SLUG PREVIEW ────────────────────────────────────────── */

.slug-preview {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.slug-preview strong { color: var(--text-muted); }

/* ── TOPBAR RIGHT ACTIONS ────────────────────────────────── */

.topbar-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.topbar-link:hover { background: var(--content-bg); color: var(--text-main); }
.topbar-link svg { width: 15px; height: 15px; }

/* ── IMAGE SLOTS (3 images par article) ──────────────────── */
/* ── IMAGE SLOTS — 3 colonnes ────────────────────────────── */
.img-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 720px) {
  .img-slots { grid-template-columns: 1fr; }
}

.img-slot {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* Badge de label (Principale / Image 2…) */
.img-slot__label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}
.img-slot__label .optional {
  font-weight: 400;
  text-transform: none;
  font-size: .7rem;
  color: var(--text-light);
}

/* Zone de dépôt */
.img-slot__zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 140px;
  padding: 1.5rem 1rem;
  background: #fff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  font-weight: normal;
  user-select: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  overflow: hidden;
}
.img-slot__zone::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(36,62,89,.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.img-slot__zone:hover,
.img-slot__zone.dragover {
  border-color: var(--primary-color);
  border-style: solid;
  box-shadow: 0 0 0 4px rgba(36,62,89,.08);
  background: #fafbff;
}
.img-slot__zone:hover::after { opacity: 1; }

/* Icône upload dans cercle */
.img-slot__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(36,62,89,.07);
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform .2s ease, background .2s ease;
}
.img-slot__zone:hover .img-slot__icon {
  background: rgba(36,62,89,.13);
  transform: scale(1.07) translateY(-1px);
}
.img-slot__icon svg { color: #243e59; }

.img-slot__cta {
  font-size: .82rem;
  font-weight: 600;
  color: var(--primary-color);
  pointer-events: none;
}
.img-slot__formats {
  font-size: .69rem;
  color: #94a3b8;
  pointer-events: none;
}

/* Input file masqué — guaranteed hidden cross-browser */
.img-slot__file-input {
  position: absolute !important;
  top: -1000px !important;
  left: -1000px !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
}

/* Aperçu de l'image uploadée */
.img-slot__preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.img-slot__preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: #f8fafc;
}
.img-slot__remove {
  position: absolute;
  top: .4rem; right: .4rem;
  width: 26px; height: 26px;
  background: rgba(239,68,68,.9);
  backdrop-filter: blur(4px);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s, transform .15s;
  z-index: 3;
}
.img-slot__remove:hover { background: #dc2626; transform: scale(1.12); }

/* Champ alt */
.img-slot__alt {
  font-size: .78rem !important;
  padding: .45rem .65rem !important;
  border-radius: 8px !important;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}
.img-slot__alt:focus {
  border-color: var(--primary-color) !important;
  background: #fff !important;
}

/* Note bas de section */
.img-count-note {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .76rem;
  color: var(--text-muted);
  padding: .5rem .75rem;
  background: #f1f5f9;
  border-radius: 8px;
  margin-top: .25rem;
}
