/* === CABINET-EXCELLENCE UI (match dashboard page) === */

/* Design tokens (same spirit as the page) */
:root{
  --radius-sm:12px;
  --radius:20px;
  --radius-lg:24px;

  --shadow-sm:0 2px 20px rgba(0,0,0,0.08);
  --shadow-md:0 10px 40px rgba(0,0,0,0.10);
  --shadow-lg:0 20px 60px rgba(0,0,0,0.15);

  --transition:all .3s ease;
}

/* Couleurs de repli : uniquement quand aucun thème /themes n'est actif.
   Sous un thème, ce sont les variables du thème qui pilotent l'apparence. */
html:not([data-app-theme]){
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
  --secondary:#64748b;
  --success:#10b981;
  --danger:#ef4444;
  --warning:#f59e0b;

  --light:#f8fafc;
  --dark:#1e293b;

  --gradient:linear-gradient(135deg,#667eea 0%,#764ba2 100%);
  --page-bg:linear-gradient(135deg,#f5f7fa 0%,#c3cfe2 100%);
}

/* Base */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

body{
  background:var(--page-bg);
  color:var(--dark);
  min-height:100vh;
  line-height:1.6;
}

/* Links */
a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:none; }

/* === NAVBAR === */
/* If your layout uses Bootstrap navbar classes, these styles will complement them */
#mainNav,
.navbar{
  background:rgba(255,255,255,.95) !important;
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  box-shadow:var(--shadow-sm);
  padding:.75rem 1rem;
  border-bottom:1px solid rgba(15,23,42,.06);
  transition:var(--transition);
}

#mainNav .navbar-brand,
.navbar .navbar-brand{
  font-weight:700;
  font-size:1.5rem;
  color:var(--primary) !important;
  letter-spacing:.2px;
}

#mainNav .navbar-nav a,
.navbar .nav-link{
  font-weight:500;
  color:var(--dark) !important;
  padding:.75rem 1rem;
  border-radius:8px;
  margin:0 .25rem;
  transition:var(--transition);
  text-transform:none; /* override previous uppercase */
}

#mainNav .navbar-nav a:hover,
.navbar .nav-link:hover{
  background:rgba(37,99,235,.10);
  color:var(--primary) !important;
  transform:translateY(-1px);
}

/* Kill old underline animation from previous theme */
#mainNav .navbar-nav a::after{ display:none !important; content:none !important; }

/* Dropdown look (works if you use Bootstrap dropdown markup) */
.dropdown-menu{
  border:none;
  box-shadow:0 10px 40px rgba(0,0,0,.10);
  border-radius:12px;
  padding:.5rem 0;
  margin-top:.5rem;
}
.dropdown-item{
  padding:.75rem 1.5rem;
  font-weight:500;
  transition:var(--transition);
}
.dropdown-item:hover{
  background:var(--gradient);
  color:#fff !important;
}

/* === HERO / HEADER === */
header.masthead,
.hero-section{
  background:var(--gradient);
  color:#fff;
  padding:4rem 0;
  margin-bottom:2rem;
  border-radius:0 0 var(--radius-lg) var(--radius-lg);
  position:relative;
  overflow:hidden;
  box-shadow:var(--shadow-md);
  text-align:center;
}

header.masthead::before,
.hero-section::before{
  content:'';
  position:absolute;
  inset:0;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100' fill='%23ffffff20'%3E%3Cpath d='M0 0 Q250 100 500 0 T1000 0 V100 H0 Z'/%3E%3C/svg%3E");
  background-size:cover;
  opacity:1;
  pointer-events:none;
}

header.masthead > *{
  position:relative;
  z-index:1;
}

header.masthead h1{
  font-weight:800;
  font-size:clamp(2rem,3.6vw,3.2rem);
  margin-bottom:.75rem;
}

header.masthead .subheading{
  color:rgba(0, 0, 0, 0.9);
  font-size:1.15rem;
  font-weight:400;
  opacity:1;
}

/* === BUTTONS === */
.btn,
button,
input[type="submit"]{
  border:none;
  border-radius:var(--radius-sm);
  padding:.875rem 2rem;
  font-weight:600;
  cursor:pointer;
  transition:var(--transition);
}

/* Primary button that matches the page */
.btn-primary,
.btn.btn-primary{
  background:var(--gradient);
  color:#fff;
  box-shadow:0 10px 25px rgba(37,99,235,.25);
}
.btn-primary:hover,
.btn.btn-primary:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 25px rgba(37,99,235,.30);
}

