/* ============================================
   GMP Beauty Concept — Espace Client
   Style principal
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  /* Bleu-gris GMP */
  --rose:        #263B78;
  --rose-dark:   #1A2D5E;
  --rose-light:  #EBF0FA;
  --rose-mid:    #6B85BE;
  --gold:        #3D5A9E;
  --gold-light:  #EBF0FA;
  --dark:        #1A2340;
  --dark2:       #222E52;
  --text:        #2C3560;
  --muted:       #6B7BA8;
  --border:      rgba(0,0,0,0.09);
  --bg:          #F4F6FB;
  --white:       #FFFFFF;
  --sidebar-w:   240px;
  --success:     #1D9E75;
  --danger:      #E24B4A;
  --warning:     #BA7517;
}

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

html { font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rose-mid); border-radius: 10px; }

/* ============================================
   LAYOUT
   ============================================ */

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

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo .brand {
  font-family: 'Cormorant Garamond', serif;
  color: white;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.sidebar-logo .brand span { color: var(--rose-mid); }

.sidebar-logo .sub {
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar-user {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--rose);
  color: white;
  font-size: 12px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.user-name { color: white; font-size: 12px; font-weight: 500; }
.user-company { color: rgba(255,255,255,0.65); font-size: 10px; }

.nav { flex: 1; padding: 14px 10px; }

.nav-section { margin-bottom: 20px; }

.nav-section-label {
  color: rgba(255,255,255,0.50);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  text-decoration: none;
}

.nav-item:hover { background: rgba(255,255,255,0.10); color: white; }

.nav-item.active {
  background: rgba(38,59,120,0.25);
  color: white;
}

.nav-item .nav-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 1;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  background: var(--rose);
  color: white;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s;
}

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

/* ============================================
   MAIN CONTENT
   ============================================ */

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--dark);
}

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

.content { padding: 28px; flex: 1; max-width: 1100px; }

/* ============================================
   COMPONENTS
   ============================================ */

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-banner h2 {
  font-family: 'Cormorant Garamond', serif;
  color: white;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.welcome-banner p { color: rgba(255,255,255,0.85); font-size: 13px; }

.welcome-pill {
  background: rgba(38,59,120,0.25);
  border: 1px solid rgba(38,59,120,0.4);
  color: var(--rose-mid);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 500; color: var(--dark); line-height: 1; }
.stat-sub { font-size: 11px; color: var(--rose); margin-top: 4px; }

/* Section title */
.section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Device Cards */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.device-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.device-card:hover {
  border-color: var(--rose);
  transform: translateY(-2px);
}

.device-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--rose-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.device-name { font-size: 13px; font-weight: 500; color: var(--dark); margin-bottom: 3px; }
.device-cat { font-size: 11px; color: var(--muted); }

.device-meta {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.device-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--rose-light);
  color: var(--rose-dark);
}

/* News Items */
.news-list { display: flex; flex-direction: column; gap: 14px; }

.news-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.news-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rose);
  margin-top: 6px;
  flex-shrink: 0;
}

.news-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--rose-light);
  color: var(--rose-dark);
  margin-bottom: 6px;
  font-weight: 500;
}

.news-tag.gold { background: var(--gold-light); color: var(--gold); }
.news-tag.teal { background: #E1F5EE; color: #0F6E56; }

.news-title { font-size: 14px; font-weight: 500; color: var(--dark); margin-bottom: 5px; }
.news-body { font-size: 12px; color: var(--muted); line-height: 1.6; }
.news-date { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* Technology Page */
.tech-header {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.tech-icon-lg {
  width: 54px; height: 54px;
  border-radius: 12px;
  background: var(--rose-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.tech-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}

.tech-sub { font-size: 12px; color: var(--muted); }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'DM Sans', sans-serif;
}

.tab-btn:hover { color: var(--rose); }
.tab-btn.active { color: var(--rose); border-bottom-color: var(--rose); }

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

/* Resource Grid */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.resource-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s;
  text-decoration: none;
  color: inherit;
}

.resource-item:hover { border-color: var(--rose); }

.res-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--rose-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.res-name { font-size: 13px; font-weight: 500; color: var(--dark); }
.res-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.res-dl { margin-left: auto; font-size: 12px; color: var(--rose); font-weight: 500; white-space: nowrap; }

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.video-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.video-thumb {
  background: var(--dark);
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.play-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(200,99,122,0.9);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 15px;
}

.video-embed { padding: 0; position: relative; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; display: block; }
.video-embed:not([style*="aspect-ratio"]) { aspect-ratio: 16/9; }

.video-info { padding: 12px 14px; }
.video-title { font-size: 12px; font-weight: 500; color: var(--dark); }
.video-duration { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Alert Box */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 12px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-info { background: var(--rose-light); color: var(--rose-dark); border: 1px solid #F4C0D1; }
.alert-success { background: #E1F5EE; color: #0F6E56; border: 1px solid #9FE1CB; }

/* Buttons */
.btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-weight: 500;
}

.btn-primary { background: var(--rose); color: white; }
.btn-primary:hover { background: var(--rose-dark); }

.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-outline:hover { border-color: var(--rose); color: var(--rose); }

.btn-danger { background: var(--danger); color: white; font-size: 11px; padding: 5px 12px; }
.btn-success { background: var(--success); color: white; font-size: 11px; padding: 5px 12px; }
.btn-sm { font-size: 11px; padding: 5px 12px; }

/* Admin Table */
.admin-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

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

.admin-card-title { font-size: 14px; font-weight: 500; color: var(--dark); }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* Neutraliser l'effet tbody sur les divs appareils */
#appareils-section div { border-bottom: none !important; }
#appareils-section div:hover { background: inherit !important; }

.status-badge {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.status-active { background: #E1F5EE; color: #0F6E56; }
.status-revoked { background: #FFEBEE; color: #C62828; }

/* Form */
.form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.form-title { font-size: 15px; font-weight: 500; color: var(--dark); margin-bottom: 18px; }

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

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus { border-color: var(--rose); }

.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox-item input[type="checkbox"] { accent-color: var(--rose); width: 14px; height: 14px; }

/* Flash Messages */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.flash-success { background: #E1F5EE; color: #0F6E56; border: 1px solid #9FE1CB; }
.flash-error { background: #FFEBEE; color: #C62828; border: 1px solid #F7C1C1; }

/* Mobile hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--dark);
  font-size: 22px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
}

.login-logo span { color: var(--rose); }

.login-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 30px;
}

.login-card .form-group { text-align: left; }

.login-card .form-group input {
  padding: 11px 14px;
  font-size: 14px;
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--rose);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  font-weight: 500;
  margin-top: 8px;
  transition: background 0.15s;
}

.btn-login:hover { background: var(--rose-dark); }

.login-footer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 20px;
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: block; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .devices-grid { grid-template-columns: repeat(2, 1fr); }
  .resource-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
}

@media (max-width: 500px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .devices-grid { grid-template-columns: 1fr; }
  .welcome-banner { flex-direction: column; gap: 12px; align-items: flex-start; }
}
