/*
 * Refonte INNAP x ECFO-CREFM
 * Langage visuel inspiré du tableau de bord hôtelier INNAP, adapté aux
 * fonctions académiques, administratives et financières de la plateforme.
 */
:root{
  --ec-primary:#5c4ee5;
  --ec-primary-dark:#4338ca;
  --ec-primary-soft:#eeecff;
  --ec-brand-magenta:#7467f0;
  --ec-brand-purple:#5145cd;
  --ec-brand-deep:#201a43;
  --ec-bg:#f4f5f9;
  --ec-surface:#fff;
  --ec-border:#e7e8ef;
  --ec-ink:#222338;
  --ec-ink-soft:#6e7185;
  --ec-ink-faint:#9a9caf;
  --ec-sidebar-bg:#fff;
  --ec-sidebar-bg-2:#fff;
  --ec-sidebar-text:#6e7185;
  --ec-sidebar-text-active:#fff;
  --ec-sidebar-width:285px;
  --ec-radius-lg:16px;
  --ec-radius-md:12px;
  --ec-radius-sm:9px;
  --ec-shadow-sm:0 2px 12px rgba(31,35,48,.045);
  --ec-shadow-md:0 15px 40px rgba(31,35,48,.10);
}

html[data-ec-theme="dark"]{
  --ec-bg:#171826;
  --ec-surface:#202231;
  --ec-border:#303344;
  --ec-ink:#f3f3f8;
  --ec-ink-soft:#b5b7c6;
  --ec-ink-faint:#858899;
  --ec-primary-soft:#302d5a;
  --ec-sidebar-bg:#1d1f2d;
  --ec-sidebar-bg-2:#1d1f2d;
  --ec-sidebar-text:#b5b7c6;
  --ec-sidebar-text-active:#fff;
  color-scheme:dark;
}

