/* style.css - Styles partagés */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #333;
  min-height: 100vh;
}
.bg-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.centered-box {
  width: 100%; max-width: 480px;
  background: white; padding: 36px;
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
h1 { color: #667eea; text-align: center; font-size: 28px; margin-bottom: 6px; }
h2 { font-size: 20px; margin-bottom: 14px; }
h3 { font-size: 15px; color: #555; margin-bottom: 8px; }
.subtitle { text-align: center; color: #888; margin-bottom: 24px; }
.hidden { display: none !important; }

.role-grid { display: flex; gap: 12px; }
.role-card {
  flex: 1; background: #f5f7fa; border: 2px solid #e0e0e0;
  border-radius: 12px; padding: 20px; text-align: center;
  text-decoration: none; color: inherit; transition: all 0.2s;
  cursor: pointer;
}
.role-card:hover { border-color: #667eea; background: #f0f3ff; transform: translateY(-2px); }
.role-icon { font-size: 36px; margin-bottom: 8px; }
.role-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.role-desc { font-size: 12px; color: #888; }

.panel { display: flex; flex-direction: column; gap: 10px; }
.panel label { font-size: 13px; color: #555; font-weight: 500; margin-bottom: -4px; margin-top: 6px; }
.panel input, .panel select, .panel textarea {
  padding: 12px 14px; font-size: 15px; border-radius: 8px;
  border: 2px solid #e0e0e0; outline: none; font-family: inherit;
}
.panel input:focus, .panel select:focus, .panel textarea:focus { border-color: #667eea; }
.panel textarea { resize: vertical; min-height: 80px; }

.actions { display: flex; gap: 10px; margin-top: 12px; }
.actions button { flex: 1; padding: 11px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.btn-primary:hover { opacity: 0.92; }
.btn-secondary { background: #f0f0f5; color: #555; }
.btn-secondary:hover { background: #e5e5ec; }
.btn-danger { background: #ef4444; color: white; }
.btn-success { background: #10b981; color: white; }
.btn-warning { background: #f59e0b; color: white; }
.btn-small { padding: 6px 11px !important; font-size: 12px !important; flex: 0 !important; }

.error-msg { color: #c33; font-size: 13px; margin-top: 8px; }
.success-msg { color: #10b981; font-size: 13px; margin-top: 8px; }

/* Common app shell */
.app-shell {
  display: flex; flex-direction: column; height: 100vh;
  background: #f5f7fa;
}
.app-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.app-header h1 { color: white; font-size: 18px; text-align: left; margin: 0; }
.app-header .user-info { font-size: 13px; opacity: 0.9; }
.app-header nav { display: flex; gap: 6px; }
.app-header nav button, .app-header nav a {
  background: rgba(255,255,255,0.2); border: none; color: white;
  padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13px;
  text-decoration: none; font-weight: 500;
}
.app-header nav button:hover, .app-header nav a:hover { background: rgba(255,255,255,0.32); }
.app-header nav .active { background: rgba(255,255,255,0.35); }

.app-body { flex: 1; overflow-y: auto; padding: 18px; }
.card {
  background: white; border-radius: 12px; padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 14px;
}
.card h2 { margin-bottom: 12px; font-size: 17px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 10px; border-bottom: 1px solid #eee; font-size: 14px;
}
.table th { background: #f8f9fc; font-weight: 600; color: #555; font-size: 12px; text-transform: uppercase; }
.table tr:hover { background: #f5f7fa; }
.table .actions { display: flex; gap: 4px; margin: 0; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select {
  padding: 8px 11px; border-radius: 7px; border: 2px solid #e0e0e0;
  font-size: 13px; outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: #667eea; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; background: #eee; color: #555;
}
.badge.success { background: #d1fae5; color: #065f46; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.info { background: #e0e7ff; color: #3730a3; }

.empty-state { text-align: center; padding: 40px; color: #888; }
.empty-state .icon { font-size: 42px; margin-bottom: 10px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 999;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.active { display: flex; }
.modal-box {
  background: white; border-radius: 14px; padding: 24px;
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
}
.modal-box h2 { margin-bottom: 16px; }

/* Toast */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #333; color: white; padding: 11px 22px; border-radius: 24px;
  font-size: 14px; z-index: 2000; opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }

@media (max-width: 600px) {
  .role-grid { flex-direction: column; }
  .centered-box { padding: 24px; }
  .app-header { flex-direction: column; gap: 8px; align-items: stretch; }
}

/* Credits footer */
.credits {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  padding: 10px 16px 8px;
  line-height: 1.5;
}
.credits strong { color: rgba(255,255,255,0.9); font-weight: 600; }

.credits-light {
  text-align: center;
  font-size: 11px;
  color: #999;
  padding: 8px 16px;
  background: #f8f9fc;
  border-top: 1px solid #eee;
  line-height: 1.5;
}
.credits-light strong { color: #555; font-weight: 600; }