/* Generic .btn fallback (if you use .btn without bootstrap) */
.btn:where(:not([class*="btn-outline"]):not(.btn-link):not(.btn-ghost):not(.btn-close):not(.btn-light):not(.btn-white):not(.cpw-btn):not(.cpw-mini)){
  background:var(--gradient);
  color:#fff;
}
.btn:where(:not([class*="btn-outline"]):not(.btn-link):not(.btn-ghost):not(.btn-close):not(.btn-light):not(.btn-white):not(.cpw-btn):not(.cpw-mini)):hover{
  transform:translateY(-2px);
  box-shadow:0 10px 25px rgba(37,99,235,.30);
}

/* Danger button */
.btn-danger{
  background:linear-gradient(135deg,#fb7185 0%, #ef4444 100%);
  color:#fff;
}

/* === CARDS / CONTAINERS === */
/* Bootstrap-like card + your existing .card selector */
.card,
.dashboard-card,
.welcome-card{
  background:#fff;
  border:none;
  border-radius:var(--radius);
  box-shadow:var(--shadow-md);
  padding:2rem;
  overflow:hidden;
  transition:var(--transition);
  position:relative;
}

.card:hover,
.dashboard-card:hover{
  transform:translateY(-4px);
  box-shadow:var(--shadow-lg);
}

/* Optional header block used in your page */
.card-header{
  background:var(--gradient);
  color:#fff;
  border:none;
  padding:1.5rem 2rem;
  font-weight:600;
  font-size:1.1rem;
}
.card-body{
  padding:2rem;
}

/* === TABLES === */
table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow-sm);
}

th, td{
  padding:1rem;
  border-bottom:1px solid #e2e8f0;
  text-align:left;
  vertical-align:middle;
}

th{
  background:rgba(37,99,235,.06);
  font-weight:700;
  color:var(--dark);
}

tr:hover{
  background:rgba(37,99,235,.05);
}

/* === INPUTS === */
input, textarea, select{
  width:100%;
  padding:.875rem 1.25rem;
  border-radius:var(--radius-sm);
  border:2px solid #e2e8f0;
  background:#fff;
  font-weight:500;
  transition:var(--transition);
}

input:focus, textarea:focus, select:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 .2rem rgba(37,99,235,.15);
}

/* Useful if you use smaller controls (month input etc.) */
input[type="month"]{
  padding:.75rem 1rem;
}

/* === POPUP === */
#win{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.40);
  justify-content:center;
  align-items:center;
  z-index:1000;
}
#win:target{ display:flex; }

.popup_win{
  background:#fff;
  border-radius:var(--radius-lg);
  padding:2.5rem;
  width:90%;
  max-width:600px;
  box-shadow:var(--shadow-lg);
  animation:popupIn .35s ease;
}
@keyframes popupIn{
  from{ transform:scale(.96); opacity:0; }
  to{ transform:scale(1); opacity:1; }
}

.close-btn{
  float:right;
  font-size:1.4rem;
  color:var(--secondary);
  cursor:pointer;
  transition:var(--transition);
}
.close-btn:hover{ color:var(--primary); }

/* === CALENDAR === */
.calendartitle{
  text-align:center;
  font-weight:700;
  font-size:1.25rem;
  margin-bottom:1rem;
  color:var(--primary);
}

.day{
  border-radius:var(--radius-sm);
  text-align:center;
  padding:.75rem;
  background:#fff;
  transition:var(--transition);
  box-shadow:var(--shadow-sm);
  border-left:4px solid rgba(37,99,235,.35);
}
.day:hover{
  background:rgba(37,99,235,.08);
  transform:translateX(3px);
}

.today{
  background:var(--primary);
  color:#fff;
  font-weight:700;
  border-left-color:var(--primary-dark);
}

/* === FOOTER === */
footer{
  background:rgba(255,255,255,.85);
  color:var(--secondary);
  text-align:center;
  padding:2rem 0;
  margin-top:3rem;
  border-top-left-radius:var(--radius);
  border-top-right-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  backdrop-filter:blur(12px);
}
footer .copyright{
  font-size:.9rem;
  opacity:.9;
}

/* Headings */
h1, h2, h3, h4, h5{
  color:var(--dark);
  letter-spacing:.2px;
}

/* Simple responsiveness */
@media (max-width:768px){
  header.masthead,
  .hero-section{
    padding:2.5rem 0;
    border-radius:0 0 var(--radius) var(--radius);
  }
  .card,
  .dashboard-card,
  .welcome-card{
    padding:1.5rem;
  }
  .card-body{ padding:1.5rem; }
}

/* Simple modal used in usagers.php */
.ce-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.40);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1200;
  padding:24px;
}

