
@import url('https://fonts.googleapis.com/css2?family=Trirong:wght@300;400;500;600;700;800;900&display=swap');

:root{
  --blue:#1018F5;
  --blue-dark:#0710B8;
  --blue-soft:#EEF1FF;
  --text:#111827;
  --muted:#526174;
  --bg:#F4F7FB;
  --white:#FFFFFF;
  --border:#DDE5F2;
  --shadow:0 18px 42px rgba(15,23,42,.08);
  --sidebar:320px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:'Trirong', Georgia, serif;
  background:var(--bg);
  color:var(--text);
  overflow-x:hidden;
}
a{text-decoration:none;color:inherit}
img{max-width:100%;display:block}
button{font:inherit}

.app{
  min-height:100vh;
  display:grid;
  grid-template-columns:var(--sidebar) minmax(0,1fr);
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  background:#fff;
  border-right:1px solid var(--border);
  z-index:80;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap:14px;
  padding:20px 18px;
  border-bottom:1px solid var(--border);
  flex:0 0 auto;
}

.sidebar-brand img{
  width:64px;
  height:64px;
  object-fit:contain;
  border-radius:18px;
  background:#fff;
  padding:6px;
  box-shadow:var(--shadow);
  flex-shrink:0;
}

.sidebar-brand strong{
  display:block;
  color:var(--blue);
  font-size:30px;
  line-height:1;
  letter-spacing:.04em;
}

.sidebar-brand span{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.sidebar-scroll{
  padding:18px;
  overflow-y:auto;
}

.nav-title{
  margin:0 0 12px;
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  letter-spacing:.13em;
  text-transform:uppercase;
}

.nav-home,
.nav-section summary{
  width:100%;
  min-height:56px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 14px;
  border-radius:18px;
  border:1px solid #E2E8F0;
  background:#F8FAFF;
  color:#1F2937;
  font-size:15px;
  font-weight:900;
}

.nav-home{
  justify-content:flex-start;
  margin-bottom:8px;
}

.nav-home.active{
  background:linear-gradient(135deg,var(--blue),var(--blue-dark));
  color:#fff;
  border-color:transparent;
  box-shadow:0 16px 34px rgba(16,24,245,.22);
}

.nav-section{
  margin:8px 0;
  border-radius:18px;
  background:#fff;
}

.nav-section summary{
  list-style:none;
  cursor:pointer;
}

.nav-section summary::-webkit-details-marker{display:none}

.nav-section summary::after{
  content:"›";
  font-size:24px;
  color:var(--blue);
  transition:transform .2s ease;
}

.nav-section[open] summary{
  background:#fff;
  color:var(--blue);
  border-bottom-left-radius:0;
  border-bottom-right-radius:0;
}

.nav-section[open] summary::after{
  transform:rotate(90deg);
}

.summary-label{
  min-width:0;
  display:flex;
  align-items:center;
  gap:12px;
}

.summary-label span:last-child{
  line-height:1.25;
  word-break:break-word;
}

.nav-icon{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:var(--blue-soft);
  color:var(--blue);
  flex-shrink:0;
}

.nav-home.active .nav-icon{
  color:#fff;
  background:rgba(255,255,255,.16);
}

.nav-count{
  min-width:28px;
  height:25px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 8px;
  border-radius:999px;
  background:var(--blue-soft);
  color:var(--blue);
  font-size:12px;
  font-weight:900;
}

.nav-submenu{
  max-height:330px;
  overflow:auto;
  padding:10px 12px 14px;
  border:1px solid #E2E8F0;
  border-top:0;
  border-bottom-left-radius:18px;
  border-bottom-right-radius:18px;
  background:#fff;
}

.nav-submenu a{
  display:block;
  padding:9px 10px;
  border-radius:12px;
  color:#374151;
  font-size:14px;
  font-weight:650;
}

.nav-submenu a:hover{
  background:var(--blue-soft);
  color:var(--blue);
}

.sidebar-overlay{
  display:none;
}

.main{
  min-width:0;
  padding:24px;
}

.topbar{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:16px;
  align-items:center;
  margin-bottom:24px;
}

.menu-btn{
  display:none;
  width:52px;
  height:52px;
  border:0;
  border-radius:18px;
  background:linear-gradient(135deg,var(--blue),var(--blue-dark));
  box-shadow:0 16px 34px rgba(16,24,245,.22);
  cursor:pointer;
  padding:0;
}

.menu-btn span{
  width:22px;
  height:2px;
  margin:5px auto;
  display:block;
  background:#fff;
  border-radius:999px;
}

.page-heading{
  min-width:0;
}

.page-heading h1{
  margin:0;
  font-size:clamp(28px,4vw,40px);
  line-height:1.08;
}

.page-heading p{
  margin:7px 0 0;
  color:var(--muted);
  font-size:16px;
}

.topbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  min-width:0;
}

