/* ============================================================
   Puy du Rêve — Intranet — Design system partagé
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@500;600;700&family=Montserrat:wght@400;500;600;700&display=swap');

:root{
  --cream:        #FBF3E9;
  --cream-soft:    #F7ECDD;
  --white:        #FFFFFF;
  --text:         #201a12;
  --text-muted:   #7a7266;
  --gold:         #C9A063;
  --gold-dark:    #B4874A;
  --gold-pale:    #F3E3C9;
  --border:       #ECE1CD;
  --danger:       #C0392B;
  --success:      #1F8A3D;
  --warning:      #A9750C;
  --discord:      #5865F2;
  --radius:       14px;
  --radius-sm:    10px;
  --shadow:       0 4px 18px rgba(60,40,10,0.06);
  --shadow-lg:    0 20px 50px rgba(40,25,5,0.12);
}

*{box-sizing:border-box;margin:0;padding:0;}
html,body{
  min-height:100%;
  font-family:'Montserrat',sans-serif;
  color:var(--text);
  background:var(--cream);
}
a{color:inherit;}
img{max-width:100%;}

/* ============ LAYOUT GENERAL ============ */
.app{
  display:flex;
  min-height:100vh;
  position:relative;
}

/* Silhouette décorative (le même "personnage aux ronds" que sur la page de
   connexion), posée en filigrane derrière le contenu de TOUTES les pages.
   Très discrète (faible opacité), purement décorative, ne capte jamais le clic. */
.app-bg-shape{
  position:fixed;right:-90px;bottom:-70px;width:480px;height:480px;
  opacity:.05;z-index:0;pointer-events:none;
}
.app-bg-shape.top{right:auto;left:-100px;bottom:auto;top:-80px;width:360px;height:360px;opacity:.04;}
.sidebar,.main{position:relative;z-index:1;}

/* Fond assombri affiché derrière le menu quand il est ouvert en mobile */
.sidebar-overlay{
  display:none;position:fixed;inset:0;background:rgba(15,10,4,.5);
  z-index:150;backdrop-filter:blur(1px);
}
.sidebar-overlay.open{display:block;}
body.no-scroll{overflow:hidden;}

/* ============ SIDEBAR ============ */
.sidebar{
  width:260px;
  flex-shrink:0;
  background:var(--white);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  padding:28px 22px;
  position:sticky;
  top:0;
  height:100vh;
}
.sidebar .logo{
  margin-bottom:36px;
  padding-left:4px;
}
.sidebar .logo img{height:44px;display:block;margin-bottom:2px;}
.sidebar .logo-fallback{
  font-family:'Lora',serif;
  font-size:24px;
  font-weight:600;
  line-height:1;
}
.sidebar .logo-fallback small{
  display:block;
  font-family:'Montserrat',sans-serif;
  font-size:11px;
  font-weight:500;
  letter-spacing:2px;
  color:var(--text-muted);
  text-transform:uppercase;
  margin-top:4px;
}

.nav{list-style:none;display:flex;flex-direction:column;gap:4px;}
.nav a{
  display:flex;align-items:center;gap:13px;
  padding:12px 14px;
  border-radius:10px;
  text-decoration:none;
  color:var(--text);
  font-size:14.5px;
  font-weight:500;
  border-left:3px solid transparent;
  transition:background .15s ease, border-color .15s ease;
}
.nav a i{width:18px;text-align:center;color:var(--text-muted);font-size:15px;}
.nav a:hover{background:var(--cream-soft);}
.nav a.active{
  background:var(--gold-pale);
  border-left:3px solid var(--gold-dark);
  font-weight:600;
}
.nav a.active i{color:var(--gold-dark);}

.sidebar .admin-block{
  margin-top:auto;
  padding-top:18px;
}
.sidebar .admin-block h4{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:1px;
  color:var(--text-muted);
  font-weight:700;
  margin:0 0 4px 14px;
}
.sidebar .admin-block small{
  display:block;
  font-size:11px;
  color:var(--text-muted);
  margin:0 0 10px 14px;
}

