/* ============================================================
   OPTIC OUSSAMA — Espace Pro (admin)
   ============================================================ */

/* Sécurité : un élément [hidden] doit TOUJOURS être caché,
   même si une règle .display quelque part cible le même élément. */
[hidden] { display: none !important; }

.pro-body {
  background: var(--cream);
  min-height: 100vh;
}

/* ===== Header ===== */
.pro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.pro-header a.pro-logo {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.pro-header a.pro-logo strong { color: var(--gold); }
.pro-header-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.pro-logout-btn {
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 9px 18px;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}
.pro-logout-btn:hover { background: var(--gold); color: var(--white); border-color: var(--gold); }

/* ===== Login screen ===== */
.pro-login-screen {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pro-login-card {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px;
  text-align: center;
}
.pro-login-card .pro-lock-icon { font-size: 2.2rem; margin-bottom: 10px; }
.pro-login-card h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.pro-login-card p.pro-login-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 26px;
}
.pro-field { text-align: left; margin-bottom: 8px; }
.pro-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
}
.pro-password-wrap { position: relative; }
.pro-password-wrap input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--cream);
}
.pro-password-wrap input:focus { outline: none; border-color: var(--gold); }
.pro-toggle-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  padding: 6px 8px;
  line-height: 1;
  color: var(--text-muted);
}
.pro-capslock-warning {
  color: #B8860B;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  margin: 8px 0 0;
}
.pro-login-error {
  color: #C0392B;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  min-height: 18px;
  margin: 10px 0 0;
}
.pro-login-submit {
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  border: none;
  border-radius: 50px;
  background: var(--gold);
  color: var(--white);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
}
.pro-login-submit:hover { background: var(--gold-dark); }

/* ===== Dashboard ===== */
.pro-dashboard { max-width: 1100px; margin: 0 auto; padding: 28px 20px 80px; }

.pro-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  padding: 9px 18px;
  border-radius: 50px;
  text-decoration: none;
  margin-bottom: 20px;
  transition: var(--transition);
}
.pro-back-btn:hover { background: var(--gold); color: var(--white); border-color: var(--gold); }

.pro-tabs, .pro-subtabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.pro-tab, .pro-subtab {
  border: 1px solid var(--gold-border);
  background: var(--white);
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.86rem;
  padding: 9px 18px;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}
.pro-tab.active, .pro-subtab.active {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.pro-tab:hover, .pro-subtab:hover { border-color: var(--gold); }

.pro-section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 24px 0 14px;
}

.pro-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: var(--text);
  color: var(--white);
  font-weight: 600;
  font-size: 0.86rem;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  margin-bottom: 18px;
  transition: var(--transition);
}
.pro-add-btn:hover { background: var(--gold-dark); }

/* Product list */
.pro-product-list { display: flex; flex-direction: column; gap: 10px; }
.pro-product-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.pro-product-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gold-bg);
}
.pro-product-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg,#FDF6E3 0%,#E8D5A3 100%);
}
.pro-product-info { flex: 1; min-width: 0; }
.pro-product-info .pro-p-name { font-weight: 600; font-size: 0.94rem; }
.pro-product-info .pro-p-meta { font-size: 0.8rem; color: var(--text-muted); }
.pro-product-badges { display: flex; gap: 6px; margin-top: 4px; }
.pro-badge-mini {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  background: var(--gold-bg);
  color: var(--gold-dark);
}
.pro-product-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pro-btn-edit, .pro-btn-delete {
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}
.pro-btn-edit:hover { border-color: var(--gold); color: var(--gold-dark); }
.pro-btn-delete { color: #C0392B; }
.pro-btn-delete:hover { background: #C0392B; color: var(--white); border-color: #C0392B; }

.pro-empty-list {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* ===== Form ===== */
.pro-form-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 28px;
}
.pro-form-panel h2 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 18px; }
.pro-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pro-form-grid .pro-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .pro-form-grid { grid-template-columns: 1fr; } }

.pro-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
}
.pro-form-group input[type="text"],
.pro-form-group input[type="number"],
.pro-form-group select,
.pro-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--cream);
}
.pro-form-group input:focus, .pro-form-group select:focus, .pro-form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.pro-form-group textarea { resize: vertical; min-height: 70px; }
.pro-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-light);
  font-weight: 500;
}
.pro-checkbox-row input { width: 16px; height: 16px; accent-color: var(--gold); }

.pro-photo-upload {
  border: 1.5px dashed var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--gold-bg);
}
.pro-photo-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.pro-photo-thumb { position: relative; width: 72px; height: 72px; }
.pro-photo-thumb img {
  width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-xs);
  border: 1px solid var(--gold-border);
}
.pro-photo-thumb.cover img { border: 2px solid var(--gold); }
.pro-photo-thumb .pro-cover-tag {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: var(--white); font-size: 0.6rem; font-weight: 700;
  padding: 1px 6px; border-radius: 50px; white-space: nowrap;
}
.pro-photo-thumb .pro-remove-photo {
  position: absolute; top: -7px; right: -7px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #C0392B; color: #fff; border: 2px solid var(--white);
  font-size: 0.7rem; line-height: 1; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}

/* Variants */
.pro-variants-toggle {
  background: none; border: none; color: var(--gold-dark); font-weight: 600;
  font-size: 0.86rem; cursor: pointer; padding: 4px 0; text-decoration: underline;
}
.pro-variant-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 12px;
  background: var(--cream);
}
.pro-variant-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pro-variant-remove {
  background: none; border: none; color: #C0392B; font-weight: 600; font-size: 0.8rem; cursor: pointer;
}
.pro-variant-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.pro-color-input { width: 48px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-xs); cursor: pointer; }

.pro-form-actions { display: flex; gap: 12px; margin-top: 22px; }
.pro-btn-save {
  border: none; background: var(--gold); color: var(--white); font-weight: 700;
  font-size: 0.9rem; padding: 12px 28px; border-radius: 50px; cursor: pointer; transition: var(--transition);
}
.pro-btn-save:hover { background: var(--gold-dark); }
.pro-btn-cancel {
  border: 1px solid var(--border); background: var(--white); color: var(--text-light);
  font-weight: 600; font-size: 0.9rem; padding: 12px 24px; border-radius: 50px; cursor: pointer;
}
.pro-form-msg { font-size: 0.85rem; font-weight: 600; margin-top: 10px; }
.pro-form-msg.ok { color: #2E7D32; }
.pro-form-msg.err { color: #C0392B; }
