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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #00bcd4 0%, #1a1a1a 100%);
  min-height: 100vh;
  color: #333;
}

/* ===== VUE LOGIN ===== */

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-center {
  width: 100%;
  max-width: 420px;
}

.logo {
  display: block;
  max-width: 220px;
  margin: 0 auto 28px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.login-box h1 {
  font-size: 1.6em;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
  text-align: center;
}

.login-subtitle {
  text-align: center;
  color: #888;
  font-size: 0.9em;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85em;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: #00bcd4;
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #00bcd4, #008ba3);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}

.btn-login:hover {
  opacity: 0.9;
}

.btn-login:active {
  transform: scale(0.99);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  margin-top: 14px;
  padding: 10px 14px;
  background: #fff0f0;
  border-left: 3px solid #e53935;
  border-radius: 4px;
  color: #c62828;
  font-size: 0.9em;
  display: none;
}

.error-msg.show {
  display: block;
}

/* ===== VUE DASHBOARD ===== */

.dash-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-header {
  background: linear-gradient(135deg, #00bcd4 0%, #008ba3 100%);
  padding: 0 32px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-sm {
  height: 78px;
  display: block;
  filter: brightness(0) invert(1);
}

.header-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 32px;
  color: white;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.welcome-text {
  color: rgba(255,255,255,0.9);
  font-size: 0.95em;
}

.welcome-text strong {
  color: #fff;
}

.group-badge {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78em;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-admin {
  background: rgba(255,255,255,0.9);
  color: #008ba3;
  border: none;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-admin:hover {
  background: #fff;
}

.btn-logout {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.22);
}

.dash-main {
  flex: 1;
  padding: 32px 32px 60px;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
}

/* ===== GRILLE DE CARTES ===== */

.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.app-card {
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 8%, 36px);
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  aspect-ratio: 1;
  position: relative;
}

.app-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.18s;
  border-radius: 14px;
}

.app-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.app-card:hover::after {
  background: rgba(255,255,255,0.1);
}

.app-card:active {
  transform: translateY(-2px) scale(1.01);
}

.card-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.15em;
  color: #fff;
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 6px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

.card-description {
  font-size: 0.82em;
  color: rgba(255,255,255,0.8);
  text-align: center;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.card-no-link {
  font-size: 0.75em;
  color: rgba(255,255,255,0.5);
  font-style: italic;
  position: relative;
  z-index: 1;
}

/* ===== EMPTY STATE ===== */

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: rgba(255,255,255,0.7);
}

.empty-icon {
  font-size: 4em;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.3em;
  color: #fff;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.95em;
}

/* ===== RESPONSIVE ===== */

/* Tablette large */
@media (max-width: 1100px) {
  .apps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablette */
@media (max-width: 850px) {
  .dash-header {
    height: 72px;
    padding: 0 20px;
  }

  .logo-sm {
    height: 52px;
  }

  .header-title {
    font-size: 22px;
  }

  .welcome-text,
  .group-badge {
    display: none;
  }

  .dash-main {
    padding: 24px 20px 48px;
  }

  .apps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

/* Mobile */
@media (max-width: 580px) {
  .dash-header {
    height: 58px;
    padding: 0 14px;
  }

  .header-left {
    gap: 12px;
  }

  .logo-sm {
    height: 38px;
  }

  .header-title {
    display: none;
  }

  .header-right {
    gap: 8px;
  }

  .btn-admin,
  .btn-logout {
    padding: 5px 10px;
    font-size: 0.8em;
  }

  .dash-main {
    padding: 16px 12px 40px;
  }

  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card-name {
    font-size: 1em;
  }

  .card-description {
    display: none;
  }
}

/* Très petit mobile */
@media (max-width: 340px) {
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}
