* {
  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;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Login Box */
.login-box {
  background: white;
  border-radius: 10px;
  padding: 40px;
  max-width: 400px;
  margin: 100px auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.logo {
  display: block;
  max-width: 250px;
  margin: 50px auto 20px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 10px;
  color: #333;
  font-size: 2em;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #666;
  font-size: 1.2em;
  font-weight: normal;
}

/* Dashboard */
.dashboard {
  background: white;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #00bcd4 0%, #008ba3 100%);
  color: white;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.5em;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info span {
  font-weight: 500;
}

/* Tabs */
.tabs {
  display: flex;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  padding: 15px 30px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover {
  background: #e5e5e5;
}

.tab-btn.active {
  color: #00bcd4;
  border-bottom-color: #00bcd4;
  background: white;
}

.tab-content {
  display: none;
  padding: 30px;
}

.tab-content.active {
  display: block;
}

/* Actions */
.actions {
  margin-bottom: 20px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #333;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #00bcd4;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 12px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-primary {
  background: #00bcd4;
  color: white;
}

.btn-primary:hover {
  background: #008ba3;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

/* Apps checklist dans le modal user */
.apps-checklist {
  border: 1px solid #ddd;
  border-radius: 5px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.app-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.app-checkbox-item:hover {
  background: #f5f5f5;
}

.app-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #00bcd4;
}

.app-checkbox-name {
  font-size: 14px;
  color: #333;
  flex: 1;
}

.app-checkbox-tech {
  font-size: 11px;
  color: #999;
  font-family: monospace;
}

.btn-portal {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-portal:hover {
  background: rgba(255,255,255,0.25);
}

.btn-danger {
  background: #dc3545;
  color: white;
  padding: 5px 10px;
  font-size: 12px;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-edit {
  background: #ffc107;
  color: #333;
  padding: 5px 10px;
  font-size: 12px;
  margin-right: 5px;
}

.btn-edit:hover {
  background: #e0a800;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

thead {
  background: #f5f5f5;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  font-weight: 600;
  color: #333;
}

tbody tr:hover {
  background: #f9f9f9;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  background: #e9ecef;
  border-radius: 3px;
  font-size: 12px;
  margin-right: 5px;
  margin-bottom: 3px;
}

.badge-admin {
  background: #00bcd4;
  color: white;
}

.badge-success {
  background: #28a745;
  color: white;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: block;
}

.modal-content {
  background-color: white;
  margin: 50px auto;
  padding: 30px;
  border-radius: 10px;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #333;
}

/* Error Messages */
.error-message {
  color: #dc3545;
  margin-top: 10px;
  font-size: 14px;
  display: none;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

.empty-state p {
  margin-bottom: 20px;
}
