/* ============================================================
   Menu applicatif — style.css
   ============================================================ */

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.6;
  color: #1a1a1a; background: #f5f5f3; min-height: 100vh;
}

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

/* ---- Conteneur ---- */
.menu-container { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

/* ---- Header ---- */
.menu-header {
  background: #fff; border-bottom: 1px solid #e8e8e5;
  padding: .75rem 0; position: sticky; top: 0; z-index: 10;
}
.menu-topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.menu-topbar h1 { font-size: 17px; font-weight: 600; flex: 1; min-width: 140px; }

/* ---- Recherche ---- */
.menu-search { flex: 1; max-width: 340px; position: relative; }
.menu-search input {
  width: 100%; font-size: 14px; padding: 7px 36px 7px 12px;
  border: 1px solid #d0cfc8; border-radius: 8px; background: #f8f8f6;
}
.menu-search input:focus { outline: none; border-color: #534AB7; background: #fff; }
.btn-reset {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: #aaa; cursor: pointer;
}
.btn-reset:hover { color: #333; }

/* ---- Boutons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500; padding: 6px 14px;
  border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: background .12s;
}
.btn-primary { background: #534AB7; color: #fff; border-color: #534AB7; }
.btn-primary:hover { background: #3C3489; }
.btn-outline { border-color: #d0cfc8; color: #333; background: #fff; }
.btn-outline:hover { background: #f0f0ed; }
.btn-ghost { color: #666; background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #f0f0ed; }
.btn-danger { background: transparent; color: #A32D2D; border-color: #f09595; }
.btn-danger:hover { background: #FCEBEB; }
.btn-sm { font-size: 12px; padding: 3px 10px; }

/* ---- Sections catégories ---- */
.cat-section { margin: 1.75rem 0; }
.cat-title {
  font-size: 14px; font-weight: 600;
  color: var(--cat-color, #444);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: .9rem;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cat-color, #e8e8e5);
}
.cat-icone { font-size: 18px; }
.cat-count {
  font-size: 11px; font-weight: 500; padding: 1px 7px;
  border-radius: 20px; background: #f0f0ed; color: #888;
  margin-left: 4px;
}

/* ---- Grille applications ---- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

/* ---- Carte application ---- */
.app-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff; border: 1px solid #e8e8e5;
  border-radius: 12px; padding: 14px 16px;
  cursor: pointer; transition: border-color .12s, box-shadow .12s;
  text-decoration: none; color: inherit;
}
.app-card:hover {
  border-color: #534AB7;
  box-shadow: 0 0 0 3px #EEEDFE;
}
.app-icone {
  font-size: 26px; line-height: 1;
  flex-shrink: 0; margin-top: 1px;
}
.app-info { min-width: 0; }
.app-nom  {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-desc {
  font-size: 12px; color: #888; margin-top: 2px;
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- Empty ---- */
.menu-empty { text-align: center; padding: 3rem; color: #aaa; font-size: 14px; }

/* ---- Admin ---- */
.admin-section { margin: 1.5rem 0; }
.admin-title {
  font-size: 15px; font-weight: 600; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
}
.admin-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border: 1px solid #e8e8e5; border-radius: 12px; overflow: hidden;
}
.admin-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: #666;
  padding: 10px 12px; background: #f8f8f6; border-bottom: 1px solid #e8e8e5;
}
.admin-table td {
  padding: 10px 12px; border-bottom: 1px solid #f0f0ed;
  font-size: 13px; vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafaf8; }
.actions-cell { display: flex; gap: 6px; align-items: center; }
.lien-cell {
  color: #185FA5; font-size: 12px; max-width: 180px;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lien-cell:hover { text-decoration: underline; }
.text-muted { color: #aaa; }
.color-dot {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 50%; vertical-align: middle; margin-right: 4px;
}

/* ---- Formulaires ---- */
.menu-form { display: flex; flex-direction: column; gap: 14px; margin-top: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: #555; font-weight: 500; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 100px; }
.form-group input[type=text],
.form-group input[type=number],
.form-group select {
  font-size: 14px; padding: 7px 10px;
  border: 1px solid #d0cfc8; border-radius: 8px;
  background: #fff; color: #1a1a1a; font-family: inherit; width: 100%;
}
.form-checks { display: flex; flex-direction: column; gap: 8px; }
.form-checks label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #444; cursor: pointer;
}
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.req { color: #A32D2D; }

/* ---- Alertes ---- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 1rem; font-size: 14px; }
.alert-info  { background: #E6F1FB; color: #0C447C; border: 1px solid #B5D4F4; }
.alert-danger{ background: #FCEBEB; color: #791F1F; border: 1px solid #F7C1C1; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .app-grid { grid-template-columns: 1fr 1fr; }
  .menu-topbar h1 { font-size: 15px; }
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) { display: none; }
}
@media (max-width: 380px) {
  .app-grid { grid-template-columns: 1fr; }
}