/* ============ MAIN / TOPBAR ============ */
.main{flex:1;min-width:0;padding:34px 44px 60px;}
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:16px;
  margin-bottom:30px;
}
.topbar h1{
  font-size:28px;font-weight:600;
}
.topbar h1 b{font-weight:700;}
.topbar .datebox{
  display:inline-flex;align-items:center;gap:10px;
  background:var(--white);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 18px;
  font-size:13.5px;
  color:var(--text);
  box-shadow:var(--shadow);
  text-decoration:none;
  cursor:pointer;
  transition:border-color .15s ease,transform .15s ease;
}
.topbar .datebox:hover{border-color:var(--gold-dark);transform:translateY(-1px);}
.topbar .datebox i{color:var(--gold-dark);}

/* Boutons mobiles du topbar (menu + accueil), regroupés à gauche */
.topbar-mobile-actions{display:flex;align-items:center;gap:10px;flex-shrink:0;}
.mobile-home{
  display:none;align-items:center;justify-content:center;
  width:42px;height:42px;border-radius:10px;background:#fff;border:1px solid var(--border);
  cursor:pointer;font-size:17px;flex-shrink:0;color:var(--text);text-decoration:none;
}
.mobile-home:hover{border-color:var(--gold-dark);color:var(--gold-dark);}