.ec{font-size:14px;background:var(--ec-bg);transition:background .2s,color .2s}
.ec h1,.ec h2,.ec h3,.ec h4,.ec h5,.ec .ec-display{font-weight:600;letter-spacing:-.02em}
.ec-sidebar{
  background:var(--ec-sidebar-bg);color:var(--ec-sidebar-text);border-right:1px solid var(--ec-border);
  transition:width .22s ease;overflow-x:hidden;box-shadow:2px 0 18px rgba(31,35,48,.025);z-index:30
}
.ec-sidebar-brand{min-height:82px;padding:18px 16px;border-bottom:1px solid var(--ec-border);white-space:nowrap;display:flex;align-items:center;gap:12px}
.ec-sidebar-brand img{width:40px;height:40px;flex:none;border:1px solid var(--ec-border);box-shadow:var(--ec-shadow-sm)}
.ec-sidebar-brand>div{min-width:0}
.ec-sidebar-brand .name{color:var(--ec-ink);font-size:13px;font-weight:800;line-height:1.2;white-space:normal;text-transform:uppercase;letter-spacing:.01em}
.ec-sidebar-brand .tag{color:var(--ec-ink-faint);font-size:10.5px;text-transform:uppercase;letter-spacing:.075em}
.ec-sidebar-section{color:var(--ec-ink-faint);font-weight:600;font-size:9.5px;margin-top:12px;padding:7px 18px}
.ec-nav{padding:7px 14px 20px;gap:3px}
.ec-nav-link{min-height:44px;color:var(--ec-sidebar-text);font-size:13px;font-weight:500;border-radius:9px;padding:10px 12px;white-space:normal;line-height:1.25}
.ec-nav-link i{font-size:18px;color:#9295a7}
.ec-nav-link:hover{background:var(--ec-primary-soft);color:var(--ec-primary)}
.ec-nav-link:hover i{color:var(--ec-primary)}
.ec-nav-link.active{background:linear-gradient(135deg,#5c4ee5,#7a6cf2);box-shadow:0 8px 20px rgba(92,78,229,.23)}
.ec-nav-link.active:hover{color:#fff;filter:brightness(1.06)}
.ec-nav-link.active:hover i{color:#fff}
.ec-sidebar-foot{border-color:var(--ec-border);padding:18px 22px}.ec-sidebar-foot a{color:var(--ec-ink-soft)}.ec-sidebar-foot a:hover{color:var(--ec-primary)}
.ec-sidebar-toggle{position:fixed;top:31px;left:calc(var(--ec-sidebar-width) - 13px);z-index:40;width:27px;height:27px;border:1px solid var(--ec-border);border-radius:50%;background:var(--ec-surface);color:var(--ec-ink-soft);display:grid;place-items:center;box-shadow:var(--ec-shadow-sm);transition:left .22s ease}
.ec-sidebar-toggle:hover{color:var(--ec-primary);border-color:var(--ec-primary)}

.ec-topbar{min-height:82px;background:color-mix(in srgb,var(--ec-surface) 94%,transparent);border-color:var(--ec-border);padding:14px 30px;box-shadow:0 2px 14px rgba(31,35,48,.025)}
.ec-topbar-title{font-size:18px;font-weight:600;color:var(--ec-ink)}
.ec-topbar-title small{font-weight:400;color:var(--ec-ink-faint);margin-top:3px}
.ec-icon-btn{background:var(--ec-surface);border-color:var(--ec-border);color:var(--ec-ink-soft);width:40px;height:40px}
.ec-profile{background:var(--ec-surface);border-color:var(--ec-border);border-radius:10px;padding:5px 9px 5px 5px}
.ec-profile:hover{background:var(--ec-primary-soft)}
.ec-avatar{border-radius:9px;background:linear-gradient(135deg,#5c4ee5,#7a6cf2)}
.ec-profile-name{color:var(--ec-ink)}
.ec-content{padding:24px 30px 34px}
.ec-breadcrumb{display:flex;align-items:center;gap:8px;color:var(--ec-ink-faint);font-size:11.5px;margin:0 0 19px}
.ec-breadcrumb i:first-child{color:var(--ec-primary)}.ec-breadcrumb i.bi-chevron-right{font-size:9px}.ec-breadcrumb strong{font-weight:500;color:var(--ec-ink-soft)}

.ec-card,.ec-stat{background:var(--ec-surface);border-color:var(--ec-border);border-radius:var(--ec-radius-lg);box-shadow:var(--ec-shadow-sm)}
.ec-search-group button{transition:background .22s ease}
.ec-search-group .bi-search{display:inline-block;transition:transform .22s ease,color .22s ease}
.ec-search-group:focus-within button{background:var(--ec-primary-soft)}
.ec-search-group:focus-within .bi-search{color:var(--ec-primary);transform:scale(1.35)}
.ec-card-head{padding:20px 22px 0;flex-wrap:wrap;row-gap:8px}.ec-card-head h2{font-size:15px;font-weight:600;color:var(--ec-ink)}
.ec-card-head[data-bs-toggle="collapse"]{padding-bottom:20px;user-select:none}
.ec-card-head[data-bs-toggle="collapse"] .bi-chevron-down{transition:transform .2s ease;color:var(--ec-ink-soft)}
.ec-card-head[data-bs-toggle="collapse"]:not(.collapsed) .bi-chevron-down{transform:rotate(180deg)}
.ec-badge{white-space:nowrap}
.ec-card-body{padding:22px}.ec-stat-grid{gap:18px}
.ec-stat{padding:20px;gap:12px}.ec-stat:before{height:2px;background:var(--ec-primary)}
.ec-stat-value{font-size:27px;font-weight:600;color:var(--ec-ink)}.ec-stat-label{color:var(--ec-ink-soft)}
.ec-stat-icon{border-radius:11px;width:46px;height:46px}
.ec-stat-glow{min-height:118px;border:0;border-radius:16px;box-shadow:0 12px 26px rgba(31,35,48,.10)}
.ec-stat-glow-violet,.ec-stat-glow-info{background:linear-gradient(135deg,#5c4ee5,#8074f5)}
.ec-stat-glow-magenta,.ec-stat-glow-success{background:linear-gradient(135deg,#20b486,#41cf9f)}
.ec-stat-glow-gold{background:linear-gradient(135deg,#f2a93b,#ffc05a)}
.ec-stat-glow-coral,.ec-stat-glow-danger{background:linear-gradient(135deg,#ef6b64,#ff8a80)}
.ec-stat-glow-blue{background:linear-gradient(135deg,#2f8fea,#6db6f5)}
.ec-stat-glow-green{background:linear-gradient(135deg,#1fae5c,#58d98a)}
.ec-stat-glow-pink{background:linear-gradient(135deg,#e0559b,#f5a3cf)}
.ec-stat-glow-orange{background:linear-gradient(135deg,#f2790a,#ffb35c)}
.ec-stat-glow-red{background:linear-gradient(135deg,#f4515e,#ff9a9e)}
.ec-stat-glow .ec-stat-value{font-size:30px;font-weight:600}.ec-stat-icon-glow{border:0;background:rgba(255,255,255,.18);border-radius:13px}
.ec-quick-card{background:var(--ec-surface);border-color:var(--ec-border);border-radius:12px}.ec-quick-card:hover{border-color:#bcb6fa}.ec-quick-card h3{font-weight:600;color:var(--ec-ink)}

.ec-btn{border-radius:8px;font-weight:600;padding:10px 16px}.ec-btn-primary{background:#5c4ee5;box-shadow:0 7px 16px rgba(92,78,229,.20)}
.ec-btn-light{background:var(--ec-primary-soft);color:var(--ec-primary)}.ec-btn-outline{background:var(--ec-surface);border-color:var(--ec-border);color:var(--ec-ink)}
.ec-input,.ec select.ec-input,.ec textarea.ec-input{background:var(--ec-surface);border-color:var(--ec-border);border-radius:8px;color:var(--ec-ink);padding:11px 13px}
.ec-input:focus{border-color:#7a6cf2;box-shadow:0 0 0 3px rgba(92,78,229,.13)}
.ec-seg{background:var(--ec-bg);border-color:var(--ec-border);border-radius:9px}.ec-seg button,.ec-seg a{border:0;background:transparent;padding:8px 15px;border-radius:7px;font-size:12.5px;font-weight:700;color:var(--ec-ink-soft);cursor:pointer;transition:background .15s,color .15s;text-decoration:none}.ec-seg button.active,.ec-seg a.active{background:#5c4ee5;color:#fff;box-shadow:none}.ec-seg button:not(.active):hover,.ec-seg a:not(.active):hover{background:var(--ec-surface);color:var(--ec-primary)}
.ec-table-wrap{border-radius:12px;border-color:var(--ec-border)}
table.ec-table{background:var(--ec-surface);color:var(--ec-ink)}table.ec-table th{background:color-mix(in srgb,var(--ec-bg) 70%,var(--ec-surface));color:var(--ec-ink-soft);font-weight:600;text-transform:none;letter-spacing:0;font-size:12px;border-color:var(--ec-border)}
table.ec-table td{border-color:var(--ec-border);font-size:13px}table.ec-table tbody tr:hover{background:var(--ec-primary-soft)}
table.ec-table tbody tr[data-href]{cursor:pointer}

/* Le gabarit d'authentification est défini dans theme.css. Ne pas réintroduire
   ici un panneau coloré ou une seconde carte autour du formulaire. */

body.ec-sidebar-compact .ec-sidebar{width:84px}
body.ec-sidebar-compact .ec-sidebar-toggle{left:71px}
body.ec-sidebar-compact .ec-sidebar-brand{padding-left:20px}
body.ec-sidebar-compact .ec-sidebar-brand>div,body.ec-sidebar-compact .ec-sidebar-section,body.ec-sidebar-compact .ec-nav-link span,body.ec-sidebar-compact .ec-sidebar-foot{display:none}
body.ec-sidebar-compact .ec-nav{padding-inline:15px}body.ec-sidebar-compact .ec-nav-link{justify-content:center;padding-inline:10px}body.ec-sidebar-compact .ec-nav-link i{width:auto;font-size:20px}

html[data-ec-theme="dark"] .ec-offcanvas{background:var(--ec-surface)}
html[data-ec-theme="dark"] .ec-sidebar{background:#1d1f2d;box-shadow:2px 0 18px rgba(0,0,0,.18)}
html[data-ec-theme="dark"] .ec-sidebar-brand img{background:#fff}
html[data-ec-theme="dark"] .dropdown-menu{--bs-dropdown-bg:var(--ec-surface);--bs-dropdown-color:var(--ec-ink);--bs-dropdown-link-color:var(--ec-ink);--bs-dropdown-border-color:var(--ec-border)}
html[data-ec-theme="dark"] .text-muted{color:var(--ec-ink-faint)!important}
html[data-ec-theme="dark"] .bg-white{background-color:var(--ec-surface)!important}

.ec-topbar-menu{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:nowrap}
.ec-status-block{display:flex;align-items:center;gap:8px;text-align:left;max-width:100%}
.ec-status-block .ec-badge{white-space:normal;text-align:center;max-width:100%}
.ec-status-block span.d-block{margin-bottom:0!important}
@media(max-width:991.98px){
  .ec-sidebar-toggle{display:none}.ec-topbar{min-height:70px;padding:12px 12px;flex-wrap:nowrap;column-gap:6px;align-items:center}.ec-content{padding:17px}.ec-breadcrumb{margin-bottom:14px}
  .ec-offcanvas{background:var(--ec-surface);width:min(86vw,310px)!important}.ec-offcanvas .ec-sidebar{border:0}.ec-profile-name,.ec-profile-role{display:none}
  .ec-topbar-title{flex:1 1 auto;min-width:0;font-size:15px;line-height:1.2;white-space:normal}
  .ec-topbar-actions{flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end;gap:6px}
  .ec-topbar-menu{gap:6px}
  .ec-topbar-menu .dropdown:last-child{padding-left:8px}
  .ec-icon-btn{width:34px;height:34px}
  .ec-profile{padding:0}
  .ec-profile .bi-chevron-down{display:none}
  .ec-avatar{width:34px;height:34px;font-size:13px}
  .ec-topbar-actions .ec-btn-back .ec-btn-label{display:none}
  .ec-topbar-actions .ec-btn-back{padding:0;width:36px;height:36px;justify-content:center;flex:none}
  .ec-topbar-actions .ec-btn-back i{margin:0}
}
@media(max-width:575.98px){.ec-topbar-title small{display:none}.ec-stat-grid{grid-template-columns:1fr 1fr;gap:12px}.ec-stat{padding:16px}.ec-stat-glow{min-height:108px;padding:18px 66px 18px 18px}.ec-stat-icon-glow{right:14px;width:45px;height:45px}.ec-card-body{padding:17px}}
