:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --primary: #2d9cdb;
  --primary-dark: #0b132b;
  --success: #27ae60;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e0e6ed;
  --shadow: 0 10px 30px rgba(11, 19, 43, 0.1);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1050;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  box-shadow: 0 0 0 6px rgba(45, 156, 219, 0.2);
}

.app-body {
  flex: 1;
  min-height: 0;
}

.app-sidenav {
  width: 250px;
  min-height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
}

.app-sidenav .nav-link {
  color: var(--muted);
  border-radius: 10px;
  margin: 4px 12px;
  padding: 10px 12px;
  transition: background 0.2s ease, color 0.2s ease;
}

.app-sidenav .nav-link:hover {
  background: rgba(45, 156, 219, 0.08);
  color: var(--primary);
}

.app-sidenav .nav-link.active {
  background: rgba(45, 156, 219, 0.15);
  color: var(--primary);
  font-weight: 600;
}

.app-content {
  min-height: calc(100vh - 56px);
}

.avatar-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.badge-soft {
  color: var(--primary);
  background: rgba(45, 156, 219, 0.12);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.success { background: var(--success); }
.status-dot.warning { background: #f2c94c; }
.status-dot.danger { background: #eb5757; }

/* Page de login - masquer header et sidebar */
.app-shell.login-page .app-topbar,
.app-shell.login-page .app-sidenav {
  display: none !important;
}

.app-shell.login-page .app-body {
  min-height: 100vh;
}

.app-shell.login-page .app-content {
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
}

/* Styles pour la page de connexion moderne */
.login-container {
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: float 20s infinite linear;
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-50px, -50px) rotate(360deg); }
}

.login-wrapper {
  display: flex;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-left {
  flex: 1;
  background: linear-gradient(135deg, rgba(45, 156, 219, 0.95) 0%, rgba(11, 19, 43, 0.95) 100%);
  color: white;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.3;
}

.login-brand {
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 40px;
}

.brand-dot-large {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.2), 0 0 0 16px rgba(255, 255, 255, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.brand-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
}

.welcome-message {
  margin-bottom: 50px;
}

.welcome-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 15px;
  line-height: 1.3;
}

.welcome-text {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
  margin: 0;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.feature-icon {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
}

.feature-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
}

.login-right {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}

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

.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.form-group-custom {
  margin-bottom: 24px;
}

.form-label-custom {
  display: block;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.form-control-custom {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fff;
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(45, 156, 219, 0.1);
}

.input-group-custom {
  position: relative;
}

.input-group-custom .form-control-custom {
  padding-right: 50px;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.btn-toggle-password:hover {
  color: var(--primary);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.form-check-custom {
  display: flex;
  align-items: center;
}

.form-check-input-custom {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  cursor: pointer;
  accent-color: var(--primary);
}

.form-check-label-custom {
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  margin: 0;
}

.forgot-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.btn-login {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(45, 156, 219, 0.4);
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 156, 219, 0.5);
}

.btn-login:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Responsive pour la page de login */
@media (max-width: 991.98px) {
  .login-wrapper {
    flex-direction: column;
  }
  
  .login-left {
    flex: 0 0 auto;
    padding: 40px 30px;
    min-height: 40vh;
  }
  
  .brand-title {
    font-size: 2rem;
  }
  
  .welcome-title {
    font-size: 1.5rem;
  }
  
  .welcome-text {
    font-size: 1rem;
  }
  
  .login-features {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
  }
  
  .feature-item {
    flex: 1;
    min-width: 150px;
  }
  
  .login-right {
    flex: 1;
    padding: 30px 20px;
  }
}

@media (max-width: 575.98px) {
  .login-left {
    padding: 30px 20px;
    min-height: 35vh;
  }
  
  .brand-logo {
    margin-bottom: 25px;
  }
  
  .brand-title {
    font-size: 1.75rem;
  }
  
  .welcome-message {
    margin-bottom: 30px;
  }
  
  .welcome-title {
    font-size: 1.25rem;
  }
  
  .login-features {
    display: none;
  }
  
  .login-card {
    max-width: 100%;
  }
}

/* Responsive */
@media (max-width: 991.98px) {
  .app-sidenav {
    position: fixed;
    left: -260px;
    top: 56px;
    height: calc(100vh - 56px);
    z-index: 1040;
    transition: left 0.2s ease;
  }
  .app-sidenav.open {
    left: 0;
    background: #fff;
  }
}