/* ============ CARDS ============ */
.card{
  background:var(--white);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card-pad{padding:32px;}

.info-card{padding:32px 36px;margin-bottom:34px;}
.info-card h2{
  font-size:13px;letter-spacing:1.5px;text-transform:uppercase;
  color:var(--gold-dark);font-weight:700;
  display:inline-block;
  border-bottom:2px solid var(--gold-dark);
  padding-bottom:6px;
  margin-bottom:18px;
}
.info-card p{line-height:1.75;color:var(--text);font-size:15px;margin-bottom:12px;}
.info-card ul{margin:6px 0 12px 20px;font-size:15px;line-height:1.8;}

/* ============ QUICK ACTION GRID (dashboard) ============ */
.quick-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:22px;
}
.quick-card{
  background:var(--white);border:1px solid var(--border);border-radius:var(--radius);
  padding:28px 26px;box-shadow:var(--shadow);
  transition:transform .2s ease, box-shadow .2s ease;
}
.quick-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-lg);}
.quick-card .icon{
  width:56px;height:56px;border-radius:50%;
  background:var(--gold-pale);color:var(--gold-dark);
  display:flex;align-items:center;justify-content:center;
  font-size:22px;margin-bottom:18px;
}
.quick-card h3{font-size:17px;font-weight:700;margin-bottom:8px;}
.quick-card p{font-size:13.5px;color:var(--text-muted);line-height:1.6;margin-bottom:18px;}
.btn-outline{
  display:inline-flex;align-items:center;gap:8px;
  border:1.5px solid var(--gold-dark);color:var(--gold-dark);
  background:transparent;padding:9px 18px;border-radius:8px;
  font-size:13px;font-weight:600;text-decoration:none;
  transition:all .2s ease;
}
.btn-outline:hover{background:var(--gold-dark);color:#fff;}

/* ============ EMPTY STATE ============ */
.empty-state{
  text-align:center;padding:70px 20px;color:var(--text-muted);
}
.empty-state .icon-circle{
  width:88px;height:88px;border-radius:50%;
  background:var(--gold-pale);color:var(--gold-dark);
  display:flex;align-items:center;justify-content:center;
  font-size:34px;margin:0 auto 22px;
}
.empty-state h3{font-size:18px;font-weight:700;color:var(--text);margin-bottom:8px;}
.empty-state p{font-size:14px;max-width:420px;margin:0 auto;line-height:1.6;}

/* ============ TABS ============ */
.tabs{display:flex;gap:28px;border-bottom:1px solid var(--border);margin-bottom:0;}
.tabs a{
  padding:14px 2px;font-size:14.5px;font-weight:600;color:var(--text-muted);
  text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px;
}
.tabs a.active{color:var(--text);border-color:var(--gold-dark);}

/* ============ FORMS ============ */
label.field-label{
  display:block;font-size:12.5px;font-weight:700;text-transform:uppercase;
  letter-spacing:.6px;color:var(--text-muted);margin-bottom:8px;
}
.field-group{margin-bottom:22px;}
input[type=text],input[type=email],input[type=password],input[type=date],
textarea,select{
  width:100%;padding:13px 15px;border:1.5px solid var(--border);
  border-radius:10px;font-family:'Montserrat',sans-serif;font-size:14.5px;
  background:var(--cream-soft);color:var(--text);
  transition:border-color .2s ease, background .2s ease;
}
input:focus,textarea:focus,select:focus{
  outline:none;border-color:var(--gold-dark);background:#fff;
}
textarea{resize:vertical;min-height:110px;}

.btn-primary{
  width:100%;background:linear-gradient(135deg,var(--gold),var(--gold-dark));
  color:#fff;border:none;padding:15px;border-radius:10px;
  font-weight:700;font-size:14.5px;letter-spacing:.5px;cursor:pointer;
  transition:filter .2s ease, transform .2s ease;
}
.btn-primary:hover{filter:brightness(1.05);transform:translateY(-1px);}
.btn-primary:disabled{opacity:.6;cursor:not-allowed;}

.btn-discord{
  width:100%;display:flex;align-items:center;justify-content:center;gap:10px;
  background:var(--discord);color:#fff;border:none;padding:15px;
  border-radius:10px;font-weight:700;font-size:14.5px;text-decoration:none;
  transition:filter .2s ease;
}
.btn-discord:hover{filter:brightness(1.08);}

.btn-danger-outline{
  border:1.5px solid var(--danger);color:var(--danger);background:transparent;
  padding:8px 14px;border-radius:8px;font-size:12.5px;font-weight:600;cursor:pointer;
}
.btn-danger-outline:hover{background:var(--danger);color:#fff;}

/* ============ TABLES ============ */
.table-wrap{border:1px solid var(--border);border-radius:var(--radius);overflow-x:auto;-webkit-overflow-scrolling:touch;background:#fff;}
table{width:100%;border-collapse:collapse;min-width:560px;}
thead{background:var(--cream-soft);}
th{
  padding:16px 20px;text-align:left;font-size:11.5px;text-transform:uppercase;
  letter-spacing:1px;color:var(--text-muted);font-weight:700;
}
td{padding:16px 20px;border-top:1px solid var(--border);font-size:14px;}
tbody tr:hover{background:var(--cream-soft);}

.badge{
  display:inline-flex;align-items:center;gap:6px;padding:5px 14px;border-radius:20px;
  font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;
}
.badge-success{background:#E7F6EA;color:var(--success);}
.badge-warning{background:#FDF1DD;color:var(--warning);}
.badge-danger{background:#FBEAE8;color:var(--danger);}
.badge-muted{background:#F0EEE9;color:var(--text-muted);}

/* ============ ALERTS ============ */
.alert{
  display:flex;align-items:flex-start;gap:14px;padding:18px 22px;border-radius:10px;
  border-left:4px solid;margin-bottom:26px;font-size:14px;line-height:1.5;
}
.alert i{font-size:19px;margin-top:1px;}
.alert-success{background:#EAF7ED;border-color:var(--success);color:#1c6b30;}
.alert-error{background:#FBEAE8;border-color:var(--danger);color:#9c2c20;}
.alert-warning{background:#FDF1DD;border-color:var(--warning);color:#8a5c09;}

/* ============ STAT CARDS (admin) ============ */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:20px;margin-bottom:30px;}
.stat-card{
  background:#fff;border:1px solid var(--border);border-radius:var(--radius);
  padding:24px 26px;display:flex;align-items:center;gap:18px;box-shadow:var(--shadow);
}
.stat-card .icon{
  width:52px;height:52px;border-radius:50%;background:var(--gold-pale);color:var(--gold-dark);
  display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0;
}
.stat-card h3{font-size:26px;font-weight:700;}
.stat-card p{font-size:12px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.6px;}

/* ============ LOGIN PAGE ============ */
.login-page{
  min-height:100vh;position:relative;background:var(--cream);
  display:flex;flex-direction:column;
  overflow:hidden;
}
.login-page::before{
  content:"";position:absolute;left:0;bottom:0;width:55%;height:70%;
  background:url('https://puydureve.fr/assets/spectacle/spectacle3.jpg') left bottom/cover no-repeat;
  opacity:.07;z-index:0;pointer-events:none;
  mask-image:linear-gradient(to top right, black 30%, transparent 75%);
  -webkit-mask-image:linear-gradient(to top right, black 30%, transparent 75%);
}
.login-page .topline{
  display:flex;justify-content:space-between;align-items:flex-start;
  padding:32px 48px;position:relative;z-index:2;font-size:14px;
}
.login-page .topline .date-time{text-align:right;line-height:1.5;color:var(--text);}
.login-page .bg-shape{
  position:absolute;right:-60px;top:20%;width:520px;height:520px;
  opacity:.5;z-index:0;pointer-events:none;
}
.login-wrap{
  flex:1;display:flex;align-items:center;justify-content:center;
  position:relative;z-index:2;padding:20px;
}
.login-card{
  width:100%;max-width:480px;background:#fff;border-radius:16px;
  padding:48px 44px 38px;box-shadow:var(--shadow-lg);
}
.login-card .brand{text-align:center;margin-bottom:36px;}
.login-card .brand img{height:56px;margin-bottom:6px;}
.login-card .brand .brand-fallback{font-family:'Lora',serif;font-size:30px;font-weight:600;}
.login-card .brand small{
  display:block;font-size:12px;letter-spacing:2px;text-transform:uppercase;
  color:var(--text-muted);margin-top:6px;
}
.login-card .divider{
  display:flex;align-items:center;gap:14px;margin:22px 0;color:var(--text-muted);font-size:12.5px;
}
.login-card .divider::before,.login-card .divider::after{content:"";flex:1;height:1px;background:var(--border);}
.login-footer{text-align:center;padding:26px;font-size:13px;color:var(--text-muted);position:relative;z-index:2;}
.login-footer a{color:var(--gold-dark);font-weight:600;text-decoration:none;}
.login-footer a:hover{text-decoration:underline;}
/* Conteneur relatif autour du SEUL champ input (pas du label) : les icônes
   se centrent ainsi toujours sur le champ, quelle que soit la hauteur du
   label ou la présence d'un message d'erreur au-dessus. */
.input-box{position:relative;display:flex;align-items:center;}
.input-box i.leading{
  position:absolute;left:15px;top:50%;transform:translateY(-50%);
  color:var(--text-muted);font-size:14.5px;pointer-events:none;line-height:1;
}
.input-box input{padding-left:42px;}
.input-box.password-wrap input{padding-right:42px;}
.input-box.password-wrap button{
  position:absolute;right:12px;top:50%;transform:translateY(-50%);
  background:none;border:none;color:var(--text-muted);cursor:pointer;
  font-size:15px;line-height:1;padding:4px;display:flex;align-items:center;justify-content:center;
}

/* ============ MODAL ============ */
.modal-overlay{
  display:none;position:fixed;inset:0;background:rgba(20,15,5,.55);
  align-items:center;justify-content:center;z-index:1000;padding:20px;
}
.modal-overlay.open{display:flex;}
.modal-box{
  background:#fff;border-radius:14px;padding:36px;max-width:560px;width:100%;
  box-shadow:var(--shadow-lg);position:relative;max-height:90vh;overflow-y:auto;
}
.modal-box .close-x{
  position:absolute;top:16px;right:20px;background:none;border:none;
  font-size:22px;color:var(--text-muted);cursor:pointer;
}
.modal-box h2{font-family:'Lora',serif;font-size:24px;margin-bottom:20px;}
.modal-box p{margin-bottom:10px;font-size:14.5px;color:var(--text);line-height:1.6;}

/* ============ NOTIFICATION "NOUVELLE INFO" (façon Pronote) ============ */
.notif-banner{
  display:flex;align-items:center;gap:18px;
  background:linear-gradient(135deg,var(--gold),var(--gold-dark));
  color:#fff;border-radius:var(--radius);padding:20px 26px;
  margin-bottom:30px;box-shadow:var(--shadow-lg);text-decoration:none;
}
.notif-banner .bell{
  width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.22);
  display:flex;align-items:center;justify-content:center;font-size:19px;flex-shrink:0;
  position:relative;
}
.notif-banner .bell .dot{
  position:absolute;top:-2px;right:-2px;width:13px;height:13px;border-radius:50%;
  background:var(--danger);border:2px solid var(--gold-dark);
  animation:pdrPulse 1.6s infinite;
}
@keyframes pdrPulse{
  0%{box-shadow:0 0 0 0 rgba(192,57,43,.55);}
  70%{box-shadow:0 0 0 8px rgba(192,57,43,0);}
  100%{box-shadow:0 0 0 0 rgba(192,57,43,0);}
}
.notif-banner strong{display:block;font-size:15.5px;margin-bottom:2px;}
.notif-banner span{font-size:13px;opacity:.92;}
.notif-banner .go{margin-left:auto;font-size:13px;font-weight:700;white-space:nowrap;display:flex;align-items:center;gap:8px;}

/* Petit point rouge sur l'élément de nav "Actualités" quand il y a du nouveau */
.nav a{position:relative;}
.nav-dot{
  width:8px;height:8px;border-radius:50%;background:var(--danger);
  margin-left:auto;flex-shrink:0;
}

/* ============ ACTUALITÉS ============ */
.news-grid{display:flex;flex-direction:column;gap:24px;}
.news-card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;}
.news-card .news-media img,
.news-card .news-media video{width:100%;max-height:420px;object-fit:cover;display:block;background:#000;}
.news-card .news-media{position:relative;}
.news-card .news-media iframe{width:100%;aspect-ratio:16/9;border:0;display:block;}
.news-card .news-body{padding:26px 30px 30px;}
.news-card h2{font-family:'Lora',serif;font-size:21px;font-weight:600;margin-bottom:6px;}
.news-card .news-meta{font-size:12.5px;color:var(--text-muted);margin-bottom:16px;display:flex;align-items:center;gap:8px;}
.news-card .news-content{font-size:14.5px;line-height:1.75;color:var(--text);}
.news-content p{margin-bottom:12px;}
.news-content img{max-width:100%;border-radius:8px;margin:10px 0;}
.news-content a{color:var(--gold-dark);text-decoration:underline;}
.news-content ul,.news-content ol{margin:8px 0 12px 22px;}
.news-content h1,.news-content h2,.news-content h3{font-family:'Lora',serif;margin:16px 0 8px;}

/* Éditeur riche (Quill) — habillage aux couleurs de l'intranet */
.pdr-editor-wrap{border:1.5px solid var(--border);border-radius:10px;overflow:hidden;background:#fff;}
.pdr-editor-wrap .ql-toolbar{background:var(--cream-soft);border:none;border-bottom:1.5px solid var(--border);font-family:'Montserrat',sans-serif;}
.pdr-editor-wrap .ql-container{border:none;font-family:'Montserrat',sans-serif;font-size:14.5px;min-height:220px;}
.pdr-editor-wrap .ql-editor{min-height:220px;}

.news-admin-item{border:1px solid var(--border);border-radius:var(--radius);padding:20px 24px;margin-bottom:16px;background:#fff;}
.news-admin-item .row{display:flex;align-items:center;gap:14px;justify-content:space-between;flex-wrap:wrap;}
.news-admin-item h4{font-family:'Lora',serif;font-size:17px;}
.news-admin-item .meta{font-size:12px;color:var(--text-muted);margin-top:2px;}
.news-admin-item details{margin-top:16px;}
.news-admin-item .thumb{width:64px;height:64px;border-radius:8px;object-fit:cover;background:var(--cream-soft);flex-shrink:0;}

.radio-pill-group{display:flex;gap:10px;flex-wrap:wrap;}
.radio-pill{
  border:1.5px solid var(--border);border-radius:8px;padding:9px 16px;font-size:13px;
  cursor:pointer;font-weight:600;color:var(--text-muted);background:var(--cream-soft);
}
.radio-pill input{display:none;}
.radio-pill.checked{border-color:var(--gold-dark);background:var(--gold-pale);color:var(--gold-dark);}

/* ============ RESPONSIVE ============ */
@media(max-width:960px){
  .sidebar{
    position:fixed;left:0;top:0;bottom:0;z-index:200;
    transform:translateX(-100%);transition:transform .25s ease;
    width:280px;box-shadow:var(--shadow-lg);
  }
  .sidebar.open{transform:translateX(0);}
  .main{padding:22px 20px 50px;}
  .mobile-toggle{display:inline-flex;}
  .mobile-home{display:inline-flex;}
  .topbar h1{font-size:24px;}
  .datebox-time{display:none;}
}
.mobile-toggle{
  display:none;align-items:center;justify-content:center;
  width:42px;height:42px;border-radius:10px;background:#fff;border:1px solid var(--border);
  cursor:pointer;font-size:17px;flex-shrink:0;
}

@media(max-width:768px){
  .card-pad{padding:22px;}
  .info-card{padding:24px 22px;}
  .stats-grid,.quick-grid,.news-grid{gap:16px;}
  .topbar{gap:12px;}
  .topbar .datebox{padding:8px 14px;font-size:12.5px;}
  .news-card .news-body{padding:20px 20px 24px;}
  .tabs{gap:0;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;flex-wrap:nowrap;}
  .tabs::-webkit-scrollbar{display:none;}
  .tabs a{padding:14px 12px;white-space:nowrap;}
  .modal-box{padding:26px 22px;}
  .news-admin-item .row{gap:12px;}
}

@media(max-width:600px){
  .login-page .topline{padding:18px 20px;flex-direction:column;gap:8px;align-items:flex-start;}
  .login-page .topline .date-time{text-align:left;}
  .login-page .bg-shape{opacity:.3;width:380px;height:380px;right:-120px;}
  .login-card{padding:34px 22px 30px;}
  .login-wrap{padding:14px;}
  .topbar h1{font-size:21px;}
  .card-pad{padding:18px;}
  .notif-banner{flex-wrap:wrap;padding:16px 18px;gap:12px;}
  .notif-banner .go{margin-left:0;width:100%;justify-content:flex-end;}
  .news-admin-item .row{flex-direction:column;align-items:flex-start;}
  .news-admin-item .row > div:last-child{width:100%;display:flex;gap:10px;}
  .news-admin-item .row > div:last-child form,
  .news-admin-item .row > div:last-child button{flex:1;}
  th,td{padding:12px 14px;font-size:13px;}
  .btn-primary,.btn-outline,.btn-discord{width:100%;justify-content:center;}
  .radio-pill-group{width:100%;}
  .radio-pill{flex:1;text-align:center;}
}

@media(max-width:420px){
  .sidebar{width:86vw;padding:24px 18px;}
  .topbar h1{font-size:19px;}
  .stat-card,.quick-card{padding:20px 18px;}
  .empty-state{padding:50px 16px;}
  .news-card .news-body{padding:18px 16px 22px;}
  .login-card .brand img{height:46px;}
}