.ce-modal-inner{
  width:100%;
  max-width:600px;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border-radius:20px;
  box-shadow:0 20px 60px rgba(0,0,0,.18);
  padding:24px;
  position:relative;
}

.ce-modal-close{
  position:absolute;
  top:12px;
  right:16px;
  font-size:28px;
  line-height:1;
  color:#64748b;
  text-decoration:none;
  transition:all .2s ease;
}
.ce-modal-close:hover{ color:#2563eb; }

/* ============ USAGERS CARD (premium) ============ */
.ce-usercard{
  background: rgba(255,255,255,.96);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.08);
  overflow: hidden;
  transition: all .3s ease;
  border: 1px solid rgba(15,23,42,.06);
  display: flex;
  flex-direction: column;
}
.ce-usercard:hover{
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,.14);
}

.ce-usercard__header{
  padding: 18px 18px 14px 18px;
  background: linear-gradient(135deg, rgba(102,126,234,.14) 0%, rgba(118,75,162,.10) 100%);
  display: flex;
  gap: 12px;
  align-items: center;
}

.ce-usercard__avatar{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--gradient);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(37,99,235,.25);
  flex: 0 0 auto;
}

.ce-usercard__name{
  font-weight: 700;
  color: var(--dark);
  line-height: 1.15;
  font-size: 1.05rem;
}
.ce-usercard__subtitle{
  margin-top: 2px;
  color: #64748b;
  font-size: .88rem;
}

.ce-usercard__list .list-group-item{
  border-color: rgba(226,232,240,.85);
  padding: 12px 16px;
  background: transparent;
}
.ce-k{
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}
.ce-v{
  color: #0f172a;
  font-weight: 600;
}

/* Footer actions */
.ce-usercard__footer{
  padding: 14px 16px 16px 16px;
  display: flex;
  gap: 10px;
  justify-content: center;
  background: rgba(248,250,252,.75);
  margin-top: auto;
  border-top: 1px solid rgba(226,232,240,.9);
}

.ce-iconbtn{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
  transition: all .25s ease;
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
  user-select: none;
}
.ce-iconbtn:hover{
  transform: translateY(-2px);
  filter: brightness(1.05);
  color: #fff;
}