.search,
.profile{
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 10px 24px rgba(15,23,42,.04);
}

.search{
  width:260px;
  max-width:100%;
  padding:13px 15px;
  color:var(--muted);
}

.profile{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px 8px 8px;
  white-space:nowrap;
}

.profile > span{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:900;
  background:linear-gradient(135deg,var(--blue),#6B7CFF);
}

.profile strong,
.profile small{
  display:block;
}

.profile small{
  color:var(--muted);
}

.hero-card{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(280px,.9fr);
  gap:22px;
  padding:32px;
  border-radius:30px;
  color:#fff;
  background:linear-gradient(135deg,var(--blue),#2F3DFF);
  box-shadow:0 20px 50px rgba(16,24,245,.22);
}

.eyebrow{
  display:inline-flex;
  margin-bottom:12px;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:rgba(255,255,255,.78);
}

.hero-card h2{
  margin:0 0 12px;
  font-size:clamp(32px,5vw,54px);
  line-height:1;
}

.hero-card p{
  margin:0;
  max-width:760px;
  color:rgba(255,255,255,.86);
  font-size:17px;
  line-height:1.7;
}

.hero-stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.hero-stats div{
  padding:18px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:20px;
  background:rgba(255,255,255,.12);
}

.hero-stats strong{
  display:block;
  font-size:30px;
}

.hero-stats span{
  display:block;
  margin-top:4px;
  color:rgba(255,255,255,.78);
}

.section-block,
.panel{
  margin-top:22px;
  padding:24px;
  border:1px solid var(--border);
  border-radius:26px;
  background:#fff;
  box-shadow:var(--shadow);
}

.section-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.section-header h2,
.panel h2{
  margin:0 0 7px;
  font-size:26px;
}

.section-header p{
  margin:0;
  color:var(--muted);
}

.modules-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}

.module-card,
.feature-card{
  min-width:0;
  display:flex;
  gap:14px;
  padding:18px;
  border:1px solid var(--border);
  border-radius:22px;
  background:linear-gradient(180deg,#fff,#F9FBFF);
}

.module-icon,
.feature-card span{
  width:46px;
  height:46px;
  flex-shrink:0;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:var(--blue-soft);
  color:var(--blue);
  font-weight:900;
}

.module-card h3,
.feature-card h3{
  margin:0 0 8px;
  font-size:17px;
  line-height:1.2;
}

.module-card p,
.feature-card p{
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.55;
}

.dashboard-grid{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(280px,.9fr);
  gap:22px;
}

.activity-list{
  display:grid;
  gap:12px;
}

.activity-list div{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:4px 12px;
  padding:15px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#F8FAFF;
}

.activity-list span{
  color:var(--muted);
}

.activity-list em{
  grid-row:1 / span 2;
  grid-column:2;
  align-self:center;
  padding:7px 11px;
  border-radius:999px;
  font-style:normal;
  font-size:12px;
  font-weight:900;
  color:var(--blue);
  background:var(--blue-soft);
}

.quick-list{
  display:grid;
  gap:12px;
}

.quick-list a{
  padding:15px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#F8FAFF;
  font-weight:800;
}

.quick-list a:hover{
  background:var(--blue-soft);
  color:var(--blue);
}

.features-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}

.feature-card{
  display:block;
}

.feature-card span{
  margin-bottom:14px;
}

.table-wrap{
  width:100%;
  overflow-x:auto;
  border:1px solid var(--border);
  border-radius:20px;
  -webkit-overflow-scrolling:touch;
}

table{
  width:100%;
  min-width:650px;
  border-collapse:collapse;
  background:#fff;
}

th,td{
  padding:15px 16px;
  border-bottom:1px solid var(--border);
  text-align:left;
  color:#1F2937;
}

th{
  background:var(--blue-soft);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.1em;
}

tr:last-child td{
  border-bottom:0;
}

.badge{
  display:inline-flex;
  padding:7px 11px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
}

.badge.ok{background:#EAF9EF;color:#16A34A}
.badge.info{background:#EEF4FF;color:var(--blue)}
.badge.warn{background:#FFF7E6;color:#F59E0B}

.footer-note{
  padding:22px 0 6px;
  color:var(--muted);
  text-align:center;
  font-size:13px;
}

@media(max-width:1280px){
  .modules-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:1120px){
  .app{
    grid-template-columns:1fr;
  }

  .sidebar{
    position:fixed;
    left:0;
    top:0;
    width:min(320px,88vw);
    max-width:88vw;
    height:100vh;
    transform:translateX(-105%);
    transition:transform .28s ease;
    box-shadow:0 30px 70px rgba(15,23,42,.22);
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .sidebar-overlay{
    display:block;
    position:fixed;
    inset:0;
    z-index:70;
    background:rgba(15,23,42,.42);
    opacity:0;
    visibility:hidden;
    transition:opacity .25s ease, visibility .25s ease;
  }

  .sidebar-overlay.show{
    opacity:1;
    visibility:visible;
  }

  .menu-btn{
    display:block;
  }

  .topbar{
    grid-template-columns:auto minmax(0,1fr);
  }

  .topbar-actions{
    grid-column:1 / -1;
    justify-content:flex-start;
  }

  .search{
    flex:1;
    width:auto;
  }

  .hero-card,
  .dashboard-grid{
    grid-template-columns:1fr;
  }

  .nav-submenu{
    max-height:none;
  }
}

@media(max-width:860px){
  .main{
    padding:18px;
  }

  .modules-grid,
  .features-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .hero-stats{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:640px){
  .main{
    padding:14px;
  }

  .topbar{
    gap:12px;
    margin-bottom:18px;
  }

  .menu-btn{
    width:48px;
    height:48px;
    border-radius:16px;
  }

  .page-heading h1{
    font-size:26px;
  }

  .page-heading p{
    font-size:14px;
  }

  .topbar-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .search,
  .profile{
    width:100%;
  }

  .hero-card,
  .section-block,
  .panel{
    padding:20px;
    border-radius:22px;
  }

  .hero-stats,
  .modules-grid,
  .features-grid{
    grid-template-columns:1fr;
  }

  .module-card{
    padding:16px;
  }

  .section-header h2,
  .panel h2{
    font-size:22px;
  }

  .activity-list div{
    grid-template-columns:1fr;
  }

  .activity-list em{
    grid-row:auto;
    grid-column:auto;
    width:max-content;
  }
}

@media(max-width:420px){
  .sidebar-brand img{
    width:56px;
    height:56px;
  }

  .sidebar-brand strong{
    font-size:24px;
  }

  .nav-home,
  .nav-section summary{
    font-size:14px;
    padding:12px;
  }

  .nav-icon{
    width:38px;
    height:38px;
  }

  .nav-submenu a{
    font-size:13.5px;
  }

  table{
    min-width:560px;
  }
}


/* =====================================================
   Police Trirong + recherche accessible
   ===================================================== */

body,
button,
input,
select,
textarea {
  font-family: 'Trirong', Georgia, serif;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Remplacement de l'ancienne fausse zone de recherche */
.search {
  display: none !important;
}

.search-form {
  width: min(100%, 520px);
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
}

.search-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  flex-shrink: 0;
}

.search-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 500;
}

.search-form input::placeholder {
  color: #6B7280;
}

.search-form button {
  border: 0;
  border-radius: 15px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.search-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(16,24,245,.18);
}

.search-form:focus-within {
  border-color: var(--blue);
  box-shadow:
    0 0 0 4px rgba(16,24,245,.12),
    0 14px 30px rgba(15,23,42,.08);
}

.search-form input:focus-visible,
.search-form button:focus-visible,
.menu-btn:focus-visible,
.nav-home:focus-visible,
.nav-submenu a:focus-visible,
summary:focus-visible,
.quick-list a:focus-visible {
  outline: 3px solid rgba(16,24,245,.35);
  outline-offset: 3px;
}

/* Ajustements Trirong : meilleure lisibilité des titres et menus */
.page-heading h1,
.hero-card h2,
.section-header h2,
.panel h2,
.sidebar-brand strong {
  letter-spacing: .01em;
}

.nav-home,
.nav-section summary,
.module-card h3,
.feature-card h3 {
  line-height: 1.35;
}

@media(max-width:1120px) {
  .search-form {
    width: 100%;
  }
}

@media(max-width:640px) {
  .search-form {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 8px;
  }

  .search-form button {
    grid-column: 1 / -1;
    width: 100%;
    padding: 11px 14px;
  }

  .search-form input {
    font-size: 14px;
  }
}