.ce-iconbtn--edit{ background: linear-gradient(135deg,#34d399 0%,#10b981 100%); }
.ce-iconbtn--delete{ background: linear-gradient(135deg,#fb7185 0%,#ef4444 100%); }
.ce-iconbtn--calendar{ background: linear-gradient(135deg,#fbbf24 0%,#f97316 100%); }
.ce-iconbtn--file{ background: linear-gradient(135deg,#60a5fa 0%,#2563eb 100%); }

.ce-iconbtn--disabled{
  background: linear-gradient(135deg,#cbd5e1 0%,#94a3b8 100%);
  opacity: .7;
  cursor: not-allowed;
  box-shadow: none;
}

/* Small screens: avoid squished key/value */
@media (max-width: 420px){
  .ce-k{ white-space: normal; }
}

/* Add Usager - form sections */
.ce-formcard .card-body{ padding: 2rem; }
@media (max-width:768px){ .ce-formcard .card-body{ padding: 1.25rem; } }

.ce-formsection{
  background: rgba(248,250,252,.75);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 16px;
  padding: 1.25rem;
}
.ce-formsection__title{
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1rem;
  display:flex;
  align-items:center;
}

/* Upload area */
.ce-uploadarea{
  border:2px dashed rgba(37,99,235,.35);
  background: rgba(248,250,252,.75);
  border-radius: 18px;
  padding: 24px;
  text-align:center;
  cursor:pointer;
  transition: all .25s ease;
}
.ce-uploadarea:hover{
  border-color: rgba(37,99,235,.6);
  background: rgba(37,99,235,.06);
  transform: translateY(-2px);
}
.ce-uploadarea.is-drag{
  border-color: rgba(16,185,129,.8);
  background: rgba(16,185,129,.08);
}

.ce-uploadarea__icon{
  font-size: 34px;
  color: #2563eb;
  margin-bottom: 8px;
}
.ce-uploadarea__title{ font-weight: 800; color: #0f172a; }
.ce-uploadarea__sub{ color:#64748b; margin-top:2px; }
.ce-uploadarea__meta{ color:#64748b; margin-top:10px; font-size:.9rem; }

/* Status messages */
.ce-status{
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(226,232,240,.9);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  font-weight: 600;
}
.ce-status--success{ border-left:4px solid #10b981; }
.ce-status--error{ border-left:4px solid #ef4444; }
.ce-status--info{ border-left:4px solid #2563eb; }

/* File list item */
.ce-fileitem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  margin-bottom: 10px;
  transition: all .25s ease;
}
.ce-fileitem:hover{
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(0,0,0,.10);
}
.ce-fileitem__name{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 800;
}
.ce-fileitem__filename{
  font-weight: 700;
  color:#0f172a;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width: 520px;
}
.ce-fileitem__meta{
  color:#64748b;
  font-weight:600;
  font-size:.9rem;
  display:flex;
  gap: 14px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.ce-fileitem__actions{
  display:flex;
  gap: 8px;
  flex: 0 0 auto;
}

/* Mini action buttons */
.ce-mini{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  display:grid;
  place-items:center;
  text-decoration:none;
  transition: all .2s ease;
}
.ce-mini:hover{ transform: translateY(-2px); }

.ce-mini--view{ background: rgba(37,99,235,.12); color:#2563eb; }
.ce-mini--dl{ background: rgba(16,185,129,.12); color:#10b981; }
.ce-mini--del{ background: rgba(239,68,68,.12); color:#ef4444; }

/* Badges */
.ce-badge{
  font-size: .72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.9);
}
.ce-badge--pdf{ background: rgba(239,68,68,.12); color:#ef4444; }
.ce-badge--doc{ background: rgba(37,99,235,.12); color:#2563eb; }
.ce-badge--img{ background: rgba(16,185,129,.12); color:#10b981; }
.ce-badge--txt{ background: rgba(100,116,139,.12); color:#64748b; }

@media (max-width: 768px){
  .ce-fileitem{ flex-direction: column; align-items: stretch; }
  .ce-fileitem__filename{ max-width: 100%; }
  .ce-fileitem__actions{ justify-content: flex-start; }
}


/* Upload area */
.ce-uploadarea{
  border:2px dashed rgba(37,99,235,.35);
  background: rgba(248,250,252,.75);
  border-radius: 18px;
  padding: 24px;
  text-align:center;
  cursor:pointer;
  transition: all .25s ease;
}
.ce-uploadarea:hover{
  border-color: rgba(37,99,235,.6);
  background: rgba(37,99,235,.06);
  transform: translateY(-2px);
}
.ce-uploadarea.is-drag{
  border-color: rgba(16,185,129,.8);
  background: rgba(16,185,129,.08);
}

.ce-uploadarea__icon{ font-size: 34px; color: #2563eb; margin-bottom: 8px; }
.ce-uploadarea__title{ font-weight: 800; color: #0f172a; }
.ce-uploadarea__sub{ color:#64748b; margin-top:2px; }
.ce-uploadarea__meta{ color:#64748b; margin-top:10px; font-size:.9rem; }

/* Status messages */
.ce-status{
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(226,232,240,.9);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  font-weight: 600;
}
.ce-status--success{ border-left:4px solid #10b981; }
.ce-status--error{ border-left:4px solid #ef4444; }
.ce-status--info{ border-left:4px solid #2563eb; }

/* File list item */
.ce-fileitem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  margin-bottom: 10px;
  transition: all .25s ease;
}
.ce-fileitem:hover{
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(0,0,0,.10);
}
.ce-fileitem__name{ display:flex; align-items:center; gap: 10px; font-weight: 800; }
.ce-fileitem__filename{
  font-weight: 700;
  color:#0f172a;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width: 520px;
}
.ce-fileitem__meta{
  color:#64748b;
  font-weight:600;
  font-size:.9rem;
  display:flex;
  gap: 14px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.ce-fileitem__actions{ display:flex; gap: 8px; flex: 0 0 auto; }

.ce-mini{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  display:grid;
  place-items:center;
  text-decoration:none;
  transition: all .2s ease;
}
.ce-mini:hover{ transform: translateY(-2px); }
.ce-mini--view{ background: rgba(37,99,235,.12); color:#2563eb; }
.ce-mini--dl{ background: rgba(16,185,129,.12); color:#10b981; }
.ce-mini--del{ background: rgba(239,68,68,.12); color:#ef4444; }

.ce-badge{
  font-size: .72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.9);
}
.ce-badge--pdf{ background: rgba(239,68,68,.12); color:#ef4444; }
.ce-badge--doc{ background: rgba(37,99,235,.12); color:#2563eb; }
.ce-badge--img{ background: rgba(16,185,129,.12); color:#10b981; }
.ce-badge--txt{ background: rgba(100,116,139,.12); color:#64748b; }

@media (max-width: 768px){
  .ce-fileitem{ flex-direction: column; align-items: stretch; }
  .ce-fileitem__filename{ max-width: 100%; }
  .ce-fileitem__actions{ justify-content: flex-start; }
}
